/* adamshawa.com — design tokens and global styles.
   Ported from the claude.ai/design project "adamshawa v5".
   Colors are the design's exact oklch values. */

@import url("../fonts/faces.css");

:root {
  --cream:  oklch(0.955 0.022 95);
  --ink:    oklch(0.22 0.015 70);
  --blue:   oklch(0.47 0.23 265);
  --red:    oklch(0.50 0.20 33);
  --yellow: oklch(0.89 0.17 102);
  --green:  oklch(0.75 0.19 145);
  --muted:  oklch(0.45 0.012 70);
  --serif:  'Old Standard TT', Georgia, serif;
  --disp:   'Archivo Black', system-ui, sans-serif;
  --mono:   'Space Mono', ui-monospace, monospace;
}

html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--blue); }
::selection { background: var(--yellow); color: var(--ink); }
p { text-wrap: pretty; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--cream); padding: 10px 16px;
  font-weight: 700; font-size: 13px;
}
.skip-link:focus { left: 0; color: var(--cream); }

/* ── keyframes (verbatim from the design) ─────────────────────────────── */
@keyframes vUp { from { opacity:0; transform:translateY(64px) } to { opacity:1; transform:none } }
@keyframes vL { from { opacity:0; transform:translateX(-110px) rotate(-5deg) } to { opacity:1; transform:none } }
@keyframes vR { from { opacity:0; transform:translateX(110px) rotate(5deg) } to { opacity:1; transform:none } }
@keyframes vPop { from { opacity:0; transform:scale(0.4) rotate(-10deg) } to { opacity:1; transform:none } }
@keyframes vRule { from { transform:scaleX(0) } to { transform:scaleX(1) } }
@keyframes exitFade { to { opacity:0.06; transform:translateY(-8vh) } }
@keyframes marqA { from { transform:translateX(0) } to { transform:translateX(-25%) } }
@keyframes marqB { from { transform:translateX(-25%) } to { transform:translateX(0) } }
@keyframes parUp { to { transform:translateY(-26vh) } }
@keyframes parUpRot { to { transform:translateY(-20vh) rotate(65deg) } }
@keyframes parDown { to { transform:translateY(16vh) rotate(-10deg) } }
@keyframes spinScroll { to { transform:rotate(180deg) } }
@keyframes wipeIn { from { clip-path:inset(0 100% 0 0); transform:translateX(-16px) } to { clip-path:inset(0 -3% 0 0); transform:none } }
@keyframes gearA { from { transform:rotate(0deg) } to { transform:rotate(320deg) } }
@keyframes gearB { from { transform:rotate(0deg) } to { transform:rotate(-320deg) } }
@keyframes reelTo2 { from { transform:translateY(-9em) } to { transform:translateY(-2em) } }
@keyframes reelTo5 { from { transform:translateY(-9em) } to { transform:translateY(-5em) } }
@keyframes barIn { from { opacity:0; transform:translateX(-52px) } to { opacity:1; transform:none } }

/* ── scroll-driven animation helpers ──────────────────────────────────────
   Elements declare their animation via custom properties:
     class="sd" style="--an:vUp; --ar:entry 10% cover 16%"
   Guarded by @supports: browsers without scroll timelines render everything
   in its resting (visible) state instead of stuck at a keyframe. */
@supports (animation-timeline: view()) {
  .sd        { animation: var(--an) linear both; animation-timeline: view();               animation-range: var(--ar); }
  .sd-scroll { animation: var(--an) linear both; animation-timeline: scroll(root block);   animation-range: var(--ar); }
}

