/* ============================================================
   Home page styles
   ============================================================ */

/* ---------------- HERO ---------------- */
.hero { position: relative; padding-top: clamp(7rem, 14vh, 11rem); padding-bottom: clamp(3rem,7vw,5rem); }
.hero-inner { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }

.hero-eyebrow { margin-bottom: 1.6rem; }
.hero h1 {
  font-size: var(--fs-h1);
  font-weight: 600;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
/* monotone emphasis: tonal shift, not colour (see DESIGN.md) */
.hero h1 .em { font-style: normal; color: var(--ink-2); font-weight: 400; }
.hero-lead { font-size: var(--fs-lead); color: var(--ink-2); max-width: 40ch; margin-top: 1.6rem; line-height: 1.4; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2.2rem; }

.hero-facts { display: flex; flex-wrap: wrap; gap: 1.6rem 2.6rem; margin-top: 2.8rem; }
.fact { display: flex; flex-direction: column; gap: .15rem; }
.fact .k { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); }
.fact .v { font-size: 1.02rem; font-weight: 600; color: var(--ink); }
.fact .v .live { display:inline-block; vertical-align:middle; position:relative; width:7px; height:7px; border-radius:50%; background:var(--ok); margin-right:.45em; box-shadow:0 0 0 3px color-mix(in srgb,var(--ok) 22%,transparent); }
/* pulse rides a pseudo-element on transform/opacity (compositor-only) — the old
   box-shadow-spread keyframes forced a repaint on every animation frame */
