/* ==========================================================================
   ANTIGONE — site stylesheet
   Headings: Test National (Klim trial)   Body: ABC Otto (Dinamo trial)
   Both are trial licences — see assets/fonts/README.md
   ========================================================================== */

/* ---------- Fonts -------------------------------------------------------- */

@font-face {
  font-family: "National";
  src: url("../fonts/National-Thin.woff2") format("woff2");
  font-weight: 100; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "National";
  src: url("../fonts/National-ThinItalic.woff2") format("woff2");
  font-weight: 100; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "National";
  src: url("../fonts/National-Light.woff2") format("woff2");
  font-weight: 200; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "National";
  src: url("../fonts/National-LightItalic.woff2") format("woff2");
  font-weight: 200; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "National";
  src: url("../fonts/National-Book.woff2") format("woff2");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "National";
  src: url("../fonts/National-BookItalic.woff2") format("woff2");
  font-weight: 300; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "National";
  src: url("../fonts/National-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "National";
  src: url("../fonts/National-RegularItalic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "National";
  src: url("../fonts/National-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "National";
  src: url("../fonts/National-MediumItalic.woff2") format("woff2");
  font-weight: 500; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "National";
  src: url("../fonts/National-Semibold.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "National";
  src: url("../fonts/National-SemiboldItalic.woff2") format("woff2");
  font-weight: 600; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "National";
  src: url("../fonts/National-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "National";
  src: url("../fonts/National-BoldItalic.woff2") format("woff2");
  font-weight: 700; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "National";
  src: url("../fonts/National-Extrabold.woff2") format("woff2");
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "National";
  src: url("../fonts/National-ExtraboldItalic.woff2") format("woff2");
  font-weight: 800; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "National";
  src: url("../fonts/National-Black.woff2") format("woff2");
  font-weight: 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "National";
  src: url("../fonts/National-BlackItalic.woff2") format("woff2");
  font-weight: 900; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Otto";
  src: url("../fonts/Otto-Light.woff2") format("woff2");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Otto";
  src: url("../fonts/Otto-LightItalic.woff2") format("woff2");
  font-weight: 300; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Otto";
  src: url("../fonts/Otto-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Otto";
  src: url("../fonts/Otto-Italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Otto";
  src: url("../fonts/Otto-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Otto";
  src: url("../fonts/Otto-MediumItalic.woff2") format("woff2");
  font-weight: 500; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Otto";
  src: url("../fonts/Otto-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Otto";
  src: url("../fonts/Otto-BoldItalic.woff2") format("woff2");
  font-weight: 700; font-style: italic; font-display: swap;
}

/* ---------- Tokens ------------------------------------------------------- */

:root {
  /* Change these two lines if the trial fonts sit under different family names. */
  --font-head: "National", "Test National", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Otto", "ABC Otto Trial", Iowan Old Style, Charter, Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  --paper:      #F4F1EA;
  --paper-sunk: #EAE5DB;
  --paper-card: #FBF9F5;
  --ink:        #191510;
  --ink-soft:   #554E42;
  --ink-faint:  #8B8272;
  --rule:       #DAD3C5;
  --rule-soft:  #E6E0D4;
  --accent:     #A03421;
  --accent-dim: #7C2717;
  --accent-wash:#F1DDD6;
  --focus:      #1B4E8F;

  /* Text fills the column beside the menu and reflows with the window, so a
     wide window shows more of a paragraph per line and a narrow one less.
     The caps only stop line length running away on very large monitors. */
  --measure:      min(100%, 74rem);
  --measure-wide: min(100%, 88rem);

  --gutter:  clamp(1.25rem, 3.5vw, 3.25rem);
  --shell:   min(100%, 92rem);
  --sidebar: clamp(12.5rem, 17vw, 16.5rem);

  --shadow-card: 0 1px 2px rgba(25,21,16,.05), 0 8px 24px -14px rgba(25,21,16,.22);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.62;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--accent); color: var(--accent-dim); }

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

h1, h2, h3, h4, h5, .head {
  font-family: var(--font-head);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}

.eyebrow {
  font-family: var(--font-head);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1rem;
}

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

/* Everything on a page hangs off the same left edge, so headings, prose and
   lists line up down the whole column. */
.shell { width: 100%; max-width: var(--shell); margin-inline: 0; padding-inline: var(--gutter); }
.measure { max-width: var(--measure); }
.measure-wide { max-width: var(--measure-wide); }

.canvas { display: flex; flex-direction: column; min-height: 100vh; min-width: 0; }
main { flex: 1 0 auto; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--paper); padding: .7rem 1rem;
  font-family: var(--font-head); font-size: .85rem;
}
.skip:focus { left: .5rem; top: .5rem; }

/* ---------- Sidebar ------------------------------------------------------ */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: clamp(1rem, 2.5vw, 1.75rem) var(--gutter);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.sidebar__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.sidebar__auth { display: flex; flex-wrap: wrap; gap: .5rem; min-width: 0; }

.wordmark {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark:hover { color: var(--accent-dim); }

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block;
  font-family: var(--font-head);
  font-size: .88rem;
  letter-spacing: .01em;
  padding: .5rem 0 .5rem .85rem;
  margin-left: -.85rem;
  text-decoration: none;
  color: var(--ink-soft);
  border-left: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.site-nav a:hover { color: var(--ink); border-left-color: var(--rule); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 500; border-left-color: var(--accent); }
.site-nav a.is-private::after {
  content: "";
  display: inline-block; width: 5px; height: 5px; margin-left: .45rem; vertical-align: .12em;
  border-radius: 50%; background: var(--accent);
}

.nav-toggle {
  font: 500 .78rem/1 var(--font-head); letter-spacing: .1em; text-transform: uppercase;
  background: none; border: 1px solid var(--rule); border-radius: 3px;
  padding: .5rem .7rem; color: var(--ink); cursor: pointer;
}

/* Narrow windows: the sidebar folds into one bar with a menu button. */
@media (max-width: 899px) {
  .sidebar {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    column-gap: .65rem; row-gap: .9rem;
  }
  .sidebar__top { display: contents; }
  .wordmark      { grid-column: 1; grid-row: 1; }
  .sidebar__auth { grid-column: 2; grid-row: 1; }
  .nav-toggle    { grid-column: 3; grid-row: 1; }
  .site-nav      { grid-column: 1 / -1; grid-row: 2; }

  .site-nav { display: none; }
  .site-nav[data-open="true"] { display: block; }
  .site-nav a { border-left: 0; margin-left: 0; padding: .6rem 0; border-bottom: 1px solid var(--rule-soft); }
  .site-nav a[aria-current="page"] { box-shadow: inset 2px 0 0 var(--accent); padding-left: .6rem; }
}

/* Wide windows: a real column that stays put while the page scrolls. */
@media (min-width: 900px) {
  body { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
  .sidebar {
    position: sticky; top: 0;
    height: 100vh; overflow-y: auto;
    border-bottom: 0;
    border-right: 1px solid var(--rule);
    padding-block: clamp(1.75rem, 3.5vw, 2.75rem);
    gap: 2.5rem;
  }
  .sidebar__auth { margin-top: auto; flex-direction: column; align-items: stretch; width: 100%; }
  .sidebar__auth .btn--cta { justify-content: center; }
  .sidebar__auth .auth-chip {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .5rem;
    width: 100%;
  }
  .sidebar__auth .auth-chip__avatar { grid-column: 1; grid-row: 1; }
  .sidebar__auth .auth-chip__name {
    grid-column: 2; grid-row: 1; align-self: center;
    overflow-wrap: anywhere;
  }
  .sidebar__auth .auth-chip__role,
  .sidebar__auth .auth-chip [data-signout] { grid-column: 1 / -1; justify-self: start; }
  .nav-toggle { display: none; }
}

/* ---------- Auth chip ---------------------------------------------------- */

.auth-chip { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.auth-chip__avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--paper-sunk); }
.auth-chip__name { font-family: var(--font-head); font-size: .8rem; }
.auth-chip__role {
  font-family: var(--font-head); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase;
  padding: .18rem .4rem; border: 1px solid var(--rule); border-radius: 2px; color: var(--ink-faint);
}
.auth-chip__role[data-role="editor"] { color: var(--accent); border-color: var(--accent-wash); background: var(--accent-wash); }

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

.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: var(--font-head); font-size: .8rem; font-weight: 500;
  letter-spacing: .06em;
  padding: .55rem .95rem;
  border: 1px solid var(--ink); border-radius: 3px;
  background: var(--ink); color: var(--paper);
  cursor: pointer; text-decoration: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--accent-dim); border-color: var(--accent-dim); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn--ghost:hover { background: var(--paper-sunk); color: var(--ink); border-color: var(--ink-faint); }
.btn--small { font-size: .72rem; padding: .38rem .6rem; }
.btn--cta {
  font-size: .88rem;
  letter-spacing: .03em;
  padding: .7rem 1.05rem;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn--cta:hover { background: var(--accent-dim); border-color: var(--accent-dim); }
.btn--danger { background: transparent; color: var(--accent); border-color: var(--accent-wash); }
.btn--danger:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- Hero --------------------------------------------------------- */

.hero { padding: clamp(3rem, 9vw, 6.5rem) 0 clamp(1.5rem, 4vw, 2.5rem); }
.hero__acronym {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(3.2rem, 13vw, 8.5rem);
  letter-spacing: .02em;
  line-height: .92;
  margin: 0;
}
.hero__acronym .glyph-alt { color: var(--accent); }
.hero__long {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: clamp(1.05rem, 2.6vw, 1.6rem);
  letter-spacing: -.005em;
  color: var(--ink-soft);
  margin: 1.1rem 0 0;
  max-width: var(--measure);
}
/* ---------- Sections ----------------------------------------------------- */

.section { padding: clamp(2rem, 4.5vw, 3.25rem) 0; }
.section:last-of-type { padding-bottom: clamp(2.5rem, 6vw, 4rem); }
.section__title { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin-bottom: 1.5rem; }

.page-head { padding: clamp(2.5rem, 7vw, 4.5rem) 0 clamp(1.5rem, 3vw, 2.25rem); }
.page-head h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
.page-head p { color: var(--ink-soft); margin: 1rem 0 0; max-width: var(--measure); }
.page-head .measure-wide { max-width: var(--measure-wide); }

.prose p { margin: 0 0 1.15rem; }
.prose p:last-child { margin-bottom: 0; }
.prose em { font-style: italic; }
.prose strong { font-weight: 500; }
.prose--lead { font-size: 1.15rem; line-height: 1.58; }
.prose--lead p:first-child::first-line { font-family: inherit; }

/* Objectives */
.objectives { list-style: none; counter-reset: obj; margin: 0; padding: 0; display: grid; gap: 1.5rem; max-width: var(--measure-wide); }
@media (min-width: 780px) { .objectives { grid-template-columns: 1fr 1fr; gap: 2rem 3rem; } }
.objectives li {
  counter-increment: obj;
  position: relative;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}
.objectives li::before {
  content: counter(obj, decimal-leading-zero);
  display: block;
  font-family: var(--font-head); font-weight: 700; font-size: .82rem; letter-spacing: .1em;
  color: var(--accent);
  margin-bottom: .55rem;
}
.objectives h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.objectives p { margin: 0; font-size: .97rem; color: var(--ink-soft); }

/* ---------- Consortium register ----------------------------------------- */

.consortium__lead { margin-bottom: clamp(2.5rem, 6vw, 4rem); max-width: var(--measure-wide); }
.consortium__lead .eyebrow { margin-bottom: .75rem; }
.consortium__lead h2 {
  font-size: clamp(1.9rem, 4.6vw, 3rem);
  letter-spacing: -.02em;
}
.consortium__lead h2 a { text-decoration: none; }
.consortium__lead h2 a:hover { color: var(--accent-dim); }
.consortium__lead .consortium__meta { margin-top: .75rem; }

.consortium__legal {
  font-family: var(--font-head); font-size: .7rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-faint);
  margin: .5rem 0 0;
}
.consortium__meta {
  margin: .3rem 0 0; font-size: .92rem; color: var(--ink-soft);
}

.register { list-style: none; margin: 0; padding: 0; max-width: var(--measure-wide); }
.register li { border-top: 1px solid var(--rule-soft); }
.register li:last-child { border-bottom: 1px solid var(--rule-soft); }

.register__link {
  display: grid; align-items: baseline;
  grid-template-columns: 1fr;
  gap: .2rem 2rem;
  padding: 1.15rem .25rem 1.05rem 0;
  text-decoration: none;
  transition: padding-left .18s ease, background-color .18s ease;
}
@media (min-width: 720px) {
  .register__link { grid-template-columns: minmax(0, 1fr) 10rem 9rem; }
}
.register__link:hover,
.register__link:focus-visible {
  background: color-mix(in srgb, var(--paper-sunk) 60%, transparent);
  padding-left: .75rem;
}

.register__name {
  font-family: var(--font-head); font-weight: 500;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.2;
  letter-spacing: -.01em;
  transition: color .18s ease;
}
.register__link:hover .register__name { color: var(--accent-dim); }
.register__place { font-size: .9rem; color: var(--ink-soft); }
.register__host {
  font-family: var(--font-head); font-size: .78rem; letter-spacing: .03em;
  color: var(--ink-faint);
}
@media (min-width: 720px) { .register__host { text-align: right; } }

.register__note {
  margin: -.5rem 0 1rem;
  font-size: .82rem; color: var(--ink-faint); font-style: italic;
  max-width: 46ch;
}

/* ---------- Entry lists (projects / pubs / media / datasets) ------------- */

.entry-list { list-style: none; margin: 0; padding: 0; max-width: var(--measure-wide); border-top: 1px solid var(--rule); }
.entry {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
  display: grid; gap: .5rem;
}
.entry__head { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
.entry__title { font-family: var(--font-head); font-size: 1.2rem; font-weight: 500; }
.entry__title a { text-decoration: none; }
.entry__title a:hover { color: var(--accent-dim); text-decoration: underline; text-decoration-color: var(--accent); }
.entry__desc { margin: 0; color: var(--ink-soft); max-width: var(--measure); }
.entry__foot { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; font-size: .78rem; color: var(--ink-faint); font-family: var(--font-head); }
.entry__url { word-break: break-all; }

.badge {
  font-family: var(--font-head); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase;
  padding: .2rem .45rem; border-radius: 2px; border: 1px solid var(--rule); color: var(--ink-faint);
  white-space: nowrap;
}
.badge--private { color: var(--accent); background: var(--accent-wash); border-color: var(--accent-wash); }
.badge--public  { color: #2C5F3F; background: #E1EDE4; border-color: #E1EDE4; }

/* ---------- People ------------------------------------------------------- */

.people-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.75rem 2rem; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
.person__photo { aspect-ratio: 4/5; background: var(--paper-sunk); border: 1px solid var(--rule); object-fit: cover; margin-bottom: .7rem; }
.person__name { font-family: var(--font-head); font-size: 1rem; font-weight: 500; }
.person__role { font-size: .85rem; color: var(--ink-soft); }
.person__org { font-size: .78rem; color: var(--ink-faint); font-family: var(--font-head); letter-spacing: .03em; }

/* ---------- Empty / upcoming states -------------------------------------- */

.upcoming {
  border: 1px dashed var(--rule);
  background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(160,52,33,.025) 10px 20px);
  padding: clamp(2rem, 5vw, 3.25rem);
  text-align: left;
  border-radius: 3px;
}
.upcoming__label {
  font-family: var(--font-head); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .6rem;
}
.upcoming p { margin: 0; color: var(--ink-soft); max-width: var(--measure); }
.upcoming .btn { margin-top: 1.25rem; }

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

.panel {
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: clamp(1.25rem, 3vw, 2rem);
}
.panel + .panel { margin-top: 1.25rem; }
.panel__title { font-size: 1.15rem; margin-bottom: .35rem; }
.panel__hint { font-size: .88rem; color: var(--ink-soft); margin: 0 0 1.25rem; max-width: 52ch; }

.field { display: block; margin-bottom: 1rem; }
.field > span {
  display: block; margin-bottom: .35rem;
  font-family: var(--font-head); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint);
}
.field input, .field textarea, .field select {
  width: 100%;
  font-family: var(--font-body); font-size: 1rem;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--rule); border-radius: 3px;
  padding: .6rem .7rem;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--ink-faint); }
.field textarea { min-height: 7rem; resize: vertical; line-height: 1.55; }
.field--mono input { font-family: var(--font-mono); font-size: .85rem; }
.field-row { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 620px) { .field-row { grid-template-columns: 1fr 1fr; } }
.checkline { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; font-size: .92rem; }
.checkline input { width: auto; }

.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .5rem; }

.notice {
  font-size: .9rem; padding: .75rem .9rem; border-radius: 3px; margin-bottom: 1rem;
  border: 1px solid var(--rule); background: var(--paper-sunk); color: var(--ink-soft);
}
.notice--error { border-color: var(--accent-wash); background: var(--accent-wash); color: var(--accent-dim); }
.notice--ok { border-color: #CFE2D6; background: #E1EDE4; color: #2C5F3F; }
.notice[hidden] { display: none !important; }

/* ---------- Modal -------------------------------------------------------- */

dialog.modal {
  border: 1px solid var(--rule); border-radius: 4px;
  padding: 0; background: var(--paper-card); color: var(--ink);
  max-width: 34rem; width: calc(100% - 2rem);
  box-shadow: var(--shadow-card);
}
dialog.modal::backdrop { background: rgba(25,21,16,.42); backdrop-filter: blur(2px); }
.modal__inner { padding: clamp(1.4rem, 4vw, 2.1rem); }
.modal__title { font-size: 1.35rem; margin-bottom: .5rem; }
.modal__close { position: absolute; top: .6rem; right: .7rem; background: none; border: 0; font-size: 1.4rem; line-height: 1; color: var(--ink-faint); cursor: pointer; }
.modal__tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--rule); margin-bottom: 1.25rem; }
.modal__tab {
  font-family: var(--font-head); font-size: .78rem; letter-spacing: .05em;
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: .5rem .55rem; cursor: pointer; color: var(--ink-faint);
}
.modal__tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

.steps { counter-reset: step; list-style: none; margin: 0 0 1.25rem; padding: 0; font-size: .9rem; color: var(--ink-soft); }
.steps li { counter-increment: step; padding-left: 1.75rem; position: relative; margin-bottom: .5rem; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: .06rem;
  width: 1.2rem; height: 1.2rem; border-radius: 50%; background: var(--paper-sunk);
  display: grid; place-items: center;
  font-family: var(--font-head); font-size: .66rem; color: var(--ink-soft);
}
.steps code { font-family: var(--font-mono); font-size: .82em; background: var(--paper-sunk); padding: .1rem .3rem; border-radius: 2px; }

/* The token permissions panel, drawn so people can match what they see on
   GitHub against what this site needs. */
.perms {
  margin: .85rem 0 .25rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper-card);
  overflow: hidden;
  font-family: var(--font-head);
}
.perms__bar {
  display: flex; gap: 1.1rem; align-items: baseline;
  padding: .5rem .75rem;
  background: var(--paper-sunk);
  border-bottom: 1px solid var(--rule);
  font-size: .72rem; color: var(--ink-faint);
}
.perms__bar b { color: var(--ink); font-weight: 500; }
.perms__row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: .5rem .75rem; align-items: start;
  padding: .7rem .75rem;
}
.perms__row + .perms__row { border-top: 1px solid var(--rule-soft); }
.perms__name { margin: 0; font-size: .82rem; font-weight: 500; color: var(--ink); }
.perms__desc {
  margin: .2rem 0 0;
  font-family: var(--font-body); font-size: .74rem; line-height: 1.4;
  color: var(--ink-faint);
}
.perms__req {
  font-size: .58rem; letter-spacing: .1em; text-transform: uppercase;
  color: #8A6100; border: 1px solid #E4CE93; border-radius: 999px;
  padding: .1rem .38rem; margin-left: .3rem; white-space: nowrap;
}
.perms__pill {
  font-size: .72rem; white-space: nowrap;
  border: 1px solid var(--rule); border-radius: 3px;
  background: var(--paper); color: var(--ink);
  padding: .32rem .5rem;
}
.perms figcaption {
  padding: .5rem .75rem;
  border-top: 1px solid var(--rule-soft);
  font-family: var(--font-body); font-size: .72rem; font-style: italic;
  color: var(--ink-faint);
}
@media (max-width: 460px) {
  .perms__row { grid-template-columns: 1fr; }
}

/* ---------- Inline editing ---------------------------------------------- */

[data-editable].is-editable {
  position: relative;
  outline: 1px dashed var(--rule); outline-offset: .7rem;
  border-radius: 2px;
  transition: outline-color .15s ease, background-color .15s ease;
}
[data-editable].is-editable:hover { outline-color: var(--ink-faint); }
[data-editable].is-editable::after {
  content: "Edit";
  position: absolute; top: -.4rem; right: -.4rem;
  font-family: var(--font-head); font-size: .58rem; letter-spacing: .12em; text-transform: uppercase;
  background: var(--accent); color: #fff; padding: .16rem .38rem; border-radius: 2px;
  opacity: 0; transition: opacity .15s ease; pointer-events: none;
}
[data-editable].is-editable:hover::after { opacity: 1; }
[data-editable].is-editable:focus {
  outline: 2px solid var(--accent);
  background: #fff;
}
[data-editable].is-dirty { outline: 1px solid var(--accent); }
[data-editable].is-dirty::after,
[data-editable].is-editable:focus::after { opacity: 1; }
[data-editable].is-dirty::after { content: "Unsaved"; background: var(--accent); }

.edit-toolbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 1.25rem; z-index: 60;
  display: flex; align-items: center; gap: .6rem;
  background: var(--ink); color: var(--paper);
  padding: .5rem .7rem; border-radius: 4px;
  box-shadow: 0 10px 30px -12px rgba(0,0,0,.5);
  font-family: var(--font-head); font-size: .78rem;
}
.edit-toolbar .btn { border-color: rgba(255,255,255,.25); background: transparent; color: var(--paper); }
.edit-toolbar .btn[disabled] { opacity: .4; }
.edit-toolbar .btn:hover { background: var(--accent); border-color: var(--accent); }
.edit-toolbar[hidden] { display: none !important; }

