/* Tea Rex Woodworks — site styles
   Tokens first (light), then dark overrides. Components only use tokens. */

:root {
  --ink: #1c1410;
  --ink-2: #4a3d34;
  --muted: #6f625a;
  --ground: #ede9e0;
  --ground-2: #e3ded3;
  --surface: #f6f3ec;
  --line: #cfc7b9;
  --dark: #261c15;
  --dark-2: #33261d;
  --on-dark: #efe7da;
  --on-dark-muted: #b8a996;
  --accent: #1f6f6b;
  --accent-ink: #ffffff;
  --accent-soft: #d9ebe9;
  --wood: #b07a46;
  --focus: #1f6f6b;
  --shadow: 0 18px 40px -20px rgba(28, 20, 16, .45);
  --logo-invert: 0;

  --display: "Alfa Slab One", "Rockwell", "Roboto Slab", Georgia, serif;
  --body: "Source Sans 3", "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  --measure: 62ch;
  --gutter: clamp(16px, 4vw, 48px);
  --wrap: 1180px;
  --radius: 4px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #efe7da;
    --ink-2: #d5c9b8;
    --muted: #a99b88;
    --ground: #17110e;
    --ground-2: #1f1712;
    --surface: #241b15;
    --line: #3f3128;
    --dark: #0f0b09;
    --dark-2: #1a1310;
    --on-dark: #efe7da;
    --on-dark-muted: #a99b88;
    --accent: #5fb8b1;
    --accent-ink: #0f1c1b;
    --accent-soft: #1d3634;
    --wood: #c8905a;
    --focus: #5fb8b1;
    --shadow: 0 18px 40px -20px rgba(0, 0, 0, .8);
    --logo-invert: 1;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #efe7da;
  --ink-2: #d5c9b8;
  --muted: #a99b88;
  --ground: #17110e;
  --ground-2: #1f1712;
  --surface: #241b15;
  --line: #3f3128;
  --dark: #0f0b09;
  --dark-2: #1a1310;
  --on-dark: #efe7da;
  --on-dark-muted: #a99b88;
  --accent: #5fb8b1;
  --accent-ink: #0f1c1b;
  --accent-soft: #1d3634;
  --wood: #c8905a;
  --focus: #5fb8b1;
  --shadow: 0 18px 40px -20px rgba(0, 0, 0, .8);
  --logo-invert: 1;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-optical-sizing: auto;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
button { font: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.08; margin: 0; text-wrap: balance; letter-spacing: .005em; }
h2 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem); }
h3 { font-size: 1.25rem; font-family: var(--body); font-weight: 700; line-height: 1.25; }
p { margin: 0; max-width: var(--measure); }
.eyebrow {
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--wood);
}
.wrap { width: min(var(--wrap), 100%); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(3.5rem, 6vw, 6.5rem); }
/* Anchor targets clear the sticky header. */
.section, .makes, #quote-form, #top { scroll-margin-top: 72px; }
.section-head { display: grid; gap: .75rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head p { color: var(--ink-2); font-size: 1.125rem; max-width: none; }
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: .5rem .9rem; border-radius: var(--radius);
}
.skip:focus { top: 1rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.25rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  font-weight: 700; text-decoration: none; cursor: pointer;
  line-height: 1.1;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { text-decoration: none; }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn-ghost:hover { text-decoration: none; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); }
.brand img { width: 40px; height: 40px; filter: invert(var(--logo-invert)); }
.brand-name { font-family: var(--display); font-size: 1.05rem; letter-spacing: .02em; line-height: 1; }
.brand-name small { display: block; font-family: var(--mono); font-size: .62rem; letter-spacing: .14em; color: var(--muted); margin-top: .25rem; text-transform: uppercase; }
.nav { display: flex; align-items: center; gap: clamp(.75rem, 2vw, 1.75rem); }
.nav a { color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .95rem; }
.nav a:hover { color: var(--accent); }
.nav .btn { padding: .55rem 1rem; font-size: .9rem; }
.nav-toggle { display: none; }
@media (max-width: 760px) {
  .nav-toggle {
    display: inline-grid; place-items: center; width: 44px; height: 44px;
    background: none; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); cursor: pointer;
  }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: .5rem var(--gutter) 1rem;
  }
  .nav[hidden] { display: none; }
  .nav a { padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .nav .btn { margin-top: .75rem; justify-content: center; border-bottom: 0; }
}

