/* Portfolio v2 — white page, Geist, small black UI type with "+" links, two-tone headlines,
   numbered sections on hairlines and a giant name in the footer. Project cards are unchanged. */
:root {
  --font: "Geist", "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --bg: #ffffff;
  --ink: #030712;
  --ink-2: #374151;
  --ink-3: #9ca3af;
  --line: #e5e7eb;
  --page: #ffffff;
  --top-bg: rgba(255,255,255,.9);
  --max: 1320px;
  --gutter: max(clamp(18px, 4.6vw, 64px), calc((100vw - var(--max)) / 2 + 64px));
}
body.v2 { background: var(--page); color: var(--ink); font-family: var(--font); font-size: 14px; }
.v2 a { color: inherit; }

/* Top bar */
.v2-top { position: sticky; top: 0; z-index: 50; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: 68px; padding: 0 var(--gutter); background: var(--top-bg); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font-size: 13px; }
.v2-me { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.v2-me img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; }
.v2-nav { display: flex; gap: 22px; }
.v2-cta { justify-self: end; }
.v2-top a:hover, .v2-foot a:hover { opacity: .5; }

/* Hero */
.v2-hero { padding: clamp(40px, 6vw, 72px) var(--gutter) clamp(56px, 7vw, 96px); display: grid; justify-items: start; max-width: calc(940px + 2 * var(--gutter)); margin: 0 auto; }
/* Water drop over the headline (js/v2-drop.js) */
.v2-hero { position: relative; }
.v2-drop { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.v2-h1 { font-size: clamp(44px, 6.6vw, 96px); font-weight: 500; letter-spacing: -0.045em; line-height: 1; }
.v2-h1 > span { display: block; }
.v2-mute { color: var(--ink-3); }
.v2-line { white-space: nowrap; }
.v2-rot { display: inline-block; height: 1.12em; overflow: hidden; vertical-align: top; margin-top: -.06em; }
.v2-rot-in { display: flex; flex-direction: column; animation: v2rot 10s cubic-bezier(.76,0,.24,1) infinite; }
.v2-rot-in b { font-weight: 500; height: 1.12em; line-height: 1.12; }
@keyframes v2rot { 0%, 22% { transform: translateY(0); } 25%, 47% { transform: translateY(-1.12em); } 50%, 72% { transform: translateY(-2.24em); } 75%, 97% { transform: translateY(-3.36em); } 100% { transform: translateY(-4.48em); } }
.v2-banner { position: relative; width: 100%; aspect-ratio: 16 / 5.6; margin: clamp(16px, 2vw, 24px) 0; overflow: hidden; background: #eef0f3; border-radius: clamp(8px, 1vw, 14px) clamp(8px, 1vw, 14px) 0 0; }
.v2-end { margin-bottom: clamp(24px, 3vw, 40px); }
.v2-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; width: 100%; font-size: 13px; }
.v2-meta dt { color: var(--ink-3); margin-bottom: 2px; }
@media (prefers-reduced-motion: reduce) { .v2-rot-in, .v2-slide { animation: none; } .v2-slide:first-child { opacity: 1; } }

/* Sections */
.v2-sec { margin: 0 var(--gutter); padding: clamp(44px, 5vw, 72px) 0; border-top: 1px solid var(--line); }
.v2-grid { display: grid; grid-template-columns: 1fr 1.65fr; gap: 24px clamp(24px, 4vw, 64px); align-items: start; }
.v2-head { margin-bottom: clamp(24px, 3vw, 40px); }
.v2-num, .v2-label { font-size: 13px; font-weight: 400; }
.v2-left { display: grid; gap: 28px; }
.v2-photo { width: min(100%, 260px); aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 15%; }
.v2-right { display: grid; gap: 22px; }
.v2-h2 { font-size: clamp(36px, 4.7vw, 68px); font-weight: 500; letter-spacing: -0.045em; line-height: 1; max-width: 13em; }
.v2-p { font-size: 13.5px; line-height: 1.55; color: var(--ink); max-width: 46em; }
.v2-services { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; margin-top: 10px; font-size: clamp(16px, 1.3vw, 19px); letter-spacing: -0.01em; }

/* What I bring: four columns, each led by a large thin numeral */
.v2-bring { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.v2-bring > div { padding: 28px 24px 8px 0; display: grid; align-content: start; gap: 12px; }
.v2-bring > div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.v2-bn { font-size: clamp(56px, 6.4vw, 96px); font-weight: 200; letter-spacing: -0.05em; line-height: .9; margin-bottom: clamp(16px, 2vw, 32px); }
.v2-bring h3 { font-size: clamp(20px, 1.7vw, 24px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; padding-bottom: 14px; position: relative; }
.v2-bring h3::after { content: ""; position: absolute; left: 0; bottom: 0; width: 32px; height: 2px; background: var(--ink); }
.v2-bring .sub { font-size: 15px; line-height: 1.4; color: var(--ink); }
.v2-bring .det { font-size: 13px; line-height: 1.55; color: var(--ink-3); }
@media (max-width: 860px) { .v2-bring { grid-template-columns: 1fr 1fr; } .v2-bring > div:nth-child(3) { padding-left: 0; border-left: 0; } .v2-bring > div:nth-child(n+3) { border-top: 1px solid var(--line); } }
@media (max-width: 560px) { .v2-bring { grid-template-columns: 1fr; } .v2-bring > div, .v2-bring > div + div { padding-left: 0; border-left: 0; } .v2-bring > div + div { border-top: 1px solid var(--line); } }

/* Worked with */
.v2-clients .v2-label { margin-bottom: clamp(28px, 3vw, 44px); }
.v2-logos { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(32px, 4vw, 56px) 24px; align-items: center; justify-items: center; }
.v2-logos img { width: 132px; height: 40px; object-fit: contain; }
.v2-logos img.sm { width: 112px; height: 34px; }
.v2-label-more { margin-top: clamp(48px, 6vw, 80px); color: var(--ink-3); }
.v2-logos-more { grid-template-columns: repeat(5, 1fr); }
.v2-logos-more img { width: 112px; height: 32px; opacity: .55; transition: opacity .2s; }
.v2-logos-more img.sm { width: 96px; height: 28px; }
.v2-logos-more img.sq { width: 56px; height: 44px; }
.v2-logos-more img:hover { opacity: 1; }

/* Impact */
.v2-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 18px; border-top: 1px solid var(--line); }
.v2-stats > div { padding: 22px 18px 24px 0; border-bottom: 1px solid var(--line); display: grid; gap: 8px; align-content: start; }
.v2-stats b { font-size: clamp(28px, 2.6vw, 38px); font-weight: 500; letter-spacing: -0.04em; line-height: 1; }
.v2-stats span { font-size: 13px; line-height: 1.45; color: var(--ink-2); max-width: 22em; }

/* Experience */
.v2-xp { list-style: none; margin-top: 18px; }
.v2-xp li { display: flex; justify-content: space-between; gap: 24px; padding: 20px 0; border-top: 1px solid var(--line); }
.v2-xp li:first-child { border-top: 0; padding-top: 4px; }
.v2-xp b { display: block; font-size: clamp(17px, 1.4vw, 20px); font-weight: 400; letter-spacing: -0.01em; }
.v2-xp span { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-3); }
.v2-xp time { font-size: 13px; color: var(--ink-3); white-space: nowrap; }

/* Footer: links row + giant name fitted to the width */
.v2-foot { margin: 0 var(--gutter); border-top: 1px solid var(--line); overflow: hidden; }
.v2-foot-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; padding: 26px 0; font-size: 13px; }
.v2-foot-links { justify-self: end; display: flex; gap: 18px; }
.v2-giant { width: max-content; font-weight: 500; letter-spacing: -0.05em; line-height: .76; white-space: nowrap; padding: 4vw 0 .02em; margin-left: -0.05em; font-size: 20vw; }

