/* Hearth — hand-rolled, no framework. Brass on a shop floor: dark by
   default, with a light counterpart sharing the same brass accent (the
   palette ninmu-helm uses too). Theme follows the OS unless the visitor
   picks one with the header toggle, which sets :root[data-theme]. */

:root {
  --bg: #16130f;
  --bg-raised: #1f1a14;
  --bg-inset: #120f0b;
  --ink: #e8ddc7;
  --ink-dim: #a89a80;
  --brass: #c98a3a;
  --brass-bright: #e8a94a;
  --rule: #3a3226;
  /* Filled buttons: text on brass. Light theme uses the deeper brass so
     button text keeps readable contrast on a pale page. */
  --btn-bg: var(--brass);
  --btn-bg-hover: var(--brass-bright);
  --on-btn: #16130f;
  --max-width: 42rem;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #fdf6e3;
  --bg-raised: #fffcf3;
  --bg-inset: #f6ecd2;
  --ink: #2c241a;
  --ink-dim: #6f6350;
  --brass: #a9701f;
  --brass-bright: #8a5a12;
  --rule: #e2d4b2;
  --btn-bg: #8a5a12;
  --btn-bg-hover: #a9701f;
  --on-btn: #fffcf3;
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #fdf6e3;
    --bg-raised: #fffcf3;
    --bg-inset: #f6ecd2;
    --ink: #2c241a;
    --ink-dim: #6f6350;
    --brass: #a9701f;
    --brass-bright: #8a5a12;
    --rule: #e2d4b2;
    --btn-bg: #8a5a12;
    --btn-bg-hover: #a9701f;
    --on-btn: #fffcf3;
    color-scheme: light;
  }
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Iowan Old Style", Charter, Georgia, serif;
  line-height: 1.6;
  font-size: 1.05rem;
}

h1, h2, h3, .wordmark {
  font-family: "Courier New", ui-monospace, Menlo, Consolas, monospace;
  color: var(--brass-bright);
  letter-spacing: 0.02em;
}

a {
  color: var(--brass-bright);
}

a:hover {
  color: var(--brass);
}

.site-header {
  border-bottom: 1px solid var(--rule);
  padding: 1rem 1.5rem;
}

.site-nav {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wordmark {
  font-weight: bold;
  text-decoration: none;
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  justify-content: flex-end;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink-dim);
}

