/* HuntLite — shared tokens and layout.
   Granite, spruce and frost are the mountain; blaze orange is the only loud thing on it. */

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin-wdth-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --granite: #dfe4e1;
  --frost: #f3f6f4;
  --spruce: #13221d;
  --spruce-2: #1c302a;
  --lichen: #7d917f;
  --slate: #4c5a54;
  --blaze: #ff6100;
  --blaze-ink: #c44700;

  --bg: var(--granite);
  --surface: var(--frost);
  --ink: var(--spruce);
  --muted: var(--slate);
  --line: color-mix(in srgb, var(--spruce) 14%, transparent);
  --accent-text: var(--blaze-ink);
  --panel: var(--spruce);
  --panel-ink: var(--frost);
  --panel-line: color-mix(in srgb, var(--frost) 14%, transparent);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: linear(0, 0.006, 0.025 2.8%, 0.101 6.1%, 0.539 18.9%, 0.721 25.3%, 0.849 31.5%,
      0.937 38.1%, 0.968 41.8%, 0.991 45.7%, 1.006 50.1%, 1.015 55%, 1.017 63.9%, 1.001 85.9%, 1);

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: 1.75rem;
  --step-3: clamp(2rem, 1.4rem + 2.4vw, 3rem);
  --step-4: clamp(2.75rem, 1.3rem + 6.2vw, 5.75rem);

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --measure: 34rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1815;
    --surface: #15241f;
    --ink: #e9eeeb;
    --muted: #9fb0a8;
    --line: color-mix(in srgb, #e9eeeb 14%, transparent);
    --accent-text: #ff8a40;
    --panel: #1a2c26;
  }
}

@view-transition { navigation: auto; }

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 420 var(--step-0) / 1.55 "Archivo", system-ui, sans-serif;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-stretch: 70%; font-weight: 760; line-height: 0.98; letter-spacing: -0.012em; margin: 0; text-wrap: balance; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); line-height: 1.05; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

.wrap { width: min(100% - 2 * var(--gutter), 76rem); margin-inline: auto; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- header ---------- */

.site-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 1.25rem;
}
.wordmark {
  font-stretch: 68%; font-size: 1.6rem; font-weight: 820; letter-spacing: -0.01em;
  text-decoration: none; display: inline-flex; align-items: baseline;
  view-transition-name: wordmark;
}
.wordmark span { font-weight: 300; }
.wordmark::before {
  content: ""; width: 0.5em; height: 0.5em; margin-right: 0.3em; align-self: center;
  background: var(--blaze); border-radius: 2px;
}
.site-nav { display: flex; align-items: center; gap: clamp(0.75rem, 2.5vw, 1.75rem); font-size: var(--step--1); font-weight: 520; }
.site-nav a { text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }
.site-nav a.hide-sm { display: none; }
@media (min-width: 40rem) { .site-nav a.hide-sm { display: inline; } }

/* ---------- buttons ---------- */

.btn {
  --btn-bg: var(--ink); --btn-fg: var(--bg);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 2.9rem; padding: 0 1.25rem;
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1px solid transparent; border-radius: 0.7rem;
  font: inherit; font-weight: 620; font-size: var(--step-0); text-decoration: none; cursor: pointer;
  transition: transform 0.35s var(--spring), background-color 0.2s, opacity 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.97); transition-duration: 0.08s; }
.btn[disabled] { opacity: 0.55; cursor: default; transform: none; }
.btn.blaze { --btn-bg: var(--blaze); --btn-fg: #1a0a00; }
.btn.quiet { --btn-bg: transparent; --btn-fg: var(--ink); border-color: var(--line); }
.btn.danger { --btn-bg: transparent; --btn-fg: #c0291d; border-color: color-mix(in srgb, #c0291d 45%, transparent); }
.btn.small { min-height: 2.3rem; padding: 0 0.9rem; font-size: var(--step--1); border-radius: 0.55rem; }
@media (prefers-color-scheme: dark) { .btn.danger { --btn-fg: #ff8f84; } }

/* ---------- forms ---------- */

label { display: block; font-size: var(--step--1); font-weight: 560; margin-bottom: 0.4rem; }
.field {
  width: 100%; min-height: 3rem; padding: 0 0.9rem;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 0.7rem;
  font: inherit; font-size: 1.0625rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field:focus { outline: none; border-color: var(--blaze); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blaze) 25%, transparent); }
.form-error { color: #b3261e; font-size: var(--step--1); min-height: 1.4em; margin-top: 0.5rem; }
@media (prefers-color-scheme: dark) { .form-error { color: #ff9a8f; } }

/* ---------- footer ---------- */

.site-foot {
  margin-top: clamp(4rem, 10vw, 8rem); padding-block: 2rem 3rem;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between;
  font-size: var(--step--1); color: var(--muted);
}
.site-foot nav { display: flex; gap: 1.5rem; }

/* ---------- prose pages ---------- */

.prose { max-width: 40rem; padding-block: clamp(2rem, 6vw, 5rem); }
.prose h1 { font-size: var(--step-3); margin-bottom: 1.5rem; }
.prose h2 { font-size: var(--step-1); font-stretch: 85%; line-height: 1.2; margin: 2.2rem 0 0.6rem; }
.prose p, .prose li { margin-bottom: 0.8rem; }
.prose ul { padding-left: 1.2rem; }
.draft-note { border: 1px dashed var(--blaze); border-radius: 0.6rem; padding: 0.7rem 0.9rem; font-size: var(--step--1); margin-bottom: 2rem; }

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

[hidden] { display: none !important; }
