/* ═══════════════════════════════════════════════════════════
   DESIGN EXECUTION — Shared Stylesheet
   designexecution.co.uk/style.css
   
   Mobile-first. Single source of truth.
   See DESIGN-SYSTEM.md for usage documentation.
   ═══════════════════════════════════════════════════════════ */

/* ——— TOKENS ——— */
:root {
  /* Backgrounds */
  --bg:          #0c0c0e;
  --bg-elevated: #141418;
  --bg-card:     #1a1a20;

  /* Text */
  --text:        #e8e4dd;
  --text-dim:    #8a857d;
  --text-muted:  #5a5650;
  --white:       #f5f2ec;

  /* Accent */
  --accent:      #e85d3a;
  --accent-glow: rgba(232, 93, 58, 0.12);
  --accent-hover:#d14e2e;

  /* Rules & borders */
  --rule:        rgba(232, 93, 58, 0.25);
  --rule-subtle: rgba(255, 255, 255, 0.06);

  /* Data palette (charts, stats, callouts) */
  --green:  #30d158;
  --cyan:   #64d2ff;
  --amber:  #ffd60a;
  --pink:   #ff375f;
  --blue:   #0a84ff;

  /* Type stacks */
  --font-serif: 'Libre Baskerville', Georgia, serif;
  --font-sans:  'DM Sans', sans-serif;
  --font-mono:  'JetBrains Mono', monospace;

  /* Spacing scale (mobile base) */
  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  1.5rem;
  --space-lg:  2.5rem;
  --space-xl:  4rem;
  --space-2xl: 6rem;

  /* Layout */
  --max-width:   900px;
  --content-width:660px;
  --gutter:      1.5rem;   /* mobile */
}

/* ——— RESET ——— */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }

/* ——— TYPOGRAPHY ——— */
.t-serif  { font-family: var(--font-serif); }
.t-sans   { font-family: var(--font-sans); }
.t-mono   { font-family: var(--font-mono); }

/* ——— NAV ——— */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--gutter);
  border-bottom: 1px solid var(--rule-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 12, 14, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  flex-wrap: wrap;
}
.nav-logo {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--white);
  text-decoration: none;
}
.nav-logo .dot { color: var(--accent); }

/* Hamburger — visible on mobile by default */
.nav-toggle {
  display: block;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
  z-index: 101;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  margin: 5px 0;
  transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Nav links — mobile: hidden vertical list; toggled via .open */
.nav-links {
  display: none;
  flex-direction: column;
  width: 100%;
  gap: 0;
  padding: 0.8rem 0 0.4rem;
  order: 3;
  list-style: none;
}
.nav-links.open { display: flex; }
.nav-links li { list-style: none; }
.nav-links a {
  display: block;
  padding: 0.7rem 0;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-subtle);
  transition: color 0.3s;
}
.nav-links li:last-child a { border-bottom: none; }
.nav-links a:hover, .nav-links a.active { color: var(--accent); }

/* ——— HERO ——— */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-xl) var(--gutter) var(--space-lg);
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -200px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}
.hero-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  animation: fadeUp 0.6s ease both;
}
.hero-tag::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--accent);
}
.hero h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(2rem, 5.5vw, 3.6rem);
  line-height: 1.12;
  color: var(--white);
  margin-bottom: var(--space-md);
  max-width: 780px;
  animation: fadeUp 0.7s ease 0.1s both;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-deck {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-dim);
  max-width: 580px;
  margin-bottom: var(--space-lg);
  animation: fadeUp 0.7s ease 0.2s both;
}
.hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  animation: fadeUp 0.7s ease 0.3s both;
}
.hero-meta .sep { color: var(--accent); }

/* ——— STAT CARDS ——— */
.stat-row {
  max-width: var(--max-width);
  margin: 0 auto var(--space-lg);
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}
.stat-row.three { grid-template-columns: 1fr 1fr 1fr; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--rule-subtle);
  border-radius: 3px;
  padding: var(--space-md) var(--space-sm);
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s;
}
.stat-card:hover { border-color: var(--rule); }
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.3s;
}
.stat-card:hover::after { opacity: 1; }
.stat-number {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.8rem;
  line-height: 1;
  margin-bottom: 0.5rem;
  color: var(--white);
}
.stat-number.red    { color: var(--accent); }
.stat-number.green  { color: var(--green); }
.stat-number.cyan   { color: var(--cyan); }
.stat-number.amber  { color: var(--amber); }
.stat-number.pink   { color: var(--pink); }
.stat-label {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  line-height: 1.4;
}

/* ——— SECTION DIVIDER ——— */
.section-divider {
  max-width: var(--max-width);
  margin: 0 auto var(--space-lg);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.section-divider .line { flex: 1; height: 1px; background: var(--rule-subtle); }
.section-divider .label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ——— ARTICLE BODY ——— */
.article {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--gutter) var(--space-xl);
}
.article p {
  font-size: 1.05rem;
  line-height: 1.85;
  margin-bottom: var(--space-md);
  color: var(--text);
}
.article p strong { color: var(--white); font-weight: 600; }
.article p.lede {
  font-size: 1.12rem;
  color: var(--white);
  line-height: 1.8;
}
.article p.lede::first-letter {
  font-size: 3.8rem;
  float: left;
  line-height: 0.78;
  margin: 0.08em 0.1em 0 0;
  color: var(--accent);
  font-weight: 700;
}

