/* ============================================================
   AGORA — STYLES
   Visual identity derived from the Agora deck:
   cream ground, mono type, black terminal labels,
   serif display, three thematic accents.
   Edit the tokens below to adjust the whole site.
   ============================================================ */
:root {
  --cream: #f2f0ea;
  --cream-deep: #e9e6dd;
  --ink: #1a1a18;
  --ink-soft: #55544e;
  --line: #cfccc1;

  --media: #c05a30;      /* social media — terracotta */
  --fabric: #6f8a72;     /* social fabric — sage */
  --democracy: #5d5d85;  /* democracy — slate purple */

  --serif: "EB Garamond", Georgia, serif;
  --mono: "Space Mono", "Courier New", monospace;

  --max: 960px;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
header {
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--cream) 92%, transparent);
  backdrop-filter: blur(6px);
}
.header-inner {
  display: flex; align-items: center; gap: 20px;
  padding: 14px 24px; max-width: var(--max); margin: 0 auto;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; margin-right: auto;
}
.brand img { height: 30px; width: auto; }
.brand span { font-family: var(--serif); font-size: 1.35rem; letter-spacing: 0.02em; }

nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a {
  text-decoration: none; font-size: 12.5px; padding: 4px 9px;
  border-radius: 3px; color: var(--ink-soft); white-space: nowrap;
}
nav a:hover { color: var(--ink); background: var(--cream-deep); }
nav a.active { background: var(--ink); color: var(--cream); }

.lang-btn {
  font-family: var(--mono); font-size: 12px; cursor: pointer;
  border: 1px solid var(--ink); background: none; color: var(--ink);
  padding: 4px 10px; border-radius: 3px;
}
.lang-btn:hover { background: var(--ink); color: var(--cream); }

/* ---------- Terminal label (signature element) ---------- */
.label {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--cream);
  font-family: var(--mono); font-size: 14px; letter-spacing: 0.06em;
  padding: 10px 18px; margin-bottom: 28px;
}
.label::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--cream); flex: none;
}

/* ---------- Type ---------- */
h1.display {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(2.4rem, 6vw, 3.6rem); line-height: 1.1;
  margin-bottom: 18px;
}
h2 { font-family: var(--serif); font-weight: 500; font-size: 1.7rem; margin-bottom: 14px; }
h3 { font-family: var(--mono); font-size: 1rem; font-style: italic; margin-bottom: 10px; }
.lead { color: var(--ink-soft); max-width: 620px; }
em, .it { font-style: italic; }

section { padding: 64px 0; }
section + section { border-top: 1px solid var(--line); }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 90px 24px 70px; }
.hero img.logo { height: 190px; width: auto; margin: 0 auto 22px; animation: fadein 1.4s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } }
.hero h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(3rem, 8vw, 4.4rem); }
.hero .tagline { font-style: italic; color: var(--ink-soft); margin: 8px 0 26px; font-size: 1.05rem; }
.hero p.intro { max-width: 600px; margin: 0 auto 32px; text-align: left; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--cream); text-decoration: none;
  font-size: 14px; padding: 12px 22px;
}
.btn::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cream); }
.btn:hover { background: var(--media); }

/* ---------- Pillars / cards ---------- */
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 720px) { .cols-3 { grid-template-columns: 1fr; } }

.card {
  border: 1px solid var(--line); padding: 22px;
  background: color-mix(in srgb, var(--cream) 60%, white 40%);
}
.card h3 { font-style: italic; }
.card.media h3 { color: var(--media); }
.card.fabric h3 { color: var(--fabric); }
.card.democracy h3 { color: var(--democracy); }
.card ul { list-style: none; }
.card ul li::before { content: "–  "; color: var(--ink-soft); }
.card p { font-size: 13.5px; color: var(--ink-soft); }

/* ---------- Chain (problem page) ---------- */
.chain { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: step; }
@media (max-width: 820px) { .chain { grid-template-columns: 1fr; } }
.chain div {
  border: 1px solid var(--ink); padding: 18px 16px; font-size: 13.5px;
  position: relative; background: var(--cream);
}
.chain div::before {
  counter-increment: step; content: "0" counter(step);
  display: block; font-style: italic; color: var(--media); margin-bottom: 8px;
}

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat .n { font-family: var(--serif); font-style: italic; font-size: 3rem; line-height: 1; }
.stat .c { font-size: 13px; color: var(--ink-soft); margin-top: 6px; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; border-left: 1px solid var(--ink); padding-left: 26px; }
.timeline li { position: relative; padding: 7px 0; }
.timeline li::before {
  content: ""; position: absolute; left: -31px; top: 16px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--ink);
}
.timeline li.media::before { background: var(--media); }
.timeline li.fabric::before { background: var(--fabric); }
.timeline li.democracy::before { background: var(--democracy); }
.timeline .d { font-style: italic; color: var(--ink-soft); margin-right: 14px; font-size: 13px; }
.legend { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 26px; font-size: 13px; font-style: italic; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.legend .media i { background: var(--media); }
.legend .fabric i { background: var(--fabric); }
.legend .democracy i { background: var(--democracy); }

/* ---------- Project cards & pages ---------- */
.project-card { text-decoration: none; display: block; }
.project-card:hover { border-color: var(--ink); }
.project-card img {
  border: 1px solid var(--line); margin-bottom: 14px;
  aspect-ratio: 8/5; object-fit: contain; padding: 18px;
  background: var(--cream);
}
.project-card .more { font-size: 12.5px; font-style: italic; color: var(--ink-soft); margin-top: 8px; }
.project-card:hover .more { color: var(--media); }

.project-hero img {
  border: 1px solid var(--line); margin: 26px 0;
  background: var(--cream); padding: 40px 24px;
  max-height: 340px; object-fit: contain; width: 100%;
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; margin-top: 10px; }
@media (max-width: 720px) { .two-col { grid-template-columns: 1fr; } }
.plist { list-style: none; }
.plist li { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.plist li::before { content: "●  "; font-size: 9px; vertical-align: 2px; color: var(--ink-soft); }

.backlink { font-size: 13px; font-style: italic; text-decoration: none; color: var(--ink-soft); }
.backlink:hover { color: var(--ink); }

/* ---------- Partners / about ---------- */
.partner { display: grid; grid-template-columns: 130px 1fr; gap: 26px; align-items: center; padding: 22px 0; border-bottom: 1px dashed var(--line); }
@media (max-width: 600px) { .partner { grid-template-columns: 1fr; } }
.partner img {
  width: 130px; height: 78px; object-fit: contain; object-position: left center;
}
.partner p { font-size: 13.5px; color: var(--ink-soft); }

/* ---------- Journal ---------- */
.post { padding: 22px 0; border-bottom: 1px dashed var(--line); }
.post .d { font-style: italic; font-size: 13px; color: var(--ink-soft); }

/* ---------- Sources ---------- */
.sources { font-size: 13px; color: var(--ink-soft); }
.sources a { color: var(--ink-soft); }
.sources a:hover { color: var(--ink); }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 34px 24px; text-align: center; font-size: 13px; color: var(--ink-soft); }
footer img { height: 44px; width: auto; margin: 0 auto 12px; opacity: 0.65; }

:focus-visible { outline: 2px solid var(--media); outline-offset: 2px; }