/* ---------- hero ---------- */
.hero { position: relative; background: var(--dark); color: var(--on-dark); overflow: hidden; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; opacity: .92; }
/* Most of this fade is baked into lion-pride-hero.webp (tools/hero-image.py); this is the remainder. */
.hero::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgba(20, 13, 9, .7) 0%, rgba(20, 13, 9, .4) 38%, rgba(20, 13, 9, .08) 70%, rgba(20, 13, 9, .02) 100%),
    linear-gradient(to right, rgba(20, 13, 9, .27), transparent 60%);
}
.hero .wrap {
  position: relative; z-index: 1;
  display: grid; gap: 1.25rem;
  padding-block: clamp(9rem, 22vw, 15rem) clamp(2.5rem, 5vw, 4rem);
}
.hero .eyebrow { color: var(--on-dark-muted); }
.hero h1 {
  font-size: clamp(2.4rem, 1.6rem + 4.6vw, 5rem);
  max-width: 14ch;
  text-shadow: 0 2px 30px rgba(0, 0, 0, .45);
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { font-size: clamp(1.05rem, 1rem + .5vw, 1.3rem); color: var(--on-dark); max-width: 46ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .5rem; }
.hero .btn-ghost { color: var(--on-dark); }
.hero-caption {
  position: absolute; right: var(--gutter); bottom: 1rem; z-index: 1;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--on-dark-muted);
}
@media (max-width: 640px) { .hero-caption { display: none; } }

/* ---------- what we make (strip) ---------- */
.makes { border-bottom: 1px solid var(--line); background: var(--ground-2); }
.makes .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0; }
.makes-item { padding: 1.4rem 1.25rem 1.4rem 0; border-right: 1px solid var(--line); margin-right: 1.25rem; }
.makes-item:last-child { border-right: 0; margin-right: 0; }
.makes-item h3 { font-size: 1.05rem; margin-bottom: .2rem; }
.makes-item p { color: var(--muted); font-size: .95rem; }
@media (max-width: 760px) {
  .makes-item { border-right: 0; margin-right: 0; border-bottom: 1px solid var(--line); padding: 1rem 0; }
  .makes-item:last-child { border-bottom: 0; }
}

/* ---------- gallery ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.75rem; }
.filter {
  background: transparent; color: var(--ink-2); border: 1px solid var(--line);
  border-radius: 999px; padding: .4rem .9rem; cursor: pointer; font-weight: 600; font-size: .9rem;
}
.filter[aria-pressed="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.filter:hover { border-color: var(--ink-2); }
.gallery { columns: 3; column-gap: 1.25rem; }
@media (max-width: 960px) { .gallery { columns: 2; } }
@media (max-width: 560px) { .gallery { columns: 1; } }
.piece {
  break-inside: avoid; margin: 0 0 1.25rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.piece[hidden] { display: none; }
.piece button {
  display: block; width: 100%; padding: 0; margin: 0; border: 0; background: none; cursor: zoom-in; text-align: left; color: inherit;
}
.piece img { width: 100%; max-height: 560px; object-fit: cover; transition: transform .35s ease; }
.piece button:hover img { transform: scale(1.02); }
.piece figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .7rem .9rem .8rem; }
.piece figcaption strong { font-weight: 700; font-size: 1rem; }
.piece figcaption span { font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.gallery-note { margin-top: 1.5rem; color: var(--muted); font-size: .95rem; max-width: none; }

/* ---------- lightbox ---------- */
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(96vw, 1400px); max-height: 96vh; }
.lightbox::backdrop { background: rgba(10, 6, 4, .92); }
.lightbox-inner { display: grid; gap: .75rem; justify-items: center; }
.lightbox img { max-height: 84vh; width: auto; max-width: 96vw; border-radius: var(--radius); box-shadow: var(--shadow); }
.lightbox-bar { display: flex; gap: 1rem; align-items: center; color: #efe7da; font-family: var(--mono); font-size: .85rem; }
.lightbox-bar button {
  background: rgba(255, 255, 255, .1); color: #efe7da; border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 999px; width: 40px; height: 40px; cursor: pointer;
}
.lightbox-bar button:hover { background: rgba(255, 255, 255, .22); }

/* ---------- process ---------- */
.process { background: var(--dark); color: var(--on-dark); }
.process .eyebrow { color: var(--wood); }
.process .section-head p { color: var(--on-dark-muted); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; counter-reset: step; list-style: none; margin: 0; padding: 0; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; max-width: 420px; } }
.step img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); margin-bottom: .5rem; }
.step { border-top: 2px solid var(--wood); padding-top: 1rem; display: grid; gap: .5rem; align-content: start; }
.step::before {
  counter-increment: step; content: "Step " counter(step);
  font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--on-dark-muted);
}
.step h3 { font-family: var(--display); font-weight: 400; font-size: 1.35rem; }
.step p { color: var(--on-dark-muted); font-size: 1rem; }
.process-foot { margin-top: 2.5rem; display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; color: var(--on-dark-muted); }
.process-foot p { max-width: none; }
.process-foot .btn-ghost { color: var(--on-dark); }

