/* ferdi.tech v2 — homepage layout (NT-V2-01).
   Loads after v2.css. Page-specific layout only; components come from v2.css,
   tokens from site.css (--bg, --text, --accent, --font-display, --dur, --ease). */

/* ── Sections: keep site.css gutters + v2 rhythm ──
   v2.css `.v2-section` sets `padding: 64px 0`, which would drop site.css's
   32px side gutters. Restore them with a higher-specificity rule. */
main > .v2-section { padding: 58px 32px; }

/* ── Header: anchor nav (v1 header kept, nav added) ── */
.top-nav { display: flex; align-items: center; gap: 20px; margin: 0 24px 0 auto; }
.top-nav a { font-size: 13.5px; font-weight: 600; color: var(--text-muted); transition: color var(--dur) var(--ease); }
.top-nav a:hover, .top-nav a:focus-visible { color: var(--accent); }
@media (max-width: 760px) { .top-nav { display: none; } }

/* ── Accent palette — Pantone 2026 "Tropic Tonalities" ──
   Brand gold stays (--accent). Palette brights are the dark-theme values;
   light theme uses them darkened just enough to read as text on cream. */
:root {
  --t-teal: #22828f; --t-olive: #7a850b; --t-orchid: #93468e;
  --t-berry: #c42b46; --t-orange: #d66e0a; --t-gold: #9a6f26;
  --c-money: var(--t-olive); --c-content: var(--t-teal); --c-apps: var(--t-gold);
  --c-kill: var(--t-berry); --c-fun: var(--t-orange); --c-vision: var(--t-orchid);
  --c-video: var(--t-orange); --c-shield: var(--t-gold);
}
[data-theme="dark"] {
  --t-teal: #3bb1c1; --t-olive: #b0be13; --t-orchid: #b468af;
  --t-berry: #df3b57; --t-orange: #fa9217; --t-gold: #d8a84e;
}

/* ── Hero — santifer.io layout: avatar left / text right (dot grid comes from the page-wide body rule in v2.css) ── */
.hero { position: relative; padding-bottom: 74px; }
.hero-head { display: flex; flex-direction: column; align-items: center; gap: 26px; text-align: center; }
@media (min-width: 721px) {
  .hero-head { flex-direction: row; align-items: center; gap: 44px; text-align: left; }
}
.hero-head-text { min-width: 0; }

/* avatar: clean white ring */
.hero-face-wrap { position: relative; flex-shrink: 0; }
.hero-face-ring {
  position: relative; padding: 4px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 12px 30px -16px rgba(0, 0, 0, .45);
}
.hero-face {
  display: block; width: 160px; height: 160px; border-radius: 50%;
  object-fit: cover; object-position: 50% 22%;
  transition: transform var(--dur) var(--ease);
}
.hero-face-ring:hover .hero-face { transform: scale(1.04); }
@media (min-width: 721px) {
  .hero-face { width: 192px; height: 192px; }
}

.hero-hi { margin: 0 0 20px; font-size: 17px; letter-spacing: .2px; color: var(--text-muted); }
.hero-hi a { font-weight: 700; color: var(--text); }
.hero-hi a:hover { opacity: .8; }
.hero-wave { display: inline-block; animation: hero-wave 2.6s ease-in-out infinite; transform-origin: 70% 70%; }
@keyframes hero-wave { 0%, 60%, 100% { transform: rotate(0deg); } 10%, 30% { transform: rotate(16deg); } 20%, 40% { transform: rotate(-8deg); } }

h1.hero-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(40px, 7.6vw, 84px); line-height: 1.02; letter-spacing: -1.2px;
  margin: 0 0 14px;
}
/* Rotating phrase: own line with a FIXED box so font swaps never move
   anything below — the #1 cause of hero jumping was per-phrase line heights.
   2026-09-16: each phrase runs its own face — the two serifs (Gloock, Remark)
   live only here; the site font candidates (Wave, Superior, Figtree) show off
   in the other three. */
