/* ==========================================================================
   Hem & Light Studio

   Light, warm, photography-forward. Built against her own references —
   Anxious Girl Knits, The Golden Thread Shop, The Tiny Tassel — all of which
   are cream-or-white ground with one bright accent colour doing the work,
   never a saturated field. Coral carries the accent weight; yellow, grass and
   teal support it, pulled from the register of the fabric designers she names
   (Tula Pink, Riley Blake, Ruby Star Society): bold prints on a light ground.

   Plain CSS with custom properties on purpose: this file has to survive being
   dropped into an Astro project verbatim, so there is no preprocessor syntax
   and no utility framework anywhere in it.

   Every text-on-colour pair in the token block below was measured, not
   eyeballed. Run `python3 scripts/check-contrast.py` after touching any colour.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fonts

   A warm rounded display for headlines and the wordmark, a warm humanist sans
   for reading. A handwritten script is a third voice, used sparingly, for a
   note in her own hand: a pull-quote attribution, a small "hi, I'm Kelsey"
   aside. All three are variable and self-hosted from public/assets/fonts
   (SIL OFL, licences shipped beside them).
   -------------------------------------------------------------------------- */

@font-face {
  font-family: 'Baloo 2';
  src: url('../assets/fonts/baloo2-var-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Caveat';
  src: url('../assets/fonts/caveat-var-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Hanken Grotesk';
  src: url('../assets/fonts/hanken-grotesk-var-latin.woff2') format('woff2');
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   2. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* -- Colour ------------------------------------------------------------
     Measured ratios (scripts/check-contrast.py):
       ink on cream .................. 12.9:1
       ink on card ................... 13.3:1
       ink-soft on cream .............. 6.2:1
       on-dark on coral ............... 4.8:1
       on-dark on coral-deep .......... 6.4:1
       on-dark on grass-deep .......... 5.3:1
       coral-deep on cream ............ 6.4:1
       rule on cream ................... 3.2:1 */

  --cream: oklch(0.975 0.012 55);
  --cream-deep: oklch(0.945 0.018 50);
  --card: oklch(0.985 0.006 55);

  --ink: oklch(0.300 0.045 30);
  --ink-soft: oklch(0.480 0.035 30);

  --rule: oklch(0.640 0.034 50);
  --rule-soft: oklch(0.860 0.022 50);

  --coral: oklch(0.560 0.195 22);
  --coral-deep: oklch(0.490 0.190 20);
  --coral-tint: oklch(0.930 0.035 25);

  --yellow: oklch(0.865 0.155 92);
  --yellow-deep: oklch(0.760 0.150 85);

  --grass: oklch(0.620 0.145 148);
  --grass-deep: oklch(0.500 0.125 148);

  --teal: oklch(0.550 0.085 212);
  --teal-deep: oklch(0.440 0.075 220);

  --on-dark: oklch(0.975 0.012 55);

  /* -- Type -------------------------------------------------------------- */
  --font-display: 'Baloo 2', 'Segoe UI Rounded', -apple-system, sans-serif;
  --font-script: 'Caveat', cursive;
  --font-label: 'Baloo 2', -apple-system, sans-serif;
  --font-body: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Fluid on the display steps, fixed at the reading end. A ~1.3 ratio with
     five steps, not eight steps a tenth apart. */
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: clamp(1.25rem, 1.13rem + 0.55vw, 1.5rem);
  --step-2: clamp(1.65rem, 1.36rem + 1.35vw, 2.35rem);
  --step-3: clamp(2.1rem, 1.53rem + 2.7vw, 3.5rem);
  --step-4: clamp(2.6rem, 1.72rem + 4.2vw, 4.6rem);

  --lh-tight: 1.08;
  --lh-snug: 1.25;
  --lh-body: 1.6;
  --measure: 66ch;

  /* -- Space ------------------------------------------------------------- */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  --section-y: clamp(3rem, 2rem + 5vw, 6rem);
  --gutter: clamp(1.25rem, 0.9rem + 1.8vw, 2.5rem);
  --wrap: 74rem;

  /* -- Form ------------------------------------------------------------- */
  --radius-card: 20px;
  --radius-chip: 12px;
  --radius-pill: 999px;
  --tap: 44px;

  /* A soft, warm shadow: a card lifted a little off cream paper. Low-opacity
     and ink-tinted rather than grey, so it never reads as generic UI chrome. */
  --lift: 0 1px 2px oklch(0.3 0.05 30 / 0.06), 0 8px 20px oklch(0.3 0.05 30 / 0.08);
  --lift-lg: 0 4px 10px oklch(0.3 0.05 30 / 0.08), 0 24px 48px oklch(0.3 0.05 30 / 0.14);

  /* -- Motion ------------------------------------------------------------
     emil-design-eng. Custom curves; the built-in easings are too weak. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
  --t-panel: 240ms;
}

/* --------------------------------------------------------------------------
   3. Base
   -------------------------------------------------------------------------- */

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

* {
  margin: 0;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: var(--lh-body);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

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

img {
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

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

.header :focus-visible,
.footer :focus-visible {
  outline-color: var(--yellow-deep);
}

::selection {
  background: var(--yellow);
  color: var(--ink);
}

/* Custom elements are inline by default, which would let the header, footer
   and catalogue collapse before their content upgrades. */
site-header,
site-footer,
pennant-heading,
category-tiles,
product-catalog {
  display: block;
}

/* --------------------------------------------------------------------------
   4. Type
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  text-wrap: balance;
}

h1 {
  font-size: var(--step-4);
  font-weight: 800;
}

h2 {
  font-size: var(--step-3);
  font-weight: 800;
}

h3 {
  font-size: var(--step-2);
}

h4 {
  font-size: var(--step-1);
}

p,
li {
  text-wrap: pretty;
}

.lede {
  font-size: var(--step-1);
  line-height: 1.5;
  max-width: 46ch;
  color: var(--ink-soft);
}

.prose {
  max-width: var(--measure);
}

.prose > * + * {
  margin-top: var(--space-md);
}

.prose h3,
.prose h4 {
  margin-top: var(--space-xl);
  color: var(--ink);
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
}

.prose li + li {
  margin-top: var(--space-2xs);
}

/* Small caps-style labels: class numbers, availability, category eyebrows.
   Rounded display font at small size reads as a friendly tag, not a stamp. */
.label {
  font-family: var(--font-label);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.label--lg {
  font-size: var(--step-0);
}

.eyebrow {
  font-family: var(--font-label);
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--coral-deep);
  letter-spacing: 0.02em;
}

.muted {
  color: var(--ink-soft);
}

/* A note in her own hand. Used once or twice a page, never for reading. */
.script {
  font-family: var(--font-script);
  font-weight: 600;
  font-size: var(--step-2);
  line-height: 1.15;
  color: var(--coral-deep);
}

a {
  color: var(--coral-deep);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
}

@media (hover: hover) and (pointer: fine) {
  a:hover {
    text-decoration-thickness: 2.5px;
  }
}

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

.skip-link {
  position: absolute;
  top: var(--space-2xs);
  left: var(--space-2xs);
  z-index: 100;
  padding: var(--space-2xs) var(--space-sm);
  background: var(--coral);
  color: var(--on-dark);
  font-family: var(--font-label);
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius-chip);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   5. Layout
   -------------------------------------------------------------------------- */

.wrap {
  width: min(100% - (var(--gutter) * 2), var(--wrap));
  margin-inline: auto;
}

.wrap--narrow {
  width: min(100% - (var(--gutter) * 2), 52rem);
  margin-inline: auto;
}

.section {
  padding-block: var(--section-y);
}

.section--tint {
  background: var(--cream-deep);
}

.stack-lg > * + * {
  margin-top: var(--space-lg);
}

.stack-md > * + * {
  margin-top: var(--space-md);
}

.stack-sm > * + * {
  margin-top: var(--space-sm);
}

/* A thin gingham-check rule: two of the palette's colours in a two-cell check,
   the closest thing to her actual fabric on a divider. Tiny and quiet, never
   a full background pattern. */
.check-rule {
  height: 6px;
  border: 0;
  border-radius: var(--radius-pill);
  background-image:
    linear-gradient(45deg, var(--coral-tint) 25%, transparent 25%, transparent 75%, var(--coral-tint) 75%),
    linear-gradient(45deg, var(--coral-tint) 25%, transparent 25%, transparent 75%, var(--coral-tint) 75%);
  background-size: 12px 12px;
  background-position: 0 0, 6px 6px;
  background-color: var(--cream-deep);
  margin-block: var(--space-xl);
  width: 4rem;
}

/* --------------------------------------------------------------------------
   7. Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  min-height: var(--tap);
  padding: var(--space-2xs) var(--space-lg);
  border: 0;
  border-radius: var(--radius-pill);
  font-family: var(--font-label);
  font-size: var(--step-0);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--t-press) var(--ease-out),
    background-color var(--t-hover) ease, box-shadow var(--t-hover) ease,
    color var(--t-hover) ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: var(--coral);
  color: var(--on-dark);
  box-shadow: var(--lift);
}

.btn--secondary {
  background: var(--card);
  color: var(--ink);
  border: 2px solid var(--rule-soft);
}

.btn--quiet {
  background: transparent;
  color: var(--coral-deep);
  padding-inline: var(--space-sm);
}

@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover {
    background: var(--coral-deep);
  }

  .btn--secondary:hover {
    border-color: var(--coral);
    color: var(--coral-deep);
  }

  .btn--quiet:hover {
    background: var(--coral-tint);
  }
}

/* --------------------------------------------------------------------------
   8. Header
   -------------------------------------------------------------------------- */

.header {
  background: var(--cream);
  color: var(--ink);
  border-bottom: 1px solid var(--rule-soft);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: 68px;
  padding-block: var(--space-2xs);
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  text-decoration: none;
  color: var(--ink);
  padding: var(--space-3xs) 0;
}

.header__logo svg {
  height: 34px;
  width: auto;
}

.header__nav {
  display: none;
}

.header__toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  min-height: var(--tap);
  padding: var(--space-2xs) var(--space-xs);
  background: transparent;
  color: inherit;
  border: 2px solid var(--rule-soft);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: transform var(--t-press) var(--ease-out),
    background-color var(--t-hover) ease;
}

.header__toggle:active {
  transform: scale(0.97);
}

.header__burger {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  position: relative;
}

.header__burger::before,
.header__burger::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transition: transform var(--t-panel) var(--ease-out);
}

.header__burger::before {
  top: -6px;
}

.header__burger::after {
  top: 6px;
}

.header__toggle[aria-expanded='true'] .header__burger {
  background: transparent;
}

.header__toggle[aria-expanded='true'] .header__burger::before {
  transform: translateY(6px) rotate(45deg);
}

.header__toggle[aria-expanded='true'] .header__burger::after {
  transform: translateY(-6px) rotate(-45deg);
}

/* grid-template-rows animates without touching height, so the panel opens
   without a layout-thrashing height transition. */
.header__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--t-panel) var(--ease-out);
  background: var(--card);
  border-bottom: 1px solid var(--rule-soft);
}

.header__panel[data-open='true'] {
  grid-template-rows: 1fr;
}

.header__panel > div {
  overflow: hidden;
}

.header__panel ul {
  list-style: none;
  padding: var(--space-sm) 0 var(--space-md);
  margin: 0;
}

.header__panel a:not(.btn) {
  display: block;
  min-height: var(--tap);
  padding: var(--space-xs) 0;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-soft);
  font-family: var(--font-label);
  font-weight: 600;
  font-size: var(--step-1);
}

