/* Amberworks — site stylesheet.
 *
 * Brand: ASSET_SPEC.md §3. Paper field, ink text, amber where it means something.
 * One deliberate look (warm light), not a theme pair - the paper IS the identity.
 *
 * Motion policy: every effect is decoration on top of a page that works without it.
 * prefers-reduced-motion turns all of it off in one block at the bottom.
 */

:root {
  --amber: #E4820C;
  --amber-deep: #B36609;
  --ink: #172B4D;
  --ink-soft: #44546F;
  --paper: #FFF8F0;
  --paper-raised: #FFFFFF;
  --line: rgba(23, 43, 77, 0.14);
  --amber-wash: rgba(228, 130, 12, 0.08);
  --radius: 14px;
  --slab: Rockwell, "Rockwell Nova", "Roboto Slab", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

::selection { background: rgba(228, 130, 12, 0.25); }

:focus-visible { outline: 2.5px solid var(--amber); outline-offset: 2px; border-radius: 4px; }

/* The page's own progress, drawn as the brand drawing a bar: a thin amber bar
 * across the very top that fills as you scroll. scaleX, so it never reflows. */
#progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: var(--amber);
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: 10;
  pointer-events: none;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font: 17px/1.65 var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--slab); line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.2rem, 5.2vw, 3.6rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1em; }
a  { color: var(--amber-deep); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--amber); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

/* ------------------------------------------------------------------
 * The ambient glow that follows the pointer. A fixed layer, painted with a
 * radial gradient whose centre is two CSS variables site.js eases toward the
 * cursor. Weightless: one element, no repaint storms, pointer-events none.
 * ------------------------------------------------------------------ */
#glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    620px circle at var(--mx, 50%) var(--my, 30%),
    rgba(228, 130, 12, 0.09),
    rgba(228, 130, 12, 0.03) 45%,
    transparent 70%
  );
}

main, header.site, footer.site { position: relative; z-index: 1; }

