/* =============================================================================
   ANDISA ADVISORY — DESIGN SYSTEM
   Single source of truth. Edit tokens here; every page inherits them.
   Concept: a scientific reading instrument. Paper surfaces for text,
   dark "canvas" panels for flow-visualisation moments, monospace readouts.
   ============================================================================= */

/* ---- 1. TOKENS ---------------------------------------------------------- */
:root {
  /* Paper / light surfaces */
  --paper:        #f3eee2;
  --paper-2:      #ece5d4;

  /* Ink / text */
  --ink:          #19282e;
  --ink-soft:     #42565d;

  /* Dark panels (canvas backgrounds) */
  --panel:        #0d1a1f;
  --panel-2:      #12262d;

  /* Accents — the working colours */
  --teal:         #39c2b0;   /* current / flow */
  --teal-bright:  #5fe6d2;
  --amber:        #e8a13a;   /* vorticity */
  --amber-bright: #ffc15e;
  --red:          #d9583b;   /* baroclinic — use sparingly */

  /* Lines / borders */
  --line:         #cbbfa6;
  --line-strong:  #a99a78;

  /* Type */
  /* --display: "Fraunces", Georgia, serif; */
  --display: "Playfair Display", Georgia, serif;
  --body:    "Spectral", Georgia, serif;
  --mono:    "IBM Plex Mono", ui-monospace, monospace;

  /* Scale & rhythm */
  --maxw: 1180px;
  --gut:  clamp(1.25rem, 4vw, 3rem);
  --r:    4px;                /* border radius — kept tight, instrument-like */

  --shadow: 0 1px 0 var(--line), 0 18px 40px -28px rgba(13,26,31,.45);
}

/* ---- 2. RESET ----------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1.02rem, .55rem + .7vw, 1.18rem);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* ---- 3. TYPOGRAPHY ------------------------------------------------------ */
h1, h2, h3, .display {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -.015em;
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: clamp(1rem,1.2rem + 5.4vw, 5.4rem); font-weight: 600}
h2 { font-size: clamp(1.9rem, 1rem + 3vw, 3.1rem); }
h3 { font-size: clamp(1.25rem, .9rem + 1.1vw, 1.6rem); font-weight: 600; }
p  { margin: 0 0 1.1em; max-width: 64ch; }
strong { font-weight: 600; }

