/* ==========================================================================
   Anvilshare - Forge Flavor
   Single stylesheet. No frameworks. Hand-written.
   Family law: BRAND-FAMILY.md | Flavor: anvilshare/BRAND.md
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Custom Properties (Flavor Tokens)
   -------------------------------------------------------------------------- */

:root {
  /* Palette */
  --forge-dark: #111009;
  --steel: #1D2228;
  --iron-glow: #C4642C;
  --ember: #E8960E;
  --chalk: #EAE4D8;
  --ash: #6B6560;
  --rule: #2E3238;
  --success: #2E7D52;
  --error: #B03030;

  /* Derived */
  --iron-glow-hover: #A85323;
  --steel-alt: #252D35;

  /* Typography */
  --font-display: "Source Serif 4", Georgia, serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Courier New", monospace;

  /* Type scale: 1.250 Major Third, base 18px */
  --text-xs: 0.64rem;     /* ~11.5px */
  --text-sm: 0.8rem;      /* ~14.4px */
  --text-base: 1rem;      /* 18px */
  --text-md: 1.25rem;     /* 22.5px */
  --text-lg: 1.563rem;    /* ~28px */
  --text-xl: 1.953rem;    /* ~35px */
  --text-2xl: 2.441rem;   /* ~44px */
  --text-3xl: 3.052rem;   /* ~55px */

  /* Spacing (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Layout */
  --max-width: 1200px;
  --max-line: 62ch;
  --baseline: 8px;
  --radius: 4px;
  --radius-none: 0px;

  /* Shadows (dark ground values) */
  --shadow-rest: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.25);

  /* Focus */
  --focus-ring: 2px solid var(--iron-glow);
  --focus-offset: 2px;
}

/* --------------------------------------------------------------------------
   2. Reset + Base
   -------------------------------------------------------------------------- */

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

html {
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0.01em;
  color: var(--chalk);
  background-color: var(--forge-dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--iron-glow);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

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

a:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
  border-radius: 2px;
}

::selection {
  background-color: var(--iron-glow);
  color: var(--forge-dark);
}

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--chalk);
  text-align: left;
}

h1 {
  font-size: var(--text-2xl);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-6);
}

h2 {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-5);
}

h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

h4 {
  font-size: var(--text-md);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

p {
  max-width: var(--max-line);
  margin-bottom: var(--space-5);
}

p:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: 600;
}

small {
  font-size: var(--text-sm);
  color: var(--ash);
}

.mono {
  font-family: var(--font-mono);
  font-weight: 400;
}

.mono-price {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--iron-glow);
}

.text-muted {
  color: var(--ash);
}

.text-ember {
  color: var(--ember);
}

/* --------------------------------------------------------------------------
   4. Layout
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.section {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

.section-sm {
  padding-top: var(--space-10);
  padding-bottom: var(--space-10);
}

/* Wright pencil line */
.rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 0;
}

.rule-section {
  border: none;
  border-top: 1px solid var(--rule);
  margin: var(--space-16) 0;
}

/* Grid: Wright triplet (3-column) */
.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

/* --------------------------------------------------------------------------
   5. Header + Navigation
   -------------------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--rule);
  padding: var(--space-4) 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.site-logo {
  display: block;
  height: 40px;
  width: auto;
  flex-shrink: 0;
}

.site-logo:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav a {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ash);
  text-decoration: none;
  white-space: nowrap;
  padding: var(--space-1) 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--iron-glow);
  border-bottom-color: var(--iron-glow);
}

.site-nav a:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.15s ease;
  padding: var(--space-3) var(--space-6);
}

.btn:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

.btn-primary {
  background-color: var(--iron-glow);
  color: var(--forge-dark);
}

.btn-primary:hover {
  background-color: var(--iron-glow-hover);
  color: var(--forge-dark);
}

.btn-secondary {
  background-color: transparent;
  color: var(--chalk);
  border: 1px solid var(--rule);
}

.btn-secondary:hover {
  border-color: var(--ash);
  color: var(--chalk);
}

.btn-ghost {
  background-color: transparent;
  color: var(--iron-glow);
  padding: var(--space-2) var(--space-4);
}

.btn-ghost:hover {
  color: var(--ember);
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-8);
}

/* --------------------------------------------------------------------------
   7. Cards + Surfaces
   -------------------------------------------------------------------------- */

