/* ==========================================================================
   alijalalkamali.com — shared design system
   --------------------------------------------------------------------------
   One typeface family (system sans, Inter as the web fallback), a warm
   off-white ground, white panels, hairline borders, and a single warm
   taupe accent. Restraint over decoration.

   Two data colours exist only inside charts and legends:
     --signal-base    baseline / unsteered / observed condition
     --signal-shift   steered / intervened / predicted condition
   ========================================================================== */

/* --- Design tokens ------------------------------------------------------- */

:root {
  /* Ground */
  --ground:      #FAF8F3;
  --panel:       #FFFFFF;
  --panel-edge:  #E8E3DB;

  /* Ink — every value below clears 4.5:1 on both --ground and --panel */
  --ink:         #241F1B;   /* headings            ~14:1 */
  --ink-body:    #332F2B;   /* body text           ~11:1 */
  --ink-soft:    #55504A;   /* secondary text      ~7.4:1 */
  --ink-faint:   #6E6861;   /* incidental only     ~5.3:1 */
  --rule:        #E2DCD2;

  /* The single accent. Darkened from TRIBE's #8B7355 so that accent-coloured
     text clears 4.5:1 on the cream ground rather than sitting just under it. */
  --accent:      #7A6244;
  --accent-soft: #A08A6B;

  /* Data only. Both drawn from TRIBE's warm family — no cool hue anywhere
     on the site. Warm charcoal reads as the baseline, taupe as the change. */
  --signal-base:      #4A443E;
  --signal-base-wash: #DCD6CD;
  --signal-shift:     #8B7355;
  --signal-shift-wash:#E6D9C4;

  /* Type: one family, plus mono for tabular data */
  --display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
  --body:    -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
  --mono:    'SF Mono', 'Monaco', ui-monospace, 'Courier New', monospace;

  /* Scale */
  --measure:   66ch;
  --gutter:    clamp(24px, 5vw, 48px);
  --stack:     clamp(34px, 3.8vw, 48px);
  --radius:    2px;
}

/* --- Reset --------------------------------------------------------------- */

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--ground);
  color: var(--ink-body);
  font-family: var(--body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.68;
  letter-spacing: -0.015em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { max-width: 100%; height: auto; }

/* --- Type ---------------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.028em;
  line-height: 1.15;
  text-wrap: balance;
}

h1 { font-size: clamp(38px, 5.2vw, 58px); line-height: 1.06; letter-spacing: -0.034em; }
h2 { font-size: clamp(25px, 2.8vw, 34px); }
h3 { font-size: clamp(19px, 1.8vw, 23px); font-weight: 600; letter-spacing: -0.022em; }

p { margin: 0 0 1.15em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

strong { font-weight: 600; color: var(--ink); }

/* Micro label: always carries real metadata, never a decorative word. */
.eyebrow,
.band-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 20px;
  max-width: none;
}

.lede {
  font-size: clamp(20px, 1.7vw, 24px);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.022em;
  color: var(--ink-body);
  max-width: 46ch;
}

.note {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: var(--measure);
}

/* --- Links --------------------------------------------------------------- */

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease, color 160ms ease;
}

a:hover { border-bottom-color: var(--accent); }

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

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

.shell { max-width: 1000px; margin: 0 auto; padding: 0 var(--gutter); }

.band { padding-block: var(--stack); }
.band + .band { border-top: 1px solid var(--rule); }

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: var(--gutter); top: 12px; z-index: 10;
  padding: 10px 16px; background: var(--ink); color: var(--panel); border-bottom: 0;
}

/* --- Masthead ------------------------------------------------------------ */

.masthead { border-bottom: 1px solid var(--rule); background: var(--ground); }

.masthead-inner {
  display: flex; flex-wrap: wrap; gap: 10px 30px;
  align-items: baseline; justify-content: space-between;
  padding-block: 22px;
}

.masthead-name {
  font-size: 15px; font-weight: 600; letter-spacing: -0.02em;
  color: var(--ink); border-bottom: 0;
}
.masthead-name:hover { border-bottom: 0; color: var(--accent); }

.masthead-nav {
  display: flex; flex-wrap: wrap; gap: 26px;
  font-size: 14.5px; font-weight: 500; letter-spacing: -0.01em;
}

.masthead-nav a { color: var(--ink-soft); }
.masthead-nav a:hover,
.masthead-nav a[aria-current='page'] { color: var(--accent); border-bottom-color: var(--accent); }

/* --- Buttons ------------------------------------------------------------- */

.button {
  display: inline-block;
  font-size: 14.5px; font-weight: 500; letter-spacing: -0.01em;
  color: #FFFFFF; background: var(--accent);
  padding: 12px 24px; border: 1px solid var(--accent); border-radius: var(--radius);
  transition: opacity 160ms ease;
}
.button:hover { opacity: 0.82; border-bottom-color: var(--accent); }

.button--quiet {
  color: var(--ink-soft); background: var(--panel); border-color: var(--panel-edge);
}
.button--quiet:hover { color: var(--accent); border-color: var(--accent); opacity: 1; }

/* --- Panels -------------------------------------------------------------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  padding: clamp(20px, 2.6vw, 30px);
}

/* --- Footer -------------------------------------------------------------- */

.colophon {
  border-top: 1px solid var(--rule);
  padding-block: 26px 36px;
  font-size: 14px;
  color: var(--ink-soft);
}

.colophon-inner {
  display: flex; flex-wrap: wrap; gap: 10px 30px; justify-content: space-between;
}

.colophon a { color: var(--ink-soft); }
.colophon a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* --- Motion -------------------------------------------------------------- */

@keyframes settle { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.settle { opacity: 0; animation: settle 620ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .settle { opacity: 1; }
}
