/* ============================================================
   FoxDim portfolio — global site styles
   Built on FoxDim tokens (styles/tokens.css).
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg-1); color: var(--fg-1);
  font-family: var(--font-sans); -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent); color: var(--bg-1); }

/* ============================================================ PRELOADER */
body.loading { overflow: hidden; }
#preloader {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-0);
  transition: transform .8s cubic-bezier(.76, 0, .24, 1) .2s;
  will-change: transform;
}
#preloader.done { transform: translateY(-100vh); pointer-events: none; }

/* word that cycles through UX/UI craft terms, with a small leading dot */
.pl-word {
  position: relative; z-index: 10; margin: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--white); font-weight: var(--w-medium);
  font-size: clamp(2rem, 4.6vw, 3.5rem); line-height: 1.1;
  letter-spacing: -.015em; text-align: center; padding: 0 6vw;
  opacity: 0; animation: plWordIn 1s ease .2s forwards;
}
.pl-dot { flex: none; width: 11px; height: 11px; border-radius: 50%; background: var(--white); margin-right: 14px; }
@keyframes plWordIn { to { opacity: .78; } }

/* dark curtain with a curved trailing edge that flattens as it lifts away */
.pl-curve { position: absolute; top: 0; left: 0; width: 100%; height: calc(100% + 300px); z-index: 1; }
.pl-curve path { fill: var(--bg-0); }

@media (prefers-reduced-motion: reduce) {
  #preloader { transition: opacity .35s ease; }
  .pl-word { animation: none; opacity: .78; }
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--space-page); }
.eyebrow {
  font-size: var(--t-eyebrow); font-weight: var(--w-extralight);
  letter-spacing: .18em; text-transform: uppercase; color: var(--accent);
  display: inline-flex; align-items: center; gap: 12px;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--accent); opacity: .6; }

/* animated gradient heading */
.grad {
  background: linear-gradient(100deg, #fff 0%, #fff 30%, var(--accent) 55%, #ffd9c4 75%, #fff 100%);
  background-size: 240% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: gradShift 9s ease-in-out infinite;
}
@keyframes gradShift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@media (prefers-reduced-motion: reduce){ .grad { animation: none; } }

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity .9s var(--ease-brand), transform .9s var(--ease-brand); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; } .reveal.d4 { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce){ .reveal { opacity: 1; transform: none; } }

/* ============================================================ HEADER */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: 88px;
  display: flex; align-items: center;
  transition: background var(--dur-fast) var(--ease-brand), backdrop-filter var(--dur-fast), border-color var(--dur-fast), height var(--dur-fast);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(var(--bg-1-rgb), .82); backdrop-filter: blur(14px);
  border-bottom-color: var(--line-1); height: 72px;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.brand { display: flex; align-items: center; gap: 13px; cursor: pointer; }
.brand .logo { width: 34px; height: 34px; position: relative; }
.brand .logo svg { width: 100%; height: 100%; display: block; }
.brand .logo svg path { transition: fill .4s var(--ease-brand); }
.brand:hover .logo svg path { fill: var(--accent); }
.brand .logo svg { animation: logoFloat 6s ease-in-out infinite; transform-origin: center; }
@keyframes logoFloat { 0%,100% { transform: rotate(0deg); } 50% { transform: rotate(-6deg) scale(1.04); } }
.brand .wm { position: relative; font-size: 17px; letter-spacing: .04em; white-space: nowrap; font-weight: var(--w-light); display: inline-flex; align-items: center; justify-content: flex-start; width: 172px; overflow: hidden; }
.brand .wm .wm-text { font-weight: var(--w-light); }
.brand .wm .wm-text b { font-weight: var(--w-regular); }
.brand .wm.is-name .wm-text { color: var(--accent); }
.brand .wm-caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; background: var(--accent); opacity: 0; border-radius: 1px; }
.brand .wm.cv .wm-caret { opacity: 1; }
.brand .wm.blink .wm-caret { animation: caretBlink .9s steps(1, end) infinite; }
@keyframes caretBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.nav-links { display: flex; align-items: center; gap: 38px; }
.nav-links a {
  font-size: 14px; font-weight: var(--w-extralight); letter-spacing: .04em;
  color: var(--fg-3); position: relative; padding: 4px 0;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-fast) var(--ease-brand);
}
.nav-links a:hover { color: var(--fg-1); } .nav-links a:hover::after { transform: scaleX(1); }

.header-right { display: flex; align-items: center; gap: 20px; }
.lang { display: flex; align-items: center; gap: 2px; }
.lang button {
  background: none; border: none; cursor: pointer; font-family: inherit;
  font-size: 13px; font-weight: var(--w-extralight); letter-spacing: .06em;
  color: var(--fg-4); padding: 5px 9px; border-radius: var(--r-pill); transition: all var(--dur-fast);
}
.lang button.on { color: var(--bg-1); background: var(--accent); font-weight: var(--w-medium); }
.btn {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: var(--w-regular); letter-spacing: .02em;
  padding: 13px 26px; border-radius: var(--r-cta); border: 1px solid var(--accent-line);
  background: var(--accent-soft); color: var(--fg-1); transition: all var(--dur-fast) var(--ease-brand);
}
.btn:hover { background: var(--accent); color: var(--bg-1); border-color: var(--accent); transform: translateY(-2px); }
.btn.solid { background: var(--accent); color: var(--bg-1); border-color: var(--accent); }
.btn.solid:hover { box-shadow: 0 14px 40px rgba(var(--accent-rgb), .35); }
.btn.ghost { background: transparent; border-color: var(--line-3); color: var(--fg-2); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); background: transparent; box-shadow: none; }
.btn.lg { padding: 16px 32px; font-size: 15px; }

