/* =====================================================================
   CogGuide stylesheet
   Change colours and fonts here; everything else follows.
   ===================================================================== */

/* ---------- Fonts (stored in fonts/, so nothing loads from Google) ---------- */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(fonts/inter-normal.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url(fonts/inter-normal.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url(fonts/inter-normal.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(fonts/inter-normal.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Source Serif 4';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url(fonts/source-serif-4-italic.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Source Serif 4';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(fonts/source-serif-4-normal.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Source Serif 4';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url(fonts/source-serif-4-normal.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #faf9f5;          /* warm off-white page background */
  --ink: #141413;         /* near-black text */
  --muted: #5f5e5a;       /* secondary text */
  --rule: #e2e0d8;        /* hairline dividers */
  --accent: #8ecae6;      /* light blue, used for buttons and highlights */
  --accent-dark: #3a8fbf; /* deeper blue, for hovers and small text */
  --heading: #008F7E;     /* teal, used for section headings and menu links */
  --card: #f2f0ea;        /* slightly darker panel */

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  --max: 1180px;
  --gutter: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .site-header, .btn, .label, .card-num, .role, .pub-type, time, .note, .site-footer {
  font-family: var(--sans);
}

h1 { font-size: clamp(38px, 5.5vw, 60px); font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; margin: 0; }
h2 { color: var(--heading); font-size: 30px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 24px; }
h3 { font-size: 20px; font-weight: 600; line-height: 1.3; margin: 0 0 8px; }
p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }
a { color: inherit; text-decoration: none; }
p a, .hero-links a { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
p a:hover, .hero-links a:hover { text-decoration-color: var(--accent); }
strong { font-weight: 600; }

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

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; }
.skip:focus { left: 8px; z-index: 100; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 249, 245, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.nav-row { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.logo-mark { height: 32px; width: auto; display: block; }
nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 26px; align-items: center; }
nav a { font-size: 14.5px; font-weight: 500; }
nav a:not(.btn) { color: var(--heading); }
nav a:not(.btn):hover { color: var(--accent-dark); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--ink); color: var(--bg);
  padding: 9px 16px; border-radius: 8px;
  font-size: 14.5px; font-weight: 500;
  transition: background .15s;
}
.btn:hover { background: var(--accent-dark); }
.btn-large { background: var(--accent); color: var(--ink); padding: 13px 22px; font-size: 16px; margin-top: 8px; }
.btn-large:hover { background: var(--accent-dark); color: #fff; }

/* ---------- Hero ---------- */
.hero { padding: 96px 0 72px; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.lede { font-size: 24px; line-height: 1.45; margin-bottom: 24px; }
.hero-links { font-family: var(--sans); font-size: 14.5px; line-height: 2; }
.hero-links a { margin-right: 12px; white-space: nowrap; }
.label { font-weight: 600; margin-right: 8px; }

/* ---------- Sections ---------- */
.section { padding: 64px 0; border-top: 1px solid var(--rule); }
.two-col { display: grid; grid-template-columns: 1fr 2fr; gap: 48px; }
.two-col h2 { margin-bottom: 0; }
.note { color: var(--muted); font-size: 15px; margin-top: 32px; }

/* ---------- Cards (What we produce) ---------- */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--card); border-radius: 12px; padding: 28px; }
.card p { font-size: 17px; }
.card-num { display: block; color: var(--accent-dark); font-weight: 600; font-size: 13px; letter-spacing: .08em; margin-bottom: 20px; }

/* ---------- Areas of work ---------- */
.areas { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 32px; }
.area { border-top: 1px solid var(--ink); padding: 20px 0 32px; }
.area p { font-size: 16.5px; line-height: 1.5; }

/* ---------- Steps ---------- */
.steps { padding-left: 1.3em; margin: 0 0 1.1em; }
.steps li { margin-bottom: 6px; }

/* ---------- Publications list ---------- */
.pub-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.pub { display: grid; grid-template-columns: 130px 140px 1fr; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--rule); font-size: 17px; }
.pub time, .pub-type { font-size: 14px; color: var(--muted); padding-top: 3px; }
.pub a:hover { color: var(--accent-dark); }
.pub-empty { display: block; color: var(--muted); }

/* ---------- People ---------- */
.people { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.person { border-top: 1px solid var(--ink); padding-top: 20px; }
.person p { font-size: 16.5px; }
.role { color: var(--accent-dark); font-size: 14px; font-weight: 500; margin-bottom: 12px; }

/* ---------- Participate ---------- */
.participate { background: var(--card); border-top: none; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding: 32px 0; font-size: 14px; color: var(--muted); }
.footer-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a:hover { color: var(--accent-dark); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .areas { grid-template-columns: repeat(2, 1fr); }
  .people, .cards { grid-template-columns: 1fr 1fr; }
  .logo-mark { height: 26px; }
}
@media (max-width: 720px) {
  body { font-size: 17px; }
  .hero { padding: 56px 0 48px; }
  .hero-grid, .two-col { grid-template-columns: 1fr; gap: 24px; }
  .lede { font-size: 20px; }
  .section { padding: 48px 0; }
  .cards, .areas, .people { grid-template-columns: 1fr; }
  nav ul { gap: 14px; }
  .logo-mark { height: 20px; }
  nav li:not(:last-child) { display: none; }   /* on phones, keep only the Participate button */
  .pub { grid-template-columns: 1fr; gap: 4px; }
}

/* =====================================================================
   Paper pages (publications/*.html)
   Same building blocks as the homepage: hero, two-column sections, cards.
   ===================================================================== */
.paper-hero h1 { font-size: clamp(34px, 4.6vw, 52px); }
.crumb { font-family: var(--sans); font-size: 14.5px; margin-bottom: 24px; }
.crumb a { color: var(--heading); }
.crumb a:hover { color: var(--accent-dark); }
.paper-kind { font-family: var(--sans); font-size: 14.5px; color: var(--muted); margin-bottom: 8px; }
.paper-kind .label { color: var(--accent-dark); }
.hero-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.hero-actions .btn-large { margin-top: 0; }
p.hero-actions a, p.crumb a, p.more a { text-decoration: none; }
.btn-plain { font-family: var(--sans); font-size: 15px; font-weight: 500; color: var(--heading); }
.btn-plain:hover { color: var(--accent-dark); }
.more { margin-top: 8px; }

/* Section headings stay in view while you read the long sections */
.sec-head { position: sticky; top: 96px; align-self: start; }
.sec-head .card-num { margin-bottom: 10px; }

.prose h3 { margin: 40px 0 12px; }
.prose h3:first-child { margin-top: 0; }
.sub-num { font-size: 13px; font-weight: 600; letter-spacing: .08em; color: var(--accent-dark); margin-right: 10px; }
.prose p, .prose li { hyphens: auto; }
.abstract-text { font-size: 21px; line-height: 1.5; }

.tags { font-family: var(--sans); font-size: 13.5px; line-height: 2.2; margin-top: 24px; }
.tag { display: inline-block; background: var(--card); border-radius: 999px; padding: 2px 12px; margin-right: 4px; white-space: nowrap; }

.step-cards { grid-template-columns: 1fr 1fr; margin: 8px 0 32px; }
.step-cards h4 { font-family: var(--sans); font-size: 18px; font-weight: 600; margin: 0 0 8px; }
.step-cards p { font-size: 16px; line-height: 1.5; }

.cite, .fn-mark { font-family: var(--sans); font-size: 0.72em; color: var(--muted); white-space: nowrap; }
.cite a, .fn-mark a { color: var(--accent-dark); }
.cite a:hover, .fn-mark a:hover { text-decoration: underline; }
:target { scroll-margin-top: 90px; }
li:target { background: #e8f3f9; border-radius: 4px; }

.footnotes { padding-left: 1.3em; margin: 0 0 32px; font-size: 16px; line-height: 1.5; }
.footnotes li { margin-bottom: 12px; }
.footnotes a:not(.back) { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; overflow-wrap: anywhere; }
.back { font-family: var(--sans); color: var(--accent-dark); }

.refs summary { display: inline-block; cursor: pointer; font-family: var(--sans); font-size: 15px; font-weight: 500; background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 8px; list-style: none; }
.refs summary::-webkit-details-marker { display: none; }
.refs summary:hover { background: var(--accent-dark); }
.refs[open] summary { margin-bottom: 20px; }
.refs ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); font-size: 14.5px; line-height: 1.5; }
.refs li { display: grid; grid-template-columns: 44px 1fr; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.ref-num { font-family: var(--sans); color: var(--muted); font-size: 13px; padding-top: 2px; }
.ref-text { overflow-wrap: anywhere; }
.ref-text a { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.ref-text a:hover { text-decoration-color: var(--accent); }

@media (max-width: 720px) {
  .sec-head { position: static; }
  .step-cards { grid-template-columns: 1fr; }
  .abstract-text { font-size: 18px; }
}

/* =====================================================================
   Framework pages (publications/mental-functions*.html)
   ===================================================================== */
.table-wrap { overflow-x: auto; margin: 8px 0 36px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.45; border-top: 1px solid var(--ink); }
.data-table th { font-family: var(--sans); font-size: 13.5px; font-weight: 600; text-align: left; color: var(--muted); padding: 10px 14px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: bottom; }
.data-table td { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.data-table td:first-child { font-family: var(--sans); font-weight: 600; font-size: 15px; }
.data-table.wide { min-width: 640px; }
.data-table.wide td { font-size: 15px; }
.data-table td.num { font-family: var(--sans); white-space: nowrap; }
.lead-in { font-family: var(--sans); font-weight: 600; }
.fn { margin: 0 0 8px; }
.fn h4 { font-family: var(--sans); font-size: 19px; font-weight: 600; margin: 36px 0 6px; }
.fn .fn-def { margin-bottom: 12px; }
.viz-callout { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--card); border-radius: 12px; padding: 18px 22px; margin: 4px 0 32px; }
.viz-callout p { margin: 0; font-family: var(--sans); font-size: 15.5px; }
p.viz-callout-text a { text-decoration: none; }
.viz-stage { padding-top: 8px; }
.mfv { margin-top: 8px; }
.two-col > * { min-width: 0; }
.home-viz { margin-top: 40px; }
.person h3 a { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 4px; }
.person h3 a:hover { color: var(--accent-dark); text-decoration-color: var(--accent); }
.avatar { display: block; width: 72px; height: 72px; border-radius: 50%; object-fit: cover; margin-bottom: 16px; background: var(--card); box-shadow: 0 0 0 1px var(--rule); }
.avatar-initials { display: flex; align-items: center; justify-content: center; font-family: var(--sans); font-size: 20px; font-weight: 600; color: var(--heading); }
/* Homepage hero gradient */
.hero:not(.paper-hero) { background: linear-gradient(180deg, #418f80 0%, #53998d 3%, #70aba0 8%, #99c3bb 15%, #a4c9c3 20%, #b3d2cc 30%, #c9e0da 45%, #dfebe9 60%, #edf4f2 72%, var(--bg) 88%); }
.pub-main a { display: inline; }
.pills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 0; font-family: var(--sans); }
.pills-label { font-size: 13px; color: var(--muted); margin-right: 2px; }
.pill { display: inline-block; font-size: 12.5px; font-weight: 500; line-height: 1.3; color: #0b5f55; background: #dcefeb; border-radius: 999px; padding: 3px 10px; }
/* ---------- Cognitive guidelines pipeline ---------- */
.gp-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.5fr); gap: 48px; align-items: start; }
.gw { display: block; width: 100%; height: auto; overflow: visible; }
.gw-done { fill: #008F7E; } .gw-active { fill: #7cc3b7; } .gw-todo { fill: #e6ebe8; }
.gw-core { fill: #fff; stroke: var(--rule); }
.gw-lab { font-family: var(--sans); font-size: 12.5px; font-weight: 500; fill: #9a9890; }
.gw-on { fill: var(--ink); font-weight: 600; }
.gw-c1 { font-family: var(--sans); font-size: 15px; font-weight: 600; fill: var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-family: var(--sans); font-size: 13px; color: var(--muted); margin: 16px 0 0; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.lg-done { background: #008F7E; } .lg-active { background: #7cc3b7; } .lg-todo { background: #e6ebe8; }
.gp-note { font-family: var(--sans); font-size: 13px; color: var(--muted); margin-top: 10px; }
.gp-head, .gp-row { display: grid; grid-template-columns: minmax(0, 1.3fr) 200px minmax(0, 1.4fr); gap: 20px; align-items: center; }
.gp-head { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding-bottom: 10px; border-bottom: 1px solid var(--ink); }
.gp-stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; font-size: 10px; letter-spacing: 0; text-transform: none; font-weight: 500; line-height: 1.2; }
.gp-list { list-style: none; margin: 0 0 24px; padding: 0; }
.gp-row { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.gp-name { font-family: var(--sans); font-size: 16px; font-weight: 600; color: var(--ink); }
.gp-status { display: block; font-weight: 400; font-size: 13px; color: var(--heading); margin-top: 2px; }
.gp-quiet .gp-name { color: var(--muted); font-weight: 500; } .gp-quiet .gp-status { color: #9a9890; }
.gp-track { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.gp-cell { height: 10px; border-radius: 5px; } .gp-done { background: #008F7E; } .gp-active { background: #7cc3b7; } .gp-todo { background: #e6ebe8; }
.gp-links { display: flex; flex-wrap: wrap; gap: 6px; font-family: var(--sans); }
a.pill { text-decoration: none; } a.pill:hover { background: #cfe8e3; }
@media (max-width: 900px) { .gp-layout { grid-template-columns: 1fr; } .gw { max-width: 440px; margin: 0 auto; } }
@media (max-width: 640px) { .gp-head { display: none; } .gp-row { grid-template-columns: 1fr; gap: 8px; } }
