/*
================================================================
ULDA DESIGN SYSTEM V0.1: TOKENS AND COMPONENTS
================================================================

1. SOURCES AND LIMITS
----------------------------------------------------------------
- Brand rules: ULDA Brand Book v0.3. Brand wins over the
  reference site on every conflict
- Structural reference: digitaljoy.nl/index.html
- The fetch returns page text only. The reference site's
  own colours, radii and shadows were not retrievable.
  Its sentiment is taken from structure and rhythm
- Kept from the source: eyebrow above every heading, a
  large headline broken over lines, airy section bands,
  card grids, a horizontal scroll track, a closing band
- Replaced: the warm yellow accent becomes one burgundy
  element per view. Soft cards become square 1px cells
- Buttons and inputs are defined for completeness. The
  ulda.nl page uses neither, per brief section 13
- Font: self-host DM Sans 400, 500, 700 or load it from
  fonts.bunny.net in the HTML head. No Google Fonts

2. BREAKPOINTS, MOBILE FIRST
----------------------------------------------------------------
- Mobile: below 768px. One column, full-width 1px lines
- Tablet: 768px to 1024px. Two columns
- Desktop: 1025px and up. Three columns
- Media queries cannot read CSS variables, so the values
  are written into the queries below
================================================================
*/

:root {
  /* 3. COLOUR, RAW */
  --ulda-paper:    #FFFFFF; /* hsl(0 0% 100%)    */
  --ulda-ink:      #000000; /* hsl(0 0% 0%)      */
  --ulda-grey:     #3A3A3A; /* hsl(0 0% 23%)     */
  --ulda-line:     #E6E6E6; /* hsl(0 0% 90%)     */
  --ulda-burgundy: #800020; /* hsl(345 100% 25%) */

  /* 4. COLOUR, SEMANTIC */
  --color-primary:          var(--ulda-ink);
  --color-secondary:        var(--ulda-grey);
  --color-background:       var(--ulda-paper);
  --color-surface:          var(--ulda-paper);
  --color-surface-invert:   var(--ulda-ink);
  --color-text:             var(--ulda-ink);
  --color-text-muted:       var(--ulda-grey);
  --color-text-invert:      var(--ulda-paper);
  --color-text-invert-mute: var(--ulda-line);
  --color-line:             var(--ulda-line);
  --color-line-strong:      var(--ulda-ink);
  --color-accent:           var(--ulda-burgundy);
  /* Accent: one element per view. Never a fill,
     never a gradient, never a hover state */

  /* 5. TYPE, FAMILY AND WEIGHT */
  --font-sans: 'DM Sans', -apple-system,
    BlinkMacSystemFont, 'Segoe UI', Roboto,
    sans-serif;
  --fw-regular: 400;
  --fw-medium:  500;
  --fw-bold:    700;

  /* 6. TYPE SCALE, MOBILE VALUES
     Golden ratio steps. H4 sits on root phi.
     Tablet and desktop override in section 12 */
  --fs-h1:    2.25rem;    /* 36 */
  --fs-h2:    1.625rem;   /* 26 */
  --fs-h3:    1.125rem;   /* 18 */
  --fs-h4:    1rem;       /* 16 */
  --fs-h5:    0.9375rem;  /* 15 */
  --fs-h6:    0.75rem;    /* 12, eyebrow */
  --fs-body:  0.9375rem;  /* 15 */
  --fs-small: 0.8125rem;  /* 13 */

  --lh-h1:   1.05;
  --lh-h2:   1.15;
  --lh-h3:   1.25;
  --lh-h4:   1.4;
  --lh-body: 1.625;       /* 26 / 16 */
  --lh-small: 1.5;

  --ls-h1:      -0.02em;
  --ls-h2:      -0.01em;
  --ls-eyebrow:  0.08em;
  --measure:     64ch;    /* body line length */

  /* 7. SPACE, FIBONACCI */
  --s0: 0.3125rem;  /*   5 */
  --s1: 0.5rem;     /*   8 */
  --s2: 0.8125rem;  /*  13 */
  --s3: 1.3125rem;  /*  21 */
  --s4: 2.125rem;   /*  34 */
  --s5: 3.4375rem;  /*  55 */
  --s6: 5.5625rem;  /*  89 */
  --s7: 9rem;       /* 144 */

  /* 8. LAYOUT */
  --container:  75rem;    /* 1200 */
  --gutter:     var(--s3);
  --band:       var(--s5); /* section padding */
  --cell:       var(--s4); /* card padding */
  --touch:      2.75rem;   /* 44px minimum */

  /* 9. SHAPE AND DEPTH, BRAND BOOK V0.3 */
  --radius:     0;
  --shadow:     none;
  --border:     1px solid var(--color-line);
  --border-ink: 1px solid var(--color-line-strong);

  /* 10. MOTION */
  --ease:     cubic-bezier(0.2, 0, 0, 1);
  --duration: 150ms;
}