.menu-toggle { display: none; }

/* ============================================================ HERO (A) */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; overflow: hidden; isolation: isolate; }

/* animated constellation background — sits behind shapes, melts into edges via the vignette */
.hero-canvas { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }

/* ---- floating elegant shapes (adapted: brand orange/amber on near-black) ---- */
.shapes { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.shapes .shape { position: absolute; opacity: 0; transform: translateY(-150px) rotate(var(--rs)); animation: shapeIn 2.4s cubic-bezier(.23,.86,.39,.96) var(--sd, 0s) forwards; }
.shapes .shape-fl { animation: shapeFloat 12s ease-in-out infinite; }
.shapes .shape-fill {
  width: 100%; height: 100%; border-radius: 999px; position: relative;
  background: linear-gradient(90deg, var(--sg), transparent);
  backdrop-filter: blur(2px);
  border: 2px solid rgba(255,255,255,.12);
  box-shadow: 0 8px 32px rgba(255,255,255,.04);
}
.shapes .shape-fill::after {
  content: ""; position: absolute; inset: 0; border-radius: 999px;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.14), transparent 70%);
}
@keyframes shapeIn { to { opacity: 1; transform: translateY(0) rotate(var(--r)); } }
@keyframes shapeFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(16px); } }
/* positions / sizes / tints */
.shape.s1 { left: -6%;  top: 16%;    width: 600px; height: 140px; --r: 12deg;  --rs: -3deg; --sd: .30s; --sg: rgba(242,115,47,.16); }
.shape.s2 { right: -4%; top: 70%;    width: 500px; height: 120px; --r: -15deg; --rs: -30deg; --sd: .50s; --sg: rgba(245,158,11,.13); }
.shape.s3 { left: 7%;   bottom: 6%;  width: 300px; height: 80px;  --r: -8deg;  --rs: -23deg; --sd: .40s; --sg: rgba(255,255,255,.07); }
.shape.s4 { right: 16%; top: 11%;    width: 200px; height: 60px;  --r: 20deg;  --rs: 5deg;  --sd: .60s; --sg: rgba(242,115,47,.13); }
.shape.s5 { left: 24%;  top: 6%;     width: 150px; height: 40px;  --r: -25deg; --rs: -40deg; --sd: .70s; --sg: rgba(245,158,11,.11); }
@media (prefers-reduced-motion: reduce) {
  .shapes .shape { animation: none; opacity: 1; transform: rotate(var(--r)); }
  .shapes .shape-fl { animation: none; }
}
/* top/bottom vignette so the shapes melt into the canvas */
.hero-vignette { position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, rgba(var(--bg-1-rgb),.55) 0%, transparent 22%, transparent 70%, rgba(var(--bg-1-rgb),.85) 100%); }
.beams { position: absolute; inset: -20% -10%; z-index: 0; pointer-events: none; }
.beams i {
  position: absolute; top: -30%; height: 160%; width: 300px;
  background: linear-gradient(180deg, transparent, rgba(var(--accent-rgb), .13), transparent);
  filter: blur(50px); transform: rotate(18deg); opacity: 0;
  animation: beamDrift 16s var(--ease-brand) infinite;
}
.beams i:nth-child(1){ left: 6%;  animation-delay: 0s; }
.beams i:nth-child(2){ left: 30%; animation-delay: -6s; width: 200px; }
.beams i:nth-child(3){ left: 60%; animation-delay: -11s; width: 360px; }
@keyframes beamDrift { 0% { opacity: 0; transform: translateY(-40px) rotate(18deg);} 40%,60% { opacity: .9; } 100% { opacity: 0; transform: translateY(70px) rotate(18deg);} }
@media (prefers-reduced-motion: reduce){ .beams i { animation: none; opacity: .45; } }

