/* Crucible Creations — shared styles
   Design tokens from handoff-docs/design_handoff_crucible_website/README.md */

/* ---- self-hosted fonts (OFL-licensed; no third-party requests) ---- */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/space-grotesk-var.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/ibm-plex-mono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/ibm-plex-mono-500.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/ibm-plex-mono-600.woff2') format('woff2');
}

:root {
  --bg: #101216;
  --panel: rgba(10, 12, 15, .7);
  --panel-solid: rgba(10, 12, 15, .75);
  --section-tint: rgba(10, 12, 15, .55);
  --border: #262b33;
  --border-strong: #33394a;
  --text: #eef0f4;
  --text-body: #aeb5c2;
  --text-card: #c6ccd7;
  --text-muted: #7d8492;
  --text-nav: #9aa3b2;
  --ember: #ff8a3d;
  --ember-bright: #ffb347;
  --ember-deep: #ff6b1a;
  --ember-pale: #ffe8d6;
  --on-ember: #0b0b0d;
  --grid-line: rgba(120, 130, 150, .05);
  --sans: 'Space Grotesk', sans-serif;
  --mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
}

a { color: var(--ember); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--ember-bright); }

/* visible keyboard focus everywhere; mouse clicks stay clean */
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }

/* ---- animations ---- */
@keyframes cc-pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes cc-ember { 0% { transform: translateY(0); opacity: .9; } 100% { transform: translateY(-110px); opacity: 0; } }
@keyframes cc-flare { 0% { opacity: 0; } 15% { opacity: 1; } 70% { opacity: .85; } 100% { opacity: 0; } }
@keyframes cc-exit-drip {
  to { opacity: 0; transform: translateY(60px) skewY(1deg) scaleY(1.05); filter: blur(8px) brightness(1.7) saturate(1.7); }
}
@keyframes cc-enter-drip {
  from { opacity: 0; transform: translateY(-40px); filter: blur(8px) brightness(1.9) saturate(1.9); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
}

/* ---- page root ---- */
.page {
  min-height: 100vh;
  min-height: 100dvh; /* mobile browsers: exclude dynamic toolbar */
  background: var(--bg);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: cc-enter-drip .55s ease-out both;
}
.page.is-leaving { animation: cc-exit-drip .5s ease-in forwards; }
.page--contact { display: flex; flex-direction: column; }

/* ---- nav ---- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 56px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  position: relative;
}
.nav-brand { display: flex; align-items: center; gap: 12px; position: relative; }
.logo-btn {
  background: none;
  border: none;
  padding: 10px; /* 24px icon + 20px = 44px hit area; negative margin keeps layout */
  margin: -10px;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.wordmark {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .04em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-family: var(--mono);
  font-size: 13px;
}
/* enlarged hit areas (44px min) — negative margins cancel the padding so visual layout is unchanged */
.nav-link { color: var(--text-nav); padding: 14px 8px; margin: -14px -8px; }
.nav-link:hover { color: var(--ember-bright); }
.nav-link[aria-current="page"] { color: var(--ember-bright); }
.nav-link[aria-current="page"]:hover { color: var(--ember-pale); }
.status-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-strong);
  padding: 5px 12px;
  color: var(--text-nav);
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 8px var(--ember-deep);
  animation: cc-pulse 2.4s ease-in-out infinite;
}

/* ---- Fe tile (easter egg) ---- */
.fe-tile {
  position: absolute;
  top: 44px;
  left: 0;
  z-index: 70;
  width: 150px;
  border: 1px solid var(--ember);
  background: #0a0c0f;
  padding: 14px 16px;
  box-shadow: 0 0 26px rgba(255, 107, 26, .45);
  font-family: var(--mono);
  display: none;
}
.fe-tile.is-visible { display: block; }
.fe-tile-corners { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }
.fe-tile-symbol { font-size: 34px; font-weight: 600; color: var(--ember-bright); line-height: 1.2; }
.fe-tile-name { font-size: 12px; color: var(--text-card); }
.fe-tile-meta { font-size: 11px; color: var(--text-muted); margin-top: 8px; line-height: 1.5; }
.fe-tile-meta .molten { color: var(--ember); }