/* ------------------------------------------------------------------ header */
header.site {
  position: sticky;
  top: 0;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  border-bottom: 1px solid var(--line);
  z-index: 5;
  transition: box-shadow 0.3s ease;
}
header.site.scrolled { box-shadow: 0 6px 22px rgba(23, 43, 77, 0.08); }
.site-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  max-width: 1080px;
  margin: 0 auto;
}
.mark {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  flex: none;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
a.home { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
a.home:hover .mark { transform: rotate(-6deg) scale(1.06); }
.wordmark { font-family: var(--slab); font-size: 1.25rem; font-weight: 700; letter-spacing: 0.01em; }
nav.site { margin-left: auto; display: flex; gap: 26px; }
nav.site a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
nav.site a:hover, nav.site a[aria-current] { color: var(--ink); border-bottom-color: var(--amber); }

/* ------------------------------------------------------------------ hero */
.hero {
  position: relative;
  overflow: clip;
  padding: 96px 0 72px;
}
.hero .wrap { position: relative; z-index: 2; max-width: 880px; }
.hero p.lede {
  font-size: 1.25rem;
  color: var(--ink-soft);
  max-width: 34em;
}
.kicker {
  font-family: var(--slab);
  color: var(--amber-deep);
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* The drifting-bar field behind the hero: the brand's ghost-bar motif as
 * atmosphere. Layers carry data-depth; site.js translates them a few px with
 * the pointer and against the scroll. Decorative, aria-hidden, behind text. */
.field { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.fbar {
  position: absolute;
  height: 26px;
  border-radius: 13px;
  background: var(--amber);
  will-change: transform;
}
.fbar.ghost {
  background: transparent;
  border: 2.5px dashed var(--amber);
}

/* ------------------------------------------------------------------ buttons */
.cta-row { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 30px; }
.btn {
  display: inline-block;
  font-family: var(--slab);
  font-size: 1.02rem;
  padding: 13px 26px;
  border-radius: 10px;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.25s ease, background 0.2s;
  will-change: transform;
}
.btn.primary {
  background: var(--amber);
  color: #fff;
  box-shadow: 0 2px 0 var(--amber-deep);
}
.btn.primary:hover { background: #ef8d15; box-shadow: 0 3px 0 var(--amber-deep), 0 10px 26px rgba(228, 130, 12, 0.28); }
.btn:active { transform: translateY(1px) !important; }
.btn.primary:active { box-shadow: 0 1px 0 var(--amber-deep); }
.btn.quiet { color: var(--ink); border: 1.5px solid var(--line); background: var(--paper-raised); }
.btn.quiet:hover { border-color: var(--amber); }

/* ------------------------------------------------------------------ sections */
section.band { padding: 72px 0; }
section.band.raised {
  background: var(--paper-raised);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; margin-top: 34px; }
@media (max-width: 820px) { .cols { grid-template-columns: 1fr; } }

.card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
section.band.raised .card { background: var(--paper); }
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(228, 130, 12, 0.5);
  box-shadow: 0 14px 34px rgba(23, 43, 77, 0.09);
}
.card h3 { display: flex; align-items: center; gap: 10px; }
.card p { color: var(--ink-soft); font-size: 0.98rem; margin: 0; }
/* The dot's slot is its FINAL bar width from the start, so the grow-on-hover never
 * reflows the title ("Built for the Monday update" wrapped to a second line and
 * shoved the card body down). The amber fill grows inside a fixed slot. */
.dot {
  width: 26px;
  height: 11px;
  flex: none;
  position: relative;
}
.dot::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 11px;
  border-radius: 4px;
  background: var(--amber);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
/* On hover the dot becomes what it always was: a small Gantt bar. */
.card:hover .dot::before { width: 26px; }

/* ------------------------------------------------------------------ the drift toy
 * A three-row miniature Gantt. Hovering (or focusing) a row slides its bar to
 * the planned-later position and leaves a dashed ghost where it was, with the
 * day tag - the product's signature feature, playable in one gesture.
 * ------------------------------------------------------------------ */
.toy {
  margin-top: 36px;
  padding: 30px 34px 22px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.toy-plot { position: relative; }
.toy-today {
  position: absolute;
  top: -6px;
  bottom: 2px;
  left: 68%;
  border-left: 2px dashed rgba(23, 43, 77, 0.3);
  pointer-events: none;
}
.toy-row { position: relative; height: 30px; margin-bottom: 14px; }
.toy-ghost {
  position: absolute;
  top: 0;
  height: 26px;
  border: 2.5px dashed var(--amber-deep);
  border-radius: 13px;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.toy-bar {
  position: absolute;
  top: 0;
  height: 26px;
  border-radius: 13px;
  background: var(--ink);
  border: 2.5px solid transparent;
  cursor: default;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  outline: none;
}
.toy-tag {
  position: absolute;
  top: 3px;
  font: 700 0.8rem var(--sans);
  color: var(--amber-deep);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.35s ease 0.15s, transform 0.35s ease 0.15s;
}
.toy-row:hover .toy-bar, .toy-bar:focus-visible { transform: translateX(var(--slip)); background: var(--amber); }
.toy-row:hover .toy-ghost, .toy-bar:focus-visible ~ .toy-ghost { opacity: 1; }
.toy-row:hover .toy-tag, .toy-bar:focus-visible ~ .toy-tag { opacity: 1; transform: translateX(0); }
.toy-caption { color: var(--ink-soft); font-size: 0.92rem; margin: 14px 0 0; }

/* ------------------------------------------------------------------ product shot */
.shot {
  margin-top: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(23, 43, 77, 0.12);
  transform: perspective(1200px) rotateX(var(--tiltx, 0deg)) rotateY(var(--tilty, 0deg));
  transition: transform 0.2s ease-out;
  will-change: transform;
}
.shot img { display: block; width: 100%; height: auto; }

.guarantee-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-raised);
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.guarantee-line strong { color: var(--ink); }

/* ------------------------------------------------------------------ prose pages */
.prose { padding: 64px 0 80px; }
.prose h1 { margin-bottom: 0.25em; }
.prose .updated { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 2.2em; }
.prose h2 { margin-top: 1.8em; font-size: 1.35rem; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 0.45em; }
.prose .card { margin: 1.4em 0; }

details.faq {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-raised);
  margin-bottom: 12px;
  overflow: hidden;
}
details.faq summary {
  cursor: pointer;
  padding: 15px 20px;
  font-family: var(--slab);
  font-size: 1.02rem;
  list-style: none;
  position: relative;
  transition: background 0.2s;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  color: var(--amber-deep);
  font-family: var(--sans);
  font-weight: 700;
  transition: transform 0.25s ease;
}
details.faq[open] summary::after { transform: rotate(45deg); }
details.faq summary:hover { background: var(--amber-wash); }
details.faq .faq-body { padding: 2px 20px 16px; color: var(--ink-soft); }

/* ------------------------------------------------------------------ footer */
footer.site {
  border-top: 1px solid var(--line);
  padding: 34px 0 44px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
footer.site .wrap { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }
footer.site nav { margin-left: auto; display: flex; gap: 20px; }
footer.site a { color: var(--ink-soft); }

/* ------------------------------------------------------------------ reveals */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }
/* Cascade within a group: kicker, then headline, then lede, then buttons. */
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }

/* Anchored sections land below the sticky header, never underneath it. */
section[id] { scroll-margin-top: 76px; }

/* ------------------------------------------------------------------ motion off */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #glow { display: none; }
  .fbar, .btn, .card, .shot, .toy-bar, .toy-ghost, .toy-tag, .reveal, .mark, .dot,
  .dot::before, header.site { transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .shot { transform: none; }
}
