/* Sidecar Tools — home page only. Other pages use /style.css.
   Colours and fonts are all defined in :root below. */

@font-face { font-family: "Instrument Serif"; src: url(fonts/instrument-serif.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url(fonts/instrument-serif-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url(fonts/inter-var.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(fonts/jetbrains-mono-var.woff2) format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --ink: #0b0d12;
  --ink-2: #11141b;
  --line: rgba(255,255,255,.08);
  --text: #eceef3;
  --muted: #8d95a8;
  --blue: #4f8cff;        /* the icon family's blue */
  --amber: #f5b53d;       /* Sidecar Sieve's "hasn't been checked" badge */

  /* TurboFind's highlight chip colours, used as the site's marker palette */
  --chip-1: #fde047;
  --chip-2: #fdba74;
  --chip-3: #86efac;
  --chip-4: #7dd3fc;
  --chip-5: #c4b5fd;
  --chip-6: #f9a8d4;

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --gutter: clamp(1.1rem, 4vw, 3rem);
  --ease: cubic-bezier(.2,.7,.1,1);
}

* { box-sizing: border-box; }
html { background: var(--ink); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--text); font: 400 1rem/1.6 var(--sans); font-feature-settings: "ss01", "cv11"; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: var(--chip-1); color: var(--ink); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

/* ---------------- Nav ---------------- */

.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: max(.9rem, env(safe-area-inset-top)) var(--gutter) .9rem;
  background: rgba(11,13,18,.72); border-bottom: 1px solid rgba(255,255,255,.05);
  backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px);
}
.wordmark { display: inline-flex; align-items: center; gap: .55rem; font: 400 1.35rem/1 var(--serif); text-decoration: none; letter-spacing: .01em; }
.wordmark .dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--blue); box-shadow: 0 0 14px var(--blue); }
.nav nav { display: flex; gap: clamp(1rem, 3vw, 2rem); font-size: .92rem; }
.nav nav a { text-decoration: none; color: var(--muted); transition: color .2s; }
.nav nav a:hover { color: var(--text); }

/* ---------------- Hero ---------------- */

.hero {
  position: relative; min-height: 100svh; display: grid; place-items: center;
  padding: 6rem var(--gutter) 5rem; overflow: hidden; isolation: isolate;
}
.field { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.hero-glow {
  position: absolute; inset: -20% -10% auto; height: 90%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 50% at 50% 45%, rgba(11,13,18,.92), rgba(11,13,18,.55) 55%, transparent 80%),
    radial-gradient(60% 40% at 50% 0%, rgba(79,140,255,.18), transparent 70%);
}
.hero::after { /* fade the field into the page below */
  content: ""; position: absolute; inset: auto 0 0; height: 30%; z-index: -1;
  background: linear-gradient(to bottom, transparent, var(--ink));
}
.hero-inner { text-align: center; max-width: 60rem; }