.wordmark-by {
  color: var(--ink-dim);
  font-weight: normal;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

@media (max-width: 30rem) {
  .wordmark-by { display: none; }
  .nav-links { gap: 0.4rem 0.9rem; }
}

.theme-toggle {
  background: none;
  border: 1px solid var(--rule);
  color: var(--ink-dim);
  border-radius: 6px;
  cursor: pointer;
  padding: 0.15rem 0.5rem;
  font-size: 0.95rem;
  line-height: 1.4;
}

.theme-toggle:hover {
  color: var(--brass-bright);
  border-color: var(--brass);
}

.nav-links a:hover {
  color: var(--brass-bright);
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.hero {
  text-align: center;
  padding: 2rem 0 1rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2rem;
}

.hero h1 {
  margin: 0 0 0.25rem;
}

.hero-tagline {
  color: var(--ink-dim);
  font-style: italic;
}

.hero-byline {
  color: var(--ink-dim);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0.25rem 0 0;
}

/* Flames inside the letters: a heavy face (thin monospace strokes leave no
   room for anything to show) clipped over two layers that only ever move
   within a closed loop, so the fire never jumps when the animation wraps:
     1. a tall vertical gradient, white-hot yellow at the base fading to
        ember red, slid up and down so the yellow climbs to three different
        heights per cycle (about 44%, 34% and 39% of the letters), always
        staying in the bottom half;
     2. a soft hot spot along the base that sways left and right.
   Every keyframe list starts and ends at the same position. Animating only
   background-position keeps it cheap and avoids `filter`, which breaks
   background-clip:text in some engines. */
.flame-text {
  font-family: "Arial Black", "Helvetica Neue", Impact, system-ui, sans-serif;
  font-weight: 900;
  font-size: clamp(3.25rem, 14vw, 6.5rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: var(--brass-bright); /* fallback if background-clip: text is unsupported */
}

@supports (background-clip: text) or (-webkit-background-clip: text) {
  .flame-text {
    background-image:
      radial-gradient(ellipse 50% 32% at 50% 100%, rgba(255, 250, 215, 0.85) 0%, rgba(255, 214, 102, 0.5) 45%, transparent 75%),
      linear-gradient(0deg, #fff6c2 0%, #ffd25a 12%, #f7a52a 22%, #e0661a 34%, #b23a0c 52%, #6e1a06 75%, #3a0d02 100%);
    background-size: 60% 100%, 100% 200%;
    background-repeat: no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: flame-rise 3.6s ease-in-out infinite;
  }
}

/* Second value of each pair is the gradient's vertical position: 100% puts
   the yellow highest (~44% up the letters), 82% lowest (~26%). */
@keyframes flame-rise {
  0%   { background-position: 30% 100%, 0 82%; }
  16%  { background-position: 75% 100%, 0 100%; }
  33%  { background-position: 55% 100%, 0 84%; }
  50%  { background-position: 15% 100%, 0 90%; }
  66%  { background-position: 45% 100%, 0 83%; }
  83%  { background-position: 85% 100%, 0 95%; }
  100% { background-position: 30% 100%, 0 82%; }
}

@media (prefers-reduced-motion: reduce) {
  .flame-text { animation: none; }
}

.pitch h2 {
  margin-top: 2.5rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.25rem;
}

.post-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-list-item {
  padding: 1.25rem 1.5rem;
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--brass);
  border-radius: 6px;
  transition: border-color 0.15s ease;
}

.post-list-item:hover {
  border-color: var(--brass);
}

.post-list-item a {
  text-decoration: none;
}

.post-list-item h2 {
  margin: 0 0 0.25rem;
}

.post-list-item time,
.post-header time {
  color: var(--ink-dim);
  font-size: 0.9rem;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

.post-header {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.series-marker {
  color: var(--ink-dim);
  font-size: 0.9rem;
}

.post-body pre {
  background: var(--bg-raised);
  padding: 1rem;
  overflow-x: auto;
  border-radius: 4px;
  border: 1px solid var(--rule);
}

.post-body code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

.post-body blockquote {
  border-left: 3px solid var(--brass);
  margin-left: 0;
  padding-left: 1rem;
  color: var(--ink-dim);
}

.post-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.next-post {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  text-decoration: none;
}

.signup-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.signup-form input[type="email"] {
  flex: 1 1 16rem;
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  color: var(--ink);
  padding: 0.6rem 0.75rem;
  border-radius: 4px;
  font-size: 1rem;
}

.signup-form button {
  background: var(--btn-bg);
  border: none;
  color: var(--on-btn);
  font-weight: bold;
  padding: 0.6rem 1.25rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

.signup-form button:hover {
  background: var(--btn-bg-hover);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--rule);
  text-align: center;
}

.footer-signup .signup-form {
  justify-content: center;
}

.footer-note {
  color: var(--ink-dim);
  font-size: 0.85rem;
  margin-top: 1.5rem;
}

/* Shared caption/CTA styles (homepage builds, /preorder/). */

.visual-caption {
  color: var(--ink-dim);
  font-size: 0.85rem;
  font-style: italic;
  margin-top: 0.5rem;
}

.cta-button {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.6rem 1.25rem;
  border-radius: 4px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  text-decoration: none;
  background: var(--btn-bg);
  color: var(--on-btn);
  font-weight: bold;
}

.cta-button:hover {
  background: var(--btn-bg-hover);
  color: var(--on-btn);
}

.cta-button--muted {
  background: transparent;
  border: 1px solid var(--brass);
  color: var(--brass-bright);
}

.cta-button--muted:hover {
  background: var(--bg);
  color: var(--brass-bright);
}

/* /preorder/ page */

.preorder-header {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.preorder-price {
  color: var(--brass-bright);
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

.preorder-body h2 {
  margin-top: 2.5rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.25rem;
}

/* Reservation form (tier + region + email) */

.reserve-form {
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: 6px;
}

.reserve-tier {
  border: none;
  padding: 0;
  margin: 0 0 1rem;
}

.reserve-tier legend {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: var(--brass-bright);
  padding: 0 0 0.5rem;
}

.reserve-tier label {
  display: block;
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.reserve-form select {
  display: block;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--rule);
  color: var(--ink);
  padding: 0.6rem 0.75rem;
  border-radius: 4px;
  font-size: 1rem;
  margin: 0.5rem 0 1rem;
}

.reserve-form input[type="email"] {
  display: block;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--rule);
  color: var(--ink);
  padding: 0.6rem 0.75rem;
  border-radius: 4px;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.reserve-form button {
  background: var(--btn-bg);
  border: none;
  color: var(--on-btn);
  font-weight: bold;
  padding: 0.6rem 1.25rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

.reserve-form button:hover {
  background: var(--btn-bg-hover);
}

/* Post images span the text column exactly, never wider. */
.post-body img {
  display: block;
  width: 100%;
  height: auto;
  margin: 1.5rem 0;
  border-radius: 6px;
}

/* Footer "Get in touch" — sitewide closing line. */
.get-in-touch {
  margin: 2.5rem auto 0;
  max-width: 32rem;
}

.get-in-touch h2 {
  margin: 0 0 0.5rem;
  font-size: 1.3rem;
}

.get-in-touch p {
  margin: 0.5rem 0;
}

.contact-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

.footer-mark {
  display: block;
  margin: 0 auto 0.5rem;
  opacity: 0.85;
}

/* Homepage: the three builds. */
.builds {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
}

.build-card {
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--brass);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
}

.build-card--later {
  border-top-color: var(--rule);
  opacity: 0.85;
}

.build-visual svg {
  display: block;
  width: 100%;
  max-width: 340px;
  height: auto;
  margin: 0 auto 0.75rem;
}

.build-card h3 {
  margin: 0;
  font-size: 1.4rem;
}

.build-price {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: var(--brass-bright);
  font-weight: bold;
  margin: 0.15rem 0 0.5rem;
}

.build-summary {
  margin: 0 0 0.75rem;
}

.build-specs {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.3rem 1rem;
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.build-specs dt {
  color: var(--ink-dim);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  padding-top: 0.1rem;
}

.build-specs dd {
  margin: 0;
}

.build-note {
  color: var(--ink-dim);
  font-size: 0.9rem;
  font-style: italic;
}

@media (max-width: 30rem) {
  .build-specs { grid-template-columns: 1fr; gap: 0 0; }
  .build-specs dd { margin-bottom: 0.4rem; }
}

/* Homepage: "See it run" — a slowly drifting ember gradient, pointing at
   the showcase. No outer glow: it read as noise on the dark theme. */
.see-it-run {
  display: block;
  margin: 2rem 0;
  padding: 1.75rem 1.5rem;
  border-radius: 10px;
  text-decoration: none;
  color: #fff7e8;
  /* Kept deep enough that cream text stays readable at the brightest point. */
  background: linear-gradient(120deg, #4e1204, #9a300a, #b25a14, #6e420c, #4e1204);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  background-size: 300% 300%;
  animation: ember-drift 8s ease-in-out infinite;
}

.see-it-run:hover {
  color: #fff;
}

.see-it-run > span {
  display: block;
}

.see-it-run-eyebrow {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}

.see-it-run-quote {
  font-family: "Courier New", ui-monospace, Menlo, Consolas, monospace;
  font-weight: bold;
  font-size: 1.35rem;
  line-height: 1.3;
  margin: 0.5rem 0 0.75rem;
}

.see-it-run-body {
  opacity: 0.95;
}

.see-it-run-cta {
  margin-top: 1rem;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-weight: bold;
}

@keyframes ember-drift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .see-it-run { animation: none; }
}

/* /preorder/ spec table. Scrolls sideways on narrow screens rather than
   squeezing three columns of specs. */
.builds-compact {
  overflow-x: auto;
  margin: 1rem 0 0.5rem;
}

.builds-compact table {
  border-collapse: collapse;
  width: 100%;
  min-width: 32rem;
  font-size: 0.92rem;
}

.builds-compact th,
.builds-compact td {
  border-bottom: 1px solid var(--rule);
  padding: 0.45rem 0.6rem;
  text-align: left;
  vertical-align: top;
}

/* To-scale drawings above the table: three across, stacking on phones. */
.builds-visuals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.builds-visuals figure {
  margin: 0;
  text-align: center;
}

.builds-visuals svg {
  display: block;
  width: 100%;
  height: auto;
}

.builds-visuals figcaption {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: var(--brass-bright);
  font-size: 0.9rem;
}

.builds-compact thead th {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: var(--brass-bright);
}

.builds-compact tbody th {
  color: var(--ink-dim);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-weight: normal;
  font-size: 0.85rem;
  white-space: nowrap;
}

/* ALTCHA captcha widget: give it our palette in both themes. It sits on
   its own line under the email field. */
altcha-widget {
  --altcha-color-base: var(--bg-raised);
  --altcha-color-text: var(--ink);
  --altcha-color-border: var(--rule);
  --altcha-color-border-focus: var(--brass);
  --altcha-color-footer-bg: var(--bg-inset);
  --altcha-max-width: 100%;
  flex-basis: 100%;
  display: block;
  margin: 0.5rem 0 0;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

.reserve-form altcha-widget {
  margin: 0 0 1rem;
}

/* Posts kept up for the record but no longer how we'd do it
   (front matter `deprecated: "<message>"`). */
.deprecated-banner {
  margin: 0 0 2rem;
  padding: 1.25rem 1.5rem;
  border: 2px solid var(--brass);
  border-left-width: 8px;
  border-radius: 6px;
  background: var(--bg-raised);
  color: var(--brass-bright);
  font-family: "Courier New", ui-monospace, Menlo, Consolas, monospace;
  font-weight: bold;
  font-size: 1.3rem;
  line-height: 1.4;
}

.deprecated-tag {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  font-weight: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  vertical-align: middle;
}
