/* ==========================================================================
   Webgoblins — the guild's ledger of styles
   Palette: forge-ink, goblin-gold, moss glow, parchment
   Type: Fraunces (display) / IBM Plex Sans (body)
   ========================================================================== */

:root {
  --ink: #0e1210;
  --ink-deep: #070907;
  --ink-raised: #141a17;
  --line: #262f28;
  --line-soft: #1b211d;
  --parchment: #f1ead9;
  --parchment-dim: #cfc7b3;
  --gold: #d4a537;
  --gold-bright: #f0c65b;
  --moss: #4caf7d;
  --moss-dim: #2f6b4c;
  --muted: #93a099;
  --danger: #c65b4e;

  --font-display: "Fraunces", "Iowan Old Style", serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;

  --measure: 62ch;
  --edge: clamp(1.5rem, 5vw, 4.5rem);
  --radius: 3px;
}

/* ---- Reset --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
body {
  margin: 0;
  background: var(--ink);
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0; letter-spacing: 0.005em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; }

.wrap {
  max-width: 74rem;
  margin: 0 auto;
  padding-left: var(--edge);
  padding-right: var(--edge);
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--gold-bright);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.hairline {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
}

.section {
  padding-top: clamp(3.5rem, 8vw, 6.5rem);
  padding-bottom: clamp(3.5rem, 8vw, 6.5rem);
  border-bottom: 1px solid var(--line);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: clamp(2rem, 5vw, 3.25rem);
}
.section-head h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  max-width: 20ch;
}
.section-head .lede {
  max-width: 34ch;
  color: var(--parchment-dim);
  font-size: 0.98rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 120ms ease, background 150ms ease, border-color 150ms ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--gold);
  color: var(--ink-deep);
}
.btn-primary:hover { background: var(--gold-bright); }
.btn-ghost {
  border-color: var(--line);
  color: var(--parchment);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--moss); color: var(--moss); }

/* ---- Header --------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(14, 18, 16, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.5rem;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}
.brand .mark { width: 28px; height: 28px; flex-shrink: 0; }
.brand .word {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--parchment);
  letter-spacing: 0.01em;
}

.main-nav { display: flex; align-items: center; gap: 2rem; }
.main-nav ul { display: flex; gap: 1.75rem; }
.main-nav a {
  text-decoration: none;
  font-size: 0.93rem;
  color: var(--parchment-dim);
  transition: color 150ms ease;
  position: relative;
}
.main-nav a:hover { color: var(--parchment); }
.header-cta { display: flex; align-items: center; gap: 1rem; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle svg { width: 18px; height: 18px; }

@media (max-width: 860px) {
  .main-nav { position: fixed; inset: 4.5rem 0 0 0; background: var(--ink); flex-direction: column; align-items: stretch; padding: 2rem var(--edge); transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; overflow-y: auto; }
  .main-nav.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav ul li { border-bottom: 1px solid var(--line-soft); }
  .main-nav ul a { display: block; padding: 1.1rem 0; font-size: 1.05rem; }
  .header-cta { flex-direction: column; align-items: stretch; margin-top: 1.5rem; }
  .header-cta .btn { justify-content: center; }
  .nav-toggle { display: inline-flex; }
}

/* ---- Hero ------------------------------------------------------------ */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(60% 55% at 78% 18%, rgba(76, 175, 125, 0.16), transparent 60%),
    radial-gradient(45% 40% at 18% 92%, rgba(212, 165, 55, 0.10), transparent 60%),
    var(--ink);
}
.hero .wrap {
  padding-top: clamp(4rem, 10vw, 7rem);
  padding-bottom: clamp(4rem, 10vw, 7rem);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2rem, 6vw, 4rem);
  align-items: center;
}
.hero-copy .eyebrow { margin-bottom: 1.1rem; }
.hero-copy h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.08;
  max-width: 14ch;
  color: var(--parchment);
}
.hero-copy .sub {
  margin-top: 1.5rem;
  max-width: 46ch;
  font-size: 1.06rem;
  color: var(--parchment-dim);
}
.hero-actions {
  margin-top: 2.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}
.hero-facts {
  margin-top: 2.75rem;
  display: flex;
  gap: 2.25rem;
  flex-wrap: wrap;
}
.hero-facts div { border-left: 1px solid var(--line); padding-left: 0.9rem; }
.hero-facts strong { display: block; font-family: var(--font-display); font-size: 1.35rem; color: var(--gold-bright); }
.hero-facts span { font-size: 0.82rem; color: var(--muted); }

.sigil-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}
.sigil-stage svg { width: min(360px, 90%); height: auto; }
.sigil-glow {
  animation: sigil-pulse 5.5s ease-in-out infinite;
  transform-origin: center;
}
.sigil-flicker { animation: sigil-flicker 5.5s ease-in-out infinite; }
@keyframes sigil-pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.035); }
}
@keyframes sigil-flicker {
  0%, 21%, 24%, 100% { opacity: 1; }
  22% { opacity: 0.75; }
  23% { opacity: 0.95; }
}
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .sigil-stage { order: -1; min-height: 200px; }
  .sigil-stage svg { width: 200px; }
}