.header__panel a[aria-current='page'] {
  color: var(--coral-deep);
  border-bottom-color: var(--coral);
}

.header__panel a[aria-current='page']::before {
  content: '';
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--coral);
  margin-right: var(--space-2xs);
  vertical-align: 0.05em;
}

.header__panel-cta {
  padding-top: var(--space-sm);
  border-bottom: 0 !important;
}

@media (min-width: 60rem) {
  .header__toggle {
    display: none;
  }

  .header__panel {
    display: none;
  }

  .header__nav {
    display: flex;
    align-items: center;
    gap: var(--space-md);
  }

  .header__nav ul {
    display: flex;
    align-items: center;
    gap: var(--space-2xs);
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .header__nav a:not(.btn) {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    padding: 0 var(--space-sm);
    color: var(--ink);
    text-decoration: none;
    font-family: var(--font-label);
    font-weight: 600;
    font-size: var(--step-0);
    border-radius: var(--radius-pill);
    position: relative;
    transition: background-color var(--t-hover) ease, color var(--t-hover) ease;
  }

  /* The tinted pill alone was too quiet to read as "you are here" against
     cream. The solid rule under it is the part that actually registers. */
  .header__nav a[aria-current='page'] {
    color: var(--coral-deep);
    background: var(--coral-tint);
  }

  .header__nav a[aria-current='page']::after {
    content: '';
    position: absolute;
    left: var(--space-sm);
    right: var(--space-sm);
    bottom: 0.35rem;
    height: 2px;
    border-radius: 2px;
    background: var(--coral);
  }

  @media (hover: hover) and (pointer: fine) {
    .header__nav a:not(.btn):not([aria-current='page']):hover {
      background: var(--cream-deep);
    }
  }
}

/* --------------------------------------------------------------------------
   9. Footer
   -------------------------------------------------------------------------- */

.footer {
  background: var(--cream-deep);
  color: var(--ink);
  border-top: 1px solid var(--rule-soft);
  padding-block: var(--space-xl) var(--space-lg);
  margin-top: var(--section-y);
}

.footer__grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.footer__mark {
  color: var(--ink);
  max-width: 13rem;
}

.footer__blurb {
  margin-top: var(--space-sm);
  max-width: 26ch;
}

.footer h2 {
  font-family: var(--font-label);
  font-size: var(--step-0);
  font-weight: 700;
  color: var(--coral-deep);
  margin-bottom: var(--space-xs);
}

.footer ul {
  list-style: none;
  padding: 0;
}

.footer li + li {
  margin-top: var(--space-3xs);
}

.footer a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--ink);
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .footer a:hover {
    color: var(--coral-deep);
    text-decoration: underline;
    text-decoration-thickness: 2px;
  }
}

