/* ==========================================================================
   dustymccarty.com — design tokens
   --------------------------------------------------------------------------
   This file is the editing surface for design changes. It loads before every
   other stylesheet. Change a value here and it changes everywhere.

   Light and dark are designed independently; neither is derived from the
   other. Switching is automatic via prefers-color-scheme — no toggle, no
   stored preference. The two palettes sit next to each other below so they
   are always edited together.

   Palette: warm cream / warm charcoal. No brand accent hue — an accent would
   compete with every photograph. The only chromatic value is the "safelight"
   focus colour, used for keyboard focus and a few active-state hints.
   ========================================================================== */


/* --------------------------------------------------------------------------
   COLOUR — light (default)
   -------------------------------------------------------------------------- */
:root {
  color-scheme: light dark;

  /* Surfaces */
  --color-bg:              #F6F5F1;  /* page background */
  --color-surface:         #FFFFFF;  /* cards, panels, blog band, form fields */
  --color-surface-sunken:  #F7F6F2;  /* behind a thumbnail before it paints */
  --color-media-bed:       #DEDDD8;  /* behind full-size images and video */

  /* Text */
  --color-text:            #1C1C1B;
  --color-text-body:       #54534E;  /* post and page body copy: a step softer than text, so links and bold stand out (7:1 on bg) */
  --color-text-muted:      #6E6D69;  /* excerpts, secondary copy, nav, portfolio intros */
  --color-text-subtle:     #9A998F;  /* dates, categories, captions */

  /* Hairlines — the only structural device in the system */
  --color-line:            #EDECE8;
  --color-line-strong:     #DEDDD8;  /* field underlines, chip hover */

  /* Signals */
  --color-focus:           #A63C28;  /* "safelight" — focus ring, active index */
  --color-selection:       #F0DAD3;
  --color-error:           #B4543F;
  --color-link-hover:      var(--color-focus);  /* text links on hover (follows focus in each mode) */

  /* Overlays */
  --color-scrim:           rgba(18, 18, 17, .62);
}

/* --------------------------------------------------------------------------
   COLOUR — dark (keep adjacent to the light block above)
   -------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg:              #121211;
    --color-surface:         #1B1B19;
    --color-surface-sunken:  #181816;
    --color-media-bed:       #2C2B28;

    --color-text:            #F3F2EF;
    --color-text-body:       #B3B2AD;  /* 8.8:1 on bg */
    --color-text-muted:      #9C9B96;
    --color-text-subtle:     #6E6D69;

    --color-line:            #232220;
    --color-line-strong:     #2C2B28;

    --color-focus:           #C4553A;  /* slightly brighter to hold contrast on charcoal */
    --color-selection:       #3A2622;
    --color-error:           #D08A78;

    --color-scrim:           rgba(8, 8, 7, .78);
  }
}

/* --------------------------------------------------------------------------
   COLOUR — mode-independent
   The lightbox is a viewing environment, not a surface: it stays dark in both
   modes, because a light lightbox changes how photographs read. The tile veil
   and CTA sit over photographs, so they are fixed too.
   -------------------------------------------------------------------------- */
:root {
  --color-lightbox-bg:     #0D0F11;
  --color-lightbox-text:   #E9E7E2;
  --color-on-image:        #FFFFFF;
  --tile-veil:             linear-gradient(to top, rgba(22, 19, 15, .6), rgba(22, 19, 15, .06) 52%, rgba(22, 19, 15, 0) 78%);
}


/* --------------------------------------------------------------------------
   TYPE
   Three faces, each with one job. The scale below is tuned to these faces —
   if you swap a family, re-check the sizes, line heights and tracking too.
   -------------------------------------------------------------------------- */
