/* Design round 1, look "night" (Moon Unit night): the Stars label as the whole site. Ink-blue night sky, cream type,
   pale moon-gold for links and buttons, hand-cut stars as a starfield; Unbounded (OFL) for headings, the core's
   Schibsted Grotesk for text. Loaded after site.css on preview hosts with ?look=night (src/lib/look.ts). */
@font-face {
  font-family: "Unbounded";
  src: url("../../assets/fonts/unbounded-latin-wght.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@layer themes {
  :root[data-look="night"],
  [data-look="night"] .nav,
  [data-look="night"] .site-footer,
  [data-look="night"] .hero {
    --sky: oklch(17% 0.035 275);
    --moon: oklch(90% 0.08 92);
    --color-background: var(--sky);
    --color-surface: oklch(21% 0.04 275);
    --color-surface-raised: oklch(25% 0.045 275);
    --color-text: oklch(94% 0.02 90);
    --color-text-muted: oklch(80% 0.025 90);
    --color-text-subtle: oklch(76% 0.025 90);
    --color-border: oklch(34% 0.05 275);
    --color-border-subtle: oklch(28% 0.045 275);
    --color-border-strong: oklch(62% 0.05 275);
    --accent: var(--moon);
    --accent-ink: var(--moon);
    --accent-fill: var(--moon);
    --accent-fill-hover: oklch(96% 0.05 92);
    --on-accent: var(--sky);
    --on-accent-fill: var(--sky);
    --color-focus: var(--moon);
    --band-inverse: oklch(12% 0.03 275);
    --nav-bg: oklch(13% 0.03 275);
  }
  :root[data-look="night"] {
    --font-heading: "Unbounded", "Arial Black", system-ui, sans-serif;
    --radius-control: 999px;
    --select-arrow-inset: 1.4em; /* the select arrow clears the pill's curve (site.css) */
    --look-field-pad: calc(1.25 * var(--step-0)); /* field text, labels and help clear the pill's curve (site.css) */
    --radius-card: 1.25rem;
    --tracking-heading: -0.02em;
  }
  :root[data-look="night"] {
    --starfield:
      radial-gradient(1.5px 1.5px at 12% 18%, oklch(96% 0.03 92 / 0.9) 50%, transparent 52%),
      radial-gradient(1px 1px at 63% 9%, oklch(96% 0.03 92 / 0.7) 50%, transparent 52%),
      radial-gradient(2px 2px at 83% 41%, oklch(96% 0.03 92 / 0.8) 50%, transparent 52%),
      radial-gradient(1px 1px at 34% 57%, oklch(96% 0.03 92 / 0.6) 50%, transparent 52%),
      radial-gradient(1.5px 1.5px at 7% 82%, oklch(96% 0.03 92 / 0.7) 50%, transparent 52%),
      radial-gradient(1px 1px at 52% 88%, oklch(96% 0.03 92 / 0.6) 50%, transparent 52%),
      radial-gradient(1px 1px at 92% 74%, oklch(96% 0.03 92 / 0.6) 50%, transparent 52%);
  }
  [data-look="night"] body {
    background-color: var(--sky);
    background-image: var(--starfield);
    background-size: 37rem 31rem;
    background-attachment: fixed;
  }
  [data-look="night"] h1, [data-look="night"] h2, [data-look="night"] h3 { font-family: var(--font-heading); font-weight: 650; }
  [data-look="night"] .eyebrow { text-transform: uppercase; letter-spacing: 0.16em; font-size: var(--step--1); font-weight: 600; color: var(--moon); }
  [data-look="night"] main a:not(.button, .nav__link, .nav__brand, .nav__cta, .wine-card__link) { color: var(--moon); }

  /* Nav and strips. */
  [data-look="night"] .nav { border-block-end: var(--border-width) solid var(--color-border); }
  [data-look="night"] .nav__brand { font-family: var(--font-heading); font-weight: 700; font-size: var(--step-0); letter-spacing: 0.02em; text-transform: uppercase; }
  [data-look="night"] .preview-note { background: oklch(21% 0.04 275); color: var(--color-text-muted); border-color: var(--color-border); }

  /* Hero: the words on the left, the Stars label large on the right, drawn straight onto the sky. The art
     (assets/img/moon-unit-stars-night.webp, made by scripts/make-night-label.py) is the marker drawing recoloured:
     paper outside the drawing is black and the ink a deep indigo, so mix-blend-mode: screen drops the paper and
     lets the sky and its stars show faintly through the ink; the moon, stars and lettering stay warm cream, with
     the marker streaks and a fine grain kept. No arch: the label is a rectangle and is shown whole.
     The core's .hero__art is a stacking context (position + z-index) inside a size container, so the blend only
     sees what the figure paints: the figure repeats the page's sky and fixed starfield (they line up) and adds a
     moon-glow halo (::before) for the label to screen onto. */
  [data-look="night"] .hero { --hero-background: transparent; padding-block: var(--space-l) var(--space-xl); }
  [data-look="night"] .hero__headline {
    font-size: clamp(2.4rem, 1.3rem + 3vw, 4rem);
    font-weight: 700; line-height: 1.02; letter-spacing: -0.03em; text-wrap: balance;
  }
  [data-look="night"] .hero__subheadline, [data-look="night"] .lede { font-family: var(--font-body); }
  [data-look="night"] .hero__subheadline { color: var(--color-text-muted); font-size: var(--step-1); line-height: 1.5; }
  @media (min-width: 52rem) {
    [data-look="night"] .hero[data-art] { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  }
  [data-look="night"] .hero__art--label {
    position: relative;
    z-index: 1;
    inline-size: min(100%, 40rem, calc(80svh * 1100 / 1555));
    padding: 5%;
    margin: 0;
    background-color: var(--sky);
    background-image: var(--starfield);
    background-size: 37rem 31rem;
    background-attachment: fixed;
  }
  [data-look="night"] .hero__art--label::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(closest-side at 38% 32%, oklch(90% 0.08 92 / 0.22), oklch(90% 0.08 92 / 0.07) 62%, transparent);
    pointer-events: none;
  }
  [data-look="night"] .hero__art--label img {
    mix-blend-mode: screen;
    filter: contrast(1.05);
    transform: rotate(-1.5deg);
    /* A soft vignette: the corners of the drawing fade into the sky instead of ending on a hard edge. */
    -webkit-mask-image: radial-gradient(ellipse 72% 66% at 50% 50%, #000 78%, transparent 100%);
    mask-image: radial-gradient(ellipse 72% 66% at 50% 50%, #000 78%, transparent 100%);
  }
  @media (max-width: 51.99rem) {
    [data-look="night"] .hero__art--label { inline-size: min(100%, 26rem); padding: 4%; }
  }

  /* Sections. */
  [data-look="night"] .section .container { border-block-start-color: var(--color-border); }
  [data-look="night"] .text-block .prose { font-size: var(--step-1); line-height: 1.6; }
  [data-look="night"] .text-block .prose p { color: var(--color-text); }

  /* Wine cards: each bottle photo in an arched window (photos keep the arch; label art does not). */
  [data-look="night"] .wine-grid { gap: var(--space-l) var(--space-m); grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); } /* the framed cards need 18rem for price + badge on one line */
  [data-look="night"] .wine-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-card); padding: 0.6rem; transition: border-color 0.2s; }
  [data-look="night"] .wine-card:hover { border-color: oklch(90% 0.08 92 / 0.6); }
  [data-look="night"] .wine-card__media { border-radius: 999px 999px 0.6rem 0.6rem; background: oklch(26% 0.05 275); }
  [data-look="night"] .wine-card__nophoto { font-family: var(--font-heading); color: var(--moon); font-size: var(--step-1); }
  [data-look="night"] .wine-card__title { font-family: var(--font-heading); font-size: var(--step-0); font-weight: 650; letter-spacing: -0.01em; }
  [data-look="night"] .wine-card__price, [data-look="night"] .wine__price { color: var(--moon); }
  [data-look="night"] .badge { border-radius: 999px; }

  /* One wine. */
  [data-look="night"] .wine__media img { border-radius: 999px 999px 1rem 1rem; }
  [data-look="night"] .ship-estimate { border-radius: var(--radius-card); }
  [data-look="night"] .label-grid img { border-radius: 0.75rem; background: oklch(96% 0.01 90); }
}
/* Round 2 check at 320 px: Unbounded is wide, so a wine's name (CHARDONNAY, SPARKLING) broke inside the word on a small
   phone. On narrow screens the name is capped at its column over about 8 em, the longest catalog word. */
@layer themes {
  @media (max-width: 30rem) {
    [data-look="night"] .wine__body { container-type: inline-size; }
    [data-look="night"] .wine h1 { font-size: min(2.6rem, 100cqi / 8); }
  }
}
