/* ==========================================================================
   natemoss — build log
   Warm dark, bone type, one amber accent. Numbers are the heroes.
   Static CSS. No framework. Load speed is a conversion lever here.
   ========================================================================== */

:root {
  /* warm charcoal, deliberately not blue-black and not pure black */
  --ink:        #14120E;
  --ink-2:      #1B1814;
  --ink-3:      #241F1A;

  --bone:       #F4EEE3;
  --bone-dim:   #B8AE9E;
  --bone-faint: #7A7166;

  --amber:      #E9A23B;
  --amber-soft: #F0BE72;

  --rule:       #332C24;

  --sans: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;

  --gut: clamp(1.25rem, 5vw, 3rem);
  --maxw: 1180px;
  --narrow: 668px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.22vw, 1.125rem);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* --- atmosphere: a whisper of grain so the flat dark has tooth --------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: .28;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

/* --- layout ------------------------------------------------------------ */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }
.narrow { max-width: var(--narrow); }

/* A narrow measure that keeps the page's single left edge, rather than
   re-centring itself in the viewport and making the margin wander. */
.wrap.narrow { max-width: var(--maxw); }
.wrap.narrow > * { max-width: var(--narrow); }

.sec {
  padding-block: clamp(4.5rem, 11vw, 9rem);
  border-top: 1px solid var(--rule);
}

/* --- type -------------------------------------------------------------- */
.mono {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.dim { color: var(--bone-faint); }

h2 {
  font-family: var(--serif);
  font-variation-settings: 'SOFT' 0, 'WONK' 1, 'opsz' 90;
  font-weight: 600;
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  line-height: 1.02;
  letter-spacing: -.02em;
  margin-bottom: 1.6rem;
}

h3 {
  font-family: var(--serif);
  font-variation-settings: 'SOFT' 0, 'WONK' 1, 'opsz' 40;
  font-weight: 600;
  font-size: clamp(1.35rem, 1.1rem + 1.05vw, 1.9rem);
  line-height: 1.14;
  letter-spacing: -.015em;
  margin-bottom: 1.1rem;
}

p + p { margin-top: 1.05em; }
p { max-width: 62ch; }

.big  { font-size: 1.2em; line-height: 1.5; color: var(--bone); }
.sub  { color: var(--bone-dim); margin-top: -.5rem; }
.emph { color: var(--amber-soft); }

.daymark {
  color: var(--amber);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .8rem;
}
.daymark::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--rule), transparent);
  max-width: 190px;
}

/* --- hero -------------------------------------------------------------- */
.hero { padding-top: clamp(2.5rem, 7vw, 5rem); padding-bottom: clamp(3rem, 7vw, 5.5rem); }

.hero-id { display: flex; gap: 1.4rem; flex-wrap: wrap; margin-bottom: clamp(3rem, 9vw, 6rem); }
.tag { color: var(--bone); }

.hero-h1 { margin: 0; font-weight: 400; }

.bignum {
  display: block;
  font-family: var(--serif);
  font-variation-settings: 'SOFT' 0, 'WONK' 1, 'opsz' 144;
  font-weight: 700;
  font-size: clamp(6.5rem, 21vw, 17rem);
  line-height: .78;
  letter-spacing: -.055em;
  color: var(--amber);
  margin-left: -.06em;      /* optical: pull the 1 back to the margin */
}

.hero-line {
  display: block;
  font-family: var(--serif);
  font-variation-settings: 'SOFT' 0, 'WONK' 0, 'opsz' 80;
  font-weight: 400;
  font-size: clamp(1.55rem, 1rem + 3.05vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -.022em;
}
.hero-line:first-of-type { margin-top: .42em; }
.hero-line em { font-style: italic; font-variation-settings: 'WONK' 1; color: var(--amber-soft); margin-right: .1em; }

.lede {
  margin-top: 1.9rem;
  max-width: 46ch;
  font-size: clamp(1.02rem, .97rem + .3vw, 1.24rem);
  color: var(--bone-dim);
}

.hero-cta {
  margin-top: 2.4rem;
  display: flex;
  align-items: center;
  gap: 1.6rem 2rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--amber);
  padding: .95em 1.5em;
  border-radius: 2px;
  text-decoration: none;
  transition: background .18s ease, transform .18s ease;
}
.btn:hover { background: var(--amber-soft); transform: translateY(-1px); }

.link-plain {
  color: var(--bone);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
  transition: border-color .18s ease, color .18s ease;
}
.link-plain:hover { color: var(--amber); border-color: var(--amber); }