.card {
  background-color: var(--steel);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--space-8);
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.card-icon {
  color: var(--iron-glow);
  flex-shrink: 0;
}

.callout {
  background-color: var(--steel);
  border-left: 3px solid var(--iron-glow);
  padding: var(--space-6) var(--space-8);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.callout p {
  max-width: var(--max-line);
}

.surface-alt {
  background-color: var(--steel);
}

/* --------------------------------------------------------------------------
   8. Tables (zebra - steel/forge alternating)
   -------------------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-base);
}

thead th {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
  text-align: left;
  color: var(--ash);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--rule);
}

tbody td {
  padding: var(--space-4);
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}

tbody tr:nth-child(odd) {
  background-color: var(--steel);
}

tbody tr:nth-child(even) {
  background-color: var(--forge-dark);
}

td .mono-price {
  font-size: var(--text-md);
}

/* --------------------------------------------------------------------------
   9. Hero
   -------------------------------------------------------------------------- */

.hero {
  padding-top: var(--space-20);
  padding-bottom: var(--space-16);
}

.hero h1 {
  font-size: var(--text-2xl);
  max-width: 20ch;
}

.hero .subhead {
  font-size: var(--text-md);
  color: var(--ash);
  max-width: var(--max-line);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   10. How-it-works triplet
   -------------------------------------------------------------------------- */

.step-number {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--iron-glow);
  font-weight: 500;
  margin-bottom: var(--space-2);
}

/* --------------------------------------------------------------------------
   11. FAQ
   -------------------------------------------------------------------------- */

.faq-item {
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--rule);
}

.faq-item:first-child {
  border-top: 1px solid var(--rule);
}

.faq-q {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--chalk);
  margin-bottom: var(--space-3);
}

.faq-a {
  color: var(--ash);
  max-width: var(--max-line);
}

.faq-a p {
  color: var(--ash);
}

/* --------------------------------------------------------------------------
   12. Mira tease panel
   -------------------------------------------------------------------------- */

.mira-panel {
  background-color: var(--steel);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--space-6) var(--space-8);
}

.mira-panel h3 {
  font-size: var(--text-md);
  color: var(--ash);
}

.mira-panel.mira-disabled {
  opacity: 0.5;
}

/* --------------------------------------------------------------------------
   13. Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: var(--space-10) 0;
  font-size: var(--text-sm);
  color: var(--ash);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-6);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  list-style: none;
}

.footer-links a {
  color: var(--ash);
  font-size: var(--text-sm);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--iron-glow);
}

/* --------------------------------------------------------------------------
   14. Utility classes
   -------------------------------------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }

/* --------------------------------------------------------------------------
   15. Focus + Accessibility
   -------------------------------------------------------------------------- */

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--iron-glow);
  color: var(--forge-dark);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius);
  font-weight: 600;
  z-index: 1000;
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-2);
}

/* --------------------------------------------------------------------------
   16. Reduced motion
   -------------------------------------------------------------------------- */

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

/* --------------------------------------------------------------------------
   17. Print styles
   -------------------------------------------------------------------------- */

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .site-header,
  .site-footer,
  .btn,
  .cta-group,
  .mira-panel {
    display: none;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #555;
  }

  h1, h2, h3, h4 {
    color: #000;
    page-break-after: avoid;
  }

  .card,
  .callout,
  .surface-alt {
    background: #fff;
    border: 1px solid #ccc;
    box-shadow: none;
  }

  table {
    border: 1px solid #ccc;
  }

  tbody tr:nth-child(odd) {
    background: #f5f5f5;
  }

  tbody tr:nth-child(even) {
    background: #fff;
  }
}

/* --------------------------------------------------------------------------
   18. Responsive - Mobile first
   -------------------------------------------------------------------------- */

/* Tablet: 640px+ */
@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }

  .hero h1 {
    font-size: var(--text-2xl);
  }
}

/* Desktop: 900px+ */
@media (min-width: 900px) {
  .grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .hero {
    padding-top: var(--space-24);
    padding-bottom: var(--space-20);
  }

  .hero h1 {
    font-size: var(--text-3xl);
    max-width: 22ch;
  }

  .hero .subhead {
    font-size: var(--text-md);
  }

  .container {
    padding-left: var(--space-10);
    padding-right: var(--space-10);
  }
}

/* Wide: 1200px+ */
@media (min-width: 1200px) {
  .container {
    padding-left: var(--space-12);
    padding-right: var(--space-12);
  }
}