/* Selected works keep their cards; only blend the frame into the white page */
.v2 .cases { border-top: 0; }
.v2 .case-row { border-bottom-color: var(--line); }
.v2 .case-row:first-child { padding-top: 0; }
.v2 .case-row:last-child { border-bottom: 0; padding-bottom: 0; }

@media (max-width: 860px) {
  .v2-nav { display: none; }
  .v2-top { grid-template-columns: 1fr auto; }
  .v2-grid { grid-template-columns: 1fr; }
  .v2-meta { grid-template-columns: 1fr 1fr; }
  .v2-logos { grid-template-columns: repeat(2, 1fr); }
  .v2-logos-more { grid-template-columns: repeat(2, 1fr); }
  .v2-stats { grid-template-columns: 1fr 1fr; }
  .v2-foot-row { grid-template-columns: 1fr; gap: 10px; }
  .v2-foot-links { justify-self: start; }
}
@media (max-width: 560px) {
  .v2-line { white-space: normal; }
  .v2-services { grid-template-columns: 1fr; gap: 12px; }
  .v2-stats { grid-template-columns: 1fr; }
  .v2-xp li { flex-direction: column; gap: 6px; }
}

/* Case pages in v2: same top bar, footer and type; the case content itself is unchanged */
body.v2-case { background: var(--page); font-family: var(--font); }
.v2-case .v2-top { font-size: 13px; }
.v2-case .next-case { margin-top: clamp(40px, 6vw, 80px); }

/* Wanya web mock: a clearly rounded frame */
figure.shot .frame.wy-web { border-radius: 32px; overflow: hidden; }
@media (max-width: 760px) { figure.shot .frame.wy-web { border-radius: 18px; } }

