/* ============================================================
   Cinnabar Foundry — hand-authored stylesheet
   Kiln-charcoal editorial. One accent: cinnabar.
   ============================================================ */

:root {
  --bg: #14100d;            /* kiln charcoal */
  --bg-raise: #1d1712;
  --bg-well: #0f0c0a;
  --fg: #f0e8db;            /* bone */
  --fg-dim: #b3a795;
  --fg-faint: #6f655a;
  --accent: #e84e2a;        /* cinnabar */
  --accent-hi: #ff7047;
  --brass: #cfa050;
  --line: rgba(240, 232, 219, 0.09);
  --line-strong: rgba(240, 232, 219, 0.18);

  --display: "Fraunces", Georgia, serif;
  --sans: "Archivo", "Helvetica Neue", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --maxw: 72rem;
  --section-y: clamp(5rem, 12vw, 8.5rem);

  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #fff; }

img, svg { display: block; max-width: 100%; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent-hi);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1.25rem;
  font-family: var(--mono);
  font-size: 0.875rem;
  text-decoration: none;
}
.skip-link:focus { left: 0.75rem; top: 0.75rem; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- type helpers ---------- */

.mono {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.mono b, .mono strong { color: var(--accent-hi); font-weight: 500; }

.display {
  font-family: var(--display);
  font-weight: 540;
  font-variation-settings: "opsz" 144, "SOFT" 24, "WONK" 1;
  line-height: 0.95;
  letter-spacing: -0.015em;
}

h1, h2, h3 { margin: 0; font-weight: 540; }

.section-title {
  font-family: var(--display);
  font-variation-settings: "opsz" 96, "SOFT" 16, "WONK" 1;
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.lead {
  color: var(--fg-dim);
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  max-width: 56ch;
  text-wrap: pretty;
}

.tnum { font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.9em 1.6em;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.btn:active { transform: translateY(1px); }

.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover { background: var(--accent-hi); }

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line-strong);
}
.btn-ghost:hover { border-color: var(--fg); }

.btn-arrow::after {
  content: "\2192";
  transition: transform 0.18s ease;
}
.btn-arrow:hover::after { transform: translateX(4px); }

/* ---------- nav ---------- */

.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem var(--gutter);
  border-bottom: 1px solid transparent;
  transition: background-color 0.25s ease, border-color 0.25s ease, padding 0.25s ease;
}
.site-nav.scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
  padding-block: 0.7rem;
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  text-decoration: none;
}
.wordmark .glyph {
  font-family: var(--display);
  font-variation-settings: "opsz" 40, "wght" 600, "SOFT" 30, "WONK" 1;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--accent);
}
.wordmark .name {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg);
}
.wordmark .name em {
  font-style: normal;
  color: var(--fg-faint);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.25rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-links a {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fg-dim);
  transition: color 0.18s ease;
}
.nav-links a:hover { color: var(--accent-hi); }

@media (max-width: 720px) {
  .nav-links li.opt { display: none; }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 8rem 0 0;
  overflow: hidden;
}

.hero-grain {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  pointer-events: none;
  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='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

.hero-glow {
  position: absolute;
  inset: -20%;
  pointer-events: none;
  background: radial-gradient(38rem 30rem at var(--hx, 72%) var(--hy, 26%), rgba(232, 78, 42, 0.14), transparent 65%);
  transition: background 0.2s ease;
}

.hero-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.hero-stage { position: relative; }

.hero-word {
  font-family: var(--display);
  font-size: clamp(4.25rem, 17vw, 13.5rem);
  line-height: 0.9;
  letter-spacing: -0.02em;
  font-weight: 500;
  font-variation-settings: "opsz" 144, "wght" 500, "SOFT" 20, "WONK" 1;
  margin: 2.5rem 0 0;
  white-space: nowrap;
}
.hero-word em {
  font-style: italic;
  font-variation-settings: "opsz" 144, "wght" 500, "SOFT" 60, "WONK" 1;
  color: var(--accent);
}

.hero-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-top: clamp(2rem, 5vw, 3.5rem);
  padding-bottom: clamp(2.5rem, 6vw, 4rem);
}

.hero-copy { max-width: 46ch; }
.hero-copy h1 {
  font-family: var(--display);
  font-variation-settings: "opsz" 60, "SOFT" 12, "WONK" 1;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.15;
  margin-bottom: 0.75rem;
  text-wrap: balance;
}
.hero-copy p { color: var(--fg-dim); margin: 0 0 1.75rem; text-wrap: pretty; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 0.875rem; }

