/* ============================================================
   Sergio Nevdah — Brutalist / Editorial
   Paper + ink + acid red. No build, no deps.
   ============================================================ */

:root {
  --paper: #f4f3ee;
  --ink: #111111;
  --ink-2: #444240;
  --accent: #ff3b00;
  --line: #11111122;
  --line-solid: #111111;

  --maxw: 1440px;
  --pad: clamp(20px, 5vw, 80px);

  --f-display: "Archivo", "Arial Narrow", Helvetica, Arial, sans-serif;
  --f-body: "Archivo", Helvetica, Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-weight: 400;
  line-height: 1.4;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--paper); }

a { color: inherit; text-decoration: none; }

.mono {
  font-family: var(--f-mono);
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.accent { color: var(--accent); }

/* ---- subtle paper grain ------------------------------------ */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
}

/* ---- custom cursor ----------------------------------------- */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 14px; height: 14px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9999;
  transition: width .2s ease, height .2s ease, background-color .2s ease, border-color .2s ease, opacity .2s ease;
  mix-blend-mode: difference;
  opacity: 0;
}
.cursor.is-active { opacity: 1; }
.cursor.is-hover {
  width: 46px; height: 46px;
  background: var(--paper);
  border-color: var(--paper);
}
body.has-cursor, body.has-cursor a, body.has-cursor button { cursor: none; }

/* ============================================================
   HEADER
   ============================================================ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px var(--pad);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1.5px solid var(--line-solid);
  transition: transform .4s cubic-bezier(.2,.8,.2,1);
}
.topbar.is-hidden { transform: translateY(-101%); }

.mark { display: flex; align-items: baseline; gap: 10px; }
.mark-name { font-weight: 800; letter-spacing: -0.02em; }

.nav { display: flex; gap: clamp(14px, 2vw, 34px); }
.nav a {
  font-family: var(--f-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: relative;
  padding-bottom: 2px;
}
.nav-idx { color: var(--accent); margin-right: 4px; }
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 1.5px;
  background: var(--ink);
  transition: width .3s cubic-bezier(.2,.8,.2,1);
}
.nav a:hover::after { width: 100%; }

.cv-link {
  font-family: var(--f-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1.5px solid var(--ink);
  padding: 8px 14px;
  transition: background-color .25s ease, color .25s ease;
}
.cv-link:hover { background: var(--ink); color: var(--paper); }

.nav-toggle { display: none; }

/* ============================================================
   LAYOUT PRIMITIVES
   ============================================================ */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(64px, 11vh, 160px) var(--pad);
  border-top: 1.5px solid var(--line-solid);
  position: relative;
  z-index: 2;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  margin: 0 0 clamp(28px, 5vh, 64px);
}
.section-label span { color: var(--accent); }

.section-head { margin-bottom: clamp(36px, 6vh, 88px); }
.section-head h2,
.method h2, .work h2, .stack h2 {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(2rem, 5.5vw, 4.4rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
  margin: 0;
  max-width: 16ch;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100svh;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 120px var(--pad) 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.hero-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--ink-2);
  padding-top: 12px;
}

.hero-title {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(3.2rem, 15vw, 14rem);
  line-height: 0.84;
  letter-spacing: -0.045em;
  margin: clamp(24px, 6vh, 60px) 0;
  text-transform: none;
}
.hero-title .line { display: block; }
.hero-title .dash { color: var(--accent); }

.hero-foot {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(24px, 5vw, 80px);
  align-items: end;
  border-top: 1.5px solid var(--line-solid);
  padding-top: 28px;
}
.hero-lede {
  font-size: clamp(1rem, 1.4vw, 1.3rem);
  line-height: 1.45;
  max-width: 46ch;
  margin: 0;
}

.stats {
  display: flex;
  gap: clamp(20px, 4vw, 56px);
  margin: 0;
  justify-content: flex-end;
}
.stats div { text-align: right; }
.stats dt {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: -0.04em;
}
.stats dd {
  margin: 6px 0 0;
  font-family: var(--f-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}

.scroll-hint {
  position: absolute;
  bottom: 18px; right: var(--pad);
  color: var(--ink-2);
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(6px); } }

/* ============================================================
   MANIFESTO
   ============================================================ */
.manifesto { border-top: none; }
.statement {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(1.7rem, 4.6vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 0;
  max-width: 20ch;
}

/* ============================================================
   METHOD
   ============================================================ */
.method-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-left: 1.5px solid var(--line-solid);
  border-top: 1.5px solid var(--line-solid);
}
.method-grid article {
  padding: clamp(24px, 3vw, 48px);
  border-right: 1.5px solid var(--line-solid);
  border-bottom: 1.5px solid var(--line-solid);
  transition: background-color .3s ease, color .3s ease;
}
.method-grid article:hover { background: var(--ink); color: var(--paper); }
.method-grid .num {
  display: block;
  color: var(--accent);
  font-size: 0.95rem;
  margin-bottom: 28px;
}
.method-grid h3 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.method-grid p { margin: 0; color: inherit; max-width: 34ch; opacity: .88; }

/* ============================================================
   WORK / RECORD
   ============================================================ */