/* --- images ------------------------------------------------------------ */
.shot-frame {
  background: var(--ink-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
}
.shot-frame img { display: block; width: 100%; height: auto; }

.hero-shot { margin-top: clamp(3rem, 7vw, 5rem); }
.hero-shot figcaption { margin-top: .9rem; text-transform: none; letter-spacing: .02em; font-size: .74rem; line-height: 1.5; max-width: 60ch; }

.shots {
  margin-top: 3rem;
  display: grid;
  /* min() keeps the track from overflowing viewports narrower than the minimum */
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 1.1rem;
}
.shots figcaption { padding: .7rem .9rem; border-top: 1px solid var(--rule); }

.watch { margin-top: 2.4rem; display: flex; gap: 1rem; align-items: baseline; flex-wrap: wrap; }
.watch .mono { text-transform: none; letter-spacing: .02em; }

/* --- decisions --------------------------------------------------------- */
.decisions .wrap.narrow { margin-top: 3.5rem; }

.decision {
  position: relative;
  padding-top: 2.6rem;
  margin-top: 2.6rem;
  border-top: 1px solid var(--rule);
}
.decision:first-child { border-top: 0; margin-top: 0; padding-top: 0; }

.decision .num {
  color: var(--amber);
  margin-bottom: .7rem;
  font-size: .74rem;
}

.decision .outcome {
  margin-top: 1.3rem;
  padding-left: 1.15rem;
  border-left: 2px solid var(--amber);
  color: var(--bone);
}
/* italic terminals crowd the roman letter that follows, so buy back a hair */
.decision .outcome em { color: var(--amber-soft); font-style: italic; margin-right: .09em; }

/* --- method ------------------------------------------------------------ */
.method { background: var(--ink-2); }

blockquote {
  margin-top: 2rem;
  padding: 1.7rem 1.9rem;
  background: var(--ink-3);
  border-left: 3px solid var(--amber);
  border-radius: 2px;
  font-family: var(--serif);
  font-variation-settings: 'SOFT' 20, 'WONK' 1, 'opsz' 40;
  font-size: clamp(1.08rem, 1rem + .5vw, 1.32rem);
  line-height: 1.42;
  letter-spacing: -.008em;
}

/* --- numbers ----------------------------------------------------------- */
.stats {
  margin: 0 0 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 1px;
  /* container stays --ink so a short final row reads as empty space, not as a
     lit cell. The hairlines come from each cell's ring instead. */
  background: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
}
.stats > div {
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--rule);
  padding: 1.4rem 1.5rem;
}
.stats dt { color: var(--bone-faint); margin-bottom: .55rem; line-height: 1.4; }
.stats dd {
  font-family: var(--serif);
  font-variation-settings: 'SOFT' 0, 'WONK' 1, 'opsz' 100;
  font-weight: 600;
  font-size: clamp(2.1rem, 1.6rem + 1.5vw, 3rem);
  line-height: .95;
  letter-spacing: -.03em;
  color: var(--amber);
}
.stats dd span {
  font-family: var(--sans);
  font-size: .85rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--bone-faint);
  margin-left: .28em;
}

/* --- day job ----------------------------------------------------------- */
.also {
  margin-top: 2rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
  color: var(--bone-dim);
}

/* --- footer ------------------------------------------------------------ */
.foot {
  border-top: 1px solid var(--rule);
  padding-block: clamp(3.5rem, 8vw, 6rem);
  background: var(--ink-2);
}
.foot-cta { margin-bottom: 2rem; }
.foot-links { display: flex; gap: 1.6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.foot-links a { color: var(--bone-dim); text-decoration: none; transition: color .18s ease; }
.foot-links a:hover { color: var(--amber); }

/* --- motion ------------------------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: rise .82s cubic-bezier(.22,.61,.36,1) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes rise { to { opacity: 1; transform: none; } }

.sec, .decision, .shots figure {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s cubic-bezier(.22,.61,.36,1), transform .7s cubic-bezier(.22,.61,.36,1);
}
.sec.in, .decision.in, .shots figure.in { opacity: 1; transform: none; }

.shots figure:nth-child(2) { transition-delay: .07s; }
.shots figure:nth-child(3) { transition-delay: .14s; }
.shots figure:nth-child(4) { transition-delay: .21s; }
.shots figure:nth-child(5) { transition-delay: .28s; }
.shots figure:nth-child(6) { transition-delay: .35s; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .sec, .decision, .shots figure { opacity: 1; transform: none; }
}

/* Visible to screen readers only. A link that hijacks the tab should say so;
   sighted users get the same information from the cursor and the new tab itself. */
.vh {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --- utility bar ------------------------------------------------------- */
/* Hidden until the hero leaves the viewport. The research is explicit that a
   single above-fold CTA outperforms a row of links, so this solves findability
   for readers who already scrolled without touching the opening. */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(20, 18, 14, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition: transform .38s cubic-bezier(.22,.61,.36,1),
              opacity .38s cubic-bezier(.22,.61,.36,1),
              visibility 0s linear .38s;
}
.topbar.in {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  transition-delay: 0s, 0s, 0s;
}

.topbar-in {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gut);
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar-name,
.topbar-links a {
  font-family: var(--mono);
  font-size: .69rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
}
.topbar-name { color: var(--bone); }
.topbar-links { display: flex; gap: clamp(.9rem, 3vw, 1.9rem); align-items: center; }
.topbar-links a { color: var(--bone-dim); transition: color .18s ease; }
.topbar-links a:hover { color: var(--bone); }
.topbar-links .topbar-cta { color: var(--amber); }

@media (max-width: 460px) {
  .topbar-name { display: none; }
  .topbar-in { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .topbar { transition: none; }
}

/* --- focus ------------------------------------------------------------- */
a:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --- print ------------------------------------------------------------- */
@media print {
  .grain, .hero-shot, .shots { display: none; }
  body { background: #fff; color: #000; }
}