.hero-grid { position: relative; z-index: 5; display: grid; grid-template-columns: 540px 1fr; align-items: center; width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 var(--space-page); }
.hero-photo { position: relative; align-self: end; height: 92vh; max-height: 920px; display: flex; align-items: flex-end; justify-content: center; }
.hero-photo .floor-glow {
  position: absolute; left: 50%; bottom: 60px; transform: translateX(-50%);
  width: 480px; height: 200px; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(var(--accent-rgb), .26), transparent 70%);
  filter: blur(40px); z-index: 1;
}
.hero-photo img {
  position: relative; z-index: 2; height: 100%; width: auto; object-fit: contain;
  filter: drop-shadow(0 30px 60px rgba(0,0,0,.6));
  animation: heroRise 1.3s var(--ease-brand) both;
}
@keyframes heroRise { from { opacity: 0; transform: translateY(50px) scale(1.03); } to { opacity: 1; transform: none; } }
.hero-content { align-self: center; padding: 96px 0 96px 56px; }
.hero-content .eyebrow { margin-bottom: 22px; animation: fadeUp .9s var(--ease-brand) both .1s; }
.hero-content h1 {
  margin: 0; font-size: clamp(3.5rem, 7.3vw, 7rem); line-height: .93; font-weight: var(--w-extralight);
  letter-spacing: -.02em;
}
.hero-content h1 span { display: block; animation: fadeUp 1s var(--ease-brand) both; }
.hero-content h1 span:nth-child(1){ animation-delay: .18s; }
.hero-content h1 span:nth-child(2){ animation-delay: .30s; color: var(--fg-2); }
.hero-lead {
  margin: 30px 0 36px; max-width: 44ch; font-size: 19px; line-height: 1.7;
  font-weight: var(--w-light); color: var(--fg-3); animation: fadeUp 1s var(--ease-brand) both .42s;
}
.hero-ctas { display: flex; gap: 16px; margin-bottom: 52px; animation: fadeUp 1s var(--ease-brand) both .52s; }
.hero-stats { display: flex; animation: fadeUp 1s var(--ease-brand) both .62s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

/* short viewports: shrink hero type/spacing so the eyebrow clears the header */
@media (max-height: 820px) {
  .hero-content { padding-bottom: 7vh; }
  .hero-content h1 { font-size: clamp(2.8rem, 6vw, 4.6rem); }
  .hero-lead { font-size: 17px; margin: 20px 0 28px; max-width: 42ch; }
  .hero-ctas { margin-bottom: 34px; }
  .hero-stats .stats .num { font-size: 42px; }
}
@media (max-height: 660px) {
  .hero-content { padding-bottom: 5vh; }
  .hero-content h1 { font-size: clamp(2.4rem, 5vw, 3.4rem); }
  .hero-lead { margin: 16px 0 22px; }
  .hero-ctas { margin-bottom: 26px; }
  .hero-stats .stats .num { font-size: 36px; }
}

.stats { display: flex; }
.stats .stat { display: flex; flex-direction: column; gap: 7px; padding-right: 40px; }
.stats .stat + .stat { padding-left: 40px; border-left: 1px solid var(--line-2); }
.stats .num { font-size: 54px; font-weight: var(--w-bold); line-height: 1; color: var(--accent); letter-spacing: -.02em; }
.stats .num .suf { color: var(--fg-3); font-weight: var(--w-light); }
.stats .lbl { font-size: 13px; font-weight: var(--w-extralight); letter-spacing: .03em; color: var(--fg-3); max-width: 15ch; }

.scroll-hint {
  position: absolute; bottom: 34px; right: 40px; z-index: 6;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--fg-4); font-weight: var(--w-extralight);
}
.scroll-hint .line { width: 1px; height: 40px; background: linear-gradient(var(--accent), transparent); animation: scrollLine 2.2s ease-in-out infinite; }
@keyframes scrollLine { 0%,100% { transform: scaleY(.4); opacity:.4; transform-origin: top;} 50% { transform: scaleY(1); opacity: 1; transform-origin: top;} }

/* ============================================================ MARQUEE */
.marquee { padding: 38px 0; border-top: 1px solid var(--line-1); border-bottom: 1px solid var(--line-1); overflow: hidden; background: var(--bg-2); }
.marquee-track { display: flex; white-space: nowrap; width: max-content; animation: marquee 38s linear infinite; }
.marquee-track span { font-size: 4.4vw; font-weight: var(--w-extralight); text-transform: uppercase; color: var(--fg-1); letter-spacing: .01em; padding-right: 1.2em; opacity: .9; }
.marquee-track span em { font-style: normal; color: var(--accent); }
@keyframes marquee { from { transform: translateX(0);} to { transform: translateX(-50%);} }
.marquee:hover .marquee-track { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce){ .marquee-track { animation: none; } }

/* ============================================================ SECTIONS */
.section { padding: 9rem 0; position: relative; }
.section.alt { background: var(--bg-2); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; margin-bottom: 4rem; }
.section-head h2 { margin: 18px 0 0; font-size: clamp(2.6rem, 5vw, 4.2rem); font-weight: var(--w-extralight); line-height: 1.02; letter-spacing: -.02em; color: var(--white); }
.section-head .sub { max-width: 42ch; font-size: 18px; line-height: 1.7; font-weight: var(--w-light); color: var(--fg-3); }