.eyebrow, .idx, .source, .badge {
  font: 500 .72rem/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.eyebrow { margin: 0 0 1.25rem; }

h1 {
  font: 400 clamp(4rem, 17vw, 11.5rem)/.86 var(--serif);
  letter-spacing: -.03em; margin: 0 0 1.6rem;
}
h1 em { font-style: italic; color: transparent; -webkit-text-stroke: 1px rgba(236,238,243,.75); }

.roster { font: 400 clamp(1.05rem, 2.6vw, 1.45rem)/1.9 var(--sans); color: #c5cad6; max-width: 40rem; margin: 0 auto 3rem; }
.roster mark {
  color: var(--ink); font-weight: 560; padding: .08em .35em; border-radius: .3em; white-space: nowrap;
  background: linear-gradient(var(--c), var(--c)) no-repeat left / 100% 100%;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.js .roster mark { background-size: 0% 100%; color: #c5cad6; animation: sweep .7s var(--ease) var(--d) forwards; }
@keyframes sweep { to { background-size: 100% 100%; color: var(--ink); } }

.dock { display: flex; justify-content: center; gap: clamp(.6rem, 3vw, 1.6rem); perspective: 800px; }
.dock { --tile: clamp(3.3rem, 13vw, 5.5rem); }
.dock a {
  /* every item is exactly one tile wide, so the spacing is even whatever the label length */
  width: var(--tile); display: grid; grid-template-columns: 100%; justify-items: center; gap: .55rem; text-decoration: none; white-space: nowrap;
  font: 500 .72rem/1 var(--mono); color: var(--muted); letter-spacing: .06em;
}
.dock img {
  width: var(--tile); border-radius: 23%;
  box-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.08);
  transform: translateZ(0) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .5s var(--ease), box-shadow .3s;
}
.js .dock a { opacity: 0; transform: translateY(18px); animation: rise .9s var(--ease) calc(1.2s + var(--i) * .08s) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
.dock a:hover img, .dock a:focus-visible img { transform: translateY(-8px) scale(1.06); box-shadow: 0 18px 40px rgba(79,140,255,.35), 0 0 0 1px rgba(255,255,255,.14); }
.dock a span { width: max-content; justify-self: center; }
.dock a:hover span { color: var(--text); }

.scroll-cue { position: absolute; bottom: 1.6rem; left: 50%; translate: -50% 0; width: 1.5rem; height: 2.4rem; border: 1.5px solid rgba(255,255,255,.25); border-radius: 1rem; }
.scroll-cue span { position: absolute; left: 50%; top: .45rem; width: 3px; height: .5rem; margin-left: -1.5px; border-radius: 2px; background: var(--text); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(.8rem); } }

/* ---------------- Chapters ---------------- */

main { position: relative; }

.chapter {
  position: relative; max-width: 88rem; margin: 0 auto;
  padding: clamp(4rem, 12vw, 9rem) var(--gutter);
  display: grid; gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
}
.chapter + .chapter { border-top: 1px solid var(--line); }

.idx { margin: 0 0 1.4rem; }
.idx span { color: var(--text); }
.chapter-icon { width: 3.6rem; border-radius: 23%; margin-bottom: 1.4rem; box-shadow: 0 8px 26px rgba(0,0,0,.45); }

.chapter h2 { margin: 0 0 1.4rem; line-height: 1; }
.chapter h2 .name { display: block; font: 400 clamp(2.8rem, 8vw, 5.2rem)/.95 var(--serif); letter-spacing: -.02em; }
.chapter h2 .sub { display: block; margin-top: .7rem; font: 400 italic clamp(1.25rem, 3vw, 1.7rem)/1.2 var(--serif); color: var(--muted); }

.summary { font-size: clamp(1.08rem, 2vw, 1.25rem); line-height: 1.55; margin: 0 0 1.5rem; max-width: 34rem; color: #d9dde6; }

.lines { list-style: none; padding: 0; margin: 0 0 1.2rem; max-width: 34rem; display: grid; gap: .75rem; }
.lines li { position: relative; padding-left: 1.4rem; color: #b9bfcc; font-size: .98rem; }
.lines li::before { content: ""; position: absolute; left: 0; top: .72em; width: .6rem; height: 2px; border-radius: 2px; background: var(--blue); }
#turbofind .lines li::before { background: linear-gradient(90deg, var(--chip-1), var(--chip-3), var(--chip-4), var(--chip-5)); }

.source { margin: 0 0 1.8rem; opacity: .75; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1.6rem; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem; text-decoration: none;
  padding: .8rem 1.25rem; border-radius: 999px; font-weight: 560; font-size: .95rem;
  background: var(--text); color: var(--ink);
  transition: transform .25s var(--ease), box-shadow .25s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(79,140,255,.35); }
.quiet { color: var(--muted); font-size: .92rem; text-underline-offset: .25em; text-decoration-color: rgba(255,255,255,.25); }
.quiet:hover { color: var(--text); }

/* Media: browser-window frame for page shots, floating panel for popups */
.chapter-media { margin: 0; position: relative; }
.chapter-media::before { /* soft colour bloom behind every screenshot */
  content: ""; position: absolute; inset: 8% 6%; z-index: -1; filter: blur(60px); opacity: .45;
  background: radial-gradient(closest-side, var(--blue), transparent);
}
#turbofind .chapter-media::before { background: conic-gradient(from 90deg, var(--chip-1), var(--chip-2), var(--chip-3), var(--chip-4), var(--chip-5), var(--chip-6), var(--chip-1)); opacity: .28; }

.window {
  display: block; border-radius: 14px; overflow: hidden; text-decoration: none;
  background: #1a1d25; border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 40px 80px -20px rgba(0,0,0,.7), 0 0 0 1px rgba(0,0,0,.4);
}
.window .bar { display: flex; gap: 7px; padding: 11px 14px; background: #1a1d25; border-bottom: 1px solid rgba(255,255,255,.06); }
.window .bar i { width: 11px; height: 11px; border-radius: 50%; background: #3a3f4b; }
.window img { width: 100%; }

.stage {
  display: grid; place-items: center; min-height: clamp(20rem, 60vw, 34rem); padding: clamp(2.2rem, 6vw, 3.5rem) 1rem;
  border-radius: 22px; border: 1px solid var(--line);
  background:
    radial-gradient(70% 60% at 50% 40%, rgba(79,140,255,.16), transparent 70%),
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--ink-2);
}
.stage::before { display: none; }
.panel {
  display: block; border-radius: 10px; overflow: hidden;
  box-shadow: 0 30px 70px -10px rgba(0,0,0,.75), 0 0 0 1px rgba(255,255,255,.12);
  transform: rotate(-2deg); transition: transform .6s var(--ease);
}
.flip .panel { transform: rotate(2deg); }
.panel:hover { transform: rotate(0) scale(1.02); }
#sidecar-sieve .panel img { width: min(325px, 66vw); }
#sidecar-capture .panel img { width: min(320px, 76vw); }

@media (min-width: 64rem) {
  .chapter { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .chapter.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .chapter.flip .chapter-text { order: 2; }
  .chapter-text { position: sticky; top: 7rem; align-self: start; }
}

/* Scroll-linked tilt for the window frames (Chrome; other browsers just show them flat) */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) and (min-width: 48rem) {
    .chapter-media .window {
      animation: settle linear both; animation-timeline: view(); animation-range: entry 0% cover 45%;
      transform-origin: 50% 100%;
    }
    @keyframes settle { from { transform: perspective(1400px) rotateX(18deg) translateY(40px) scale(.94); opacity: .3; } to { transform: none; opacity: 1; } }
  }
}

/* Reveal on scroll (only when JS is running; without it everything is simply visible).
   Blocks rise into place as they reach ~82% down the screen; chapter text cascades line by line. */
.js .reveal {
  opacity: 0; transform: translateY(44px);
  transition: opacity 1s cubic-bezier(.22,.61,.36,1), transform 1.1s cubic-bezier(.22,.61,.36,1);
}
.js .reveal.in { opacity: 1; transform: none; }
.js .chapter-media.reveal { transform: translateY(56px) scale(.97); transition-delay: .18s; }
.js .chapter-media.reveal.in { transform: none; }

.js .chapter-text.reveal { opacity: 1; transform: none; }
.js .chapter-text.reveal > * {
  opacity: 0; transform: translateY(32px);
  transition: opacity .9s cubic-bezier(.22,.61,.36,1), transform 1s cubic-bezier(.22,.61,.36,1);
  transition-delay: calc(var(--k, 0) * 80ms);
}
.js .chapter-text.reveal.in > * { opacity: 1; transform: none; }
.chapter-text > :nth-child(2) { --k: 1; }
.chapter-text > :nth-child(3) { --k: 2; }
.chapter-text > :nth-child(4) { --k: 3; }
.chapter-text > :nth-child(5) { --k: 4; }
.chapter-text > :nth-child(6) { --k: 5; }
.chapter-text > :nth-child(7) { --k: 6; }

/* ---------------- "Says when it can't" ---------------- */

.cant {
  position: relative; overflow: hidden;
  padding: clamp(5rem, 14vw, 10rem) var(--gutter);
  background:
    radial-gradient(50% 60% at 15% 0%, rgba(245,181,61,.14), transparent 70%),
    radial-gradient(40% 50% at 100% 100%, rgba(245,181,61,.08), transparent 70%),
    #0e0f12;
  border-top: 1px solid rgba(245,181,61,.18);
}
.cant-inner { max-width: 72rem; margin: 0 auto; }
.badge { display: inline-flex; align-items: center; gap: .7rem; color: var(--amber); margin: 0 0 1.6rem; }
.pulse { position: relative; width: .7rem; height: .7rem; border-radius: 50%; background: var(--amber); }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--amber); animation: ping 2s ease-out infinite; }
@keyframes ping { from { transform: scale(1); opacity: .7; } to { transform: scale(3); opacity: 0; } }

.cant h2 { font: 400 clamp(2.7rem, 9vw, 7rem)/.95 var(--serif); letter-spacing: -.02em; margin: 0 0 clamp(2.5rem, 6vw, 4.5rem); max-width: 14ch; }
.cant h2 em { color: var(--amber); }

.cant-grid { display: grid; gap: 1.5rem; }
.cant blockquote {
  margin: 0; padding: clamp(1.4rem, 3vw, 2.2rem); border-radius: 18px;
  background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.07);
  border-left: 3px solid var(--amber);
}
.cant blockquote p { margin: 0 0 1rem; font-size: clamp(1.02rem, 1.8vw, 1.15rem); line-height: 1.6; color: #dcdfe6; }
.cant blockquote footer { display: flex; align-items: center; gap: .7rem; margin-top: 1.4rem; font: 500 .72rem/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cant blockquote footer img { width: 1.9rem; border-radius: 23%; }
.cant blockquote strong { font-weight: 600; color: var(--amber); }
.cant .limits { display: grid; gap: 1.25rem; }
.cant .limits p { margin: 0; }
@media (min-width: 56rem) {
  .cant-grid { grid-template-columns: 3fr 2fr; align-items: start; }
  .cant blockquote.wide { grid-column: 1 / -1; }
  .cant .limits { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
  .cant .limits p + p { border-left: 1px solid rgba(255,255,255,.08); padding-left: 2rem; }
}

/* ---------------- Footer ---------------- */

.site-foot { border-top: 1px solid var(--line); padding: clamp(3.5rem, 8vw, 6rem) var(--gutter) max(2.5rem, env(safe-area-inset-bottom)); }
.foot-inner { max-width: 88rem; margin: 0 auto; display: grid; gap: 2.5rem; }
.foot-mark { font: 400 clamp(3rem, 12vw, 8rem)/.9 var(--serif); letter-spacing: -.03em; margin: 0; color: #2a2e38; }
.foot-mark em { color: #2a2e38; }
.foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 2rem; }
.foot-cols h3 { font: 500 .72rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 1rem; }
.foot-cols a { display: block; text-decoration: none; color: #c5cad6; padding: .25rem 0; }
.foot-cols a:hover { color: var(--text); }
@media (min-width: 56rem) { .foot-inner { grid-template-columns: 1fr auto; align-items: end; } .foot-cols { grid-template-columns: repeat(2, 13rem); } }

/* ---------------- Reduced motion ---------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .roster mark { background-size: 100% 100%; color: var(--ink); }
  .js .dock a, .js .reveal, .js .chapter-text.reveal > * { opacity: 1; transform: none; }
}