/* ── header ───────────────────────────────────────────────────────────── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px;
  padding: 10px clamp(14px, 2.4vw, 36px);
  background: var(--cream);
  border-bottom: 3px solid var(--ink);
}
.brand { text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.brand:hover { color: var(--ink); }
.brand-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--red); display: inline-block; }
.brand-name { font-family: var(--disp); font-size: 16px; letter-spacing: 0.02em; }
.brand-sub { font-size: 9.5px; letter-spacing: 0.22em; color: var(--muted); }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-inline-start: auto; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; }
.lang-switch { display: flex; align-items: center; gap: 2px; margin-inline-start: 10px; padding-inline-start: 10px; border-inline-start: 2px solid var(--ink); }
.lang-switch a { text-decoration: none; cursor: pointer; padding: 6px 7px; color: var(--muted); font-size: 10px; letter-spacing: 0.1em; }
.lang-switch a:hover { background: var(--ink); color: var(--cream); }
.lang-switch a[aria-current="true"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.nav-link { text-decoration: none; cursor: pointer; padding: 6px 10px; color: var(--ink); }
.nav-link:hover { background: var(--ink); color: var(--cream); }
.nav-hire { text-decoration: none; cursor: pointer; padding: 6px 10px; background: var(--yellow); border: 2px solid var(--ink); color: var(--ink); }
.nav-hire:hover { background: var(--ink); color: var(--yellow); }

/* ── shared section furniture ─────────────────────────────────────────── */
.kicker { font-size: 11px; font-weight: 700; letter-spacing: 0.3em; margin-bottom: 14px; }
.h-display { margin: 0 0 8px; font-family: var(--disp); font-size: clamp(38px, 7.4vw, 110px); line-height: 0.94; text-transform: uppercase; }

/* ── buttons (all interactive controls reset + focus ring) ────────────── */
button { font-family: inherit; }
.btn { all: unset; cursor: pointer; box-sizing: border-box; }
.btn:focus-visible, a:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.btn-model { flex: 1; text-align: center; padding: 9px 6px; border: 3px solid var(--blue); color: var(--blue); font-weight: 700; font-size: 12px; letter-spacing: 0.1em; }
.btn-model:hover { background: var(--blue); color: var(--cream); }
.btn-code { flex: 1; text-align: center; padding: 9px 6px; border: 3px solid var(--ink); font-weight: 700; font-size: 12px; letter-spacing: 0.1em; }
.btn-code:hover { background: var(--ink); color: var(--cream); }
.btn-verdict { margin-top: 12px; padding: 8px 12px; border: 3px solid var(--ink); font-weight: 700; font-size: 11px; letter-spacing: 0.14em; }
.btn-verdict:hover { background: var(--ink); color: var(--yellow); }
.btn-back { padding: 10px 16px; border: 3px solid var(--cream); font-weight: 700; font-size: 12px; letter-spacing: 0.12em; }
.btn-back:hover { background: var(--cream); color: var(--ink); }
.btn-advance { padding: 10px 16px; background: var(--red); border: 3px solid var(--red); font-weight: 700; font-size: 12px; letter-spacing: 0.12em; }
.btn-advance:hover { background: var(--cream); color: var(--red); }
.btn-dossier { margin-top: 14px; padding: 9px 14px; border: 3px solid var(--ink); font-weight: 700; font-size: 11px; letter-spacing: 0.14em; }
.btn-dossier:hover { background: var(--ink); color: var(--cream); }

.station-chip { padding: 9px 12px; white-space: nowrap; font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; border: 3px solid oklch(0.955 0.022 95 / 0.35); background: transparent; color: oklch(0.955 0.022 95 / 0.55); }
.station-chip.is-past { border-color: var(--yellow); color: var(--yellow); }
.station-chip.is-current { border-color: var(--yellow); background: var(--yellow); color: var(--ink); }

.confess-btn { display: block; font-family: var(--disp); font-size: clamp(40px, 8.4vw, 124px); line-height: 1; letter-spacing: -0.01em; color: var(--blue); border-bottom: 6px solid var(--blue); padding-bottom: 10px; }
.confess-btn:hover { color: var(--red); border-bottom-color: var(--red); }

.mail-link { display: inline-block; font-family: var(--disp); font-size: clamp(30px, 6.4vw, 96px); line-height: 1; color: var(--yellow); text-decoration: none; border-bottom: 8px solid var(--yellow); padding-bottom: 12px; word-break: break-word; }
.mail-link:hover { color: var(--cream); border-bottom-color: var(--cream); }