/* Hero banner: colour panels with a device peeking up from the bottom (3 phones, 1 laptop), synced with the rotating word */
.v2-slide { position: absolute; inset: 0; background: var(--bg); opacity: 0; animation: v2slide 10s infinite; overflow: hidden; }
/* Each slide crossfades during the same 22–25% window in which the word slides up */
.v2-slide:nth-child(2) { animation-delay: -7.5s; } .v2-slide:nth-child(3) { animation-delay: -5s; } .v2-slide:nth-child(4) { animation-delay: -2.5s; }
@keyframes v2slide { 0%, 22% { opacity: 1; } 25%, 97% { opacity: 0; } 100% { opacity: 1; } }
.v2-slide:first-child { opacity: 1; }
.v2-iphone { position: absolute; left: 50%; top: 18%; width: 30%; transform: translateX(-50%); padding: .9%; background: #0a0a0b; border-radius: 16.5% / 7.6%;
  box-shadow: 0 0 0 3px #d4d6da, 0 0 0 4.5px #a9adb3, 0 40px 70px -24px rgba(0,0,0,.45); }
.v2-iphone img { width: 100%; aspect-ratio: 390 / 844; object-fit: cover; object-position: top; border-radius: 14.5% / 6.7%; display: block; }
.v2-iphone::after { content: ""; position: absolute; left: 50%; top: 2.6%; width: 27%; aspect-ratio: 3.3; transform: translateX(-50%); background: #000; border-radius: 99px; }
.v2-laptop { position: absolute; left: 13%; top: 22%; width: 100%; padding: 1.5% 1.5% 0; background: #0a0a0b; border-radius: clamp(24px, 3.8vw, 54px) clamp(24px, 3.8vw, 54px) 0 0;
  box-shadow: 0 0 0 2px #2a2b2e, 0 40px 70px -24px rgba(0,0,0,.35); }
.v2-laptop img { width: 100%; display: block; border-radius: clamp(16px, 2.5vw, 36px) clamp(16px, 2.5vw, 36px) 0 0; }
.v2-notch { position: absolute; left: 50%; top: 0; width: 17%; height: 4.6%; transform: translateX(-50%); background: #0a0a0b; border-radius: 0 0 clamp(6px, 1vw, 12px) clamp(6px, 1vw, 12px); z-index: 1; }
.v2-notch::after { content: ""; position: absolute; left: 50%; top: 38%; width: 7%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: #1d1f24; box-shadow: inset 0 0 0 1px #2c2f36; }
/* Straight device with a thick black bezel and grey rim (Variabl) */
.v2-tab { position: absolute; left: 9%; top: 26%; width: 100%; padding: 3.4% 0 0 3.4%; background: #000; border-radius: clamp(28px, 4.6vw, 66px) 0 0 0;
  box-shadow: 0 0 0 2px #8f9095, 0 0 0 4px #d9dadd, 0 40px 80px -24px rgba(0,0,0,.3); }
.v2-tab img { width: 100%; display: block; border-radius: clamp(10px, 1.9vw, 27px) 0 0 0; }
/* Tilted desktop mock entering from the right (unused) */
.v2-tilt { position: absolute; left: 42%; top: -6%; width: 70%; transform: rotate(5deg); transform-origin: 0 0; padding: 1.1% 0 0 1.1%; background: #0a0a0b;
  border-radius: clamp(14px, 2vw, 28px) 0 0 0; box-shadow: -3px 0 0 #f3efe7, 0 40px 80px -20px rgba(40,10,80,.45); }
.v2-tilt img { width: 100%; display: block; border-radius: clamp(8px, 1.2vw, 16px) 0 0 0; }
@media (max-width: 560px) {
  .v2-banner { aspect-ratio: 4 / 3; }
  .v2-tilt { left: 26%; width: 110%; top: -4%; }
  .v2-tab { left: 7%; width: 170%; top: 20%; }
  .v2-iphone { width: 46%; top: 14%; padding: 1.6%; box-shadow: 0 0 0 2px #d4d6da, 0 0 0 3px #a9adb3, 0 30px 50px -20px rgba(0,0,0,.45); }
  .v2-laptop { left: 8%; width: 150%; top: 18%; }
}

/* ---------- Light / dark toggle (js/theme.js) ---------- */
.v2-end-top { justify-self: end; display: inline-flex; align-items: center; gap: 14px; }
.v2-theme { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px 0 10px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; transition: background .2s, border-color .2s; }
.v2-theme:hover { border-color: var(--ink-3); }
.v2-theme:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.v2-theme svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.v2-theme .i-sun, [data-theme="dark"] .v2-theme .i-moon { display: none; }
[data-theme="dark"] .v2-theme .i-sun { display: block; }
@media (max-width: 560px) { .v2-theme-t { display: none; } .v2-theme { padding: 0 8px; } .v2-end-top { gap: 10px; } }
.theme-anim, .theme-anim body, .theme-anim .v2-top, .theme-anim .v2-sec, .theme-anim .case-row { transition: background-color .4s, color .4s, border-color .4s; }

/* Dark theme: the same tokens, inverted */
html[data-theme="dark"] {
  color-scheme: dark;
  --page: #0b0b0c;
  --bg: #0b0b0c;
  --top-bg: rgba(11,11,12,.85);
  --ink: #f4f4f5;
  --ink-2: #c9cacd;
  --ink-3: #8b8f97;
  --line: #26272b;
  --soft: #17181a;
  --bg-alt: #131315;
  --rule: #26272b;
  --rule-strong: #e4e4e7;
  --accent: #f4f4f5;
  --black: #000;
}
html[data-theme="dark"] body { background: var(--page); color: var(--ink); }
html[data-theme="dark"] .v2-mute { color: #6b7079; }
html[data-theme="dark"] ::selection { background: #f4f4f5; color: #0b0b0c; }
/* logos are dark artwork: show them as light marks */
html[data-theme="dark"] .v2-logos img { filter: brightness(0) invert(1); opacity: .85; }
html[data-theme="dark"] .v2-logos-more img { opacity: .45; }
html[data-theme="dark"] .v2-logos-more img:hover { opacity: .9; }
/* hero banner panels sit a little darker so they don't glare */
html[data-theme="dark"] .v2-slide { filter: brightness(.92); }
/* buttons that were black-on-white */
html[data-theme="dark"] .btn-dark, html[data-theme="dark"] .btn-light { background: #f4f4f5; color: #0b0b0c; border-color: #f4f4f5; }
/* Case diagrams and recreated UI are artwork with their own light palette:
   keep them light inside the dark theme so their text stays readable. */
html[data-theme="dark"] :is(.persona, .ia-tree, .ix-card, .ix-pair, .mo-card, .mo-demo, .ro, .ro-stages article, .lt-stages article, .ms-ui, .sp-group,
  .p2p-band, .p2p-ph, .mock, .m-app, .m-phone, .nv-assist, .nv-ws, .nv-ob, .nv-vp, figure.shot .frame, .work-thumb, .wf-grid > div) {
  --ink: #0a0a0a; --ink-2: #4d4d4d; --ink-3: #8b8b8b; --line: #d9d9d7; --rule: #d9d9d7; --rule-strong: #111111;
  --soft: #ebebea; --bg-alt: #ebebea; --bg: #f5f5f4; --accent: #0a0a0a; color: var(--ink); color-scheme: light;
}

/* v3 · Nivala process: six short steps in a 3 × 2 grid */
.proc-lede { font-size: clamp(17px, 1.5vw, 21px); line-height: 1.4; letter-spacing: -0.01em; color: var(--ink); max-width: 40em; margin-bottom: 22px; }
.process.p6 { grid-template-columns: repeat(3, 1fr); }
.process.p6 > div { padding-bottom: 22px; }
.process.p6 > div:nth-child(4) { border-left: 0; padding-left: 0; }
.process.p6 > div:nth-child(n+4) { border-top: 1px solid var(--rule); padding-top: 18px; }
.process.p6 p { font-size: 14.5px; line-height: 1.5; }
@media (max-width: 860px) {
  .process.p6 { grid-template-columns: 1fr 1fr; }
  .process.p6 > div:nth-child(n) { border-left: 0; padding-left: 0; border-top: 0; margin-top: 0; }
  .process.p6 > div:nth-child(even) { border-left: 1px solid var(--rule); padding-left: 16px; }
  .process.p6 > div:nth-child(n+3) { border-top: 1px solid var(--rule); padding-top: 16px; }
}
@media (max-width: 560px) {
  .process.p6 { grid-template-columns: 1fr; }
  .process.p6 > div:nth-child(n) { border-left: 0; padding: 14px 0; border-top: 1px solid var(--rule); }
  .process.p6 > div:first-child { border-top: 0; }
  .process.p6 h3 { margin: 4px 0; }
}
.nv-learn { margin-top: 1.2em; padding-top: 1.2em; border-top: 1px solid var(--rule); color: var(--ink-2); }
.nv-learn b { color: var(--ink); font-weight: 600; }

/* v3 · Nivala process: five steps from brief to prototype */
.process.p5 { grid-template-columns: repeat(5, 1fr); }
.process.p5 p { font-size: 14.5px; line-height: 1.5; }
@media (max-width: 960px) {
  .process.p5 { grid-template-columns: 1fr; }
  .process.p5 > div:nth-child(n) { border-left: 0; padding: 14px 0; margin-top: 0; border-top: 1px solid var(--rule); }
  .process.p5 > div:first-child { border-top: 0; }
  .process.p5 h3 { margin: 4px 0; }
}