.fact .v .live::after { content:""; position:absolute; inset:0; border-radius:50%; background:color-mix(in srgb,var(--ok) 55%,transparent); animation: livePulse 2.2s cubic-bezier(.4,0,.2,1) infinite; }
@keyframes livePulse {
  0%   { transform: scale(1); opacity: 1; }
  70%  { transform: scale(3.6); opacity: 0; }
  100% { transform: scale(3.6); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .fact .v .live::after { animation: none; display: none; }
}

/* hero media (Lottie). The old .hero-photo / .ph-grain / .tag / .hero-badge
   block was removed 2026-07-14 — no page has used the portrait-photo hero
   since the Lottie hero shipped (2026-06-26). */
.hero-media { position: relative; justify-self: end; width: 100%; }
.hero-lottie { display: block; width: 100%; aspect-ratio: 1 / 1; margin-inline: auto; }

/* default = centered stack: animation on top, text centered beneath */
[data-hero="portrait"] .hero { text-align: center; }
[data-hero="portrait"] .hero-inner { grid-template-columns: 1fr; justify-items: center; }
[data-hero="portrait"] .hero-media { order: -1; justify-self: center; max-width: min(340px, 80vw); margin-bottom: .4rem; }
[data-hero="portrait"] .hero-copy { width: 100%; max-width: min(1120px, 92vw); margin-inline: auto; }
/* Hero intro line above the headline — now a print-offset eyebrow chip with a hover wave */
.hero-hi { margin-bottom: 1rem; }
.hero-hi-chip { cursor: default; line-height: 1; font-size: .9rem; padding: .62em 1.2em; }
.hero-hi-chip .wave { display: inline-block; transform-origin: 70% 70%; }
.hero-hi-chip:hover .wave { animation: heroWave 1.3s ease-in-out; }
@keyframes heroWave {
  0%, 60%, 100% { transform: rotate(0deg); }
  10%, 30%, 50% { transform: rotate(14deg); }
  20%, 40%      { transform: rotate(-8deg); }
}
@media (prefers-reduced-motion: reduce) { .hero-hi-chip:hover .wave { animation: none; } }
/* Hero headline: explicit 3-line break, sized to fill the column width. */
.hero h1.hero-title { font-size: clamp(2.1rem, 4.7vw, 56px); line-height: 1.16; letter-spacing: -.02em; text-wrap: normal; }
.hero h1.hero-title .em { display: inline; }
[data-hero="portrait"] .hero-lead { margin-inline: auto; }
[data-hero="portrait"] .hero-actions { justify-content: center; }
[data-hero="portrait"] .hero-facts { justify-content: center; }

/* (the "statement" and "split" hero variants were removed with the tweaks panel —
   "portrait" is the only layout; see DESIGN.md Decisions Log 2026-07-14) */
@media (max-width: 880px) {
  [data-hero] .hero-inner { grid-template-columns: 1fr !important; }
  .hero-media { order: -1 !important; max-width: 300px !important; justify-self: center; }
}

/* ---------------- MARQUEE ---------------- */
.marquee {
  max-width: var(--maxw); margin-inline: auto;
  border-block: 1px solid var(--line-soft); padding-block: 1.8rem; overflow: hidden; background: var(--paper);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.marquee-track { display: flex; gap: clamp(2.5rem, 5vw, 4.5rem); width: max-content; animation: marquee 38s linear infinite; align-items: center; will-change: transform; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; row-gap: 2rem; }
  .marquee-item[aria-hidden] { display: none; }   /* show one set, not the loop copies */
}
@keyframes marquee { to { transform: translateX(-33.3333%); } }   /* shift exactly one of the three copies */
.marquee-item { display: flex; align-items: center; justify-content: center; flex: none; width: 132px; height: 46px; }
/* Uniform bounding box + `contain` gives every logo the SAME footprint regardless of proportion.
   `grayscale(1)` + a fixed opacity desaturates them to a cohesive monochrome wall while keeping each
   logo's internal shapes legible. (A hard `brightness(0)` silhouette turned the badge logos — cf247,
   artificial, MAG's mark — into solid black blobs.) Per-logo `--s` nudges optical weight.
   NOTE: cf247 / artificial / MAG are badge-style with baked-in fills, so they still read a touch
   heavier than the wordmarks — transparent single-colour versions would even the wall out completely. */
.marquee-item img {
  max-height: 100%; max-width: 100%; width: auto; height: auto; object-fit: contain; display: block;
  transform: scale(var(--s, 1));
  filter: grayscale(1) opacity(.6); transition: filter .3s ease, transform .3s ease;
}
.marquee-item.is-mark img { --s: 1.06; }                        /* square marks read small */
.marquee-item img[src*="gonutrition"] { --s: .82; }             /* wide wordmark — rein in */
.marquee-item img[src*="luxome"] { --s: .72; }                  /* still a touch big */
.marquee-item img[src*="dwp"], .marquee-item img[src*="mag"] { --s: 1.12; }   /* nudge up a touch */
.marquee:hover .marquee-item img { filter: grayscale(1) opacity(.82); }
.marquee-item img:hover { filter: grayscale(1) opacity(1); }
/* brightness lift after invert: mid-grey wordmarks (ao.com, gonutrition, luxome) otherwise
   invert to murky grey on the dark paper */
[data-theme="dark"] .marquee-item img { filter: grayscale(1) invert(1) brightness(1.6) opacity(.75); }
[data-theme="dark"] .marquee:hover .marquee-item img { filter: grayscale(1) invert(1) brightness(1.6) opacity(.9); }
[data-theme="dark"] .marquee-item img:hover { filter: grayscale(1) invert(1) brightness(1.6) opacity(1); }

/* Home section headings — centred stack (h2 above its meta line) */
.section-head { flex-direction: column; align-items: center; text-align: center; }
.section-head h2 { max-width: 22ch; }
.section-head .meta { max-width: 46ch; }

/* ---------------- WORK ---------------- */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1.5rem, 3vw, 2.6rem); }
@media (max-width: 760px) { .work-grid { grid-template-columns: 1fr; } }

.case-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--paper); border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink); padding: 1.5rem 1.5rem 1.9rem;
  transition: transform .15s ease, box-shadow .15s ease;
}
/* Beat the .reveal--shown failsafe (transform/transition: none !important) so the push survives reveal. */
.case-card.reveal--shown { transition: transform .15s ease, box-shadow .15s ease !important; }
.case-card:hover { transform: translate(-3px, -3px) !important; box-shadow: 6px 6px 0 var(--ink); }
.case-thumb {
  position: relative; overflow: hidden;
  aspect-ratio: 16/11; background: var(--paper-2);
}
.case-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .7s cubic-bezier(.16,1,.3,1); }
.case-card:hover .case-thumb img { transform: scale(1.045); }
.case-meta { display: flex; align-items: flex-start; gap: 1rem; margin-top: 1.3rem; }
.case-meta h3 { font-size: var(--fs-h3); letter-spacing: -.02em; }