/* ---------- projects grid ---------- */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.proj-card {
  position: relative; border-radius: var(--r-lg); overflow: hidden; cursor: pointer;
  background: var(--bg-0); border: 1px solid var(--line-1);
  aspect-ratio: 4 / 5; display: flex; flex-direction: column; justify-content: flex-end;
  transition: transform var(--dur-mid) var(--ease-brand), box-shadow var(--dur-mid) var(--ease-brand), border-color var(--dur-mid);
}
.proj-card .cover { position: absolute; inset: 0; z-index: 0; }
.proj-card .cover img { width: 100%; height: 100%; object-fit: cover; object-position: center top; transition: transform .7s var(--ease-brand); }
/* landscape / non-portrait shots: show whole frame, let it letterbox on black */
.proj-card.contain .cover img { object-fit: contain; object-position: center; }
.proj-card .scrim { position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(var(--bg-1-rgb),0) 0%, rgba(var(--bg-1-rgb),0) 42%, rgba(var(--bg-0-rgb,5,5,5),.55) 66%, rgba(var(--bg-0-rgb,5,5,5),.96) 100%); }
.proj-card .spot { position: absolute; inset: 0; z-index: 2; opacity: 0; transition: opacity var(--dur-mid); background: radial-gradient(360px circle at var(--mx,50%) var(--my,50%), rgba(var(--accent-rgb),.18), transparent 60%); }
.proj-card .body { position: relative; z-index: 3; padding: 28px; }
.proj-card .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.proj-card .tag { font-size: 12px; font-weight: var(--w-extralight); letter-spacing: .04em; color: var(--fg-2); padding: 6px 14px; border: 1px solid var(--line-white); border-radius: var(--r-pill); background: rgba(0,0,0,.25); backdrop-filter: blur(6px); }
.proj-card h3 { margin: 0; font-size: var(--t-card); font-weight: var(--w-medium); color: var(--accent); }
.proj-card p { margin: 8px 0 0; font-size: 15px; line-height: 1.6; color: var(--fg-2); font-weight: var(--w-light); max-width: 46ch; }
.proj-card .go { display: inline-flex; align-items: center; gap: 10px; margin-top: 20px; font-size: 14px; color: var(--fg-1); font-weight: var(--w-regular); transition: gap var(--dur-fast), color var(--dur-fast); }
.proj-card .go svg { transition: transform var(--dur-fast) var(--ease-brand); }
.proj-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-card); border-color: var(--accent-line); }
.proj-card:hover .cover img { transform: scale(1.07); }
.proj-card:hover .spot { opacity: 1; }
.proj-card:hover .go { gap: 16px; color: var(--accent); }
.proj-card:hover .go svg { transform: translateX(4px); }

/* ---------- about ---------- */
.about { text-align: center; max-width: 780px; margin: 0 auto; }
.about .eyebrow { justify-content: center; }
.about h2 { margin: 22px 0 40px; font-size: clamp(2.2rem, 4vw, 3.4rem); font-weight: var(--w-extralight); line-height: 1.18; letter-spacing: -.01em; color: var(--fg-1); }
.about h2 b { font-weight: var(--w-regular); color: var(--white); }
.about p { font-size: var(--t-body); line-height: var(--lh-body); color: var(--fg-2); font-weight: var(--w-light); margin: 0 auto 1.7rem; max-width: 62ch; }
.about p strong { color: var(--accent); font-weight: var(--w-medium); }

/* ---------- skills ---------- */
.skills-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: start; }
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tool {
  display: flex; align-items: center; gap: 14px; padding: 18px 20px;
  background: var(--surface-1); border: 1px solid var(--line-1); border-radius: var(--r-md);
  transition: transform var(--dur-fast) var(--ease-brand), border-color var(--dur-fast), background var(--dur-fast);
}
.tool:hover { transform: translateY(-4px); border-color: var(--accent-line); background: var(--surface-2); }
.tool img { width: 30px; height: 30px; object-fit: contain; }
.tool span { font-size: 14px; font-weight: var(--w-light); color: var(--fg-2); }
.methods { display: flex; flex-direction: column; gap: 2px; }
.method { padding: 20px 0 20px 22px; border-left: 2px solid var(--line-2); transition: border-color var(--dur-fast), padding var(--dur-fast); }
.method:hover { border-left-color: var(--accent); padding-left: 30px; }
.method h4 { margin: 0 0 6px; font-size: 18px; font-weight: var(--w-medium); color: var(--fg-1); }
.method p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--fg-3); font-weight: var(--w-light); }
.skills-aside h3 { font-size: 22px; font-weight: var(--w-light); color: var(--fg-1); margin: 0 0 24px; }

/* ---------- approach ---------- */
.approach-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step { padding: 38px 32px; background: var(--surface-1); border: 1px solid var(--line-1); border-radius: var(--r-xl); position: relative; overflow: hidden; transition: border-color var(--dur-fast), transform var(--dur-fast) var(--ease-brand), box-shadow var(--dur-fast) var(--ease-brand); }
.step:hover { border-color: var(--accent-line); transform: translateY(-6px); box-shadow: var(--shadow-card); }
.step .spot { position: absolute; inset: 0; z-index: 0; opacity: 0; pointer-events: none; border-radius: inherit; transition: opacity var(--dur-mid) var(--ease-brand); background: radial-gradient(340px circle at var(--mx,50%) var(--my,50%), rgba(var(--accent-rgb),.16), transparent 60%); }
.step:hover .spot { opacity: 1; }
.step .glyph, .step h4, .step p { position: relative; z-index: 1; }
.step .ghost-n { position: absolute; right: 18px; top: 0; font-size: 150px; font-weight: var(--w-bold); color: rgba(255,255,255,.04); line-height: 1; }
.step .glyph {
  width: 60px; height: 60px; margin-bottom: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--fg-2);
  transition: background var(--dur-fast) var(--ease-brand), border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast) var(--ease-brand);
}
.step .glyph svg { width: 28px; height: 28px; display: block; }
.step:hover .glyph { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); transform: translateY(-2px) scale(1.05); }
.step h4 { margin: 0 0 12px; font-size: 21px; font-weight: var(--w-medium); color: var(--fg-1); }
.step p { margin: 0; font-size: 15px; line-height: 1.7; color: var(--fg-3); font-weight: var(--w-light); }