.scroll-cue {
  writing-mode: vertical-rl;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fg-faint);
  animation: cue 2.4s ease-in-out infinite;
}
@keyframes cue {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(8px); opacity: 1; }
}
@media (max-width: 720px) { .scroll-cue { display: none; } }

/* ---------- marquee ---------- */

.marquee {
  border-block: 1px solid var(--line);
  background: var(--bg-raise);
  overflow: hidden;
  padding-block: 1.1rem;
}
.marquee-track {
  display: inline-flex;
  gap: 3.5rem;
  white-space: nowrap;
  animation: slide 28s linear infinite;
  will-change: transform;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  font-family: var(--display);
  font-variation-settings: "opsz" 72, "wght" 500, "SOFT" 40, "WONK" 1;
  font-size: 1.8rem;
  color: var(--fg-dim);
}
.marquee-track span.hot { color: var(--accent); }
.marquee-track .sep { color: var(--brass); font-size: 1.1rem; transform: translateY(-0.35em); }
@keyframes slide { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */

section { padding-block: var(--section-y); }

.section-head {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: clamp(3rem, 7vw, 4.5rem);
}

/* ---------- typefaces ---------- */

.face {
  border-top: 1px solid var(--line);
  padding: clamp(2rem, 5vw, 3.25rem) 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem 3rem;
  cursor: pointer;
  transition: background-color 0.25s ease;
}
.face:last-child { border-bottom: 1px solid var(--line); }
.face:hover { background: var(--bg-raise); }
@media (min-width: 860px) {
  .face {
    grid-template-columns: 15rem minmax(0, 1fr);
    padding-inline: clamp(0rem, 2vw, 1.5rem);
  }
}

.face-id { display: flex; flex-direction: column; gap: 0.35rem; }
.face-id .idx { font-family: var(--mono); font-size: 0.75rem; color: var(--fg-faint); letter-spacing: 0.2em; }
.face-id .fname {
  font-family: var(--mono);
  font-size: 0.9375rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.face-id .axes {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--brass);
  letter-spacing: 0.06em;
  margin-top: 0.5rem;
}

.face-sample {
  font-family: var(--display);
  font-size: clamp(2.25rem, 6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 120, "wght" var(--w, 500), "SOFT" var(--s, 20), "WONK" var(--k, 1);
  transition: font-variation-settings 0.45s ease, color 0.45s ease;
}
.face:hover .face-sample { font-variation-settings: "opsz" 144, "wght" var(--wh, 700), "SOFT" var(--sh, 60), "WONK" 1; }
.face.sample-sans .face-sample { font-family: var(--sans); font-variation-settings: "wght" var(--w, 500); letter-spacing: -0.02em; }
.face.sample-sans:hover .face-sample { font-variation-settings: "wght" var(--wh, 650); }
.face.sample-mono .face-sample { font-family: var(--mono); font-size: clamp(1.75rem, 4.5vw, 3.25rem); font-weight: 500; letter-spacing: -0.03em; }
.face .face-blurb {
  grid-column: 1 / -1;
  color: var(--fg-dim);
  max-width: 52ch;
  margin: 0;
}
.face .try {
  grid-column: 1 / -1;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-hi);
}

/* ---------- lab ---------- */

.lab {
  background: var(--bg-well);
  border-block: 1px solid var(--line);
}

.lab-panel {
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--bg-raise);
  overflow: hidden;
}