/* 11. BASE */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  color-scheme: only light;
  background: var(--color-background);
}
body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  color: var(--color-text);
  text-align: left;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--fw-bold);
  text-wrap: balance;
}
h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
  letter-spacing: var(--ls-h1);
}
h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  letter-spacing: var(--ls-h2);
}
h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
}
h4 {
  font-size: var(--fs-h4);
  line-height: var(--lh-h4);
}
h5 {
  font-size: var(--fs-h5);
  line-height: var(--lh-h4);
  font-weight: var(--fw-medium);
}
h6, .eyebrow {
  font-size: var(--fs-h6);
  line-height: var(--lh-h4);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.eyebrow { margin-bottom: var(--s2); }
p { max-width: var(--measure); }
small, .small {
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  color: var(--color-text-muted);
}

/* 12. RESPONSIVE SCALE */
@media (min-width: 768px) {
  :root {
    --fs-h1:   3rem;       /* 48 */
    --fs-h2:   2rem;       /* 32 */
    --fs-h3:   1.375rem;   /* 22 */
    --fs-h4:   1.125rem;   /* 18 */
    --fs-h5:   1rem;       /* 16 */
    --fs-h6:   0.8125rem;  /* 13 */
    --fs-body: 1rem;       /* 16 */
    --gutter:  var(--s4);
    --band:    var(--s6);
  }
}
@media (min-width: 1025px) {
  :root {
    --fs-h1: 4.125rem;     /* 66 */
    --fs-h2: 2.5625rem;    /* 41 */
    --fs-h3: 1.625rem;     /* 26 */
    --fs-h4: 1.25rem;      /* 20 */
    --gutter: var(--s5);
    --band:   var(--s7);
    --cell:   var(--s5);
  }
}

/* 13. LAYOUT PRIMITIVES */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.band {
  /* Minimal, matching the tile grid's own small gap */
  padding-block: var(--s2);
}
.band--invert {
  background: var(--color-surface-invert);
  color: var(--color-text-invert);
}
.band--invert .eyebrow,
.band--invert small {
  color: var(--color-text-invert-mute);
}
.header {
  padding-block: var(--s3);
  border-bottom: var(--border);
}
.wordmark {
  font-size: calc(var(--fs-h4) * 2);
  font-weight: var(--fw-bold);
  letter-spacing: calc(var(--ls-h2) + 3px);
  -webkit-text-stroke: 2px currentColor;
}
.footer {
  padding-block: var(--s4);
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}

/* 14. CARD GRID
   Superseded by the page-level .tile-grid/.tile system */

/* 15. SCROLL TRACK
   Unused: the quotes section that needed it was cut
   (no real quotes yet) */

/* 16. BUTTONS
   Square, 44px, bold text, colour only on hover.
   No accent on hover or fill */
.btn {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding: var(--s2) var(--s4);
  font: var(--fw-bold) var(--fs-body)
    / 1 var(--font-sans);
  text-decoration: none;
  border: var(--border-ink);
  cursor: pointer;
  transition:
    background-color var(--duration) var(--ease),
    color var(--duration) var(--ease);
}
.btn--primary {
  background: var(--color-primary);
  color: var(--color-text-invert);
}
.btn--primary:hover {
  background: var(--color-surface);
  color: var(--color-text);
}
.btn--secondary {
  background: transparent;
  color: var(--color-text);
}
.btn--secondary:hover {
  background: var(--color-primary);
  color: var(--color-text-invert);
}
.btn:disabled,
.btn[aria-disabled="true"] {
  border-color: var(--color-line);
  color: var(--color-text-muted);
  background: var(--color-surface);
  cursor: not-allowed;
}

/* 17. LINKS
   Mail addresses on ulda.nl use this. Plain text,
   44px tap height, underline on hover */
.link {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration)
    var(--ease);
}
.link:hover { border-bottom-color: currentColor; }

/* 18. INPUTS
   Unused on ulda.nl. Kept for later tools */
.input {
  width: 100%;
  min-height: var(--touch);
  padding: var(--s2) var(--s3);
  font: var(--fw-regular) 1rem / 1.4
    var(--font-sans); /* 16px stops iOS zoom */
  color: var(--color-text);
  background: var(--color-surface);
  border: var(--border);
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder { color: var(--color-text-muted); }
.input:hover { border-color: var(--color-secondary); }
.input:focus {
  outline: none;
  border-color: var(--color-line-strong);
}
.input[aria-invalid="true"] {
  border: 2px solid var(--color-line-strong);
}
.label {
  display: block;
  margin-bottom: var(--s1);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
}

/* 19. ACCENT
   Apply to one element per view. Text colour only */
.accent { color: var(--color-accent); }

/* 20. FOCUS AND MOTION */
:focus-visible {
  outline: 2px solid var(--color-line-strong);
  outline-offset: 2px;
}
.band--invert :focus-visible {
  outline-color: var(--color-text-invert);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0ms !important;
    scroll-behavior: auto !important;
  }
}

/*
================================================================
*/