/* Mono "readouts" — labels, nav, equation/credit tags */
.mono, .eyebrow, .tag, nav a, .readout {
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.eyebrow {
  font-size: .74rem;
  color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: .6em;
  margin-bottom: 1.1rem;
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px; background: var(--line-strong);
}
.lede { font-size: 1.22em; color: var(--ink-soft); max-width: 60ch; }

/* ---- 4. LAYOUT ---------------------------------------------------------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }
section { padding-block: clamp(3.5rem, 8vw, 7rem); }
.section-tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.grid { display: grid; gap: clamp(1.25rem, 3vw, 2.25rem); }
@media (min-width: 760px) {
  .cols-2 { grid-template-columns: repeat(2, 1fr); }
  .cols-3 { grid-template-columns: repeat(3, 1fr); }
  .split  { grid-template-columns: 1.15fr .85fr; align-items: center; }
}

/* Dark canvas sections */
.canvas {
  background: var(--panel);
  color: var(--paper);
  position: relative;
  overflow: hidden;
}
.canvas h1, .canvas h2, .canvas h3 { color: var(--paper); }
.canvas p, .canvas .lede { color: #c6d2d2; }
.canvas .eyebrow { color: var(--teal); }
.canvas .eyebrow::before { background: var(--teal); opacity: .6; }

/* ---- 5. HEADER / NAV ---------------------------------------------------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; padding-block: .8rem; position: relative;
}
.brand img { height: 38px; width: auto; }
nav ul { list-style: none; display: flex; gap: clamp(1rem, 2.5vw, 2.2rem); margin: 0; padding: 0; align-items: center; }
nav a { font-size: .76rem; color: var(--ink-soft); text-decoration: none; padding-block: .4rem; position: relative; transition: color .2s; }
nav a:hover, nav a[aria-current="page"] { color: var(--ink); }
nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; bottom: -.15rem; width: 100%; height: 2px; background: var(--teal);
}
.nav-cta {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  text-decoration: none; padding: .6rem 1rem; border: 1px solid var(--ink); border-radius: var(--r);
  color: var(--ink); transition: background .2s, color .2s;
}
.nav-cta:hover { background: var(--ink); color: var(--paper); }
.site-head .nav-toggle { display: none; }
@media (max-width: 820px) {
  nav ul { display: none; }
  .site-head .nav-toggle { display: inline-flex; }
  nav ul.open {
    display: flex; flex-direction: column; align-items: stretch; gap: 1rem;
    position: absolute; top: calc(100% + .6rem); right: 0; z-index: 60;
    background: var(--paper); border: 1px solid var(--line);
    border-radius: var(--r); padding: 1.2rem 1.4rem; box-shadow: var(--shadow);
    min-width: 200px;
  }
  nav ul.open .nav-cta { text-align: center; }
  .hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.hamburger { position: relative; }
.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  left: 0;
}
.hamburger::before { top: -7px; }
.hamburger::after  { top:  7px; }
}

/* ---- 6. BUTTONS --------------------------------------------------------- */
.btn {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: .6em;
  background: var(--paper);
  padding: .85rem 1.4rem; border-radius: var(--r); text-decoration: none;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s, background .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--teal); color: var(--paper-2); font-weight: 600; }
.btn-primary:hover { background: var(--teal-bright); box-shadow: 0 10px 30px -12px var(--teal); }
.btn-amber { background: var(--amber); color: var(--panel); font-weight: 600; }
.btn-amber:hover { background: var(--amber-bright); box-shadow: 0 10px 30px -12px var(--amber); }
.btn-ghost { border-color: none; color: var(--ink); }
.btn-ghost:hover { background: var(--paper-2); color: var(--ink); }
.canvas .btn-ghost:hover { background: var(--paper); color: var(--panel); }
.btn-arrow::after { content: "→"; font-family: var(--body); }

/* ---- 7. CARDS / PANELS -------------------------------------------------- */
.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: clamp(1.4rem, 3vw, 2rem);
  position: relative;
  transition: border-color .2s, transform .2s;
}
.card:hover { border-color: var(--line-strong); }
.card .tag { font-size: .68rem; color: var(--teal); display: inline-block; margin-bottom: .8rem; }
.card.canvas { background: var(--panel-2); border-color: #1c3a44; }

/* A horizontal rule of mono tags / trust badges */
.badges { display: flex; flex-wrap: wrap; gap: .6rem; }
.badge {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase;
  padding: .5rem .85rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: .5em; background: var(--paper);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.canvas .badge { border-color: #2a4a52; color: #c6d2d2; background: transparent; }

/* "Readout" data tag — for CPD credits, durations, validation no. */
.readout {
  font-size: .7rem; color: var(--ink-soft); display: flex; gap: .4em; align-items: baseline;
}
.readout b { font-family: var(--display); font-size: 1.9rem; font-weight: 600; color: var(--ink); letter-spacing: -.02em; text-transform: none; }
.canvas .readout b { color: var(--paper); }

/* Big stat block */
.stat b { font-family: var(--display); font-size: clamp(2.6rem, 6vw, 4.2rem); font-weight: 600; display: block; line-height: 1; letter-spacing: -.03em; }
.stat .mono { font-size: .72rem; color: var(--ink-soft); margin-top: .6rem; display: block; }
.stat.teal b  { color: var(--teal); }
.stat.amber b { color: var(--amber); }

/* ---- 8. FLOW MOTIF (signature decoration on dark canvas) ---------------- */
.flowfield { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .5; }
.flowfield path { fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-dasharray: 6 16; animation: flow 6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -220; } }
@media (prefers-reduced-motion: reduce) { .flowfield path { animation: none; } }

/* ---- 9. PLACEHOLDER MARKER (visible while drafting; delete in production)  */
.ph {
  background: repeating-linear-gradient(45deg, #ffe9b8, #ffe9b8 8px, #ffe1a0 8px, #ffe1a0 16px);
  border: 1px dashed var(--amber); color: #7a4d00; font-family: var(--mono);
  font-size: .8rem; padding: .15em .45em; border-radius: 3px; text-transform: none; letter-spacing: 0;
}

/* ---- 10. FOOTER --------------------------------------------------------- */
.site-foot { background: var(--panel); color: #9fb0b2; font-size: .92rem; padding-block: clamp(3rem, 6vw, 4.5rem) 2rem; }
.site-foot a { color: var(--teal); text-decoration: none; }
.site-foot a:hover { color: var(--teal-bright); }
.site-foot h4 { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--paper); margin: 0 0 1rem; }
.foot-grid { display: grid; gap: 2rem; }
@media (min-width: 720px) { .foot-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.foot-disclaimer { border-top: 1px solid #1c3a44; margin-top: 2.5rem; padding-top: 1.5rem; font-size: .82rem; color: #7f9092; max-width: 70ch; }
.site-foot .brand img { height: 42px; }

/* ---- 11. UTILITIES ------------------------------------------------------ */
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.accent-teal { color: var(--teal); } .accent-amber { color: var(--amber); } .accent-red { color: var(--red); }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
/* Reveal is an ENHANCEMENT only: hidden state applies solely when JS is active
   (html.js set by an inline head script). No JS => content is fully visible. */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; } }
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }

/* ---- 12. PUBLICATIONS STRIP --------------------------------------------- */
.pub-strip {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.pub-strip-item {
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  align-items: start;
  gap: .8rem 1rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line);
  transition: background .18s;
}
.pub-strip-item:last-child { border-bottom: none; }
.pub-strip-item:hover { background: var(--paper); }
.pub-num {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--teal);
  letter-spacing: .06em;
  padding-top: .25rem;
  text-align: right;
}
.pub-body { min-width: 0; }
.pub-title {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 .3rem;
}
.pub-authors {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .06em;
  color: var(--ink-soft);
  margin: 0 0 .25rem;
}
.pub-journal {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .04em;
  color: var(--ink-soft);
  margin: 0;
}
.pub-journal em { font-style: italic; color: var(--amber); }
.pub-link {
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--teal);
  text-decoration: none;
  border: 1px solid var(--teal);
  border-radius: 2px;
  padding: .25rem .55rem;
  white-space: nowrap;
  align-self: start;
  transition: background .18s, color .18s;
}
.pub-link:hover { background: var(--teal); color: var(--panel); }
@media (max-width: 600px) {
  .pub-strip-item { grid-template-columns: 2.2rem 1fr; }
  .pub-link { grid-column: 2; justify-self: start; margin-top: .4rem; }
}