/* ---------- Private gate ------------------------------------------------- */

.gate { padding: clamp(2rem, 6vw, 4rem) 0; }
.gate__box {
  border: 1px solid var(--rule); border-radius: 3px; background: var(--paper-card);
  padding: clamp(1.75rem, 5vw, 3rem);
}
.gate__box { max-width: var(--measure-wide); }
.gate__box h2 { font-size: 1.5rem; margin-bottom: .6rem; }
.gate__box p { color: var(--ink-soft); margin: 0 0 1.25rem; }

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

.site-footer {
  margin-top: clamp(3rem, 8vw, 5rem);
  border-top: 1px solid var(--rule);
  background: var(--paper-sunk);
  padding: clamp(2rem, 5vw, 3rem) 0 2rem;
  font-size: .88rem;
}
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-grid h3 {
  font-family: var(--font-head); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: .7rem;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: .35rem; }
.funding {
  display: flex; gap: 1rem; align-items: flex-start;
  border-top: 1px solid var(--rule); margin-top: 2rem; padding-top: 1.5rem;
  color: var(--ink-soft); font-size: .82rem; line-height: 1.55;
}
.funding__flag { flex: none; width: 3.6rem; }
.funding p { margin: 0; max-width: var(--measure-wide); }
.colophon { margin-top: 1.5rem; font-size: .76rem; color: var(--ink-faint); font-family: var(--font-head); letter-spacing: .04em; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media print {
  .sidebar, .site-footer, .edit-toolbar, .btn { display: none !important; }
  body { background: #fff; }
}