:root {
  --font-display:  'Playfair Display', Georgia, serif;     /* titles, headings, pull quotes */
  --font-body:     'Karla', system-ui, sans-serif;         /* reading text, excerpts, fields */
  --font-utility:  'Archivo', system-ui, -apple-system, sans-serif; /* nav, dates, labels, buttons */
  --font-mono:     ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Display sizes scale with the viewport between a floor and a ceiling. */
  --text-display-xl:  clamp(46px, 6.6vw, 92px);
  --text-display-work: clamp(42px, 5.4vw, 76px);  /* single work title */
  --text-display-l:   clamp(38px, 4.6vw, 62px);   /* page, post and index titles */
  --text-display-m:   clamp(28px, 3.2vw, 42px);   /* home blog band title */
  --text-card-title:  clamp(26px, 2.6vw, 34px);   /* blog index card title */
  --text-404:         clamp(30px, 3.4vw, 44px);
  --text-heading:     32px;   /* post h2 */
  --text-subheading:  24px;   /* post h3 */
  --text-title:       22px;   /* grid tile title (All Works) */
  --text-title-s:     18px;   /* grid tile title (home) */
  --text-quote:       27px;
  --text-lede:        23px;
  --text-body:        20px;
  --text-standfirst:  19px;
  --text-body-s:      17px;   /* excerpts */
  --text-small:       16px;   /* footer, comments */
  --text-nav:         11.5px;
  --text-label:       10.5px; /* section labels */
  --text-utility:     10px;   /* dates, categories */
  --text-micro:       9.5px;  /* home tile meta, tile CTA */
  --text-caption:     11.5px; /* captions: sentence case, never uppercased */

  --leading-display:  1;
  --leading-heading:  1.16;
  --leading-title:    1.2;
  --leading-quote:    1.36;
  --leading-lede:     1.56;
  --leading-standfirst: 1.6;
  --leading-body:     1.68;

  --tracking-display: -0.022em;
  --tracking-l:       -0.02em;
  --tracking-heading: -0.014em;
  --tracking-title:   -0.008em;
  --tracking-nav:     0.13em;
  --tracking-utility: 0.15em;  /* uppercase utility text, weight 500 */
  --tracking-label:   0.16em;
  --tracking-caption: 0.05em;

  --measure-text:     720px;  /* long-form column, ~66ch at 20px */
  --measure-page:     660px;  /* about / contact column */
}

/* Phones (≤ 680px): the reading column is only ~320px wide, so desktop sizes
   leave 4–6 words a line. One step down keeps lines near 36–40 characters.
   Line heights are unchanged. Desktop sizes above are untouched. */
@media (max-width: 680px) {
  :root {
    --text-body:        18px;
    --text-lede:        20px;
    --text-standfirst:  17px;
    --text-quote:       23px;
    --text-heading:     28px;
    --text-subheading:  21px;
  }
}


/* --------------------------------------------------------------------------
   SPACING — 4px base
   Section rhythm: 76 between blocks, 56 into a band, 44 from a rule into content.
   -------------------------------------------------------------------------- */
:root {
  --space-1:   4px;
  --space-2:   8px;
  --space-3:   12px;
  --space-4:   16px;
  --space-5:   24px;
  --space-6:   32px;
  --space-7:   44px;
  --space-8:   56px;
  --space-9:   76px;
  --space-10:  96px;
  --space-11:  112px;
  --space-12:  160px;
}


/* --------------------------------------------------------------------------
   LAYOUT
   Grid: > 900px 3 columns · 561–900px 2 columns · ≤ 560px 1 column.
   Mobile (≤ 680px) uses a 26px gutter everywhere.
   -------------------------------------------------------------------------- */
:root {
  --layout-max:        1200px;  /* outer container */
  --layout-pad:        40px;    /* desktop page padding */
  --layout-pad-mobile: 26px;
  --grid-gap:          24px;    /* portfolio grid column + row gap */
  --grid-gap-mobile:   16px;
  --tile-pad:          14px;    /* card padding around a grid thumbnail */
  --media-gap:         44px;    /* gap between images on a single work */
  --radius:            1px;     /* effectively square; never above 1px */
}


/* --------------------------------------------------------------------------
   THE MARK
   The dm signature is a stroked path. It is sized by height (width follows
   its 2.361:1 aspect) and its stroke weight is re-specified per size, so the
   rendered line stays optically constant:
       rendered px = stroke-width × (height ÷ 83.29)
   These are optical adjustments, not a uniform scale — don't "tidy" them.
   Never render below 26px high: the loop in the m closes up.
   -------------------------------------------------------------------------- */
:root {
  --mark-header-height:  34px;  --mark-header-stroke:  3.7;  /* → 1.51px, the floor */
  --mark-footer-height:  26px;  --mark-footer-stroke:  4.8;  /* → 1.50px */
  --mark-hero-height:    132px; --mark-hero-stroke:    0.8;  /* → 1.27px */
}


/* --------------------------------------------------------------------------
   MOTION
   prefers-reduced-motion collapses everything to zero.
   -------------------------------------------------------------------------- */
:root {
  --ease:            cubic-bezier(.33, 0, .16, 1);
  --ease-out:        cubic-bezier(.22, 1, .36, 1);
  --ease-zoom:       cubic-bezier(.16, .84, .44, 1);
  --dur-fast:        200ms;   /* field focus, link colour */
  --dur-open:        220ms;   /* lightbox / overlay fade */
  --dur-veil:        550ms;   /* tile hover veil */
  --dur-zoom:        800ms;   /* tile hover image zoom */
  --dur-draw:        1800ms;  /* signature stroke, once per page load */
  --tile-zoom:       1.058;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0ms;
    --dur-open: 0ms;
    --dur-veil: 0ms;
    --dur-zoom: 0ms;
    --dur-draw: 0ms;
    --tile-zoom: 1;
  }
}
