/* ============================================================
   datenightdigital — TOKENS
   The only file you edit to reskin the entire site. Every page
   references it from its <helmet>. All element styling is inline
   and reads from these custom properties.

   NOTE ON FONTS: Fraunces (Google Fonts, variable, SOFT 100 / WONK 0) sets
   display. It is loaded by a <link> in every page's <helmet>.
   ============================================================ */

/* Brand faces. Fraunces sets display and headings. Figtree sets body, navigation,
   buttons, forms and labels. Both load from Google Fonts in each page head. */
:root {
  /* ---- Colour — brand palette ----------------------------
     #033334 teal · #ED8563 coral · #ECA5A1 blush
     #7AA9BD sky  · #F7EDEA paper
     -------------------------------------------------------- */
  --ink:        #033334;   /* primary text, dark surfaces */
  --ink-2:      #1C4849;   /* secondary dark */
  --paper:      #F7EDEA;   /* warm off-white canvas */
  --paper-2:    #F0E2DE;   /* recessed canvas */
  --accent:     #ED8563;   /* the confident accent — fills, marks, key data */
  --accent-deep: #A8461F;  /* text-safe coral for links and small type (AA on paper) */
  --accent-hi:  #E0673F;   /* hover fill */
  --accent-lo:  #FBE3DA;   /* accent wash */
  --on-accent:  #033334;   /* type on an accent fill */
  --blush:      #ECA5A1;   /* secondary data colour */
  --sky:        #7AA9BD;   /* secondary data colour */
  --muted:      #586765;   /* secondary text on paper — AA on both --paper (5.15) and --paper-2 (4.70) */
  --muted-dark: #8FA5A4;   /* secondary text on dark */
  --line:       #E3D2CD;   /* hairlines, grid rules */
  --rule:       rgba(3, 51, 52, 0.15);  /* hairline over blush, per the token sheet */
  --ink-80:     rgba(3, 51, 52, 0.8);   /* body copy on paper */
  --ink-55:     rgba(3, 51, 52, 0.55);  /* captions and labels */
  --line-dark:  #14403F;   /* hairlines on dark */
  --dark:       #022526;   /* cinematic surround */
  --paper-glass: color-mix(in srgb, var(--paper) 92%, transparent); /* sticky header */
  --logo-rest:  #5F6E6D;   /* client wordmark at rest, resolves to --ink on hover */
  --on-dark-soft: rgba(247, 237, 234, 0.08);  /* fills on --dark */
  --on-dark-line: rgba(247, 237, 234, 0.45);  /* hairlines on --dark */
  --on-accent-line: #033334;                  /* outlined button on an accent fill */
  --flag:       #7A2FA6;   /* placeholder token on paper — deliberately off-brand */
  --flag-bg:    #F3E7F7;
  --flag-dark:  #E2AEF7;   /* same token on --ink / --dark surfaces */
  --flag-bg-dark: rgba(226,174,247,0.12);

  /* ---- Type --------------------------------------------- */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    'Figtree', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-ui:      'Figtree', 'Helvetica Neue', Helvetica, Arial, sans-serif;  /* labels, nav, buttons, form fields */

  /* Display tokens are Fraunces. None goes below 1.5rem. Weights: 600 for
     mega/hero/1/2/stat, 500 for 3/4, italic for accent lines, never under 300. */
  --t-mega:  clamp(3.5rem, 9vw, 8rem);      /* Display XL — hero */
  --t-hero:  clamp(2.9rem, 7.4vw, 6.5rem);  /* Display XL — page hero */
  --t-1:     clamp(2.5rem, 6vw, 5rem);      /* Display L — section openers */
  --t-2:     clamp(2rem, 4vw, 3.25rem);     /* Display M — page titles */
  --t-3:     clamp(1.6rem, 2.2vw, 2rem);    /* Heading */
  --t-4:     clamp(1.5rem, 1.8vw, 1.65rem); /* Heading, smallest display size */
  --t-stat:  clamp(3rem, 7vw, 6rem);        /* the numbers band */

  /* Body tokens are Figtree. */
  --t-lead:  1.25rem;
  --t-body:  1.0625rem;
  --t-small: 0.9375rem;
  --t-micro: 0.8125rem;   /* uppercase labels and eyebrows */

  --lh-display: 1.06;
  --lh-tight:   1.12;
  --lh-body:    1.6;
  --tr-display: -0.018em;
  --tr-label:   0.08em;

  /* ---- Space -------------------------------------------- */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 144px;
  --section:  clamp(64px, 9vw, 144px);
  --gutter:   clamp(20px, 4.5vw, 64px);
  --cell-pad: clamp(16px, 2.4vw, 36px);  /* symmetric inset for hairline-grid cells */
  --wrap:     1440px;
  --measure:  68ch;
  --measure-long: 62ch;   /* long-form pages, e.g. the founder story */

  /* ---- Radii + motion ----------------------------------- */
  --r-sm: 2px; --r-md: 4px; --r-pill: 999px;
  --d-fast: 140ms; --d: 260ms; --d-slow: 620ms;
  --e: cubic-bezier(0.22, 0.61, 0.36, 1);
  --header-h: 68px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, video, svg { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4, .display, [style*="--font-display"] {
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 0, "WONK" 0;
}
[style*="--font-display"] { font-synthesis: none; }

/* Text links: 2px coral underline that thickens on hover. */
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; transition: text-decoration-thickness var(--d-fast) var(--e), color var(--d-fast) var(--e); }
a:hover { color: var(--accent-deep); text-decoration-thickness: 3px; }

::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 3px; border-radius: var(--r-sm); }

