/* tokens.css
   The only file in the project allowed to contain raw colour values.
   Every other stylesheet references these custom properties. */

/* [data-theme="light"] is repeated so a forced-light block can be nested inside a
   dark page, which the preview page relies on to show both themes side by side. */
:root,
[data-theme="light"] {
  /* Colour, light mode */
  --bg:           #F7F1EB;
  --bg-elev:      #FDFAF7;
  --surface:      #FFFFFF;
  --ink:          #231A18;
  --ink-soft:     #5C4A43;
  --ink-muted:    #8A766E;
  --line:         #E3D5CC;
  --blush:        #F1D3D7;
  --blush-soft:   #F8E6E8;
  --rose:         #C4838F;
  --rose-deep:    #9A5966;
  --rose-ink:     #FFFFFF;
  --rosewood:     #3E2228;
  --rosewood-ink: #F7EDEA;
  --sage:         #A9B5A0;
  --sage-deep:    #6F7E66;
  --focus:        #9A5966;
  --shadow:       0 12px 32px rgba(62, 34, 40, 0.10);
  --shadow-header: 0 1px 0 rgba(62, 34, 40, 0.06), 0 6px 18px rgba(62, 34, 40, 0.07);

  /* Header glass, and the hairline used on the rosewood band. */
  --header-bg:    rgba(253, 250, 247, 0.92);
  --on-rosewood-line: rgba(247, 237, 234, 0.15);

  /* Closing band and footer grounds. Light keeps the flat rosewood. */
  --band-top:     var(--rosewood);
  --band-bottom:  var(--rosewood);
  --footer-bg:    var(--rosewood);
  /* Nail illustration depth. Read by nails.js through var(), so the shadows
     follow the theme without a re-render. */
  --nail-shadow:      rgba(62, 34, 40, 0.22);
  --set-card-highlight: rgba(255, 255, 255, 0);

  --band-dark-top:    #4A2A31;
  --band-dark-bottom: #2E1B1F;
  --footer-dark:      #120C0B;

  /* Primary action. Approved deviation from the original spec: in light the deeper
     rose carries white ink, because white on --rose is only 3.00:1 and fails AA at
     button text size. The floating button is --rose-deep in light too, so both
     primary actions match. Dark keeps --rose on --rose-ink at 8.69:1. */
  --action:       var(--rose-deep);
  --action-hover: var(--rosewood);
  --action-ink:   var(--rose-ink);

  /* Type families */
  --ff-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --ff-body: "Manrope", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  /* Fluid type scale, interpolated between a 360px and a 1120px viewport. */
  --fs-display: clamp(2.5rem, 1.55rem + 4.21vw, 4.5rem);    /* 40 -> 72 */
  --fs-h1:      clamp(2.125rem, 1.47rem + 2.89vw, 3.5rem);  /* 34 -> 56 */
  --fs-h2:      clamp(1.75rem, 1.39rem + 1.58vw, 2.5rem);   /* 28 -> 40 */
  --fs-h3:      clamp(1.375rem, 1.26rem + 0.53vw, 1.625rem);/* 22 -> 26 */
  --fs-lead:    clamp(1.125rem, 1.07rem + 0.26vw, 1.25rem); /* 18 -> 20 */
  --fs-body:    clamp(1rem, 0.97rem + 0.13vw, 1.0625rem);   /* 16 -> 17 */
  --fs-small:   0.875rem;                                   /* 14 */
  --fs-eyebrow: 0.75rem;                                    /* 12 */

  --lh-heading: 1.05;
  --lh-body: 1.6;
  --ls-heading: -0.02em;
  --ls-eyebrow: 0.16em;

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;

  --section-y: var(--s-8);

  /* Radius */
  --r-sm: 8px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-pill: 999px;

  /* Layout */
  --container-max: 1120px;
  --measure: 68ch;
  --tap: 44px;
  --header-h: 64px;
}

@media (min-width: 900px) {
  :root,
  [data-theme="light"] {
    --header-h: 72px;
    --section-y: var(--s-9);
  }
}

[data-theme="dark"] {
  --bg:           #1E1614;
  --bg-elev:      #271E1C;
  --surface:      #2F2523;
  --ink:          #F4ECE7;
  --ink-soft:     #D8C7BF;
  --ink-muted:    #A69388;
  --line:         #3F322E;
  --blush:        #4A3036;
  --blush-soft:   #3A282C;
  --rose:         #E2A5AF;
  --rose-deep:    #C4838F;
  --rose-ink:     #1E1614;
  --rosewood:     #150F0E;
  --rosewood-ink: #F4ECE7;
  --sage:         #4E5947;
  --sage-deep:    #A9B5A0;
  --focus:        #E2A5AF;
  --shadow:       0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-header: 0 1px 0 rgba(0, 0, 0, 0.35), 0 6px 18px rgba(0, 0, 0, 0.32);

  --header-bg:    rgba(39, 30, 28, 0.92);
  --on-rosewood-line: rgba(244, 236, 231, 0.15);

  --nail-shadow:      rgba(0, 0, 0, 0.40);
  --set-card-highlight: rgba(255, 255, 255, 0.07);

  --band-top:     var(--band-dark-top);
  --band-bottom:  var(--band-dark-bottom);
  --footer-bg:    var(--footer-dark);

  /* In dark, --rose on --rose-ink is 8.69:1, so the specified pairing stands. */
  --action:       var(--rose);
  --action-hover: var(--rose-deep);
  --action-ink:   var(--rose-ink);
}
