/* ───────────────────────────────────────────────────────────────────────────
   Ordersmithy — house design system
   Shared by the homepage and every product page. Page-specific layout lives
   in its own stylesheet; everything that must look the same everywhere lives
   here. Change a token here and the whole site follows.
   ─────────────────────────────────────────────────────────────────────────── */

:root {
  /* Ground — deep navy-black, warm enough that ember sits on it naturally */
  --bg:       #070C14;
  --panel:    #0F1926;
  --panel-2:  #142132;
  --line:     #1E2D42;
  --line-2:   #26374F;

  /* Ink — three levels is enough; a fourth always ends up unreadable */
  --ink:      #F3F7FC;
  --ink-2:    #9DAFC6;
  --ink-3:    #6E82A0;

  /* Ember is the brand: hot metal. Steel is the cool counterpart for data. */
  --accent:     #FF6B2C;
  --accent-2:   #FF8A55;
  --accent-dim: rgba(255, 107, 44, .12);
  --steel:      #5093D6;

  /* Status — semantic only, never decoration */
  --ok:   #35D08A;
  --warn: #FFB020;
  --risk: #FF5A5A;

  /* Type. Archivo carries the headings, Inter the reading, JetBrains the data. */
  --display: Archivo, "Segoe UI", system-ui, sans-serif;
  --sans:    Inter, "Segoe UI", system-ui, sans-serif;
  --mono:    "JetBrains Mono", "Cascadia Mono", SFMono-Regular, Consolas, monospace;

  /* Nothing on this site is allowed below --fs-label (12.5px). Small type that
     cannot be read is not minimal, it is just small. */
  --fs-label: .78rem;
  --fs-small: .9rem;
  --fs-body:  1.0625rem;

  --maxw: 1180px;
  --edge: clamp(1.25rem, 5vw, 3.5rem);

  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* ── Type ──────────────────────────────────────────────────────────────── */

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.025em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); }
h2 { font-size: clamp(1.95rem, 4.2vw, 3.1rem); line-height: 1.08; }
h3 { font-size: clamp(1.2rem, 2vw, 1.45rem); font-weight: 700; letter-spacing: -.015em; line-height: 1.2; }

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

a { color: inherit; }

.lede {
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 62ch;
  text-wrap: pretty;
}

/* The one place uppercase mono belongs: short labels that are scanned, not read. */
.label {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin: 0 0 1rem;
  font-family: var(--mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: .1em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--accent);
}
.label--muted { color: var(--ink-3); }
.label::before {
  content: "";
  width: 6px; height: 6px;
  background: currentColor;
  border-radius: 50%;
  flex: none;
}
.label--bare::before { display: none; }

/* ── Layout ────────────────────────────────────────────────────────────── */

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--edge); }
.section { padding-block: clamp(4.5rem, 9vw, 8rem); }
.section + .section { border-top: 1px solid var(--line); }

/* ── Buttons ───────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 50px;
  padding: .85rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: var(--sans);
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: -.005em;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--accent); color: #140600; }
.btn--primary:hover { background: var(--accent-2); }

.btn--ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink-3); background: var(--panel); }

/* ── Header ────────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(7, 12, 20, .78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); background: rgba(7, 12, 20, .93); }

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: -.02em;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
}
.brand span { color: var(--accent); }
.brand svg { flex: none; margin-right: .55rem; }

.site-nav { display: flex; gap: 1.75rem; }
.site-nav a {
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  transition: color .18s ease;
}
.site-nav a:hover { color: var(--ink); }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  color: var(--ink);
  cursor: pointer;
}
.nav-toggle rect { fill: currentColor; transition: transform .2s ease, opacity .2s ease; transform-origin: center; }
.nav-toggle[aria-expanded="true"] rect:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] rect:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] rect:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; order: 3; }
  .site-header .wrap { flex-wrap: wrap; row-gap: 0; }
  .site-nav {
    order: 4;
    flex-basis: 100%;
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .28s ease;
  }
  .site-nav[data-open] { max-height: 20rem; }
  .site-nav a {
    padding: .95rem .25rem;
    border-top: 1px solid var(--line);
    font-size: 1rem;
  }
  .site-header .btn--sm { order: 2; }
}

/* ── Footer ────────────────────────────────────────────────────────────── */

.site-footer { border-top: 1px solid var(--line); padding-block: 3.5rem 2.5rem; }
.site-footer .wrap { display: grid; gap: 2rem; }
.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  justify-content: space-between;
  color: var(--ink-3);
  font-size: var(--fs-small);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.footer-links a { color: var(--ink-2); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }

/* ── Reveal on scroll ──────────────────────────────────────────────────── */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* ── Focus: visible, always ────────────────────────────────────────────── */

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

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #140600;
  padding: .75rem 1.25rem; z-index: 100; border-radius: 0 0 8px 0;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 0; }