/* single solid (black) chip holding the headline metric — the case-study label, inverted */
.case-foot { margin-top: 1.1rem; }
.case-outcome { color: var(--ink-2); margin-top: .9rem; max-width: 48ch; }

/* ---------------- FUN STATS — scattered "print card" toss (Option A) ---------------- */
.fs-wrap { position: relative; max-width: 1120px; margin: clamp(2rem, 4vw, 3rem) auto; display: flex; flex-wrap: wrap; gap: 34px 40px; justify-content: center; align-items: center; }
.fs-card {
  background: var(--paper); border: 2px solid var(--ink); border-radius: 2px;
  box-shadow: 3px 3px 0 var(--ink); padding: 22px 24px 20px; width: 230px;
  transition: transform .22s ease, box-shadow .22s ease;
}
/* tilts are static (the wrap carries `.reveal`, not the cards — so the reveal transform can't flatten them) */
.fs-card:nth-child(1) { transform: rotate(-4deg); margin-top: 12px; }
.fs-card:nth-child(2) { transform: rotate(3deg); margin-top: -26px; }
.fs-card:nth-child(3) { transform: rotate(-2deg); margin-top: 30px; }
.fs-card:nth-child(4) { transform: rotate(4deg); margin-top: -14px; }
.fs-card:hover { transform: translate(-3px, -3px) rotate(0deg); box-shadow: 6px 6px 0 var(--ink); }
.fs-num { font-family: var(--font-display); font-size: var(--fs-h2); font-weight: 700; letter-spacing: -.03em; line-height: .9; }
.fs-lbl { margin-top: 12px; font-size: .92rem; color: var(--ink-2); font-weight: 500; }
@media (max-width: 620px) { .fs-card { width: 100%; max-width: 320px; transform: none !important; margin-top: 0 !important; } }

/* ---------------- SIDE PROJECTS (optional section — remove with its index.html block) ----------------
   Four small print-offset cards in one row on desktop; an edge-bleed horizontal
   scroller with snap points on small screens. Reuses the case-card visual language
   (2px ink border + hard shadow) at a reduced scale. */
.side-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.side-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: .85rem;
  background: var(--paper); border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink); padding: 1.25rem 1.25rem 1.4rem;
}
.side-thumb { width: 100%; aspect-ratio: 16/11; overflow: hidden; background: var(--paper-2); }
.side-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.side-card h3 { font-size: 1.15rem; font-weight: 600; letter-spacing: -.01em; }
.side-card p { color: var(--ink-2); font-size: .95rem; line-height: 1.5; }
.side-card .ext { display: inline-block; transition: transform .18s ease; }
/* only linked cards get the case-card push (beat the .reveal--shown failsafe like .case-card does) */
a.side-card { transition: transform .15s ease, box-shadow .15s ease; }
.reveal--shown a.side-card, a.side-card.reveal--shown { transition: transform .15s ease, box-shadow .15s ease !important; }
a.side-card:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--ink); }
a.side-card:hover .ext { transform: translate(2px, -2px); }
@media (prefers-reduced-motion: reduce) {
  a.side-card, .side-card .ext { transition: none; }
}
@media (max-width: 880px) {
  .side-grid {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    margin-inline: calc(var(--pad-x) * -1); padding-inline: var(--pad-x);
    /* without this, mandatory snap aligns card 1 to the scrollport (= screen)
       edge, ignoring the inline padding — cards glue to the left of the screen */
    scroll-padding-inline: var(--pad-x);
    padding-bottom: .8rem;   /* keeps the hard shadow + scrollbar off the cards */
  }
  .side-card { flex: 0 0 min(76vw, 300px); scroll-snap-align: start; }
}

/* ---------------- ABOUT ---------------- */
.about-intro { max-width: 1000px; margin-inline: auto; text-align: center; }
.about-intro > h2 { font-size: var(--fs-h2); margin-bottom: clamp(1.6rem, 4vw, 2.4rem); }

/* Logo → name morph signature (built by js/vendor/logo-morph.js; hover to explode the mark into the name) */
.logo-morph { width: 100%; max-width: 470px; margin: 0 auto clamp(1.8rem, 4vw, 2.8rem); }
.logo-morph svg { width: 100%; height: auto; display: block; color: var(--ink); overflow: visible; }
@media (pointer: fine) { .logo-morph { cursor: pointer; } }