.policy-wrap {
      max-width: 720px;
      margin: 0 auto;
      padding: 4rem 1.5rem 6rem;
    }

    /* ── Metadata bar ── */
    .policy-meta {
      display: flex;
      gap: 2rem;
      flex-wrap: wrap;
      margin-bottom: 2.5rem;
      padding-bottom: 1.5rem;
      border-bottom: 1px solid var(--border, #e4e0d8);
    }
    .policy-meta span {
      font-family: var(--mono, 'IBM Plex Mono', monospace);
      font-size: 0.72rem;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: var(--paper-2);
    }
    .policy-meta strong {
      color: var(--teal);
    }

    /* ── Section headings ── */
    .policy-wrap h1 {
      font-family: var(--display, 'Playfair Display', Georgia, serif);
      font-size: clamp(1.75rem, 4vw, 2.5rem);
      font-weight: 700;
      line-height: 1.15;
      color: var(--ink, #1a1714);
      margin: 0 0 0.5rem;
    }
    .policy-wrap .eyebrow {
      font-family: var(--mono, 'IBM Plex Mono', monospace);
      font-size: 0.7rem;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--accent-teal, #0e7d6e);
      margin: 0 0 0.75rem;
    }
    .policy-wrap h2 {
      font-family: var(--display, 'Playfair Display', Georgia, serif);
      font-size: 1.2rem;
      font-weight: 700;
      color: var(--ink, #1a1714);
      margin: 2.5rem 0 0.6rem;
      padding-top: 2rem;
      border-top: 1px solid var(--border, #e4e0d8);
    }
    .policy-wrap h2:first-of-type {
      border-top: none;
    }

    /* ── Body copy ── */
    .policy-wrap p,
    .policy-wrap li {
      font-family: var(--body, 'Spectral', Georgia, serif);
      font-size: 1rem;
      line-height: 1.75;
      color: var(--text, #3d3830);
    }
    .policy-wrap ul,
    .policy-wrap ol {
      padding-left: 1.4rem;
      margin: 0.6rem 0 1rem;
    }
    .policy-wrap li + li {
      margin-top: 0.35rem;
    }

    /* ── Highlight box ── */
    .policy-box {
      background: var(--surface-alt, #f5f2ec);
      border-left: 3px solid var(--accent-teal, #0e7d6e);
      padding: 1rem 1.25rem;
      margin: 1.25rem 0;
      border-radius: 0 4px 4px 0;
    }
    .policy-box p {
      margin: 0;
      font-size: 0.93rem;
    }

    /* ── Contact table ── */
    .contact-table {
      width: 100%;
      border-collapse: collapse;
      margin: 1rem 0;
      font-family: var(--body, 'Spectral', Georgia, serif);
      font-size: 0.93rem;
    }
    .contact-table td {
      padding: 0.45rem 0.75rem;
      vertical-align: top;
      color: var(--text, #3d3830);
    }
    .contact-table td:first-child {
      font-family: var(--mono, 'IBM Plex Mono', monospace);
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--muted, #7a7060);
      white-space: nowrap;
      width: 9rem;
    }
    .contact-table tr + tr td {
      border-top: 1px solid var(--border, #e4e0d8);
    }

    /* ── Back link ── */
    .back-link {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      font-family: var(--mono, 'IBM Plex Mono', monospace);
      font-size: 0.72rem;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: var(--accent-teal, #0e7d6e);
      text-decoration: none;
      margin-bottom: 2.5rem;
    }
    .back-link:hover { text-decoration: underline; }