.footer__base {
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  border-top: 1px solid var(--rule-soft);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-md);
  justify-content: space-between;
  align-items: center;
  color: var(--ink-soft);
  font-size: var(--step--1);
}

.footer__base .script {
  font-size: var(--step-1);
}

.footer__credit {
  font-size: var(--step--1);
}

.footer__credit a {
  min-height: 0;
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .footer__credit a:hover {
    color: var(--coral-deep);
  }
}

/* --------------------------------------------------------------------------
   10. Hero
   -------------------------------------------------------------------------- */

.hero {
  padding-block: var(--space-xl) var(--section-y);
  overflow: hidden;
}

.hero__grid {
  display: grid;
  gap: var(--space-xl);
  align-items: center;
}

@media (min-width: 60rem) {
  .hero__grid {
    grid-template-columns: 0.95fr 1.05fr;
    gap: var(--space-2xl);
  }
}

.hero h1 {
  margin-bottom: var(--space-md);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.hero__photo {
  position: relative;
  isolation: isolate;
}

.hero__photo figure {
  margin: 0;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--lift-lg);
}

/* A small handwritten note tucked at the photo's corner, the way a card would
   be tucked into a gift. Stands in for a real caption until photography ships. */
.hero__note {
  position: absolute;
  right: calc(var(--space-lg) * -1);
  bottom: calc(var(--space-lg) * -1);
  max-width: 12rem;
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--lift);
  padding: var(--space-sm) var(--space-md);
  rotate: -3deg;
  z-index: 2;
}

