/* =========================================================
   Marcus Valeriano — Portfolio
   Design system + layout + motion
   ========================================================= */

:root {
  /* Palette — brand navy / blue / sky */
  --bg:        #04131f;
  --bg-2:      #081e2f;
  --surface:   #0c243799;
  --surface-solid: #0c2437;
  --line:      #ffffff14;
  --line-strong: #ffffff2b;

  --text:      #e9eef3;
  --muted:     #9fb4c6;
  --faint:     #5f7587;

  /* Brand colors */
  --navy:      #01273f;
  --ink:       #1b3059;
  --blue:      #4392d8;
  --sky:       #71c1f2;
  --c1: #4392d8;   /* blue  */
  --c2: #71c1f2;   /* sky   */
  --c3: #1b3059;   /* ink   */
  --grad: linear-gradient(110deg, var(--c1), var(--c2));

  /* Type — single family, hierarchy by weight */
  --display: "Montserrat", system-ui, sans-serif;
  --sans:    "Montserrat", system-ui, sans-serif;
  --mono:    "Montserrat", system-ui, sans-serif;

  --maxw: 1240px;
  --pad: clamp(1.25rem, 5vw, 5rem);
  --r: 18px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  font-size: 15.5px;
}

/* Ambient background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(60vw 60vw at 80% -10%, #4392d81f, transparent 60%),
    radial-gradient(50vw 50vw at -10% 30%, #71c1f214, transparent 60%),
    radial-gradient(50vw 50vw at 60% 110%, #1b305912, transparent 60%);
  z-index: -2;
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  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.5'/%3E%3C/svg%3E");
  opacity: 0.025;
  z-index: -1;
  pointer-events: none;
  mix-blend-mode: overlay;
}

a { color: inherit; text-decoration: none; }
img, canvas { display: block; max-width: 100%; }
::selection { background: var(--c1); color: #fff; }

/* ---------- Cursor ---------- */
.cursor { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999; mix-blend-mode: difference; }
.cursor__dot {
  position: fixed; width: 7px; height: 7px; border-radius: 50%;
  background: #fff; transform: translate(-50%, -50%);
}
.cursor__ring {
  position: fixed; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid #ffffff80; transform: translate(-50%, -50%);
  transition: width .3s var(--ease), height .3s var(--ease), background .3s, border-color .3s;
}
.cursor.is-hover .cursor__ring { width: 64px; height: 64px; background: #ffffff14; border-color: transparent; }
.cursor__label {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(.5);
  font-family: var(--mono); font-size: .6rem; letter-spacing: .08em; text-transform: uppercase;
  color: #fff; white-space: nowrap; opacity: 0; transition: opacity .25s, transform .3s var(--ease);
}
.cursor.is-label .cursor__ring { width: 76px; height: 76px; background: var(--c1); border-color: transparent; mix-blend-mode: normal; }
.cursor.is-label .cursor__label { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.cursor.is-label { mix-blend-mode: normal; }
.cursor.is-down .cursor__ring { transform: translate(-50%, -50%) scale(.82); }
@media (hover: none), (max-width: 820px) { .cursor { display: none; } }

/* ---------- Section progress rail ---------- */
.rail { position: fixed; right: 26px; top: 50%; transform: translateY(-50%); z-index: 800; display: flex; flex-direction: column; gap: 16px; }
.rail a { position: relative; width: 22px; height: 22px; display: grid; place-content: center; }
.rail a span { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); transition: transform .35s var(--ease), background .35s; }
.rail a:hover span { transform: scale(1.4); background: var(--muted); }
.rail a.is-active span { background: transparent; width: 11px; height: 11px; background-image: var(--grad); transform: scale(1); box-shadow: 0 0 12px #4392d8aa; }
.rail a::after {
  content: attr(data-label); position: absolute; right: 28px; top: 50%; transform: translateY(-50%) translateX(6px);
  font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text);
  background: #0c243766; border: 1px solid var(--line); padding: .25rem .6rem; border-radius: 100px;
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s var(--ease); backdrop-filter: blur(6px);
}
.rail a:hover::after { opacity: 1; transform: translateY(-50%) translateX(0); }
@media (max-width: 1100px) { .rail { display: none; } }

/* ---------- Scroll progress ---------- */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1000; }
.scroll-progress span {
  display: block; height: 100%; width: 0%;
  background: var(--grad); box-shadow: 0 0 14px #4392d8aa;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem var(--pad);
  transition: padding .4s var(--ease), background .4s, border-color .4s, backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  padding: .7rem var(--pad);
  background: #04131fcc; backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav__brand { display: flex; align-items: center; gap: .65rem; font-weight: 600; }
.nav__mark {
  width: 40px; height: 40px; display: grid; place-content: center;
}
.nav__mark img { height: 40px; width: 40px; }
.nav__brandtext { font-family: var(--mono); letter-spacing: .01em; font-size: .98rem; }
.nav__links { display: flex; gap: 1.35rem; }
.nav__links a { font-family: var(--mono); font-size: .9rem; color: var(--muted); position: relative; transition: color .3s; }
.nav__links a span { color: var(--c2); font-size: .7rem; margin-right: .15rem; opacity: .8; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 1px; width: 0;
  background: var(--grad); transition: width .35s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after, .nav__links a.is-active::after { width: 100%; }
.nav__links a.is-active { color: var(--text); }
.nav__cta {
  font-family: var(--mono); font-size: .9rem; padding: .55rem 1.1rem;
  border: 1px solid var(--line-strong); border-radius: 100px;
  transition: background .3s, color .3s, border-color .3s;
}
.nav__cta:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.nav__burger { display: none; background: none; border: 0; cursor: pointer; width: 34px; height: 34px; position: relative; }
.nav__burger span { position: absolute; left: 6px; right: 6px; height: 2px; background: var(--text); transition: transform .35s var(--ease), opacity .25s; }
.nav__burger span:nth-child(1){ top: 12px; } .nav__burger span:nth-child(2){ bottom: 12px; }
.nav__burger.is-open span:nth-child(1){ transform: translateY(5px) rotate(45deg); }
.nav__burger.is-open span:nth-child(2){ transform: translateY(-5px) rotate(-45deg); }

.mobilemenu {
  position: fixed; inset: 0; z-index: 850; background: #04131ff5; backdrop-filter: blur(10px);
  display: flex; flex-direction: column; justify-content: center; gap: .4rem; padding: var(--pad);
  transform: translateY(-100%); transition: transform .5s var(--ease);
}
.mobilemenu.is-open { transform: translateY(0); }
.mobilemenu a { font-family: var(--display); font-size: clamp(1.5rem, 6vw, 2.4rem); font-weight: 500; letter-spacing: -0.02em; }
.mobilemenu a span { font-family: var(--mono); font-size: 1rem; color: var(--c2); margin-right: .5rem; }

/* ---------- Layout ---------- */
.section { padding: clamp(5rem, 12vh, 9rem) var(--pad); max-width: var(--maxw); margin: 0 auto; }
.section__head { margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.section__index { font-family: var(--mono); font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; color: var(--c2); display: inline-block; margin-bottom: 1rem; }
.section__title { font-family: var(--display); font-weight: 500; font-size: clamp(1.85rem, 4vw, 3.1rem); line-height: 1.08; letter-spacing: -0.025em; }
.section__lead { max-width: 600px; margin-top: 1.2rem; color: var(--muted); font-size: clamp(.95rem, 1.4vw, 1.05rem); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: 0 var(--pad); overflow: hidden; }
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: .9; }
.hero__glow {
  position: absolute; width: 60vmax; height: 60vmax; left: 50%; top: 40%;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, #4392d822, transparent 60%);
  filter: blur(40px); z-index: 0; pointer-events: none;
}
.hero__inner { position: relative; z-index: 2; max-width: 1100px; margin: 0 auto; width: 100%; padding-top: 4rem; }
.hero__eyebrow {
  font-family: var(--mono); font-size: .8rem; color: var(--muted); letter-spacing: .05em;
  display: inline-flex; align-items: center; gap: .6rem; margin-bottom: 1.5rem;
  padding: .45rem .9rem; border: 1px solid var(--line); border-radius: 100px; background: var(--surface);
}
.hero__eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c2); box-shadow: 0 0 0 0 #71c1f299; animation: pulse 2s infinite; }
@keyframes pulse { 0%{ box-shadow: 0 0 0 0 #71c1f266; } 70%{ box-shadow: 0 0 0 9px #71c1f200; } 100%{ box-shadow: 0 0 0 0 #71c1f200; } }

.hero__title { font-family: var(--display); font-weight: 500; font-size: clamp(2.1rem, 5.4vw, 4.3rem); line-height: 1.07; letter-spacing: -0.035em; margin-bottom: 1.6rem; }
.hero__title .line { display: block; overflow: hidden; padding-bottom: .16em; }
.hero__title .word { display: inline-block; }
.js .hero__title .word { transform: translateY(110%); }
.hero__title .word.accent {
  background: linear-gradient(110deg, var(--c2), var(--c1) 50%, var(--c2) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-style: italic; animation: shimmer 7s linear infinite;
}
@keyframes shimmer { to { background-position: -220% 0; } }
.hero__lead { max-width: 560px; font-size: clamp(.98rem, 1.4vw, 1.1rem); color: var(--muted); margin-bottom: 2.1rem; }
.hero__lead strong { color: var(--text); font-weight: 600; }

.hero__actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero__scroll { position: absolute; bottom: 7.5rem; right: var(--pad); display: flex; flex-direction: column; align-items: center; gap: .8rem; z-index: 2; }
.hero__scroll span { font-family: var(--mono); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--faint); writing-mode: vertical-rl; }
.hero__mouse { width: 22px; height: 36px; border: 1px solid var(--line-strong); border-radius: 14px; display: flex; justify-content: center; padding-top: 6px; }
.hero__mouse i { width: 3px; height: 7px; border-radius: 3px; background: var(--c2); animation: scrolldot 1.6s var(--ease) infinite; }
@keyframes scrolldot { 0%{ transform: translateY(0); opacity: 1; } 70%{ transform: translateY(10px); opacity: 0; } 100%{ opacity: 0; } }

.hero__marquee { position: absolute; bottom: 0; left: 0; right: 0; padding: 1.1rem 0; border-top: 1px solid var(--line); background: #04131f66; backdrop-filter: blur(6px); overflow: hidden; z-index: 2; }
.hero__marquee-track { display: flex; align-items: center; gap: 2rem; white-space: nowrap; width: max-content; animation: slide 32s linear infinite; }
.hero__marquee-track span { font-family: var(--mono); font-size: .95rem; color: var(--muted); letter-spacing: .02em; }
.hero__marquee-track .sep { color: var(--c1); }
@keyframes slide { to { transform: translateX(-50%); } }
.hero__marquee:hover .hero__marquee-track { animation-play-state: paused; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; gap: .6rem; font-family: var(--mono); font-size: .95rem; font-weight: 500;
  padding: .95rem 1.6rem; border-radius: 100px; cursor: pointer; transition: transform .25s var(--ease), background .3s, color .3s, border-color .3s, box-shadow .4s;
  will-change: transform;
}
.btn svg { transition: transform .3s var(--ease); }
.btn--primary { background: var(--text); color: var(--bg); }
/* gradient sweep on hover */
.btn--primary::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0;
  background: var(--grad);
  transition: opacity .4s var(--ease);
}
.btn--primary:hover { color: #fff; box-shadow: 0 18px 44px -16px #4392d888; }
.btn--primary:hover::before { opacity: 1; }
.btn--primary:hover svg { transform: translateX(4px); }
.btn--ghost { border: 1px solid var(--line-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--text); background: #ffffff0d; transform: translateY(-2px); }

/* ---------- About ---------- */
.about__lead { max-width: 820px; }
.about__lead p { font-size: clamp(1.1rem, 1.9vw, 1.5rem); font-family: var(--display); font-weight: 300; line-height: 1.45; letter-spacing: -0.005em; }
.about__lead em { font-style: italic; color: var(--c2); }
.about__lead .muted { font-family: var(--sans); font-size: 1.05rem; color: var(--muted); margin-top: 1.5rem; font-weight: 400; }
.about__mission { max-width: 760px; margin: 2.2rem 0 0; border-left: 2px solid var(--c1); padding-left: 1.3rem;
  font-family: var(--display); font-weight: 500; font-size: clamp(1.15rem, 2.3vw, 1.65rem); line-height: 1.4; letter-spacing: -0.01em; color: var(--text); }
.about__mission b { font-weight: 600; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.about__personal { max-width: 64ch; margin-top: 2.4rem; }
.about__personal-label { display: block; font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--c2); margin-bottom: .9rem; }
.about__personal p { font-family: var(--sans); font-size: 1.05rem; color: var(--muted); line-height: 1.65; }
.about__personal p + p { margin-top: 1rem; }

/* ---------- Timeline ---------- */
.timeline { display: flex; flex-direction: column; gap: 1.4rem; }
.tl { display: grid; grid-template-columns: 200px 1fr; gap: 2rem; align-items: start; }
.tl__rail { position: relative; padding-top: .4rem; }
.tl__year { font-family: var(--mono); font-size: .9rem; color: var(--c2); letter-spacing: .03em; position: sticky; top: 100px; display: inline-block; }
.tl__card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: clamp(1.6rem, 3vw, 2.4rem); backdrop-filter: blur(8px);
  transition: border-color .4s, transform .3s var(--ease), box-shadow .4s; will-change: transform;
}
.tl__card:hover { border-color: var(--line-strong); box-shadow: 0 24px 60px -28px #4392d844; }
.tl__top { margin-bottom: 1rem; }
.tl__card h3 { font-family: var(--display); font-size: clamp(1.15rem, 2vw, 1.45rem); font-weight: 500; letter-spacing: -0.015em; }
.tl__org { font-family: var(--mono); font-size: .92rem; color: var(--muted); margin-top: .3rem; display: block; }
.tl__card p { color: var(--muted); }
.tl__tags { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.3rem; }
.tl__tags li { font-family: var(--mono); font-size: .78rem; padding: .35rem .7rem; border: 1px solid var(--line); border-radius: 100px; color: var(--text); }

/* ---------- Gradient text helper ---------- */
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Vision: manifesto accordion ---------- */
.manifesto { border-top: 1px solid var(--line); }
.belief { border-bottom: 1px solid var(--line); }
.belief__trigger { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; background: none; border: 0; cursor: pointer; text-align: left; padding: clamp(1.05rem, 2.4vw, 1.5rem) 0; color: var(--muted); transition: color .35s var(--ease), padding-left .4s var(--ease); }
.belief__trigger:hover { color: var(--text); padding-left: .7rem; }
.belief__trigger:focus-visible { outline: 2px solid var(--c2); outline-offset: 4px; border-radius: 6px; }
.belief__title { font-family: var(--display); font-size: clamp(1.1rem, 2.2vw, 1.55rem); line-height: 1.25; letter-spacing: -0.02em; transition: color .35s; }
.belief__trigger:hover .belief__title { color: var(--text); }
.belief.is-open .belief__title { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.belief__icon { position: relative; width: 20px; height: 20px; flex: none; color: var(--faint); transition: color .35s; }
.belief__trigger:hover .belief__icon { color: var(--text); }
.belief.is-open .belief__icon { color: var(--c2); }
.belief__icon::before, .belief__icon::after { content: ""; position: absolute; background: currentColor; border-radius: 2px; transition: transform .4s var(--ease), opacity .35s; }
.belief__icon::before { left: 0; right: 0; top: 50%; height: 2px; transform: translateY(-50%); }
.belief__icon::after { top: 0; bottom: 0; left: 50%; width: 2px; transform: translateX(-50%); }
.belief.is-open .belief__icon::after { transform: translateX(-50%) scaleY(0); opacity: 0; }
.belief__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease); }
.belief.is-open .belief__panel { grid-template-rows: 1fr; }
.belief__inner { overflow: hidden; }
.belief__inner p { color: var(--muted); max-width: 68ch; padding: 0 3rem clamp(1.2rem, 2.4vw, 1.6rem) 0; }

/* ---------- Learning agility (closes the Experience section) ---------- */
.adapt { margin-top: clamp(2.6rem, 5vw, 4rem); padding-top: clamp(2.6rem, 5vw, 4rem); border-top: 1px solid var(--line); }
.adapt__head { font-family: var(--display); font-size: clamp(1.4rem, 3vw, 2.1rem); line-height: 1.15; letter-spacing: -0.025em; max-width: 24ch; margin-bottom: 1.2rem; }
.adapt__copy { max-width: 64ch; color: var(--muted); font-size: clamp(1.02rem, 1.8vw, 1.22rem); line-height: 1.6; }
.adapt__line { margin-top: 1.4rem; font-size: clamp(1.02rem, 1.7vw, 1.2rem); color: var(--muted); }
.adapt__scramble { display: inline-block; min-width: 9ch; white-space: nowrap; font-weight: 600; color: var(--c2); letter-spacing: .01em; }
.adapt__scramble::after { content: "▮"; margin-left: .08em; color: var(--c2); animation: blink 1.05s steps(1) infinite; }
.scr-dim { color: var(--c1); opacity: .8; }
@keyframes blink { 50% { opacity: 0; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Clients / Marquee ---------- */
.marquee { overflow: hidden; padding: .4rem 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee__track { display: flex; gap: 3rem; width: max-content; align-items: center; will-change: transform; }
.marquee__track span { font-family: var(--display); font-weight: 400; font-style: italic; font-size: clamp(1.35rem, 3.2vw, 2.4rem); color: var(--faint); transition: color .3s; white-space: nowrap; }
.marquee__track span:hover { color: var(--text); }


/* ---------- Résumé band ---------- */
.resume__inner {
  display: flex; align-items: center; justify-content: space-between; gap: clamp(1.6rem, 4vw, 3rem);
  flex-wrap: wrap; padding: clamp(1.8rem, 4vw, 2.8rem) clamp(1.6rem, 4vw, 2.8rem);
  border: 1px solid var(--line); border-radius: var(--r);
  background: linear-gradient(120deg, var(--bg-2), #0a2335);
  position: relative; overflow: hidden;
}
.resume__inner::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px circle at 88% 18%, #4392d822, transparent 60%);
}
.resume__text { position: relative; max-width: 46ch; }
.resume__title { font-family: var(--display); font-weight: 600; font-size: clamp(1.4rem, 3vw, 2.1rem); line-height: 1.12; letter-spacing: -0.025em; margin: .7rem 0 .7rem; }
.resume__text p { color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.12rem); line-height: 1.55; }
.resume__btn { position: relative; flex-shrink: 0; }

/* ---------- Experiments / The Lab ---------- */
.lab {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  padding: clamp(2rem, 5vw, 3.4rem); border: 1px solid var(--line); border-radius: var(--r);
  background: linear-gradient(120deg, var(--bg-2), #0a2538);
  overflow: hidden; transition: border-color .4s var(--ease), transform .4s var(--ease);
}
.lab:hover { border-color: var(--c1); }
.lab__glow { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(520px circle at var(--mx, 80%) var(--my, 30%), #4392d825, transparent 55%); opacity: .8; transition: opacity .4s; }
.lab:hover .lab__glow { opacity: 1; }
.lab__body { position: relative; display: flex; flex-direction: column; gap: .7rem; }
.lab__eyebrow { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--mono); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--c2); }
.lab__eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c2); box-shadow: 0 0 0 0 #71c1f2aa; animation: pulse 2.2s infinite; }
@keyframes pulse { 0%{ box-shadow: 0 0 0 0 #71c1f2aa; } 70%{ box-shadow: 0 0 0 10px #71c1f200; } 100%{ box-shadow: 0 0 0 0 #71c1f200; } }
.lab__big { font-family: var(--display); font-weight: 600; font-size: clamp(1.7rem, 4vw, 2.8rem); line-height: 1.05; letter-spacing: -0.03em; }
.lab__sub { color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.12rem); max-width: 44ch; }
.lab__arrow { position: relative; flex-shrink: 0; width: 64px; height: 64px; display: grid; place-content: center; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--c2); transition: transform .4s var(--ease), background .4s, color .4s, border-color .4s; }
.lab:hover .lab__arrow { background: var(--grad); color: #04131f; border-color: transparent; transform: rotate(-45deg) scale(1.05); }

/* ---------- Experiments page (the lab) ---------- */
.nav__links a.is-current { color: var(--text); }
.nav__links a.is-current::after { width: 100%; }

.lab-hero { padding-top: clamp(7rem, 14vw, 10rem); }
.lab-hero__back { display: inline-block; font-family: var(--mono); font-size: .82rem; letter-spacing: .08em; color: var(--muted); margin-bottom: 1.6rem; transition: color .3s; }
.lab-hero__back:hover { color: var(--c2); }
.lab-hero__title { font-family: var(--display); font-weight: 700; font-size: clamp(2.3rem, 7vw, 5rem); line-height: 1.02; letter-spacing: -0.04em; margin: .6rem 0 1.4rem; max-width: 16ch; }
.lab-hero__lead { max-width: 60ch; color: var(--muted); font-size: clamp(1.05rem, 1.9vw, 1.3rem); line-height: 1.6; }

.xsection { padding-top: clamp(2rem, 5vw, 3rem); }
.xgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: clamp(1.2rem, 2.4vw, 1.8rem); }
.xcard { position: relative; border: 1px solid var(--line); border-radius: var(--r); background: linear-gradient(150deg, var(--bg-2), #0a2335); overflow: hidden; transition: border-color .4s var(--ease), transform .4s var(--ease); }
.xcard::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(420px circle at 50% 0%, #4392d820, transparent 60%); transition: opacity .4s; }
.xcard:hover { border-color: var(--line-strong); }
.xcard:hover::before { opacity: 1; }
.xcard.is-empty { border-style: dashed; }
.xcard__inner { position: relative; padding: clamp(1.6rem, 3vw, 2.2rem); display: flex; flex-direction: column; gap: .9rem; height: 100%; }
.xcard__status { align-self: flex-start; font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; padding: .4rem .7rem; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); }
.xcard__status.is-live { color: #04131f; background: var(--grad); border-color: transparent; }
.xcard__status.is-progress { color: var(--c2); border-color: #4392d855; }
.xcard__status.is-planned { color: var(--faint); }
.xcard__title { font-family: var(--display); font-weight: 600; font-size: clamp(1.25rem, 2.4vw, 1.6rem); line-height: 1.15; letter-spacing: -0.02em; }
.xcard__desc { color: var(--muted); font-size: 1rem; line-height: 1.6; }
.xcard__desc a, .xcard__link { color: var(--c2); }
.xcard__tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto; padding-top: .4rem; list-style: none; }
.xcard__tags li { font-family: var(--mono); font-size: .72rem; letter-spacing: .04em; color: var(--faint); padding: .3rem .6rem; border: 1px solid var(--line); border-radius: 999px; }
.xsection__foot { margin-top: clamp(2.4rem, 5vw, 3.4rem); color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.15rem); }
.xsection__cta { color: var(--c2); font-weight: 500; }

/* ---------- Contact ---------- */
.contact { text-align: left; }
.contact__inner { max-width: var(--maxw); margin: 0 auto; }
.contact__big { font-family: var(--display); font-weight: 500; font-size: clamp(2rem, 5.4vw, 4rem); line-height: 1.05; letter-spacing: -0.035em; margin: 1rem 0 1.4rem; }
.contact__intro { max-width: 620px; margin: 0 0 2.6rem; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.15rem); }
.contact__mail { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-style: italic; transition: opacity .3s; }
.contact__mail:hover { opacity: .8; }
.contact__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.contact__item { background: var(--bg-2); padding: 1.8rem 1.5rem; display: flex; flex-direction: column; gap: .5rem; transition: background .3s; }
a.contact__item:hover { background: #ffffff08; }
.contact__k { font-family: var(--mono); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); transition: color .3s; }
a.contact__item:hover .contact__k { color: var(--c2); }
.contact__v { font-size: 1.02rem; color: var(--text); word-break: break-word; transition: transform .3s var(--ease); }
a.contact__item:hover .contact__v { transform: translateX(5px); }

/* ---------- Contact form ---------- */
.contact__body { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; margin-top: 1rem; }
.contact__details { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.contact__details .contact__item { background: var(--bg-2); }

.cform__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cform { display: flex; flex-direction: column; gap: 1.6rem; }
.cform__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; }

.field { position: relative; }
.field input, .field textarea {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line-strong);
  color: var(--text); font-family: var(--sans); font-size: 1.05rem; padding: 1.6rem 0 .7rem; resize: vertical;
  transition: border-color .3s;
}
.field textarea { min-height: 130px; line-height: 1.5; }
.field input:focus, .field textarea:focus { outline: none; }
.field label {
  position: absolute; left: 0; top: 1.5rem; color: var(--muted); font-size: 1.05rem; pointer-events: none;
  transform-origin: left center; transition: transform .3s var(--ease), color .3s;
}
.field label em { font-style: normal; color: var(--faint); font-size: .85em; }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label {
  transform: translateY(-1.55rem) scale(.78); color: var(--c2);
}
.field__line { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--grad); transition: width .4s var(--ease); }
.field input:focus ~ .field__line, .field textarea:focus ~ .field__line { width: 100%; }
.field--area .field__line { bottom: 4px; }
.field__count { position: absolute; right: 0; bottom: -1.4rem; font-family: var(--mono); font-size: .72rem; color: var(--faint); }
.field__count b { color: var(--muted); font-weight: 500; }
.field__error { display: block; min-height: 0; font-family: var(--mono); font-size: .74rem; color: #ff6b6b; opacity: 0; transform: translateY(-4px); transition: opacity .3s, transform .3s; margin-top: .4rem; }
.field.is-invalid input, .field.is-invalid textarea { border-bottom-color: #ff6b6b88; }
.field.is-invalid .field__error { opacity: 1; transform: none; }
.field.is-invalid { animation: shake .4s var(--ease); }
@keyframes shake { 0%,100%{ transform: translateX(0); } 20%{ transform: translateX(-7px); } 40%{ transform: translateX(6px); } 60%{ transform: translateX(-4px); } 80%{ transform: translateX(2px); } }

.cform__submit { align-self: flex-start; position: relative; overflow: hidden; margin-top: .6rem; }
.cform__submit .cform__spinner, .cform__submit .cform__check { position: absolute; right: 1.6rem; opacity: 0; }
.cform__arrow { transition: transform .3s var(--ease), opacity .3s; }
.cform__submit:hover .cform__arrow { transform: translateX(4px); }
.cform.is-sending .cform__arrow { opacity: 0; }
.cform.is-sending .cform__spinner { opacity: 1; animation: spin .8s linear infinite; }
.cform.is-sending .cform__submit-label { opacity: .7; }
.cform.is-sent { pointer-events: none; }
.cform.is-sent .cform__submit { background: linear-gradient(110deg, var(--c1), var(--c2)); color: #fff; }
.cform.is-sent .cform__arrow { opacity: 0; }
.cform.is-sent .cform__check { opacity: 1; animation: pop .5s var(--ease); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 0%{ transform: scale(0); } 60%{ transform: scale(1.3); } 100%{ transform: scale(1); } }
.cform__status { font-family: var(--mono); font-size: .85rem; min-height: 1.2rem; color: var(--muted); opacity: 0; transform: translateY(-4px); transition: opacity .4s, transform .4s; }
.cform__status.is-show { opacity: 1; transform: none; }
.cform__status.is-error { color: #ff8a8a; }
.cform__status.is-ok { color: #5ee0c0; }

/* ---------- Footer ---------- */
.footer { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; padding: 2.5rem var(--pad); border-top: 1px solid var(--line); max-width: var(--maxw); margin: 0 auto; }
.footer__left { display: flex; align-items: center; gap: 1rem; }
.footer__mark { width: 42px; height: 42px; display: grid; place-content: center; }
.footer__mark img { height: 42px; width: 42px; }
.footer__left p { font-family: var(--mono); font-size: .88rem; color: var(--muted); }
.footer__note { font-size: .88rem; color: var(--faint); }
.footer__top { font-family: var(--mono); font-size: .88rem; color: var(--muted); transition: color .3s; }
.footer__top:hover { color: var(--text); }

/* ---------- Reveal animations ---------- */
/* Hidden states gated behind .js so content is never stuck if JS fails. */
.js [data-reveal] {
  opacity: 0; transform: translateY(48px) scale(.985); filter: blur(10px);
  transition: opacity 1s var(--ease), transform 1.05s var(--ease), filter 1s var(--ease);
  transition-delay: var(--d, 0s); will-change: opacity, transform, filter;
}
.js [data-reveal].is-in { opacity: 1; transform: none; filter: none; }

.js .stag { opacity: 0; transform: translateY(14px); transition: opacity .55s var(--ease), transform .55s var(--ease), color .3s, border-color .3s, background .3s; }
.js .stag.stag-in { opacity: 1; transform: translateY(0); }

.splitlines .ln { display: block; overflow: hidden; padding-bottom: .14em; }
.js .splitlines .ln > span { display: block; transform: translateY(110%); transition: transform 1s var(--ease); transition-delay: var(--ld, 0s); }
.js .splitlines.is-in .ln > span { transform: translateY(0); }

/* ---------- Type weight scale (single-family Montserrat hierarchy) ---------- */
/* 700 — display titles & marks */
.hero__title, .section__title, .contact__big, .nav__mark, .footer__mark { font-weight: 700; }
/* 600 — sub-headings, big nav, buttons */
.belief__title, .tl__card h3, .mobilemenu a, .btn, .adapt__head { font-weight: 600; }
/* 300 — large light lead */
.about__lead p { font-weight: 300; }
/* 600 italic — hero accent words (lighter than the 700 around them) */
.hero__title .word.accent { font-weight: 600; }
/* 500 — client marquee */
.marquee__track span { font-weight: 500; }
/* 500 — labels & UI text (Montserrat reads light at 400 in caps) */
.section__index, .hero__eyebrow,
.nav__links a, .nav__cta, .nav__brandtext, .tl__year, .tl__org,
.contact__k, .hero__scroll span, .footer__left p, .footer__top,
.footer__note,
.tl__tags li, .field__count, .field__error,
.cform__status, .mobilemenu a span { font-weight: 500; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .contact__body { grid-template-columns: 1fr; gap: 2.5rem; }
}
@media (max-width: 820px) {
  .nav__links, .nav__cta { display: none; }
  .nav__burger { display: block; }
  .tl { grid-template-columns: 1fr; gap: .8rem; }
  .tl__year { position: static; }
  .hero__scroll { display: none; }
  .resume__inner { flex-direction: column; align-items: flex-start; }
  .lab { flex-direction: column; align-items: flex-start; gap: 1.6rem; }
  .lab__arrow { width: 54px; height: 54px; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .cform__row { grid-template-columns: 1fr; }
  .nav__brandtext { font-size: .9rem; }
}
/* Short viewports (e.g. phones in landscape): let the hero grow to fit its
   content and drop the decorative ticker + scroll cue, so the buttons are
   never hidden behind the bottom marquee. */
@media (max-height: 620px) {
  .hero { min-height: auto; justify-content: flex-start; padding-top: 4.75rem; padding-bottom: 2rem; }
  .hero__inner { padding-top: .5rem; }
  .hero__title { font-size: clamp(1.8rem, 4.6vw, 2.7rem); margin-bottom: .9rem; }
  .hero__lead { margin-bottom: 1.25rem; }
  .hero__marquee, .hero__scroll { display: none; }
}

/* ---------- Reduced motion ----------
   We keep subtle, continuous, low-amplitude motion (the skills/brand marquees
   and the gradient shimmer) so the brand still feels alive, and calm the
   large-movement / pointer-driven effects (travel + blur reveals, hero word
   slide, parallax, 3D tilt, custom cursor, smooth scroll — the last three are
   also gated in JS). */
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { transform: none !important; filter: none !important; transition: opacity .8s ease !important; }
  .js .stag { transform: none !important; transition: opacity .5s ease !important; }
  .adapt__scramble::after { animation: none !important; }
  .js .splitlines .ln { overflow: visible; }
  .js .splitlines .ln > span, .js .hero__title .word { transform: none !important; transition: none !important; }
  .cursor { display: none; }
}