.about-copy { max-width: 58ch; margin-inline: auto; }
.about-copy p { font-size: var(--fs-lead); line-height: 1.55; color: var(--ink); }
.about-copy p + p { margin-top: 1.4rem; }
.about-copy .small { font-size: var(--fs-body); color: var(--ink-2); line-height: 1.65; }
.about-copy .em { font-weight: 600; }

/* Toolkit — rounded zebra table (no dividers); each tool shows its brand logo, borderless */
.toolkit {
  margin: clamp(2.6rem, 5vw, 4rem) auto 0; max-width: 660px;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  text-align: left;
}
.tk-row {
  display: grid; grid-template-columns: 148px 1fr; gap: .6rem 1.2rem; align-items: center;
  padding: .95rem clamp(1rem, 3vw, 1.5rem);
}
.tk-row:nth-child(odd) { background: var(--paper-2); }   /* zebra — shading replaces the dividers */
.tk-cat { font-weight: 600; font-size: .98rem; letter-spacing: -.01em; }
.tk-tools { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; }
.tool { display: inline-flex; align-items: center; gap: .5em; font-size: .9rem; color: var(--ink); }
.tool img { width: 20px; height: 20px; object-fit: contain; display: block; flex: none; }
@media (max-width: 620px) { .tk-row { grid-template-columns: 1fr; gap: .55rem; } }

/* résumé "other skills" note under the toolkit */
.toolkit-note { max-width: 60ch; margin: 1.2rem auto 0; text-align: center; color: var(--ink-2); font-size: .95rem; line-height: 1.5; }

/* ---------------- ABOUT — OUTSIDE THE WORK (photos tossed onto a surface) ---------------- */
.tiles-head { margin-top: clamp(2.6rem, 5vw, 4.4rem); margin-bottom: .4rem; text-align: center; }
.tiles-bio { max-width: 56ch; margin: 1.3rem auto .2rem; text-align: center; }
.tiles-bio p { color: var(--ink-2); font-size: var(--fs-body); line-height: 1.6; }
.tiles-bio p + p { margin-top: .9rem; }
.tiles-wrap { display: flex; justify-content: center; margin-top: clamp(1.6rem, 4vw, 2.6rem); }

/* mobile-first: a tidy grid */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; width: 100%; max-width: 460px; }
.tile { background: var(--paper); padding: 6px; border-radius: var(--radius); box-shadow: var(--shadow); }
.tile img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: calc(var(--radius) - 6px); display: block; }

/* wide screens: scatter them — overlapping, gently rotated, like a handful of photos thrown down */
@media (min-width: 880px) {
  .tiles { position: relative; display: block; width: 100%; max-width: 900px; height: 560px; }
  .tile {
    position: absolute; left: 50%; top: 50%; width: 212px; height: 252px; padding: 7px;
    transform: translate(-50%, -50%) translate(calc(var(--x, 0) * 1px), calc(var(--y, 0) * 1px)) rotate(var(--rot, 0deg)) scale(.9);
    opacity: 0; transition: transform .45s cubic-bezier(.2,.8,.2,1), box-shadow .45s ease;
    cursor: pointer; will-change: transform;
  }
  .tile img { height: 100%; aspect-ratio: auto; }
  .tiles-wrap:is(.in, .reveal--shown) .tile {
    opacity: 1;
    transform: translate(-50%, -50%) translate(calc(var(--x, 0) * 1px), calc(var(--y, 0) * 1px)) rotate(var(--rot, 0deg)) scale(1);
    animation: tileToss .8s cubic-bezier(.34, 1.56, .64, 1) backwards;
  }
  .tiles-wrap:is(.in, .reveal--shown) .tile:hover {
    transform: translate(-50%, -50%) translate(calc(var(--x, 0) * 1px), calc(var(--y, 0) * 1px)) rotate(0deg) scale(1.32);
    box-shadow: 0 40px 72px -10px rgba(17, 21, 26, .34);
    z-index: 100;
  }
  @keyframes tileToss {
    from { opacity: 0; transform: translate(-50%, -50%) translate(0, 46px) rotate(0deg) scale(.6); }
  }
  .tiles-wrap:is(.in, .reveal--shown) .tile:nth-child(1) { animation-delay: 0s; }
  .tiles-wrap:is(.in, .reveal--shown) .tile:nth-child(2) { animation-delay: .05s; }
  .tiles-wrap:is(.in, .reveal--shown) .tile:nth-child(3) { animation-delay: .1s; }
  .tiles-wrap:is(.in, .reveal--shown) .tile:nth-child(4) { animation-delay: .15s; }
  .tiles-wrap:is(.in, .reveal--shown) .tile:nth-child(5) { animation-delay: .2s; }
  .tiles-wrap:is(.in, .reveal--shown) .tile:nth-child(6) { animation-delay: .25s; }
  .tiles-wrap:is(.in, .reveal--shown) .tile:nth-child(7) { animation-delay: .3s; }
  .tiles-wrap:is(.in, .reveal--shown) .tile:nth-child(8) { animation-delay: .35s; }
}
@media (prefers-reduced-motion: reduce) {
  .tile { transition: none; }
  .tiles-wrap:is(.in, .reveal--shown) .tile { animation: none !important; }
}