/* ---- stoke flare (easter egg) ---- */
.flare-bg {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 70% at 50% 100%, rgba(255, 107, 26, .55), rgba(255, 107, 26, .15) 55%, transparent 80%);
  animation: cc-flare 2.6s ease-out forwards;
  display: none;
}
.flare-toast {
  position: fixed;
  left: 50%;
  bottom: 64px;
  transform: translateX(-50%);
  z-index: 61;
  pointer-events: none;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: .14em;
  color: var(--ember-pale);
  background: rgba(10, 12, 15, .9);
  border: 1px solid var(--ember);
  padding: 12px 22px;
  box-shadow: 0 0 30px rgba(255, 107, 26, .5);
  animation: cc-flare 2.6s ease-out forwards;
  display: none;
}
.flare-bg.is-active, .flare-toast.is-active { display: block; }

/* ---- hero (Home) ---- */
.hero {
  position: relative;
  padding: 96px 56px 110px;
  overflow: hidden;
  max-width: 1200px;
  margin: 0 auto;
}
.hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 45% 60% at 82% 70%, rgba(255, 107, 26, .20), transparent 70%);
  pointer-events: none;
}
.ember {
  position: absolute;
  border-radius: 50%;
  animation: cc-ember linear infinite;
}
.ember-1 { left: 70%; bottom: 60px; width: 3px; height: 3px; background: var(--ember-bright); animation-duration: 5s; }
.ember-2 { left: 84%; bottom: 40px; width: 2px; height: 2px; background: var(--ember); animation-duration: 6.5s; animation-delay: 1.6s; }
.ember-3 { left: 60%; bottom: 80px; width: 2px; height: 2px; background: #ffd9a0; animation-duration: 5.8s; animation-delay: 3s; }
.hero-inner { display: flex; gap: 64px; align-items: flex-start; }
.hero-copy { flex: 1; }
.kicker {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .16em;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.hero h1 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 64px;
  line-height: 1.04;
  letter-spacing: -.02em;
  margin: 0 0 26px;
}
.accent { color: var(--ember); }
.hero-lede {
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.65;
  color: var(--text-body);
  max-width: 560px;
  margin: 0 0 30px;
  text-wrap: pretty;
}
.cta-row { display: flex; gap: 12px; }
.btn-filled {
  display: inline-block;
  background: var(--ember);
  color: var(--on-ember);
  border: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .1em;
  padding: 13px 26px;
  transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.btn-filled:hover {
  background: var(--ember-bright);
  color: var(--on-ember);
  box-shadow: 0 0 24px rgba(255, 107, 26, .45);
  transform: translateY(-1px);
}
.btn-outlined {
  display: inline-block;
  border: 1px solid var(--border-strong);
  color: var(--text-body);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .1em;
  padding: 13px 26px;
  transition: border-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.btn-outlined:hover {
  border-color: var(--ember);
  color: var(--ember-bright);
  box-shadow: 0 0 18px rgba(255, 107, 26, .25);
}

/* ---- gauges ---- */
.gauges { width: 250px; flex: none; display: grid; gap: 12px; }
.gauge {
  border: 1px solid var(--border-strong);
  background: var(--panel-solid);
  padding: 18px 20px;
}
.gauge-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.gauge-readout {
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 600;
}
.gauge-readout--hot {
  color: var(--ember-bright);
  text-shadow: 0 0 20px rgba(255, 107, 26, .4);
}
.gauge-readout .unit { font-size: 15px; color: var(--text-muted); }
.gauge-bar { height: 4px; background: #1c2027; margin-top: 12px; }
.gauge-bar-fill { height: 100%; width: 86%; background: linear-gradient(90deg, var(--ember-deep), var(--ember-bright)); }

/* ---- sections ---- */
.section { border-top: 1px solid var(--border); }
.section--tint { background: var(--section-tint); }
.section-inner { max-width: 1200px; margin: 0 auto; padding: 64px 56px 72px; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 26px;
  flex-wrap: wrap;
  gap: 12px;
}
.section-head .kicker { margin-bottom: 10px; }
.section h2 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 36px;
  margin: 0;
}
.h2-suffix { color: var(--text-muted); font-weight: 500; font-size: 20px; }
.nominal { font-family: var(--mono); font-size: 12px; color: var(--text-muted); }

/* ---- promise cards ---- */
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card {
  border: 1px solid var(--border-strong);
  background: var(--bg);
  padding: 22px 24px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.card--wide { grid-column: 1 / -1; }
.card-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ember-bright);
  box-shadow: 0 0 10px var(--ember-deep);
  flex: none;
  margin-top: 6px;
  animation: cc-pulse 2.4s ease-in-out infinite;
}
.card-title {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .1em;
  color: var(--ember-bright);
  margin-bottom: 6px;
}
.card-body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-card);
}

