/*
 * theme.css — Kernel & Grove. Sun-warmed paper, orchard clay and moss —
 * a grower's catalogue, not a supplement label. Both modes derive from the
 * four colours the owner approved: canvas #f3eee3, accent #b5652e,
 * accent-text #755c32, ink #2b2620.
 */

:root {
  --canvas: #f3eee3;
  --surface: #faf7f2;
  --surface-2: #ece1cc;
  --border: #ddd0b4;
  --border-strong: #c1ac86;
  --ink: #2b2620;
  --muted: #68645d;

  --accent: #b5652e;
  --accent-hover: #9c5424;
  --accent-ink: #000000;
  --accent-text: #755c32;
  --accent-strong: #8e4f24;
  --accent-soft: #ecd9bd;
  --accent-border: #d3af7d;

  --success: #4b6b3a;
  --success-ink: #fbfaf3;
  --success-soft: #e2e8d4;
  --success-strong: #3a5a2c;

  --warning: #a8701f;
  --warning-ink: #fff8ee;
  --warning-soft: #f1e1bd;
  --warning-strong: #855814;

  --danger: #9c3d2b;
  --danger-ink: #fff8ee;
  --danger-soft: #f0d9cf;
  --danger-strong: #7d2f20;

  --chart-1: #b5652e;
  --chart-2: #5f7a44;
  --chart-3: #8e4f24;
  --chart-4: #c69a3f;
  --chart-5: #755c32;
  --chart-6: #3f4a2c;

  --font-display: "Fraunces", "Iowan Old Style", ui-serif, Georgia, serif;
  --font-body: "Work Sans", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Work Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --display-weight: 560;
  --display-tracking: -0.01em;
  --eyebrow-tracking: 0.06em;

  --radius-btn: 0.625rem;
  --radius-card: 1.125rem;
  --radius-input: 0.5rem;
  --border-w: 1px;
  --border-strong-w: 1.5px;
  --card-pad: 1.75rem;
  --measure: 66ch;
  --shadow-card: 0 1px 2px color-mix(in srgb, var(--ink) 8%, transparent),
    0 14px 28px -18px color-mix(in srgb, var(--ink) 35%, transparent);
  --shadow-raised: 0 4px 10px color-mix(in srgb, var(--ink) 10%, transparent),
    0 24px 48px -20px color-mix(in srgb, var(--ink) 40%, transparent);
  --shadow-btn: 0 1px 1px color-mix(in srgb, var(--ink) 12%, transparent);

  /* This app's own tokens — the moss band, the hairline rule, the paper grain,
     and the text colour laid over a photograph — fixed regardless of mode,
     because the scrim beneath it is always dark in both. */
  --x-moss: #333b23;
  --x-moss-deep: #262c19;
  --x-moss-ink: #ece4cf;
  --x-moss-line: color-mix(in srgb, var(--x-moss-ink) 22%, transparent);
  --x-hairline: color-mix(in srgb, var(--ink) 14%, transparent);
  --x-grain-a: color-mix(in srgb, var(--ink) 4%, transparent);
  --x-grain-b: color-mix(in srgb, var(--canvas) 100%, transparent);
  --x-photo-ink: #fff8ee;
  --x-photo-line: color-mix(in srgb, var(--x-photo-ink) 55%, transparent);
}