.hero-rotate { display: block; font-size: 1.06em; height: 1.16em; overflow: visible; }
.rt-line { display: inline-block; line-height: 1.16; vertical-align: top; white-space: nowrap; }
.rt-scrambling { opacity: .92; }
.rt-money   { font-family: 'Gloock', var(--font-display); font-weight: 400; letter-spacing: -.01em; color: var(--c-money); }
.rt-content { font-family: 'LT Remark', var(--font-display); font-style: italic; font-weight: 400; color: var(--c-content); }
.rt-apps    { font-family: 'LT Superior', var(--font-body); font-weight: 800; letter-spacing: -.5px; color: var(--c-apps); }
.rt-kill    { font-family: 'LT Wave', var(--font-body); font-weight: 900; text-transform: uppercase; letter-spacing: .5px; color: var(--c-kill); }
.rt-fun     { font-family: 'Figtree', var(--font-body); font-weight: 900; color: var(--c-fun); }
.rt-line:not(.rt-scrambling) { animation: rt-pop .45s var(--ease) both; }
@keyframes rt-pop { from { transform: translateY(6px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.hero-proof {
  margin: 0 0 22px; font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 15px; line-height: 1.5; color: var(--text-muted);
  min-height: 1.6em; /* proof lines vary; reserve one line so swaps stay put */
  animation: proof-in .5s var(--ease) both;
}
@keyframes proof-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }
.hero-roles { margin: 16px 0 8px; justify-content: center; }
.hero-stats { margin: 0 0 26px; justify-content: center; }
@media (min-width: 721px) {
  .hero-roles, .hero-stats { justify-content: flex-start; }
}
.chip { backdrop-filter: blur(4px); }
.hero-stats .chip:nth-child(1) { border-color: color-mix(in srgb, var(--c-content) 45%, transparent); color: var(--c-content); }
.hero-stats .chip:nth-child(2) { border-color: color-mix(in srgb, var(--c-kill) 45%, transparent); color: var(--c-kill); }
.hero-stats .chip:nth-child(3) { border-color: color-mix(in srgb, var(--c-vision) 45%, transparent); color: var(--c-vision); }
.hero-stats .chip:nth-child(4) { border-color: color-mix(in srgb, var(--c-money) 45%, transparent); color: var(--c-money); }
.hero .hero-sub { margin-bottom: 32px; }
.hero .hero-sub a { text-decoration: underline; text-underline-offset: 3px; }
.hero .cta-row { flex-wrap: wrap; gap: 14px 30px; justify-content: center; }
@media (min-width: 721px) { .hero .cta-row { justify-content: flex-start; } }

/* ── My path: stat band, capability cards, flow diagram, source of truth ──
   The career band always has 4 cells, so pin the column count instead of
   using auto-fit — that avoids an empty bordered cell on narrow screens. */
.v2-section .stat-band { margin-top: 0; grid-template-columns: repeat(2, 1fr); }
.v2-section .stat-band + .stat-band { margin-top: 10px; }
@media (min-width: 700px) { .v2-section .stat-band { grid-template-columns: repeat(4, 1fr); } }

/* Every cell is the same box, so the two bands read as one table.
   - figures sit on a FIXED-height line box, bottom-anchored, so the large and
     the small number sizes share one baseline across both rows;
   - labels get a fixed 3-line reserve, so a one-line label pads instead of
     shrinking its cell (no 1/2/3-line raggedness);
   - left-aligned figures + labels scan like data instead of floating
     mid-cell at different widths. */
.v2-section .stat { display: flex; flex-direction: column; text-align: left; padding: 20px 18px 18px; }
.v2-section .stat-band .stat-num {
  font-family: var(--font-body); font-weight: 800; letter-spacing: -.5px;
  font-size: clamp(22px, 3vw, 30px);
  flex: 0 0 auto;
  display: flex; align-items: flex-end; /* bottom-anchored in the box → shared baseline */
  min-height: clamp(26px, 3.6vw, 36px); /* fixed line box; tracks the largest figure size */
  line-height: 1;
}
.v2-section .stat-band .stat-num.is-wide { font-size: clamp(16px, 2.2vw, 23px); }
.v2-section .stat-band .stat-label { flex: 1 1 auto; margin-top: 8px; line-height: 1.35; min-height: 4.05em; /* 3 lines at 1.35 */ }

/* Cells this narrow wrap the longest label ("$5k+ …", 68 chars) to a 4th line —
   and the two bands must stay the same height, so reserve that line there. */
@media (max-width: 430px), (min-width: 700px) and (max-width: 799px) {
  .v2-section .stat-band .stat-label { min-height: 5.4em; } /* 4 lines at 1.35 */
}
/* Phones: tighter gutters keep labels and figures inside the cell. */
@media (max-width: 430px) { .v2-section .stat { padding: 18px 15px 16px; } }
/* Cramped 4-col widths: narrower gutters keep the longest label inside the
   3-line reserve and every figure on one line. */
@media (min-width: 700px) and (max-width: 860px) { .v2-section .stat { padding: 18px 12px 16px; } }
/* Small phones: tighter gutters keep the longest label inside its reserve. */
@media (max-width: 380px) { .v2-section .stat { padding: 16px 12px 14px; } }

.cap-grid { margin-bottom: 38px; }
.cap-card { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.cap-card:hover, .cap-card:focus-within { transform: translateY(-3px); box-shadow: 0 10px 28px -18px color-mix(in srgb, var(--card-c, var(--text)) 65%, transparent); }
.cc-robot  { --card-c: var(--t-teal); }
.cc-money  { --card-c: var(--t-olive); }
.cc-apps   { --card-c: var(--t-orchid); }
.cc-vision { --card-c: var(--t-berry); }
.cc-video  { --card-c: var(--t-orange); }
.cc-shield { --card-c: var(--t-gold); }
.cap-emoji {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px; font-size: 20px; margin-bottom: 12px;
  background: color-mix(in srgb, var(--card-c, var(--accent)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--card-c, var(--accent)) 30%, transparent);
}
.cap-card:hover .cap-emoji { animation: cap-bounce .6s var(--ease); }
@keyframes cap-bounce { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-5px) rotate(-6deg); } 70% { transform: translateY(1px) rotate(3deg); } }

/* Flow diagram: spine on the left, emoji node + year pill, arrows between steps */
.flow { --node-col: 74px; display: flex; flex-direction: column; margin: 0 0 30px; position: relative; }
.flow::before {
  content: ""; position: absolute; z-index: 0;
  left: calc(var(--node-col) / 2 - 1px); top: 28px; bottom: 30px; width: 2px;
  background-image: repeating-linear-gradient(to bottom, color-mix(in srgb, var(--c-fun) 55%, transparent) 0 8px, transparent 8px 16px);
}
.flow-step { display: grid; grid-template-columns: 74px 1fr; gap: 0 18px; position: relative; }
.flow-node { grid-column: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding-bottom: 6px; }
.flow-emoji {
  display: flex; align-items: center; justify-content: center; width: 54px; height: 54px;
  border-radius: 50%; font-size: 26px; background: var(--bg); position: relative; z-index: 1;
  border: 2px solid var(--flow-c, var(--border));
  box-shadow: 0 0 0 5px var(--bg), 0 0 0 6px color-mix(in srgb, var(--flow-c, var(--border)) 35%, transparent);
}
.flow-year {
  font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  padding: 2px 9px; border-radius: 999px; color: var(--flow-c, var(--text-muted));
  border: 1px solid color-mix(in srgb, var(--flow-c, var(--border)) 45%, transparent);
  background: color-mix(in srgb, var(--flow-c, var(--accent)) 8%, var(--bg));
}
.fs-photo  { --flow-c: var(--c-apps); }
.fs-ep101  { --flow-c: var(--c-content); }
.fs-kyurate { --flow-c: var(--c-vision); }
.flow-card { grid-column: 2; border: 1px solid var(--border); border-left: 3px solid var(--flow-c, var(--border)); border-radius: 14px; padding: 18px 20px; background: var(--bg); margin-bottom: 4px; transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.flow-card:hover, .flow-card:focus-within { transform: translateX(4px); border-left-width: 5px; }
.flow-arrow { display: flex; justify-content: center; width: 74px; color: var(--c-fun); margin: 2px 0; position: relative; z-index: 1; }
.flow-arrow svg { width: 26px; height: 26px; background: var(--bg); border-radius: 50%; padding: 1px; animation: flow-nudge 1.6s ease-in-out infinite; }
@keyframes flow-nudge { 0%, 100% { transform: translateY(0); opacity: .65; } 50% { transform: translateY(5px); opacity: 1; } }
.tl-head h3 { font-size: 17px; }
@media (max-width: 560px) {
  .flow { --node-col: 56px; }
  .flow-step { grid-template-columns: 56px 1fr; gap: 0 12px; }
  .flow-arrow { width: 56px; }
  .flow-emoji { width: 44px; height: 44px; font-size: 21px; }
}

.sot-box h3 { margin: 0 0 8px; font-family: var(--font-display); font-size: 24px; font-weight: 600; color: var(--text); }
.sot-box > p { margin: 0; max-width: 60ch; font-size: 15px; color: var(--text-muted); }
.mini-tool { transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.mini-tool:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }

/* ── Motion off switch ── */
@media (prefers-reduced-motion: reduce) {
  .hero-wave, .flow-arrow svg, .cap-card:hover .cap-emoji,
  .rt-line:not(.rt-scrambling), .hero-proof { animation: none; }
}

/* ── What I build: project cards ── */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.proj-img { max-height: 260px; object-fit: cover; object-position: top center; background: var(--bg-soft); }
.proj-img-link { display: block; }
.proj-img-link:hover .proj-img, .proj-img-link:focus-visible .proj-img { border-color: var(--accent); transform: translateY(-2px); }
.proj-img-link .proj-img { transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.proj-card .slideshow { max-width: 100%; margin: 0; }
.proj-card .proj-links a { color: var(--accent-soft); }

/* ── Proof band ── */
.proof .proof-grid { margin-top: 34px; }
.proof .logo-strip { margin-top: 6px; border-top: 1px solid var(--border); padding-top: 22px; }

/* ── About fact chips ── */
.about .about-lede { max-width: 62ch; }
.about-chips { margin-top: 24px; }

/* ── Writing card grid ── */
.write-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.write-grid .related-card h3 { font-family: var(--font-display); font-size: 20px; }
.write-meta { margin: 0; margin-top: auto; padding-top: 6px; font-size: 12px; color: var(--text-faint); letter-spacing: .4px; }
.write-more { margin: 18px 0 0; }

/* ── Contact: modern bold close (2026-09-16). Centred, sans, oversized, flat
   colour — no gradients, no kicker, no box around the buttons. Copy unchanged. ── */
.contact { text-align: center; }
.contact .contact-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(60px, 13vw, 168px); line-height: .95; letter-spacing: -.045em;
  margin: 0 0 26px;
}
.ct-word { display: block; }
.ct-word--say { color: var(--text); }
.ct-word--hey { color: var(--t-berry); }

.contact .contact-lede {
  font-size: clamp(18px, 2.1vw, 22px); line-height: 1.55;
  color: var(--text-muted); max-width: 44ch; margin: 0 auto 42px;
}

.contact .cta-row { justify-content: center; flex-wrap: wrap; gap: 16px; align-items: center; }
.contact .btn {
  font-family: var(--font-body); font-size: 18px; font-weight: 800; letter-spacing: .01em;
  padding: 18px 38px; border-radius: 999px;
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease),
              border-color var(--dur) var(--ease), color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.contact .btn-primary {
  color: var(--bg); background: var(--text);
  background-image: none; background-size: auto; padding-bottom: 18px;
}
.contact .btn-primary:hover, .contact .btn-primary:focus-visible {
  color: #fff; transform: translateY(-3px); background-size: auto; background-image: none;
  background-color: var(--t-berry);
  box-shadow: 0 16px 32px -16px color-mix(in srgb, var(--t-berry) 70%, transparent);
}
.contact .btn-ghost { color: var(--text); border: 2px solid var(--border); background: transparent; }
.contact .btn-ghost:hover, .contact .btn-ghost:focus-visible {
  transform: translateY(-3px); color: var(--t-teal); border-color: color-mix(in srgb, var(--t-teal) 65%, transparent);
  background: color-mix(in srgb, var(--t-teal) 8%, transparent);
}

.contact .contact-note {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 26px;
  font-size: 12.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--text-muted);
}
.contact .contact-note::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--t-olive);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--t-olive) 18%, transparent);
  animation: contact-dot 2.6s ease-in-out infinite;
}
@keyframes contact-dot { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }

/* Staggered entrance (reuses site.js .reveal observer). */
.contact .ct-word--say.reveal { transition-delay: .06s; }
.contact .ct-word--hey.reveal { transition-delay: .14s; }
.contact .contact-lede.reveal { transition-delay: .24s; }
.contact .cta-row.reveal { transition-delay: .34s; }
.contact .contact-note.reveal { transition-delay: .44s; }

@media (max-width: 720px) {
  .contact .contact-title { line-height: 1; }
  .contact .btn { width: 100%; justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .contact .contact-note::before { animation: none; }
}

/* ── Footer ── */
.footer-note { margin-bottom: 14px; }
.footer-copy { margin: 0 0 44px; font-size: 12.5px; letter-spacing: .6px; color: var(--text-faint); }

/* ── Small screens ── */
@media (max-width: 720px) {
  main > .v2-section { padding: 44px 22px; }
  .hero { padding-bottom: 52px; }
  .hero-proof { min-height: 3.2em; } /* reserve two lines on narrow screens */
  .proj-grid, .write-grid { grid-template-columns: 1fr; }
  .proj-img { max-height: 220px; }
}

/* ── Card lift + glass fills (2026-09-16): every homepage box gets a soft
   resting shadow and a 70%-opaque fill so the dot grid peeks through; hero
   pills drop to 40%-opaque backgrounds. Fills sit in page CSS because v2.css
   is orchestrator-owned. Hover glows in earlier rules still replace the
   resting shadow where they were designed to. ── */
.cap-card,
.proj-card,
.write-grid .related-card,
.v2-section .stat-band {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, .05),
    0 10px 28px -16px rgba(0, 0, 0, .22);
}