/* ---- how we work ---- */
.how-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 56px 72px;
  display: flex;
  gap: 64px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.how-copy { flex: 1; min-width: 420px; }
.how-copy .kicker { margin-bottom: 10px; }
.how-copy h2 { margin: 0 0 18px; }
.how-copy p {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-body);
  margin: 0;
  max-width: 540px;
  text-wrap: pretty;
}
.role-table {
  width: 300px;
  flex: none;
  border: 1px solid var(--border-strong);
  background: var(--panel-solid);
  font-family: var(--mono);
  font-size: 13px;
}
.role-table-head {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  letter-spacing: .14em;
  font-size: 11px;
}
.role-row {
  display: flex;
  justify-content: space-between;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
}
.role-row:last-child { border-bottom: none; }
.role-row .role { color: var(--text-nav); }
.role-row .agents { color: var(--ember-bright); }
.role-row .human { color: var(--text); }

/* ---- contact main ---- */
.contact-main { flex: 1; position: relative; overflow: hidden; }
.contact-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 50% 55% at 50% 115%, rgba(255, 107, 26, .18), transparent 70%);
  pointer-events: none;
}
.contact-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 96px 56px 110px;
  position: relative;
}
.contact-inner h1 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 56px;
  line-height: 1.06;
  letter-spacing: -.02em;
  margin: 0 0 22px;
}
.contact-lede {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-body);
  margin: 0 0 40px;
  text-wrap: pretty;
}
.field-label {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.message-box {
  width: 100%;
  background: var(--panel-solid);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px; /* ≥16px so iOS Safari doesn't zoom on focus */
  line-height: 1.6;
  padding: 16px 18px;
  resize: vertical;
  outline: none;
  transition: border-color .18s ease;
}
.message-box:focus { border-color: var(--ember); }
.message-box:focus-visible { outline: none; } /* border shift is the focus cue here */
.send-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.send-row .btn-filled { padding: 14px 28px; }
.direct-line { font-family: var(--mono); font-size: 13px; color: var(--text-muted); }
.direct-line a { padding: 14px 6px; margin: 0 -6px; } /* inline: enlarges hit area without moving text */
.send-note {
  display: none;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ember-pale);
  margin: 14px 0 0;
  max-width: 560px;
}
.send-note.is-visible { display: block; }

/* ---- footer ---- */
.footer { border-top: 1px solid var(--border); background: var(--panel); }
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-copy { font-family: var(--mono); font-size: 13px; color: var(--text-muted); }
.footer-promise { font-family: var(--mono); font-size: 13px; color: var(--text-nav); }
.footer-links { display: flex; gap: 24px; font-family: var(--mono); font-size: 13px; }

/* ---- small screens ---- */
@media (max-width: 720px) {
  .nav {
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 20px;
  }
  .nav-links { gap: 18px; flex-wrap: wrap; }

  .hero { padding: 56px 20px 72px; }
  .hero-inner { flex-direction: column; gap: 44px; }
  .hero h1 { font-size: 40px; }
  .hero-lede { font-size: 16px; }
  .cta-row { flex-wrap: wrap; }
  .gauges { width: 100%; max-width: 340px; }

  .section-inner { padding: 48px 20px 56px; }
  .section h2 { font-size: 28px; }
  .h2-suffix { font-size: 16px; }
  .card-grid { grid-template-columns: 1fr; }

  .how-inner { padding: 48px 20px 56px; gap: 44px; flex-direction: column; }
  .how-copy { min-width: 0; }
  .role-table { width: 100%; max-width: 340px; }

  .contact-inner { padding: 56px 20px 72px; }
  .contact-inner h1 { font-size: 38px; }
  .contact-lede { font-size: 16px; }

  .footer-inner { padding: 28px 20px; }
}