/* ---------------- EXPERIENCE — divider ledger (logo · role/summary · date + type) ---------------- */
.xp-list { border-top: 1px solid var(--line); }
.xp-item {
  display: grid; grid-template-columns: 60px 1fr auto; gap: 1.5rem; align-items: start;
  padding: 1.6rem 0; border-bottom: 1px solid var(--line);
  transition: padding-left .3s ease;
}
.xp-item:hover { padding-left: .8rem; }
/* logo sits on a paper-2 tile (no border); a light tile is forced in dark mode so black marks still read */
.xp-logo { width: 60px; height: 60px; display: grid; place-items: center; background: var(--logo-tile); border-radius: 10px; flex: none; overflow: hidden; }
.xp-logo img { max-width: 74%; max-height: 74%; width: auto; height: auto; object-fit: contain; }
.xp-logo .brand-mark { width: 58%; height: auto; color: var(--ink); }
.xp-role { font-family: var(--font-display); font-weight: 600; font-size: 1.26rem; letter-spacing: -.01em; }
.xp-co { color: var(--ink-2); font-weight: 500; }
.xp-blurb { margin-top: .5rem; max-width: 62ch; font-size: .96rem; color: var(--ink-2); line-height: 1.55; }
.xp-meta { text-align: right; display: flex; flex-direction: column; gap: .7rem; align-items: flex-end; white-space: nowrap; }
.xp-yr { font-family: var(--font-mono); font-size: .82rem; color: var(--ink-2); font-weight: 600; letter-spacing: .01em; }
.xp-meta .eyebrow { font-size: .58rem; padding: .35em .7em; box-shadow: 1px 1px 0 var(--stone); }
@media (max-width: 680px) {
  .xp-item { grid-template-columns: 46px 1fr; padding: 1.3rem 0; }
  .xp-item:hover { padding-left: 0; }
  .xp-logo { width: 46px; height: 46px; }
  .xp-meta { grid-column: 2; text-align: left; align-items: flex-start; flex-direction: row-reverse; justify-content: flex-end; gap: .8rem; margin-top: .5rem; }
}

/* ---------------- MORE WORK (revealed under Selected work) ---------------- */
.more-reveal-wrap { display: flex; justify-content: center; margin-top: clamp(2.2rem, 4vw, 3.2rem); }
.more-toggle .arr { display: inline-block; }
/* arrow points down at rest, nudges down on hover (inherited from .btn), flips up once open */
.more-toggle[aria-expanded="true"] .arr { transform: rotate(180deg); }
.more-toggle[aria-expanded="true"]:hover .arr { transform: rotate(180deg) translateY(2px); }

/* collapsible panel — JS animates height; content stays in the DOM for the anchor/footer links */
.more-panel { overflow: hidden; }
.more-panel[hidden] { display: none; }
.more-panel-note { text-align: center; color: var(--ink-2); font-size: .95rem; margin: clamp(1.6rem,3vw,2.4rem) auto clamp(1.4rem,3vw,2rem); max-width: 44ch; }
.more-behance { margin-top: 2rem; color: var(--ink-2); font-size: .95rem; }
.more-behance a { border-bottom: 1px solid var(--line); transition: border-color .2s, color .2s; }
.more-behance a:hover { color: var(--ink); border-color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .more-panel { transition: none !important; } }
/* Archive cards now reuse the Selected-work `.case-card` component (same 2-col .work-grid),
   so they match the flagship cards exactly — no bespoke .more-card styles needed. */