@media (max-width: 40rem) {
  .hero__note {
    right: 0;
    bottom: calc(var(--space-md) * -1);
    max-width: 10rem;
    padding: var(--space-xs) var(--space-sm);
  }
}

/* --------------------------------------------------------------------------
   11. Product card
   -------------------------------------------------------------------------- */

.tag {
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius-card);
  padding: var(--space-sm) var(--space-md);
  box-shadow: var(--lift);
}

.tag__class {
  font-family: var(--font-label);
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--coral-deep);
}

.tag__title {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 700;
  line-height: var(--lh-snug);
  margin-top: var(--space-3xs);
}

/* --------------------------------------------------------------------------
   12. Catalogue
   -------------------------------------------------------------------------- */

.catalog {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  list-style: none;
  padding: 0;
}

.product {
  background: var(--card);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  box-shadow: var(--lift);
  transition: transform var(--t-hover) var(--ease-out),
    box-shadow var(--t-hover) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .product:hover {
    transform: translateY(-4px);
    box-shadow: var(--lift-lg);
  }
}

.product:has(a:active) {
  transform: scale(0.985);
}

.product__media {
  aspect-ratio: 1 / 1;
  background: var(--cream-deep);
}

.product__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product__body {
  padding: var(--space-sm) var(--space-md) var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  flex: 1;
}