.cap-card,
.proj-card,
.write-grid .related-card {
  background: color-mix(in srgb, var(--bg) 70%, transparent);
}

/* Stat band: v2.css draws the hairline cell dividers as the band's own
   background showing through 1px grid gaps. Keep the band on the same cream
   glass as the other cards (a border-tinted fill read as muddy brown) and let
   each cell carry its own accent wash on top. */
.v2-section .stat-band { background: color-mix(in srgb, var(--bg) 70%, transparent); }
.v2-section .stat { background: transparent; }

.hero .chip { background: color-mix(in srgb, var(--bg-soft) 40%, transparent); }
.hero .chip--solid { background: color-mix(in srgb, var(--accent) 6%, transparent); }

/* ── Stat bands: live motion (2026-09-16). Cells rise in with a stagger, the
   figures count up (assets/js/stat-alive.js), each cell carries its own accent
   colour — tinted wash, coloured figure, top tick — and answers on hover.
   Without JS the bands simply render statically. ── */
.v2-section .stat { position: relative; transition: background-color var(--dur) var(--ease); }
.v2-section .stat::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: var(--stat-c, var(--accent)); opacity: .12;
  transition: opacity var(--dur) var(--ease);
}
.v2-section .stat > * { position: relative; z-index: 1; }
.v2-section .stat:hover::after, .v2-section .stat:focus-within::after { opacity: .26; }