/* ============================================================ STORY-SCROLL STACK
   Pinned panels that rotate from 30°→0° (origin bottom-left) as the next
   scrolls up over the previous. Motion driven by GSAP ScrollTrigger.
   ============================================================ */
.flow-stack { position: relative; width: 100%; }
.panel-h { margin: 18px 0 0; font-size: clamp(2.6rem, 5vw, 4.2rem); font-weight: var(--w-extralight); line-height: 1.02; letter-spacing: -.02em; color: var(--white); }
.flow-section {
  position: relative; min-height: 100vh; width: 100%; overflow: hidden;
  --panel: var(--bg-1);
}
.flow-inner {
  position: relative; min-height: 100vh; width: 100%;
  display: flex; flex-direction: column; justify-content: center;
  padding: 120px 0 90px; background: var(--panel);
  transform-origin: bottom left; will-change: transform;
  box-shadow: 0 -34px 90px rgba(0,0,0,.7);
}
/* glowing orange seam at the top edge — catches the eye as a panel folds in */
.flow-inner::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; z-index: 4;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), .8), transparent);
}
.flow-inner::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 140px; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(var(--accent-rgb), .05), transparent);
}
.flow-inner > * { position: relative; z-index: 2; }

/* per-panel tones */
.fp-about    .flow-inner { --panel: #0a0a0a; }
.fp-skills   .flow-inner { --panel: #0e0e0e; }
.fp-methods  .flow-inner { --panel: #0a0a0a; }
.fp-approach .flow-inner { --panel: #0c0c0c; }
.fp-approach .flow-inner { background:
  radial-gradient(120% 80% at 80% 12%, rgba(var(--accent-rgb), .10), transparent 55%),
  var(--panel); }

/* tools — standalone wide grid (skills panel) */
.tools-wide { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; max-width: 720px; }
.tools-wide .tool { padding: 22px 24px; }
.tools-wide .tool img { width: 34px; height: 34px; }
.tools-wide .tool span { font-size: 15px; }
.skills-split { display: grid; grid-template-columns: 1fr 720px; gap: 64px; align-items: center; }

/* methods — standalone 2×2 grid (how-I-work panel) */
.methods-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 56px; }
.methods-grid .method { padding: 22px 0 22px 24px; }
.methods-grid .method h4 {
  font-size: 20px;
  background-image: linear-gradient(90deg, var(--accent) 0%, var(--accent) 38%, var(--fg-1) 62%, var(--fg-1) 100%);
  background-size: 220% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  transition: background-position .6s var(--ease-brand);
}
.methods-grid .method:hover h4 { background-position: 0 0; }
@media (prefers-reduced-motion: reduce) { .methods-grid .method h4 { transition: none; } }
.methods-grid .method p { font-size: 15px; }

/* reduced-motion / fallback: behave like normal stacked sections */
.flow-stack.no-flow .flow-section { min-height: 0; overflow: visible; }
.flow-stack.no-flow .flow-inner { min-height: 0; padding: 8rem 0; transform: none !important; box-shadow: none; }

@media (max-width: 1100px) {
  .skills-split { grid-template-columns: 1fr; gap: 36px; }
  .tools-wide { max-width: 560px; }
  .methods-grid { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 900px) {
  .flow-section { min-height: 0; overflow: visible; }
  .flow-inner { min-height: 0; padding: 6rem 0; transform: none !important; box-shadow: none; }
  .flow-inner::after { display: none; }
}

/* ============================================================ FOOTER */
.footer { position: relative; padding: 8rem 0 3rem; background: var(--bg-0); overflow: hidden; }
.footer-bg {
  position: absolute; left: 50%; bottom: -3%; transform: translateX(-50%);
  font-size: 27vw; font-weight: var(--w-bold); letter-spacing: -.05em; line-height: .8;
  color: rgba(255,255,255,.025); white-space: nowrap; z-index: 0; pointer-events: none; user-select: none;
}
.footer .wrap { position: relative; z-index: 1; }
.footer-cta { text-align: center; margin-bottom: 6rem; }
.footer-cta .eyebrow { justify-content: center; margin-bottom: 26px; }
.footer-big {
  font-size: clamp(3rem, 9vw, 9rem); font-weight: var(--w-extralight); line-height: .92;
  letter-spacing: -.03em; margin: 0 0 44px; text-transform: none;
}
.footer-big .grad { display: inline-block; }
.magnetic-wrap { display: flex; justify-content: center; }
.magnetic { will-change: transform; }
.footer-rows { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line-2); margin-bottom: 3rem; }
.frow { display: flex; flex-direction: column; gap: 6px; padding: 28px 0; border-bottom: 1px solid var(--line-2); }
.frow + .frow { } 
.contacts { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 4rem; }
.contact { background: var(--bg-0); padding: 30px 32px; display: flex; align-items: center; gap: 18px; transition: background var(--dur-fast); }
.contact:hover { background: var(--surface-1); }
.contact .ic { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background var(--dur-fast), transform var(--dur-fast); color: var(--fg-2); }
.contact:hover .ic { background: var(--accent); color: var(--bg-1); transform: scale(1.08); }
.contact .ic svg { width: 20px; height: 20px; }
/* stack label over value on two lines with a small gap */
.contact > span:not(.ic) { display: flex; flex-direction: column; gap: 5px; }
.contact .lbl { font-size: 12px; color: var(--fg-4); text-transform: lowercase; letter-spacing: .04em; }
.contact .val { font-size: 16px; color: var(--fg-1); font-weight: var(--w-light); }
.contact:hover .val { color: var(--accent); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 2rem; border-top: 1px solid var(--line-1); }
.footer-bottom .copy { font-size: 13px; color: var(--fg-4); font-weight: var(--w-extralight); }
.socials { display: flex; gap: 12px; }
.socials a { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; color: var(--fg-3); transition: all var(--dur-fast) var(--ease-brand); }
.socials a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }
.socials a svg { width: 18px; height: 18px; }

/* ============================================================ RESPONSIVE */

/* ── 1100px — tablet: nav drawer + layout stack ── */
@media (max-width: 1100px) {
  /* hamburger button */
  .menu-toggle {
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    gap: 5px; width: 44px; height: 44px; padding: 0; flex-shrink: 0;
    background: none; border: 1px solid var(--line-2); border-radius: var(--r-md);
    cursor: pointer; color: var(--fg-2);
    transition: border-color var(--dur-fast), background var(--dur-fast);
  }
  .menu-toggle:hover { border-color: var(--accent); background: var(--accent-soft); }
  .menu-toggle span {
    display: block; width: 18px; height: 1.5px;
    background: currentColor; border-radius: 2px;
    transition: transform 0.38s var(--ease-brand), opacity 0.18s, width 0.18s;
    transform-origin: center;
  }
  body.nav-open .menu-toggle { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
  body.nav-open .menu-toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  body.nav-open .menu-toggle span:nth-child(2) { opacity: 0; width: 0; }
  body.nav-open .menu-toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

  /* nav drawer panel */
  .nav-links {
    display: flex !important;
    flex-direction: column; align-items: flex-start; gap: 0;
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(320px, 85vw);
    background: rgba(8, 8, 8, 0.97); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--line-2);
    padding: 96px 36px 48px;
    z-index: 500;
    transform: translateX(110%);
    transition: transform 0.45s var(--ease-brand);
    overflow-y: auto;
  }
  body.nav-open .nav-links { transform: translateX(0); }
  body.nav-open { overflow: hidden; }

  .nav-links a {
    font-size: 20px; font-weight: var(--w-extralight); letter-spacing: 0.02em;
    color: var(--fg-2); padding: 16px 0; width: 100%;
    border-bottom: 1px solid var(--line-1);
    transition: color var(--dur-fast) var(--ease-brand), padding-left var(--dur-fast) var(--ease-brand);
  }
  .nav-links a:last-child { border-bottom: none; }
  .nav-links a:hover { color: var(--accent); padding-left: 10px; }
  .nav-links a::after { display: none; }

  /* backdrop behind the drawer */
  body.nav-open::before {
    content: ""; position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.62); z-index: 490;
    pointer-events: none;
  }

  /* hero */
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { display: none; }
  .hero-content { padding: 130px 0 80px; }

  /* layout */
  .skills-grid { grid-template-columns: 1fr; gap: 40px; }
  .projects { grid-template-columns: repeat(2, 1fr); }
  .approach-grid { grid-template-columns: 1fr; }
  .contacts { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .footer-rows { grid-template-columns: 1fr 1fr; }
}

/* ── 768px — large phone ── */
@media (max-width: 768px) {
  :root { --space-page: 1.25rem; }

  .section { padding: 6.5rem 0; }
  .section-head { margin-bottom: 2.4rem; }
  .section-head h2 { font-size: clamp(1.9rem, 7vw, 3rem); }
  .section-head .sub { font-size: 16px; }

  .hero-content { padding: 120px 0 60px; }
  .hero-lead { font-size: 17px; margin: 20px 0 28px; max-width: 100%; }
  .hero-ctas { margin-bottom: 36px; gap: 12px; }

  .stats .num { font-size: 42px; }
  .stats .stat { padding-right: 28px; }
  .stats .stat + .stat { padding-left: 28px; }
  .stats .lbl { font-size: 12px; }

  .scroll-hint { display: none; }
  .marquee-track span { font-size: 6vw; }

  .footer { padding: 5rem 0 2.5rem; }
  .footer-cta { margin-bottom: 4rem; }
  .footer-bottom { flex-direction: column; align-items: center; gap: 16px; text-align: center; }
}

/* ── 640px — standard mobile ── */
@media (max-width: 640px) {
  :root { --space-page: 1rem; }

  .section { padding: 5.5rem 0; }
  .header-right .btn { display: none; }

  .hero-content { padding: 110px 0 56px; }
  .hero-lead { font-size: 16px; }

  .projects { grid-template-columns: 1fr; gap: 20px; }

  /* Cards: image on top, text section below — no overlap */
  .proj-card {
    aspect-ratio: unset;
    justify-content: flex-start;
    min-height: 0;
  }
  .proj-card .cover {
    position: relative;
    top: auto; left: auto; right: auto; bottom: auto;
    height: 220px;
    flex-shrink: 0;
    overflow: hidden;
  }
  .proj-card .cover img {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
  }
  .proj-card.contain .cover img { object-fit: contain; }
  .proj-card .scrim { display: none; }
  .proj-card .spot { display: none; }
  .proj-card .body {
    position: static;
    z-index: auto;
    background: var(--surface-1);
    padding: 18px 20px 22px;
    flex: 1;
  }
  .proj-card .tag { backdrop-filter: none; background: var(--surface-2); }
  .proj-card p { max-width: 100%; }

  .tools { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .tool { padding: 14px 16px; gap: 10px; }
  .tools-wide { grid-template-columns: repeat(2, 1fr); gap: 12px; max-width: 100%; }
  .tools-wide .tool { padding: 16px 18px; }
  .tools-wide .tool img, .tools-wide .tool .tool-icon { width: 28px; height: 28px; }
  .tools-wide .tool span { font-size: 14px; }

  .step { padding: 30px 24px; }
  .contact { padding: 22px 18px; }
  .contact .val { font-size: 14px; }

  .footer-rows { grid-template-columns: 1fr; }
  .frow { padding: 20px 0; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 16px; }

  .wm-dialog { padding: 36px 24px 28px; }
}

/* ── 440px — small phones ── */
@media (max-width: 440px) {
  .hero-content h1 { font-size: clamp(2.5rem, 11vw, 3.6rem); }
  .hero-lead { font-size: 15px; }
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .hero-ctas .btn { width: 100%; justify-content: center; }

  .stats .num { font-size: 34px; }
  .stats .stat { padding-right: 16px; }
  .stats .stat + .stat { padding-left: 16px; }

  .pl-word { font-size: clamp(1.6rem, 7.5vw, 2.8rem); }

  .wm-dialog { padding: 32px 18px 24px; }
  .wm-title { font-size: clamp(1.5rem, 7vw, 1.9rem); }
}

/* ============================================================ WRITE / CONTACT MODAL */
body.modal-open { overflow: hidden; }
.write-modal {
  position: fixed; inset: 0; z-index: 100000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; opacity: 0; visibility: hidden;
  transition: opacity var(--dur-mid) var(--ease-brand), visibility var(--dur-mid);
}
.write-modal.open { opacity: 1; visibility: visible; }
.wm-overlay { position: absolute; inset: 0; background: rgba(5, 5, 5, .78); backdrop-filter: blur(8px); }
.wm-dialog {
  position: relative; z-index: 1; width: 100%; max-width: 520px;
  background: var(--surface-1); border: 1px solid var(--line-2);
  border-radius: var(--r-xl); padding: 44px 44px 40px;
  box-shadow: var(--shadow-card);
  transform: translateY(24px) scale(.98); opacity: 0;
  transition: transform var(--dur-mid) var(--ease-brand), opacity var(--dur-mid) var(--ease-brand);
}
.write-modal.open .wm-dialog { transform: none; opacity: 1; }
.wm-x {
  position: absolute; top: 18px; right: 18px; width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-round); border: 1px solid var(--line-2);
  background: transparent; color: var(--fg-3); cursor: pointer;
  transition: all var(--dur-fast) var(--ease-brand);
}
.wm-x svg { width: 18px; height: 18px; }
.wm-x:hover { color: var(--accent); border-color: var(--accent); transform: rotate(90deg); }
.wm-title { margin: 18px 0 10px; font-size: clamp(1.8rem, 3.4vw, 2.4rem); font-weight: var(--w-extralight); line-height: 1.1; color: var(--fg-1); letter-spacing: -.01em; }
.wm-sub { margin: 0 0 28px; font-size: 15px; line-height: 1.6; color: var(--fg-3); font-weight: var(--w-light); max-width: 42ch; }
.wm-form { display: flex; flex-direction: column; gap: 18px; }
.wm-field { display: flex; flex-direction: column; gap: 8px; }
.wm-field > span { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--fg-4); font-weight: var(--w-light); }
.wm-field input,
.wm-field textarea {
  font-family: inherit; font-size: 15px; color: var(--fg-1); font-weight: var(--w-light);
  background: var(--bg-1); border: 1px solid var(--line-2); border-radius: var(--r-md);
  padding: 13px 16px; outline: none; resize: vertical;
  transition: border-color var(--dur-fast) var(--ease-brand), box-shadow var(--dur-fast) var(--ease-brand);
}
.wm-field textarea { min-height: 110px; line-height: 1.55; }
.wm-field input::placeholder,
.wm-field textarea::placeholder { color: var(--fg-4); opacity: .7; }
.wm-field input:focus,
.wm-field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .14); }
.wm-send { justify-content: center; margin-top: 6px; }
.wm-send.sending { opacity: .8; cursor: progress; }
.wm-status { margin: 4px 0 0; font-size: 13.5px; text-align: center; font-weight: var(--w-light); min-height: 1.2em; transition: opacity var(--dur-fast) var(--ease-brand); }
.wm-status.ok { color: var(--accent); font-weight: var(--w-regular); }
.wm-status.err { color: #e0563f; }
@media (max-width: 560px) {
  .wm-dialog { padding: 38px 24px 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .write-modal, .wm-dialog { transition: opacity .2s ease; }
  .wm-dialog { transform: none; }
  .wm-x:hover { transform: none; }
}

/* ============================================================ ENHANCE — premium motion & presentation */

/* hold hero entrance until the preloader curtain lifts */
body.loading .hero-content .eyebrow,
body.loading .hero-content h1 span,
body.loading .hero-lead,
body.loading .hero-ctas,
body.loading .hero-stats,
body.loading .hero-photo img,
body.loading .shapes .shape { animation-play-state: paused !important; }

/* hero h1 — lines unveil while rising (replaces plain fade) */
.hero-content h1 span { animation-name: lineUp; }
@keyframes lineUp {
  from { opacity: 0; clip-path: inset(0 0 100% 0); transform: translateY(46%) rotate(1.2deg); }
  to   { opacity: 1; clip-path: inset(-15% 0 -15% 0); transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-content h1 span { animation-name: fadeUp; }
}

/* header hides scrolling down, returns scrolling up */
.site-header {
  transition: background var(--dur-fast) var(--ease-brand), backdrop-filter var(--dur-fast),
              border-color var(--dur-fast), height var(--dur-fast), transform .55s var(--ease-brand);
}
.site-header.hide { transform: translateY(-105%); }

/* thin scroll progress bar */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 100000;
  background: linear-gradient(90deg, var(--accent), #ffd9c4);
  transform-origin: left; transform: scaleX(0); pointer-events: none;
}

/* custom cursor — dot + lagging ring (fine pointers only) */
@media (hover: hover) and (pointer: fine) {
  html.has-cursor, html.has-cursor a, html.has-cursor button { cursor: none; }
  html.has-cursor input, html.has-cursor textarea, html.has-cursor select { cursor: auto; }
}
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 100002; pointer-events: none;
  border-radius: 50%; opacity: 0; transition: opacity .25s ease;
}
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--accent); }
.cursor-ring {
  width: 38px; height: 38px; margin: -19px 0 0 -19px;
  border: 1px solid rgba(var(--accent-rgb), .5);
  display: flex; align-items: center; justify-content: center;
  transition: width .35s var(--ease-brand), height .35s var(--ease-brand), margin .35s var(--ease-brand),
              background .35s, border-color .35s, opacity .25s;
}
.cursor-ring .cur-label {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  font-weight: var(--w-light); color: var(--fg-1);
  opacity: 0; transition: opacity .25s; white-space: nowrap;
}
.cursor-ring.is-link {
  width: 56px; height: 56px; margin: -28px 0 0 -28px;
  background: rgba(var(--accent-rgb), .10); border-color: rgba(var(--accent-rgb), .85);
}
.cursor-ring.is-view {
  width: 94px; height: 94px; margin: -47px 0 0 -47px;
  background: rgba(5, 5, 5, .55); backdrop-filter: blur(3px);
  border-color: var(--accent);
}
.cursor-ring.is-view .cur-label { opacity: 1; }