/* ---- Services ---------------------------------------------------------- */
.service-list { display: grid; gap: 0; }
.service-row {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 1.75rem;
  align-items: start;
  padding: 1.75rem 0;
  border-top: 1px solid var(--line);
}
.service-row:last-child { border-bottom: 1px solid var(--line); }
.service-row .icon { width: 2.5rem; height: 2.5rem; color: var(--moss); }
.service-row h3 { font-size: 1.25rem; color: var(--parchment); }
.service-row p { color: var(--parchment-dim); font-size: 0.98rem; max-width: 52ch; }
@media (max-width: 700px) {
  .service-row { grid-template-columns: 2.5rem 1fr; }
  .service-row p { grid-column: 2; margin-top: 0.4rem; }
}

/* ---- Process ------------------------------------------------------------ */
.process-rail { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.process-step {
  padding: 0 1.75rem 0 0;
  border-right: 1px solid var(--line);
  position: relative;
}
.process-step:last-child { border-right: none; padding-right: 0; }
.process-step .num {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--gold-bright);
  display: block;
  margin-bottom: 0.9rem;
}
.process-step h3 { font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--parchment); }
.process-step p { font-size: 0.92rem; color: var(--parchment-dim); }
@media (max-width: 780px) {
  .process-rail { grid-template-columns: 1fr 1fr; gap: 2rem 1.5rem; }
  .process-step { border-right: none; padding-right: 0; }
}
@media (max-width: 480px) {
  .process-rail { grid-template-columns: 1fr; }
}

/* ---- Why / value props --------------------------------------------------- */
.why-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.why-cell { background: var(--ink); padding: 1.9rem; }
.why-cell h3 { font-size: 1.05rem; color: var(--gold-bright); margin-bottom: 0.55rem; }
.why-cell p { font-size: 0.94rem; color: var(--parchment-dim); }
@media (max-width: 700px) { .why-grid { grid-template-columns: 1fr; } }

/* ---- Examples / work ------------------------------------------------------ */
.example-note { color: var(--muted); font-size: 0.85rem; margin-top: -1.5rem; margin-bottom: 2.5rem; max-width: 50ch; }
.example-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.example-card {
  border: 1px solid var(--line);
  padding: 1.4rem;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
}
.example-plate { aspect-ratio: 16/10; margin-bottom: 1rem; border: 1px solid var(--line-soft); background: var(--ink-raised); overflow: hidden; }
.example-plate svg { width: 100%; height: 100%; }
.example-card h3 { font-size: 1.02rem; color: var(--parchment); }
.example-card .meta { display: block; margin-top: 0.3rem; font-size: 0.82rem; color: var(--muted); }
@media (max-width: 700px) { .example-grid { grid-template-columns: 1fr; } }

/* ---- Pricing ledger --------------------------------------------------------- */
.ledger-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}
.ledger-controls label { font-size: 0.88rem; color: var(--muted); }
.region-select {
  background: var(--ink-raised);
  border: 1px solid var(--line);
  color: var(--parchment);
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  min-width: 220px;
}
.ledger {
  border: 1px solid var(--line);
  overflow: hidden;
}
.ledger table { width: 100%; border-collapse: collapse; }
.ledger th, .ledger td { text-align: left; padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.ledger thead th { font-size: 0.78rem; color: var(--muted); font-weight: 500; background: var(--ink-raised); }
.ledger tbody tr:last-child td { border-bottom: none; }
.ledger td.tier-name { color: var(--parchment); font-family: var(--font-display); font-size: 1.05rem; width: 30%; }
.ledger td.tier-desc { color: var(--parchment-dim); font-size: 0.92rem; }
.ledger td.tier-price { color: var(--gold-bright); font-size: 1.15rem; white-space: nowrap; text-align: right; }
.ledger-foot { margin-top: 1.1rem; font-size: 0.85rem; color: var(--muted); max-width: 60ch; }

/* ---- Contact ------------------------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(2rem, 5vw, 4rem); }
.contact-side h2 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); max-width: 16ch; }
.contact-side p { margin-top: 1.1rem; color: var(--parchment-dim); max-width: 40ch; }
.contact-detail { margin-top: 2rem; }
.contact-detail dt { font-size: 0.78rem; color: var(--muted); }
.contact-detail dd { margin: 0.2rem 0 1.1rem; font-family: var(--font-display); font-size: 1.1rem; color: var(--parchment); }

.field { margin-bottom: 1.2rem; }
.field label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.5rem; }
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--ink-raised);
  border: 1px solid var(--line);
  color: var(--parchment);
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--moss); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
@media (max-width: 600px) { .field-row, .contact-grid { grid-template-columns: 1fr; } }
.form-status { margin-top: 1rem; font-size: 0.92rem; min-height: 1.3em; }
.form-status.ok { color: var(--moss); }
.form-status.err { color: var(--danger); }
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; }

/* ---- Footer ---------------------------------------------------------------- */
.site-footer { padding-top: clamp(3rem, 6vw, 4rem); padding-bottom: 2.5rem; }
.footer-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2rem; padding-bottom: 2.5rem; }
.footer-brand .brand { margin-bottom: 0.9rem; }
.footer-brand p { color: var(--muted); font-size: 0.9rem; max-width: 32ch; }
.footer-links { display: flex; gap: 3.5rem; flex-wrap: wrap; }
.footer-links h4 { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.9rem; font-weight: 500; }
.footer-links ul li { margin-bottom: 0.55rem; }
.footer-links a { text-decoration: none; font-size: 0.9rem; color: var(--parchment-dim); }
.footer-links a:hover { color: var(--gold-bright); }
.footer-bottom { padding-top: 1.75rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; font-size: 0.82rem; color: var(--muted); }

/* Utility */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