/* ── marquee ──────────────────────────────────────────────────────────── */
.marquee { border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); background: var(--ink); color: var(--cream); overflow: clip; padding: 10px 0; }
.marq-row { display: flex; white-space: nowrap; font-family: var(--disp); font-size: clamp(26px, 3.6vw, 52px); text-transform: uppercase; }
.marq-a { animation: marqA 26s linear infinite; }
.marq-b { animation: marqB 32s linear infinite; color: transparent; -webkit-text-stroke: 1.5px var(--cream); }

/* ── machine section (class-triggered on first view) ──────────────────── */
.m-card { border: 3px solid var(--ink); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.machine-on .m-card { animation: vUp 0.55s ease both; }
.m-bar { height: 10px; background: var(--ink); }
.machine-on .m-bar { animation: barIn 0.5s ease-out both; }
.machine-on .m-gear-a { animation: gearA 1.6s ease-in-out 0.55s both; }
.machine-on .m-gear-b { animation: gearB 1.6s ease-in-out 0.55s both; }
.m-pop { position: absolute; white-space: nowrap; font-size: 10.5px; font-weight: 700; border: 2px solid var(--ink); padding: 3px 7px; background: var(--cream); }
.machine-on .m-pop, .machine-on .m-stamp { animation: vPop 0.35s cubic-bezier(.34,1.56,.64,1) both; }
.m-stamp { animation-delay: 1.7s; }
.machine-on .m-reel-2 { animation: reelTo2 1.5s cubic-bezier(.22,.8,.25,1) 0.6s both; }
.machine-on .m-reel-5 { animation: reelTo5 1.5s cubic-bezier(.22,.8,.25,1) 0.75s both; }
.reel-window { display: inline-block; overflow: clip; height: 1em; line-height: 1em; vertical-align: bottom; }
.reel-strip { display: flex; flex-direction: column; }
.reel-strip span { display: block; height: 1em; line-height: 1em; }

/* ── sorting game ─────────────────────────────────────────────────────── */
.game-card { background: var(--cream); color: var(--ink); border: 3px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); padding: 16px; }
.game-label { font-weight: 700; font-size: 15.5px; line-height: 1.45; }
.game-actions { display: flex; gap: 10px; margin-top: 12px; }

/* The deck is a messy physical pile: answer the top card and the next one
   surfaces. Lower cards peek out at shuffled angles. */
/* Cards are inset so rotation never crosses into the neighbouring bins;
   site.js sets the pile's real height from the tallest card. */
.deck-stack { position: relative; min-height: 280px; }
.deck-stack .game-card { position: absolute; left: 14px; right: 14px; top: 0; box-sizing: border-box; }
.deck-stack .game-card:nth-child(1) { z-index: 6; transform: rotate(-1.8deg); }
.deck-stack .game-card:nth-child(2) { z-index: 5; transform: rotate(1.6deg) translate(7px, 8px); }
.deck-stack .game-card:nth-child(3) { z-index: 4; transform: rotate(-1.1deg) translate(-8px, 15px); }
.deck-stack .game-card:nth-child(4) { z-index: 3; transform: rotate(2.1deg) translate(5px, 21px); }
.deck-stack .game-card:nth-child(5) { z-index: 2; transform: rotate(-2.4deg) translate(-4px, 27px); }
.deck-stack .game-card:nth-child(6) { z-index: 1; transform: rotate(1.3deg) translate(8px, 33px); }
.deck-stack #verdict { position: relative; z-index: 20; }

.bin-item { border: 2px solid var(--cream); padding: 10px 12px; font-size: 13px; font-weight: 700; line-height: 1.4; }
.bin-item.is-right { background: oklch(0.955 0.022 95 / 0.12); }
.bin-stamp { display: inline-block; margin-left: 6px; padding: 1px 6px; font-size: 10px; letter-spacing: 0.1em; transform: rotate(-2deg); }
.bin-stamp.is-right { background: var(--yellow); color: var(--ink); }
.bin-stamp.is-wrong { background: var(--ink); color: var(--cream); }
.bin-why { display: block; font-size: 11px; opacity: 0.8; margin-top: 3px; }