.product__title {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 700;
  line-height: var(--lh-snug);
  margin: 0;
}

.product__title a {
  color: inherit;
  text-decoration: none;
}

.product__title a::after {
  content: '';
  position: absolute;
  inset: 0;
}

.product__blurb {
  font-size: var(--step--1);
  color: var(--ink-soft);
  margin: 0;
}

.product__foot {
  margin-top: auto;
  padding-top: var(--space-2xs);
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  flex-wrap: wrap;
}

/* Availability is a per-item property, never a per-category one: she keeps
   ready-made stock in every category. The word is the signal, colour is
   reinforcement only, so this never depends on colour alone. */
.stock {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.25em 0.75em;
  border-radius: var(--radius-pill);
  font-family: var(--font-label);
  font-size: var(--step--1);
  font-weight: 700;
}

.stock--ready {
  background: var(--grass-deep);
  color: var(--on-dark);
}

.stock--made {
  background: var(--yellow);
  color: var(--ink);
}

.stock::before {
  content: '';
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.product__price {
  font-family: var(--font-label);
  font-size: var(--step-0);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}

/* --------------------------------------------------------------------------
   13. Category filter chips
   -------------------------------------------------------------------------- */

.catalog-controls {
  display: grid;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.catalog-filter h3 {
  color: var(--ink-soft);
  margin-bottom: var(--space-2xs);
  font-weight: 700;
}

.catalog-count {
  font-size: var(--step--1);
  min-height: 1.6em;
  margin-bottom: var(--space-sm);
}

.rosette-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  padding: 0;
  margin: 0;
  list-style: none;
}

.rosette-nav button {
  min-height: var(--tap);
  padding: var(--space-2xs) var(--space-md);
  background: var(--card);
  border: 2px solid var(--rule-soft);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: var(--font-label);
  font-size: var(--step--1);
  font-weight: 700;
  transition: transform var(--t-press) var(--ease-out),
    background-color var(--t-hover) ease, border-color var(--t-hover) ease,
    color var(--t-hover) ease;
}

.rosette-nav button[aria-pressed='true'] {
  background: var(--coral);
  border-color: var(--coral);
  color: var(--on-dark);
}

.rosette-nav button:active {
  transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
  .rosette-nav button:not([aria-pressed='true']):hover {
    border-color: var(--coral);
    color: var(--coral-deep);
  }
}

/* --------------------------------------------------------------------------
   14. Category tiles
   -------------------------------------------------------------------------- */

.tiles {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  list-style: none;
  padding: 0;
}

/* Grid items stretch to the row's tallest item by default, but that item is
   the <li>, not the <a> inside it. Without an explicit height the anchor
   stays content-sized, so cards in the same row end up visibly different
   heights whenever their blurb text wraps differently. */
.tiles > li {
  display: flex;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--lift);
  transition: transform var(--t-hover) var(--ease-out),
    box-shadow var(--t-hover) var(--ease-out);
}

.tile__media {
  aspect-ratio: 4 / 5;
  background: var(--cream-deep);
  flex-shrink: 0;
}

.tile__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile__body {
  padding: var(--space-sm) var(--space-md) var(--space-md);
  flex: 1;
}

.tile__name {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 700;
  line-height: var(--lh-snug);
}

.tile__blurb {
  font-size: var(--step--1);
  color: var(--ink-soft);
  margin-top: var(--space-3xs);
}

@media (hover: hover) and (pointer: fine) {
  .tile:hover {
    transform: translateY(-4px);
    box-shadow: var(--lift-lg);
  }
}

.tile:active {
  transform: scale(0.985);
}

/* --------------------------------------------------------------------------
   15. Numbered lists — FAQ, Shipping & Returns, how-it-works
   -------------------------------------------------------------------------- */

.book {
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--lift);
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
}

.book__head {
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-md);
}

.entries {
  list-style: none;
  margin: 0;
  counter-reset: entry;
}