.v2-section .stat::before {
  content: ""; position: absolute; top: 0; left: 12%; right: 12%; height: 3px; z-index: 0;
  border-radius: 0 0 3px 3px; background: var(--stat-c, var(--accent));
  opacity: .85; transform: scaleX(0); transform-origin: 50% 0;
  transition: transform .6s var(--ease), opacity var(--dur) var(--ease);
}
.v2-section .stat-band.is-live .stat::before { transform: scaleX(1); animation: stat-breathe 3.6s ease-in-out infinite; }
.v2-section .stat:hover::before { opacity: 1; }
@keyframes stat-breathe { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }

@keyframes stat-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.v2-section .stat-band.is-live .stat { animation: stat-in .55s var(--ease) both; }
.v2-section .stat-band.is-live .stat:nth-child(1) { animation-delay: 0s; }
.v2-section .stat-band.is-live .stat:nth-child(2) { animation-delay: .09s; }
.v2-section .stat-band.is-live .stat:nth-child(3) { animation-delay: .18s; }
.v2-section .stat-band.is-live .stat:nth-child(4) { animation-delay: .27s; }
.v2-section .stat-band.is-live .stat:nth-child(1)::before { transition-delay: .05s; }
.v2-section .stat-band.is-live .stat:nth-child(2)::before { transition-delay: .14s; }
.v2-section .stat-band.is-live .stat:nth-child(3)::before { transition-delay: .23s; }
.v2-section .stat-band.is-live .stat:nth-child(4)::before { transition-delay: .32s; }

.v2-section .stat-num {
  color: var(--stat-c, var(--accent));
  transition: color var(--dur) var(--ease), transform var(--dur) var(--ease),
              text-shadow var(--dur) var(--ease);
}
.v2-section .stat:hover .stat-num {
  transform: scale(1.04);
  text-shadow: 0 2px 16px color-mix(in srgb, var(--stat-c, var(--accent)) 45%, transparent);
}

/* Per-cell accent, echoing the tonal palette used by the hero chips and cards. */
.v2-section .stat-band .stat:nth-child(1) { --stat-c: var(--t-teal); }
.v2-section .stat-band .stat:nth-child(2) { --stat-c: var(--t-olive); }
.v2-section .stat-band .stat:nth-child(3) { --stat-c: var(--t-orchid); }
.v2-section .stat-band .stat:nth-child(4) { --stat-c: var(--t-berry); }
.v2-section .stat-band + .stat-band .stat:nth-child(1) { --stat-c: var(--t-berry); }
.v2-section .stat-band + .stat-band .stat:nth-child(2) { --stat-c: var(--t-orange); }
.v2-section .stat-band + .stat-band .stat:nth-child(3) { --stat-c: var(--t-teal); }
.v2-section .stat-band + .stat-band .stat:nth-child(4) { --stat-c: var(--t-orchid); }

@media (prefers-reduced-motion: reduce) {
  .v2-section .stat-band.is-live .stat { animation: none; }
  .v2-section .stat-band.is-live .stat::before { animation: none; transform: scaleX(1); transition: none; }
}