.record { list-style: none; margin: 0; padding: 0; }
.role {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  grid-template-areas:
    "time name loc"
    "time note note";
  gap: 6px clamp(20px, 3vw, 56px);
  align-items: baseline;
  padding: clamp(24px, 3.5vh, 44px) clamp(8px, 1.5vw, 24px);
  border-top: 1.5px solid var(--line-solid);
  position: relative;
  transition: color .3s ease, padding-left .3s cubic-bezier(.2,.8,.2,1);
}
.record .role:last-child { border-bottom: 1.5px solid var(--line-solid); }
.role::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
  z-index: -1;
}
.role:hover { color: var(--paper); padding-left: clamp(16px, 2.5vw, 40px); }
.role:hover::before { transform: scaleY(1); }
.role > * { position: relative; }

.role-time { grid-area: time; color: var(--ink-2); padding-top: 6px; }
.role:hover .role-time { color: var(--paper); }
.role-name {
  grid-area: name;
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(1.5rem, 3.6vw, 3rem);
  line-height: 1;
  letter-spacing: -0.03em;
}
.role-loc { grid-area: loc; color: var(--ink-2); text-align: right; }
.role:hover .role-loc { color: var(--paper); }
.role-note {
  grid-area: note;
  margin: 8px 0 0;
  max-width: 60ch;
  opacity: .9;
}
/* company as its own line under the name */
.role {
  grid-template-areas:
    "time name loc"
    "time co   loc"
    "time note note";
}
.role-co {
  grid-area: co;
  margin-top: 2px;
  font-family: var(--f-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--accent);
}
.role:hover .role-co { color: var(--paper); }

/* ============================================================
   STACK
   ============================================================ */
.stack { padding-bottom: clamp(32px, 5vh, 56px); }

.marquee {
  overflow: hidden;
  border-top: 1.5px solid var(--line-solid);
  border-bottom: 1.5px solid var(--line-solid);
  background: var(--ink);
  color: var(--paper);
  position: relative;
  z-index: 2;
}
.marquee-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(2.2rem, 6vw, 5rem);
  letter-spacing: -0.03em;
  text-transform: uppercase;
  padding: 14px 0;
  will-change: transform;
  animation: marquee 38s linear infinite;
}
.marquee-track span { padding: 0 0.4em; }
.marquee-track .sep { color: var(--accent); }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  border-top: none;
  padding-top: clamp(40px, 6vh, 72px);
}
.stack-tags span {
  font-family: var(--f-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 1.5px solid var(--line-solid);
  padding: 8px 14px;
  transition: background-color .25s ease, color .25s ease, transform .25s ease;
}
.stack-tags span:hover {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
  transform: translateY(-3px);
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-title {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(2rem, 6vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0 0 clamp(40px, 7vh, 96px);
  max-width: 18ch;
}
.contact-rows { list-style: none; margin: 0; padding: 0; }
.contact-rows li { border-top: 1.5px solid var(--line-solid); }
.contact-rows li:last-child { border-bottom: 1.5px solid var(--line-solid); }
.contact-rows a {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: clamp(20px, 3vh, 34px) clamp(8px, 1.5vw, 20px);
  transition: padding-left .3s cubic-bezier(.2,.8,.2,1), background-color .3s ease, color .3s ease;
}
.contact-rows a:hover { background: var(--ink); color: var(--paper); padding-left: clamp(20px, 3vw, 44px); }
.c-label { color: var(--ink-2); }
.contact-rows a:hover .c-label { color: var(--accent); }
.c-value {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(1.3rem, 3vw, 2.4rem);
  letter-spacing: -0.02em;
  word-break: break-word;
}
.c-arrow { font-size: 1.4rem; transition: transform .3s ease; }
.contact-rows a:hover .c-arrow { transform: translate(4px, -4px); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px var(--pad);
  border-top: 1.5px solid var(--line-solid);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--ink-2);
  position: relative;
  z-index: 2;
}
.f-name { font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1);
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .nav, .cv-link { display: none; }
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px; height: 40px;
    background: none;
    border: 1.5px solid var(--ink);
    cursor: pointer;
    padding: 0 9px;
  }
  .nav-toggle span { display: block; height: 1.5px; background: var(--ink); transition: transform .3s ease, opacity .3s ease; }

  .topbar.nav-open .nav {
    display: flex;
    position: fixed;
    inset: 64px 0 auto 0;
    flex-direction: column;
    gap: 0;
    background: var(--paper);
    border-bottom: 1.5px solid var(--line-solid);
    padding: 0;
  }
  .topbar.nav-open .nav a {
    padding: 20px var(--pad);
    border-top: 1.5px solid var(--line-solid);
    font-size: 1rem;
  }
  .topbar.nav-open .nav-toggle span:first-child { transform: translateY(3.25px) rotate(45deg); }
  .topbar.nav-open .nav-toggle span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

  .hero-foot { grid-template-columns: 1fr; gap: 28px; align-items: start; }
  .stats { justify-content: flex-start; }
  .stats div { text-align: left; }

  .method-grid { grid-template-columns: 1fr; }

  .role {
    grid-template-columns: 1fr;
    grid-template-areas:
      "time"
      "name"
      "co"
      "loc"
      "note";
    gap: 4px;
  }
  .role-loc { text-align: left; }
  .role:hover { padding-left: clamp(8px, 4vw, 20px); }

  .contact-rows a { grid-template-columns: 1fr auto; }
  .c-label { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .hero-meta { font-size: 0.62rem; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .cursor { display: none; }
  body.has-cursor, body.has-cursor a, body.has-cursor button { cursor: auto; }
}