/* Not a blanket `padding: 0`. `.entries` is declared after `.book`, so a
   blanket reset wins the cascade on `<ol class="entries book">` and strips
   the card's own padding — which put the number discs hard against the card
   edge. Only reset the list padding where there is no card around it. */
.entries:not(.book) {
  padding: 0;
}

.entries > li {
  counter-increment: entry;
  padding-block: var(--space-lg);
  border-top: 1px solid var(--rule-soft);
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  gap: var(--space-sm);
}

.entries > li:first-child {
  border-top: 0;
  padding-top: 0;
}

/* Explicit placement, not grid auto-flow: with three grid items (::before,
   h3, p) and two columns, auto-flow wraps the third item back to column 1
   instead of stacking it under h3 in column 2. Named placement fixes it
   regardless of how many paragraphs an entry has. */
.entries > li::before {
  content: counter(entry);
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  display: grid;
  place-items: center;
  /* Sized to the h3's line box (1.75rem ≈ --step-1 × --lh-tight) so the disc
     centres on the first line of the heading instead of hanging below it. */
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--coral-tint);
  font-family: var(--font-label);
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--coral-deep);
  font-variant-numeric: tabular-nums;
}

.entries > li > h3,
.entries > li > p {
  grid-column: 2;
}

.entries h3 {
  font-size: var(--step-1);
  margin-bottom: var(--space-2xs);
}

.entries p + p {
  margin-top: var(--space-2xs);
}

/* --------------------------------------------------------------------------
   16. Size guide table
   -------------------------------------------------------------------------- */

.table-scroll {
  overflow-x: auto;
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: var(--lift);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  min-width: 34rem;
}

caption {
  text-align: left;
  padding: var(--space-sm) var(--space-md) 0;
  color: var(--ink-soft);
  font-size: var(--step--1);
}

th,
td {
  padding: var(--space-xs) var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--rule-soft);
}

thead th {
  background: var(--coral-tint);
  color: var(--coral-deep);
  font-family: var(--font-label);
  font-size: var(--step--1);
  font-weight: 700;
  border-bottom: 0;
}

thead th:first-child {
  border-top-left-radius: var(--radius-card);
}

thead th:last-child {
  border-top-right-radius: var(--radius-card);
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

tbody th {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-0);
}

/* --------------------------------------------------------------------------
   17. Custom order form
   -------------------------------------------------------------------------- */

.blank {
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--lift);
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
}

.blank__head {
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.fields {
  display: grid;
  gap: var(--space-lg);
}

.f {
  display: grid;
  gap: var(--space-2xs);
}

.f > label,
.f > .f__legend {
  font-family: var(--font-label);
  font-size: var(--step-0);
  font-weight: 700;
}

.f__hint {
  font-family: var(--font-body);
  font-size: var(--step--1);
  color: var(--ink-soft);
  font-weight: 400;
}

.f input[type='text'],
.f input[type='email'],
.f input[type='date'],
.f select,
.f textarea {
  width: 100%;
  min-height: var(--tap);
  padding: var(--space-2xs) var(--space-sm);
  background: var(--cream);
  border: 2px solid var(--rule-soft);
  border-radius: var(--radius-chip);
  font-size: var(--step-0);
  transition: border-color var(--t-hover) ease, background-color var(--t-hover) ease;
}

.f textarea {
  min-height: 7rem;
  resize: vertical;
  line-height: var(--lh-body);
}

.f select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% + 1px), calc(100% - 12px) calc(50% + 1px);
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: var(--space-xl);
}

.f input:focus,
.f select:focus,
.f textarea:focus {
  border-color: var(--coral);
  background: var(--card);
}

.f input::placeholder,
.f textarea::placeholder {
  color: var(--ink-soft);
}

.f__row {
  display: grid;
  gap: var(--space-md);
}

@media (min-width: 40rem) {
  .f__row--2 {
    grid-template-columns: 1fr 1fr;
  }
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

.checks {
  display: grid;
  gap: var(--space-3xs);
  margin-top: var(--space-2xs);
}

.check {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  min-height: var(--tap);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 400;
}

.check input {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  accent-color: var(--coral);
}

.f__error {
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--coral-deep);
  display: none;
}

.f[data-invalid='true'] .f__error {
  display: block;
}

