/*
  Lady Jane Friday design tokens
  Source: brief section 5 (visual direction). Every colour, font, size and
  space used by the site should come from here; styles.css holds no raw values.

  Fonts load from Google Fonts in index.html (a <link>, not @import, so they
  never block this file):
  https://fonts.googleapis.com/css2?family=Bodoni+Moda:opsz,wght@6..96,400;6..96,500&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Mrs+Saint+Delafield&display=swap

  Fluid sizes scale between a 375px phone and a 1280px desktop.
*/

:root {
  /* ---------- Palette (brief section 5, sampled from the moodboard) ---------- */

  --colour-linen-cream:    #F3EDE2;  /* background */
  --colour-riviera-green:  #1F3B2D;  /* primary, dark panels */
  --colour-terracotta:     #B23A2E;  /* accent 1 */
  --colour-burnt-orange:   #D2693A;  /* accent 2 */
  --colour-coastal-blue:   #6E8FB5;  /* accent 3 */
  --colour-ink:            #2A2723;  /* text */
  --colour-antique-gold:   #B08A4E;  /* fine rules, details */

  /* Supporting tints, derived from the palette for contrast and depth */
  --colour-paper:          #FAF6EE;  /* card and form surface, a shade lighter than linen */
  --colour-ink-soft:       #5A5148;  /* secondary text */
  --colour-gold-deep:      #8A6A35;  /* gold dark enough for field borders and small marks */
  --colour-gold-light:     #D9BC86;  /* gold readable on Riviera green */
  --colour-white:          #FFFFFF;  /* input fields */

  /*
    Contrast on linen cream (WCAG AA body text needs 4.5:1):
      ink 12.8, riviera green 10.5, ink soft 6.7, terracotta 5.1, gold deep 4.3
      burnt orange 3.1, coastal blue 2.9, antique gold 2.7
    So burnt orange, coastal blue and antique gold are decoration only
    (rules, icons, accent bars, motifs), never text.
    On riviera green: linen cream 10.5, gold light 6.7.
  */

  /* ---------- Semantic colour roles (use these in components) ---------- */

  --colour-bg:             var(--colour-linen-cream);
  --colour-surface:        var(--colour-paper);
  --colour-text:           var(--colour-ink);
  --colour-text-muted:     var(--colour-ink-soft);
  --colour-heading:        var(--colour-riviera-green);
  --colour-accent:         var(--colour-terracotta);     /* eyebrows, script lines, errors */
  --colour-rule:           var(--colour-antique-gold);
  --colour-panel:          var(--colour-riviera-green);
  --colour-on-panel:       var(--colour-linen-cream);
  --colour-on-panel-accent: var(--colour-gold-light);
  --colour-button-bg:      var(--colour-riviera-green);
  --colour-button-text:    var(--colour-linen-cream);
  --colour-button-hover:   var(--colour-terracotta);
  --colour-field-bg:       var(--colour-white);
  --colour-field-border:   var(--colour-gold-deep);
  --colour-focus:          var(--colour-terracotta);
  --colour-error:          var(--colour-terracotta);

  /* ---------- Font stacks ---------- */

  /* Display: high-contrast serif in caps. Bodoni Moda is the closest free match
     to the moodboard wordmark; it is not condensed, so caps get slight tracking. */
  --font-display: "Bodoni Moda", "Bodoni 72", Didot, "Playfair Display", Georgia, serif;
  /* Body: elegant readable serif, 18px minimum on mobile */
  --font-body: "Cormorant Garamond", Cormorant, Garamond, "Times New Roman", serif;
  /* Script: two uses only, "Every day is Friday." and "More Life, Please." */
  --font-script: "Mrs Saint Delafield", "Snell Roundhand", "Apple Chancery", cursive;

  --weight-regular: 400;
  --weight-medium:  500;
  --weight-semibold: 600;

  /* ---------- Type scale (fluid, roughly 1.2 on phone opening to 1.25+ on desktop) ---------- */

  --text-sm:     clamp(0.9375rem, 0.9116rem + 0.1105vw, 1rem);     /* 15 to 16px: eyebrows, labels, footer */
  --text-base:   clamp(1.125rem, 1.073rem + 0.221vw, 1.25rem);     /* 18 to 20px: body, wordmark (wider tracking needs the smaller size to fit 375px) */
  --text-lg:     clamp(1.3125rem, 1.235rem + 0.3315vw, 1.5rem);    /* 21 to 24px: intro, card titles, steps */
  --text-xl:     clamp(1.5625rem, 1.433rem + 0.5525vw, 1.875rem);  /* 25 to 30px: success message */
  --text-2xl:    clamp(1.875rem, 1.616rem + 1.105vw, 2.5rem);      /* 30 to 40px: section titles */
  --text-hero:   clamp(2.625rem, 1.744rem + 3.757vw, 4.75rem);     /* 42 to 76px: headline */
  --text-script: clamp(2.5rem, 2.189rem + 1.326vw, 3.25rem);       /* 40 to 52px: script lines */

  --leading-tight:  1.05;  /* hero headline */
  --leading-snug:   1.2;   /* headings, card titles */
  --leading-normal: 1.55;  /* body */
  --leading-loose:  1.7;   /* intro paragraph */

  --tracking-tight:    -0.01em; /* large display headline */
  --tracking-caps:      0.04em; /* display caps section titles */
  --tracking-label:     0.14em; /* form labels, buttons */
  --tracking-eyebrow:   0.2em;  /* small caps eyebrows, per brief */
  --tracking-wordmark:  0.32em; /* LADY JANE FRIDAY */

  /* ---------- Spacing (4px base, rem so it follows text zoom) ---------- */

  --space-3xs: 0.25rem;  /*  4px */
  --space-2xs: 0.5rem;   /*  8px */
  --space-xs:  0.75rem;  /* 12px */
  --space-s:   1rem;     /* 16px */
  --space-m:   1.5rem;   /* 24px */
  --space-l:   2rem;     /* 32px */
  --space-xl:  3rem;     /* 48px */
  --space-2xl: 4rem;     /* 64px */
  --space-3xl: 6rem;     /* 96px */

  /* Fluid layout spacing */
  --space-gutter:  clamp(1.25rem, 0.732rem + 2.21vw, 2.5rem);  /* 20 to 40px page sides */
  --space-section: clamp(3.5rem, 2.464rem + 4.42vw, 6rem);     /* 56 to 96px between sections */

  /* ---------- Layout ---------- */

  --measure:       34rem;  /* comfortable line length for text blocks */
  --measure-wide:  40rem;
  --container:     68rem;  /* widest content row */
  --tap-target:    3rem;   /* 48px minimum for buttons and fields */

  /* ---------- Lines, edges, depth (paper, not plastic) ---------- */

  --rule-hairline: 1px;
  --rule-strong:   2px;
  --radius:        0;      /* paper has square corners */
  --radius-round:  50%;    /* step numbers, monogram */

  --shadow-paper:  0 1px 0 rgb(42 39 35 / 0.06), 0 10px 24px -18px rgb(42 39 35 / 0.45);
  --shadow-lifted: 0 18px 40px -26px rgb(42 39 35 / 0.6);
  --focus-ring:    2px solid var(--colour-focus);
  --focus-offset:  3px;

  /* Subtle paper grain, inline SVG noise tinted toward ink */
  --texture-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .27 0 0 0 0 .18 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");


  /* ---------- Scrapbook (moodboard: torn notes, tape, polaroids, a luggage tag) ---------- */

  --colour-note:           #F8F2E7;  /* fresh note paper */
  --colour-note-aged:      #EDE3D0;  /* older, warmer scrap */
  --colour-photo-border:   #FDFBF6;  /* polaroid white */
  --colour-tape:           rgb(226 214 186 / 0.78);
  --colour-on-card:        var(--colour-linen-cream); /* text on the green monogram card */

  /* Barely-there tilts: placed by a careful hand, not a child's scrapbook.
     Only photos, the monogram card and the tag tilt; text pieces sit straight. */
  --tilt-a: -1deg;
  --tilt-b:  0.6deg;
  --tilt-c: -0.4deg;
  --tilt-d:  1.2deg;
  --tilt-tag: 2.5deg;

  /* Shadows as filters, so they follow torn edges */
  --shadow-scrap: drop-shadow(0 1px 1px rgb(42 39 35 / 0.12)) drop-shadow(0 8px 12px rgb(42 39 35 / 0.16));
  --shadow-photo: drop-shadow(0 2px 2px rgb(42 39 35 / 0.14)) drop-shadow(0 12px 18px rgb(42 39 35 / 0.22));

  /* Torn paper edges, used as mask layers on paper pieces */
  --edge-size: 0.5rem;
  --edge-tile: 18.75rem; /* torn edges repeat at this width, so they look the same on any card */
  --edge-torn-top: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 12' preserveAspectRatio='none'%3E%3Cpath d='M0 12 L0 4.4 7 4.2 15 4.0 26 4.3 33 5.3 40 5.7 48 5.8 54 5.9 61 6.5 70 6.0 79 4.2 84 4.5 90 5.8 95 6.3 104 6.3 113 5.2 118 4.3 128 5.4 139 5.8 148 4.6 156 3.9 161 4.9 165 6.4 173 5.9 177 4.4 183 3.8 188 3.6 193 4.1 200 5.1 207 4.9 217 5.0 224 4.9 233 4.8 240 5.0 249 4.8 256 4.7 262 4.5 273 5.8 284 7.2 294 6.4 300 4.4 L300 12Z'/%3E%3C/svg%3E");
  --edge-torn-bottom: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 12' preserveAspectRatio='none'%3E%3Cpath d='M0 0 L0 5.7 6 5.3 16 5.5 24 5.7 30 5.4 35 5.7 44 6.4 49 6.0 54 5.2 62 5.6 72 6.2 80 5.8 86 5.5 97 6.0 102 6.5 106 6.8 112 6.6 119 6.9 124 7.4 129 6.4 135 5.1 144 5.1 148 5.9 155 6.5 165 6.3 176 6.4 185 6.4 193 6.5 202 7.0 207 7.2 211 7.4 215 7.1 225 6.1 234 5.4 245 4.7 249 4.4 258 5.0 265 5.9 274 6.2 280 6.0 291 5.5 296 5.1 300 5.7 L300 0Z'/%3E%3C/svg%3E");

  --tape-width:  5.5rem;
  --tape-height: 1.6rem;

  /* ---------- Motion (unhurried) ---------- */

  --ease-out:        cubic-bezier(0.2, 0.7, 0.2, 1);
  --duration-quick:  200ms;  /* hovers, focus */
  --duration-reveal: 800ms;  /* scroll fade-ins */
  --reveal-distance: 14px;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-quick:  0ms;
    --duration-reveal: 0ms;
    --reveal-distance: 0px;
  }
}