html[data-theme="dark"] {
  --canvas: #201a12;
  --surface: #2a2216;
  --surface-2: #362c1c;
  --border: #473a25;
  --border-strong: #5f4e30;
  --ink: #f1e7d4;
  --muted: #b9ac93;

  --accent: #d0813f;
  --accent-hover: #e0924e;
  --accent-ink: #241407;
  --accent-text: #e2b978;
  --accent-strong: #e2b978;
  --accent-soft: #46351f;
  --accent-border: #6c4f28;

  --success: #8aab6c;
  --success-ink: #16210f;
  --success-soft: #2d3a1f;
  --success-strong: #aecb92;

  --warning: #d19f4c;
  --warning-ink: #241804;
  --warning-soft: #3c2d14;
  --warning-strong: #e2b978;

  --danger: #c37257;
  --danger-ink: #240f08;
  --danger-soft: #3c2016;
  --danger-strong: #e0977c;

  --chart-1: #d0813f;
  --chart-2: #91b374;
  --chart-3: #e2b978;
  --chart-4: #d8c25f;
  --chart-5: #c2a06f;
  --chart-6: #6c7c53;

  --shadow-card: 0 1px 2px color-mix(in srgb, black 30%, transparent),
    0 14px 28px -18px color-mix(in srgb, black 55%, transparent);
  --shadow-raised: 0 4px 10px color-mix(in srgb, black 35%, transparent),
    0 24px 48px -20px color-mix(in srgb, black 60%, transparent);

  --x-moss: #1c2113;
  --x-moss-deep: #14170d;
  --x-moss-ink: #ece4cf;
  --x-moss-line: color-mix(in srgb, var(--x-moss-ink) 18%, transparent);
  --x-hairline: color-mix(in srgb, var(--ink) 16%, transparent);
  --x-grain-a: color-mix(in srgb, black 10%, transparent);
  --x-grain-b: color-mix(in srgb, var(--canvas) 100%, transparent);
  --x-photo-ink: #fff8ee;
  --x-photo-line: color-mix(in srgb, var(--x-photo-ink) 55%, transparent);
}

/*
 * app.css — Kernel & Grove's own screen: the full-bleed photo bands (hero,
 * closing) and their legibility scrims, the header sitting over a photo,
 * and the one hero entrance the brief calls for. Everything else on the
 * page is primitives and utilities.
 */

/* ---- Hero: full-bleed photo with the bar and the headline riding over it.
   The photo sits absolute, behind everything; the scrim is a real ANCESTOR
   of the header and the headline (not a sibling wash) — it carries an
   explicit, opaque background-color as well as its gradient, so the text
   inside it always sits on a solid, measurable ground, in both modes. */
.hero-shell {
  position: relative;
  height: 88vh;
  min-height: 32rem;
  overflow: hidden;
}
.hero-bg-img {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-scrim-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  background-color: color-mix(in srgb, black 52%, transparent);
  background-image: linear-gradient(
    to bottom,
    color-mix(in srgb, black 30%, transparent) 0%,
    color-mix(in srgb, black 8%, transparent) 30%,
    color-mix(in srgb, black 8%, transparent) 50%,
    color-mix(in srgb, black 58%, transparent) 100%
  );
}

/* A control sitting on the photo, not on a card — the theme toggle in the bar.
   Fixed light ink in both modes: the scrim beneath it is always dark. */
.on-photo {
  color: var(--x-photo-ink);
}
.on-photo:hover {
  background: color-mix(in srgb, white 16%, transparent);
  color: var(--x-photo-ink);
}

/* ---- Closing statement: the same device, once more, to close the page. */
.closing-shell {
  position: relative;
  height: 78vh;
  min-height: 28rem;
  overflow: hidden;
}
.closing-bg-img {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.closing-scrim-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background-color: color-mix(in srgb, black 48%, transparent);
  background-image: linear-gradient(
    to bottom,
    transparent 0%,
    color-mix(in srgb, black 18%, transparent) 40%,
    color-mix(in srgb, black 62%, transparent) 100%
  );
}

@media (max-width: 40rem) {
  .hero-shell { height: 76vh; }
  .closing-shell { height: 62vh; }
}

/* ---- Origin strip: a hairline row, not a card grid. */
.origin-col {
  border-color: var(--x-hairline);
}

/* ---- The header's link row never wraps; on a narrow phone it scrolls. */
.nav-links {
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar {
  display: none;
}

/* ---- The one entrance this page uses: the hero headline block, once. */
[data-inview] {
  opacity: 0;
  transform: translateY(22px);
}
[data-inview].is-in {
  opacity: 1;
  transform: none;
  transition: opacity 700ms var(--ease-out, ease-out), transform 700ms var(--ease-out, ease-out);
}
html.reduced-motion [data-inview] {
  opacity: 1;
  transform: none;
  transition: none;
}