.lab-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.lab-text {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
.lab-text:focus-visible { outline-offset: -2px; }

.lab-preview {
  padding: clamp(2rem, 6vw, 4rem) 1.5rem;
  min-height: 22vh;
  display: flex;
  align-items: center;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.lab-preview p {
  margin: 0;
  width: 100%;
  font-family: var(--display);
  font-size: clamp(2.5rem, calc(var(--size, 64) * 1vw), 7.5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-weight: calc(var(--wght, 500) * 1);
  font-variation-settings: "opsz" calc(var(--opsz, 72) * 1), "wght" calc(var(--wght, 500) * 1), "SOFT" calc(var(--soft, 20) * 1), "WONK" calc(var(--wonk, 1) * 1);
  overflow-wrap: break-word;
  transition: font-variation-settings 0.12s ease;
}
.lab-preview.invert { background: #ece4d3; color: #1a140e; }

.lab-controls {
  display: grid;
  gap: 1.1rem 2.5rem;
  padding: 1.5rem;
  border-top: 1px solid var(--line);
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

.ctl label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 0.5rem;
}
.ctl output {
  color: var(--accent-hi);
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}
.ctl input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  height: 1.25rem;
  cursor: ew-resize;
}

.lab-toggles { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.toggle {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-dim);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  padding: 0.5em 1em;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}
.toggle[aria-pressed="true"] { color: var(--accent-hi); border-color: var(--accent); }

/* ---------- licensing ---------- */

.plans {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}
.plan {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem 2rem;
  padding: clamp(1.75rem, 4vw, 2.5rem) clamp(0.5rem, 2vw, 1.5rem);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.plan:hover { background: var(--bg-raise); }
.plan.selected { background: var(--bg-raise); box-shadow: inset 3px 0 0 var(--accent); }
@media (min-width: 860px) {
  .plan { grid-template-columns: 14rem 26rem minmax(0, 1fr) auto; align-items: center; }
}
.plan h3 {
  font-family: var(--display);
  font-variation-settings: "opsz" 48, "SOFT" 10, "WONK" 0;
  font-size: 1.75rem;
}
.plan .scope { color: var(--fg-dim); font-size: 0.9375rem; margin: 0; max-width: 40ch; }
.plan .incl {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fg-faint);
  letter-spacing: 0.08em;
  margin: 0;
}
.plan .price {
  font-family: var(--mono);
  font-size: 1.5rem;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  justify-self: start;
}
.plan .price small { font-size: 0.75rem; color: var(--fg-faint); display: block; letter-spacing: 0.1em; }
@media (min-width: 860px) { .plan .price { justify-self: end; } }

/* ---------- studio ---------- */

.studio-grid {
  display: grid;
  gap: 3rem;
}
@media (min-width: 860px) { .studio-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 4rem; } }

.studio-prose p { color: var(--fg-dim); margin: 0 0 1.5rem; text-wrap: pretty; }
.studio-prose p:first-child::first-letter {
  font-family: var(--display);
  font-size: 3.4em;
  float: left;
  line-height: 0.8;
  padding-right: 0.12em;
  color: var(--accent);
  font-variation-settings: "opsz" 144, "wght" 600, "SOFT" 40, "WONK" 1;
}

.facts { margin: 0; display: grid; gap: 1.5rem; }
.facts div { border-top: 1px solid var(--line); padding-top: 0.9rem; }
.facts dt {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 0.3rem;
}
.facts dd { margin: 0; font-size: 1.0625rem; }

/* ---------- mail ---------- */

.mail {
  background: var(--bg-well);
  border-top: 1px solid var(--line);
}
.mail-inner { display: grid; gap: 2.5rem; }
@media (min-width: 860px) { .mail-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4rem; align-items: end; } }

.mail-form { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.45rem; }
.field label {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.field input, .field textarea {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1rem;
  padding: 0.6rem 0.1rem;
  transition: border-color 0.2s ease;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-bottom-color: var(--accent);
}
.field textarea { resize: vertical; min-height: 5rem; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; }
.mail-form .btn { align-self: flex-start; margin-top: 0.5rem; }

/* ---------- footer ---------- */

.site-foot {
  border-top: 1px solid var(--line);
  padding: 3.5rem 0 2.5rem;
}
.foot-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 3rem;
}
.foot-big {
  font-family: var(--display);
  font-variation-settings: "opsz" 90, "SOFT" 30, "WONK" 1;
  font-size: clamp(2.5rem, 8vw, 5rem);
  line-height: 1;
  color: var(--fg-faint);
  letter-spacing: -0.01em;
  width: 100%;
}
.foot-big em { color: var(--accent); font-style: italic; }
.foot-note {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--fg-faint);
}
.foot-note a { color: var(--fg-dim); text-decoration-color: var(--accent); text-underline-offset: 3px; }

/* ---------- reveal ---------- */

.rv {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.6, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.rv.in { opacity: 1; transform: none; }
html.no-motion .rv { opacity: 1; transform: none; transition: none; }

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track { animation: none; }
  .scroll-cue { animation: none; }
  .hero-glow { transition: none; }
}

/* ---------- thanks / 404 ---------- */

.tiny {
  min-height: 70svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding-top: 6rem;
}
.tiny .big {
  font-family: var(--display);
  font-variation-settings: "opsz" 144, "SOFT" 40, "WONK" 1;
  font-size: clamp(3.5rem, 12vw, 9rem);
  line-height: 1;
}
.tiny p { color: var(--fg-dim); max-width: 44ch; margin: 1.5rem auto 2.5rem; }