/* ---------- shop / about ---------- */
.shop .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
@media (max-width: 860px) { .shop .wrap { grid-template-columns: 1fr; } }
.shop-copy { display: grid; gap: 1rem; }
.shop-copy p { color: var(--ink-2); }
.shop-img { position: relative; }
.shop-img img { border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.shop-img .badge {
  position: absolute; left: -.75rem; bottom: 1.5rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .6rem .9rem; font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2);
  box-shadow: var(--shadow);
}
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: .5rem; padding: 0; list-style: none; }
@media (max-width: 480px) { .facts { grid-template-columns: 1fr; } }
.facts li { border-left: 3px solid var(--accent); padding-left: .8rem; }
.facts strong { display: block; font-weight: 700; }
.facts span { color: var(--muted); font-size: .92rem; }

/* ---------- craft shows ---------- */
.shows { border-top: 1px solid var(--line); }
.shows-photos { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.25rem; }
@media (max-width: 640px) { .shows-photos { grid-template-columns: 1fr; } }
.shows-photos figure { margin: 0; }
.shows-photos img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.shows-photos figure:last-child img { aspect-ratio: 1; object-position: center 40%; }
@media (max-width: 640px) { .shows-photos figure:last-child img { aspect-ratio: 4 / 5; } }
.shows-photos figcaption { margin-top: .6rem; font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* ---------- contact ---------- */
.contact { background: var(--ground-2); border-top: 1px solid var(--line); }
.contact .wrap { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(2rem, 5vw, 5rem); }
@media (max-width: 860px) { .contact .wrap { grid-template-columns: 1fr; } }
.contact-side { display: grid; gap: 1.25rem; align-content: start; }
.contact-side p { color: var(--ink-2); }
.direct-line { font-weight: 700; font-size: 1.15rem; }
.direct-line a { color: var(--ink); text-decoration: none; }
.direct-line a:hover { color: var(--accent); }
.form { display: grid; gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }
.field { display: grid; gap: .35rem; }
.field label { font-weight: 700; font-size: .95rem; }
.field small { color: var(--muted); font-size: .85rem; }
.field input, .field select, .field textarea {
  font: inherit; color: var(--ink); background: var(--ground);
  border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .8rem; width: 100%;
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.form-foot small { color: var(--muted); }
.form-status { padding: .7rem .9rem; border-radius: var(--radius); font-weight: 600; border: 1px solid var(--line); outline: none; }
.form-status.is-ok { background: var(--accent-soft); color: var(--ink); border-color: var(--accent); }
.form-status.is-err { background: var(--surface); color: var(--ink); border-color: var(--wood); }
.honey { position: absolute; left: -9999px; }
.turnstile:empty { display: none; }
.turnstile { margin-top: .25rem; }

/* ---------- footer ---------- */
.site-footer { background: var(--dark); color: var(--on-dark-muted); font-size: .92rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; padding-block: 1.75rem; }
.site-footer a { color: var(--on-dark); }
.site-footer img { width: 34px; height: 34px; opacity: .85; }
.footer-brand { display: flex; align-items: center; gap: .6rem; }