/* ── availability board ───────────────────────────────────────────────── */
.month-cell { border: 3px solid var(--cream); padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.month-mon { font-family: var(--disp); font-size: 22px; text-transform: uppercase; }
.month-year { font-size: 10px; letter-spacing: 0.18em; opacity: 0.8; }
.chip { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; padding: 6px 8px; display: inline-block; align-self: flex-start; }
/* Traffic-light coding: green = open, yellow = partial, red = full. */
.chip-open { background: var(--green); color: var(--ink); }
.chip-part { background: var(--yellow); color: var(--ink); }
.chip-full { background: var(--red); color: var(--cream); }
.chip-unknown { background: transparent; color: oklch(0.955 0.022 95 / 0.6); border: 2px dashed oklch(0.955 0.022 95 / 0.6); }

/* ── author-note markers ──────────────────────────────────────────────── */
body:not(.show-markers) .marker { display: none; }

/* ── footer ───────────────────────────────────────────────────────────── */
.site-footer { background: var(--cream); border-top: 3px solid var(--ink); padding: 26px clamp(18px, 3.4vw, 54px); display: flex; flex-wrap: wrap; gap: 12px 36px; align-items: baseline; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; }
.site-footer a { color: var(--ink); }
.site-footer .legal-links { margin-inline-start: auto; display: flex; gap: 12px; }
.li-btn { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; background: var(--ink); color: var(--cream) !important; align-self: center; }
.li-btn:hover { background: var(--blue); }
.li-btn svg { width: 14px; height: 14px; fill: currentColor; display: block; }

/* ── RTL (Arabic): connected script must never be letter-spaced ───────── */
[dir="rtl"] body, [dir="rtl"] .kicker, [dir="rtl"] .h-display, [dir="rtl"] .brand-name,
[dir="rtl"] .brand-sub, [dir="rtl"] .site-nav, [dir="rtl"] .chip, [dir="rtl"] .month-mon,
[dir="rtl"] .bin-stamp, [dir="rtl"] .station-chip, [dir="rtl"] .site-footer,
[dir="rtl"] .btn-model, [dir="rtl"] .btn-code, [dir="rtl"] .btn-verdict, [dir="rtl"] .btn-back,
[dir="rtl"] .btn-advance, [dir="rtl"] .btn-dossier { letter-spacing: 0; }
[dir="rtl"] .skip-link { left: auto; right: -9999px; }
[dir="rtl"] .skip-link:focus { right: 0; }
.site-footer .legal-links a { color: var(--muted); }

/* ── small screens: the display sizes' clamp() floors are tuned for
   desktop and overflow a 390px phone; rein them in and let very long
   single words hyphenate instead of clipping. ────────────────────────── */
@media (max-width: 560px) {
  .site-header { gap: 6px 10px; }
  .site-nav { font-size: 10px; gap: 2px; }
  .nav-link, .nav-hire { padding: 6px 7px; }
  .lang-switch { margin-inline-start: 4px; padding-inline-start: 6px; }
  #top h1 { font-size: clamp(28px, 10.5vw, 60px) !important; overflow-wrap: anywhere; }
  .h-display { font-size: clamp(24px, 8vw, 60px) !important; hyphens: auto; overflow-wrap: anywhere; }
  .confess-btn, .mail-link { font-size: clamp(22px, 7.5vw, 48px) !important; }
}

/* ── reduced motion: everything rests in its final, readable state ────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sd, .sd-scroll,
  .marq-a, .marq-b,
  .machine-on .m-card, .machine-on .m-bar,
  .machine-on .m-gear-a, .machine-on .m-gear-b,
  .machine-on .m-pop, .machine-on .m-stamp { animation: none; }
  .machine-on .m-reel-2 { animation: none; transform: translateY(-2em); }
  .machine-on .m-reel-5 { animation: none; transform: translateY(-5em); }
}