/* ---- Keyframes ----------------------------------------- */
@keyframes dn-marquee-l { from { transform: translate3d(0,0,0); } to { transform: translate3d(-50%,0,0); } }
@keyframes dn-marquee-r { from { transform: translate3d(-50%,0,0); } to { transform: translate3d(0,0,0); } }
@keyframes dn-rise { from { opacity: 0; transform: translate3d(0, 22px, 0); } to { opacity: 1; transform: none; } }
@keyframes dn-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes dn-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes dn-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.72); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

@media print { body { background: #fff; } }

/* ---- Grid hairlines -----------------------------------------
   Dividers belong to the CELL, never to the viewport or the
   container. Each cell carries `box-shadow: 0 0 0 1px <rule>`
   and its grid keeps `gap: 1px`, so neighbouring shadows meet
   as a single hairline and the outer edge is ruled too. Because
   nothing is painted by the container, a grid area with no cell
   in it paints nothing — dividers cannot outlive their cells at
   any column count, and no media query can fall out of sync.
   Cells use symmetric --cell-pad; the grid is pulled out by the
   same amount so column one still aligns to the page grid.
   ------------------------------------------------------------ */

/* ---- Hover photo ---------------------------------------------
   A block marked [data-hover-bg] fades a photo ([data-hover-bg-layer])
   in behind itself on hover or keyboard focus, under a teal scrim,
   and flips its type to paper; [data-hover-accent] goes coral.
   Touch devices keep the plain block. Separate from site.js's
   [data-reveal] scroll animation. */
[data-hover-bg] h2, [data-hover-bg] h3, [data-hover-bg] p, [data-hover-bg] span { transition: color var(--d) var(--e); }
[data-hover-bg-layer] { opacity: 0; transition: opacity var(--d-slow) var(--e); }
[data-hover-bg-layer] img { transform: scale(1.08); transition: transform 1.4s var(--e); }
[data-hover-bg-layer]::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(3, 51, 52, 0.92) 0%, rgba(3, 51, 52, 0.74) 100%); }
[data-hover-bg="color"] { transition: background-color var(--d) var(--e); }
@media (hover: hover) {
  [data-hover-bg="color"]:hover, [data-hover-bg="color"]:focus-within { background-color: var(--dark); }
  [data-hover-bg]:hover [data-hover-bg-layer], [data-hover-bg]:focus-within [data-hover-bg-layer] { opacity: 1; }
  [data-hover-bg]:hover [data-hover-bg-layer] img, [data-hover-bg]:focus-within [data-hover-bg-layer] img { transform: scale(1); }
  [data-hover-bg]:hover h2, [data-hover-bg]:hover h3, [data-hover-bg]:hover p,
  [data-hover-bg]:focus-within h2, [data-hover-bg]:focus-within h3, [data-hover-bg]:focus-within p { color: var(--paper) !important; }
  [data-hover-bg]:hover [data-hover-accent], [data-hover-bg]:focus-within [data-hover-accent] { color: var(--accent) !important; }
}

/* ---- Capability chips ----------------------------------------
   [data-chips] lists cascade in once site.js marks them revealed:
   each chip rises into place in reading order (--i is its index)
   and flashes coral as it lands, then settles to its outline.
   fill-mode backwards so hover styles still win afterwards. */
@keyframes dn-chip {
  0%   { opacity: 0; transform: translate3d(0, 16px, 0) scale(0.92); }
  45%  { opacity: 1; transform: translate3d(0, -3px, 0) scale(1.03); background-color: var(--accent); border-color: var(--accent); color: var(--on-accent); }
  100% { opacity: 1; transform: none; }
}
[data-chips]:not([data-revealed]) > li { opacity: 0; }
[data-chips][data-revealed] > li { animation: dn-chip 900ms var(--e) backwards; animation-delay: calc(var(--i, 0) * 55ms + 200ms); }

/* ---- City strips (Datenight Media) ---- */
[data-city] img { transform: scale(1.02); filter: grayscale(1); transition: transform 1.2s var(--e), filter 600ms var(--e); }
[data-city] img[data-colour] { filter: none; }
[data-city] [data-city-arrow] { display: inline-block; transition: transform var(--d) var(--e); }
@media (hover: hover) {
  [data-city]:hover img, [data-city]:focus-visible img { transform: scale(1.08); }
  [data-city]:hover [data-city-arrow], [data-city]:focus-visible [data-city-arrow] { transform: translate(4px, -4px); }
}

/* ---- Width-dependent behaviour that inline styles cannot express ---- */
@media (max-width: 899px) {
  [data-sticky-wide] { position: static !important; }
  [data-cta-actions] { justify-content: flex-start !important; }
}