/* marquee — soft edge fade */
.marquee {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

/* project cards — 3D tilt entrance (the .tilt-in hook finally gets styles) */
.tilt-in {
  opacity: 0;
  transform: perspective(1000px) translateY(60px) rotateX(6deg);
  transition: opacity .9s var(--ease-brand), transform .9s var(--ease-brand),
              box-shadow var(--dur-mid) var(--ease-brand), border-color var(--dur-mid);
}
.tilt-in.in { opacity: 1; transform: none; }
.projects .proj-card.tilt-in.in:hover { transform: translateY(-10px); transition-duration: .45s; }
@media (prefers-reduced-motion: reduce) { .tilt-in { opacity: 1; transform: none; } }

/* project cards — ghost index numbers 01–06 */
.projects { counter-reset: proj; }
.projects .proj-card { counter-increment: proj; }
.projects .proj-card::before {
  content: "0" counter(proj);
  position: absolute; top: 16px; right: 22px; z-index: 2;
  font-size: 60px; font-weight: var(--w-bold); line-height: 1; letter-spacing: -.03em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, .18);
  pointer-events: none;
  transition: -webkit-text-stroke-color .5s var(--ease-brand), transform .5s var(--ease-brand);
}
.projects .proj-card:hover::before {
  -webkit-text-stroke-color: rgba(var(--accent-rgb), .6);
  transform: translateY(-4px);
}

/* project covers — bleed for the scroll parallax (desktop) */
@media (min-width: 901px) {
  .proj-card .cover { inset: -7% 0; }
}

/* next-case link — name swells toward the cursor */
.next-case .nc-name { transition: transform .5s var(--ease-brand); }
.next-case a:hover .nc-name { transform: scale(1.04); }

@media (max-width: 640px) {
  .projects .proj-card::before { font-size: 40px; top: 12px; right: 14px; }
}