.f[data-invalid='true'] input,
.f[data-invalid='true'] select,
.f[data-invalid='true'] textarea {
  border-color: var(--coral-deep);
}

/* The honeypot. Off-screen rather than display:none, because some bots skip
   anything hidden and fill everything else. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-card);
  background: var(--cream-deep);
}

.form-status[hidden] {
  display: none;
}

.form-status--ok {
  background: var(--coral-tint);
}

.form-status--bad {
  background: var(--card);
  border: 2px solid var(--coral-deep);
}

.form-status h3 {
  font-size: var(--step-1);
  margin-bottom: var(--space-3xs);
}

/* --------------------------------------------------------------------------
   18. About
   -------------------------------------------------------------------------- */

.placard {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: clamp(1.5rem, 1rem + 2vw, 3rem);
  box-shadow: var(--lift);
}

.about__grid {
  display: grid;
  gap: var(--space-xl);
  align-items: start;
}

@media (min-width: 56rem) {
  .about__grid {
    grid-template-columns: 0.85fr 1.15fr;
    gap: var(--space-2xl);
  }
}

.pinned {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--lift-lg);
}

.pinned figcaption {
  padding: var(--space-sm) var(--space-3xs) 0;
  font-size: var(--step--1);
  color: var(--ink-soft);
}

/* A pull-quote in her own words. Used once per page at most. */
.ribbon-quote {
  background: var(--coral-tint);
  border-radius: var(--radius-card);
  padding: var(--space-lg);
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  max-width: 30ch;
}

.ribbon-quote cite {
  display: block;
  margin-top: var(--space-sm);
  font-family: var(--font-script);
  font-size: var(--step-1);
  font-style: normal;
  font-weight: 600;
  color: var(--coral-deep);
}

/* --------------------------------------------------------------------------
   19. Placeholder imagery

   Photography does not exist yet (docs/photography-brief.md). Every image
   slot ships at its final aspect ratio so her shots drop in with no reflow,
   and the placeholder says out loud that it is one.
   -------------------------------------------------------------------------- */

.ph {
  display: grid;
  place-content: center;
  gap: var(--space-2xs);
  text-align: center;
  width: 100%;
  height: 100%;
  padding: var(--space-sm);
  background: repeating-linear-gradient(
    -45deg,
    var(--cream-deep) 0 10px,
    var(--card) 10px 20px
  );
  color: var(--ink-soft);
  border: 0;
}

.ph span {
  font-family: var(--font-label);
  font-size: var(--step--1);
  font-weight: 700;
}

.ph small {
  font-family: var(--font-label);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.ratio {
  display: block;
  width: 100%;
}

.ratio--1x1 {
  aspect-ratio: 1 / 1;
}

.ratio--4x5 {
  aspect-ratio: 4 / 5;
}

.ratio--3x2 {
  aspect-ratio: 3 / 2;
}

/* --------------------------------------------------------------------------
   20. Notices
   -------------------------------------------------------------------------- */

.notice {
  background: var(--card);
  border: 2px dashed var(--rule);
  border-radius: var(--radius-card);
  padding: var(--space-md);
}

.notice__title {
  font-family: var(--font-label);
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--coral-deep);
  margin-bottom: var(--space-2xs);
}

/* --------------------------------------------------------------------------
   21. Page intro
   -------------------------------------------------------------------------- */

.page-head {
  padding-block: var(--space-xl) var(--section-y);
}

.page-head .lede {
  margin-top: var(--space-md);
}

/* --------------------------------------------------------------------------
   22. Staggered first paint

   One orchestrated page-load reveal beats a dozen scattered micro-interactions.
   Short delays only: 60ms apart, and nothing waits on it to become interactive.
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal > * {
    animation: reveal 420ms var(--ease-out) backwards;
  }

  .reveal > *:nth-child(1) {
    animation-delay: 0ms;
  }
  .reveal > *:nth-child(2) {
    animation-delay: 60ms;
  }
  .reveal > *:nth-child(3) {
    animation-delay: 120ms;
  }
  .reveal > *:nth-child(4) {
    animation-delay: 180ms;
  }
  .reveal > *:nth-child(5) {
    animation-delay: 240ms;
  }

  @keyframes reveal {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
  }
}