/* Section marker (inline) */
.section-mark {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 3rem 0 var(--space-md);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.section-mark::before { content: '//'; color: var(--text-muted); }

/* ——— PULL QUOTE ——— */
.pullquote {
  margin: var(--space-lg) calc(-1 * var(--space-xs));
  padding: 2rem var(--space-md);
  border-left: 3px solid var(--accent);
  background: var(--bg-elevated);
}
.pullquote p {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--white);
  margin-bottom: 0;
}
.pullquote .attrib {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 0.8rem;
  display: block;
}

/* ——— SOURCE CITATION ——— */
.source {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-top: -0.8rem;
  margin-bottom: var(--space-md);
  padding-left: var(--space-sm);
  border-left: 1px solid var(--rule-subtle);
  line-height: 1.6;
}
.source a { color: var(--text-dim); text-decoration: none; transition: color 0.3s; }
.source a:hover { color: var(--accent); }

/* ——— CHART CARD ——— */
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--rule-subtle);
  border-radius: 3px;
  padding: var(--space-md);
  margin: 2rem 0;
}
.cc-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--white);
  margin-bottom: 0.2rem;
}
.cc-sub {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  letter-spacing: 0.04em;
}
.cc-canvas { position: relative; width: 100%; height: 240px; }
.cc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.8rem;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  color: var(--text-dim);
}
.cc-legend span { display: flex; align-items: center; gap: 4px; }
.cc-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.cc-src {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
  line-height: 1.5;
}
.cc-src a { color: var(--text-dim); text-decoration: none; }

/* ——— CALLOUT BOX ——— */
.callout {
  background: var(--bg-card);
  border: 1px solid var(--rule-subtle);
  border-left: 3px solid var(--green);
  border-radius: 0 3px 3px 0;
  padding: var(--space-md);
  margin: 2rem 0;
}
.callout.warn { border-left-color: var(--amber); }
.callout.hot  { border-left-color: var(--accent); }
.callout h4 {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.6rem;
}
.callout.warn h4 { color: var(--amber); }
.callout.hot h4  { color: var(--accent); }
.callout p {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}
.callout p:last-child { margin-bottom: 0; }
.callout p strong { color: var(--white); }

/* ——— FRAMEWORK GRID ——— */
.fw-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--rule-subtle);
  border-radius: 3px;
  overflow: hidden;
  margin: 2rem 0;
}
.fw-cell {
  background: var(--bg-card);
  padding: var(--space-md);
}
.fw-cell h5 {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.fw-cell p {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0;
}

/* ——— CTA BAND ——— */
.cta-band {
  max-width: var(--max-width);
  margin: 0 auto var(--space-xl);
  padding: 0 var(--gutter);
}
.cta-inner {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  text-align: center;
}
.cta-text h3 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--white);
  margin-bottom: 0.4rem;
}
.cta-text p {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.55;
}
.cta-btn, .send-btn {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--accent);
  border: none;
  padding: 1rem 2.2rem;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.3s, transform 0.2s;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.cta-btn:hover, .send-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* ——— FOOTER ——— */
.footer {
  border-top: 1px solid var(--rule-subtle);
  padding: 2rem var(--gutter);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: center;
  text-align: center;
  max-width: var(--max-width);
  margin: 0 auto;
}
.footer-left {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.footer-right {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
}

/* ——— FORM FIELDS ——— */
.contact-fields { display: flex; flex-direction: column; gap: var(--space-sm); margin-bottom: 2rem; }
.field-row { display: grid; grid-template-columns: 1fr; gap: var(--space-sm); }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.field input,
.field textarea,
.field select {
  background: var(--bg-card);
  border: 1px solid var(--rule-subtle);
  border-radius: 2px;
  padding: 0.8rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--white);
  outline: none;
  transition: border-color 0.3s;
  width: 100%;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-muted); }
.field input:focus,
.field textarea:focus,
.field select:focus { border-color: var(--accent); }
.field textarea { min-height: 100px; resize: vertical; }
.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238a857d' d='M1.4 0L6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}
.field select option { background: var(--bg-card); color: var(--white); }

.contact-footnote {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 1.2rem;
  line-height: 1.6;
}

/* ——— SCROLL REVEAL ——— */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ——— ANIMATION ——— */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — TABLET (640px+)
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 640px) {
  :root { --gutter: 2.5rem; }
  .fw-grid { grid-template-columns: 1fr 1fr; }
  .cc-canvas { height: 300px; }
  .field-row { grid-template-columns: 1fr 1fr; }
  .stat-row { grid-template-columns: repeat(4, 1fr); }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — DESKTOP (680px+)
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 680px) {
  .nav { padding: var(--space-md) var(--gutter); }

  /* Hide hamburger, show horizontal nav */
  .nav-toggle { display: none; }
  .nav-links {
    display: flex;
    flex-direction: row;
    width: auto;
    gap: 2rem;
    padding: 0;
    order: 0;
  }
  .nav-links a {
    display: inline;
    padding: 0;
    font-size: 0.72rem;
    border-bottom: none;
  }

  /* Pull quotes get breathing room */
  .pullquote { margin: var(--space-lg) -2rem; padding: 2.5rem; }

  /* CTA layout side-by-side */
  .cta-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    text-align: left;
  }

  /* Footer side-by-side */
  .footer {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}
