/* ==========================================================================
   Sifr Network — site styles
   Design tokens from Sifr Network design document (Section 2)
   Build: Qoder using kimi-k3
   ========================================================================== */

/* ---------- Fonts (self-hosted, variable) ---------- */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../assets/fonts/space-grotesk-var-latin.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: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../assets/fonts/space-grotesk-var-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF0-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url('../assets/fonts/ibm-plex-sans-var-latin.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: 'IBM Plex Sans';
  font-style: italic;
  font-weight: 100 700;
  font-display: swap;
  src: url('../assets/fonts/ibm-plex-sans-var-italic-latin.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: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url('../assets/fonts/ibm-plex-sans-var-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF0-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: italic;
  font-weight: 100 700;
  font-display: swap;
  src: url('../assets/fonts/ibm-plex-sans-var-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF0-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Design tokens ---------- */
:root {
  --paper: #F8FAFC;
  --paper-dim: #F1F5F9;
  --midnight: #101828;
  --midnight-2: #0B1120;
  --teal: #14B8A6;
  --teal-dark: #0F8378;
  --gold: #F5A524;
  --slate: #64748B;
  --slate-light: #94A3B8;
  --line: #E2E8F0;
  --line-dark: #263449;

  --font-display: 'Space Grotesk', 'IBM Plex Sans', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;

  --w-max: 1200px;
  --w-read: 720px;
  --radius: 16px;
  --radius-sm: 10px;
  --space-section: clamp(64px, 8vw, 96px);

  --focus: 2px solid var(--teal-dark);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--midnight);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(36px, 5vw, 48px); font-weight: 600; }
h2 { font-size: clamp(26px, 3.4vw, 32px); font-weight: 600; }
h3 { font-size: clamp(20px, 2.4vw, 22px); font-weight: 600; }
p { margin: 0 0 1em; max-width: 70ch; }
a { color: var(--teal-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--midnight); }
ul, ol { padding-inline-start: 1.3em; }
li { margin-bottom: 0.35em; }
code, kbd { font-family: var(--font-mono); font-size: 0.9em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

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

.skip-link {
  position: absolute;
  inset-inline-start: 12px;
  top: -48px;
  background: var(--midnight);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 8px;
  z-index: 200;
  transition: top 0.15s ease-out;
}
.skip-link:focus { top: 12px; color: var(--paper); }

.wrap { max-width: var(--w-max); margin-inline: auto; padding-inline: clamp(20px, 4vw, 32px); }
.read { max-width: var(--w-read); }
.section { padding-block: var(--space-section); }
.section + .section { padding-top: 0; }

/* ---------- Eyebrow ---------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 18px;
}
.eyebrow::before { content: ''; width: 28px; height: 3px; background: var(--gold); border-radius: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease-out, background 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out;
}
.btn-primary { background: var(--teal-dark); color: #fff; }
.btn-primary:hover { background: var(--midnight); color: #fff; transform: translateY(-2px); }
.btn-ghost { border-color: currentColor; color: inherit; background: transparent; }
.btn-ghost:hover { transform: translateY(-2px); }
.btn-outline-dark { border-color: var(--midnight); color: var(--midnight); background: transparent; }
.btn-outline-dark:hover { background: var(--midnight); color: var(--paper); transform: translateY(-2px); }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--midnight);
  min-height: 44px;
}
.brand img { width: 34px; height: 34px; display: block; }
.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 17px;
  line-height: 1;
}
.brand-text span { color: var(--slate); font-weight: 500; }
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--midnight);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}
.main-nav a:hover { background: var(--paper-dim); color: var(--midnight); }
.main-nav a[aria-current='page'] { color: var(--teal-dark); font-weight: 600; }
.nav-join { margin-inline-start: 8px; min-height: 40px; padding: 6px 18px; }
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle svg { display: block; }
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 12px 20px 20px;
    gap: 2px;
    box-shadow: 0 18px 30px -18px rgba(16, 24, 40, 0.25);
  }
  .main-nav[hidden] { display: none; }
  .main-nav a { width: 100%; }
  .nav-join { margin: 8px 0 0; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: var(--midnight);
  color: var(--paper);
  overflow: clip;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
  padding-block: clamp(72px, 10vw, 128px);
}
.hero h1 { color: var(--paper); margin-bottom: 0.4em; }
.hero .lede { font-size: clamp(18px, 2vw, 21px); color: #D7DEE8; max-width: 34em; }
.hero .eyebrow { color: var(--slate-light); }
.hero-mark { width: min(320px, 60%); margin-inline: auto; display: block; filter: drop-shadow(0 12px 40px rgba(20, 184, 166, 0.18)); }
.hero .btn-ghost { color: var(--paper); }
.hero .btn-ghost:hover { background: rgba(248, 250, 252, 0.08); }
.constellation {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.5;
  animation: drift 90s linear infinite;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-320px, -160px, 0); }
}
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero .btn-row { justify-content: center; }
  .hero .eyebrow { justify-content: center; }
  .hero-mark { width: min(240px, 55%); }
  .hero .lede { margin-inline: auto; }
}

/* ---------- Grids & cards ---------- */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform 0.15s ease-out, border-color 0.15s ease-out;
}
.card:hover { transform: translateY(-2px); border-color: var(--teal); }
.card h3 { margin-bottom: 0.4em; }
.card p:last-child { margin-bottom: 0; }
.card-icon { width: 40px; height: 40px; margin-bottom: 16px; color: var(--teal-dark); }

/* ---------- Stat blocks ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { text-align: start; }
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(38px, 4.5vw, 52px);
  font-weight: 700;
  line-height: 1;
  color: var(--teal-dark);
}
.stat-num .plus { color: var(--gold); }
.stat-label { color: var(--slate); margin-top: 8px; font-size: 15px; }

/* ---------- Dark band (join CTA / footer-adjacent) ---------- */
.band-dark {
  background: var(--midnight);
  color: var(--paper);
  border-radius: var(--radius);
  padding: clamp(32px, 6vw, 64px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.band-dark h2, .band-dark h3 { color: var(--paper); margin-bottom: 0.3em; }
.band-dark p { color: #C7D0DC; margin-bottom: 0; }

/* ---------- Tags / badges ---------- */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--paper-dim);
  border: 1px solid var(--line);
  color: var(--slate);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.badge-lang {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 1px 9px;
  border-radius: 6px;
  background: rgba(245, 165, 36, 0.14);
  color: #925E07;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}
.badge-cadence {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.12);
  color: var(--teal-dark);
  font-size: 12.5px;
  font-weight: 600;
}

/* ---------- Filter bar ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filter-btn {
  min-height: 40px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--slate);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease-out;
}
.filter-btn:hover { border-color: var(--teal); color: var(--teal-dark); }
.filter-btn[aria-pressed='true'] { background: var(--midnight); border-color: var(--midnight); color: var(--paper); }
.filter-empty { display: none; color: var(--slate); font-style: italic; padding: 24px 0; }
.filter-empty.visible { display: block; }

/* ---------- Resource rows ---------- */
.resource-list { display: grid; gap: 14px; }
.resource-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease-out, border-color 0.15s ease-out;
}
.resource-row:hover { transform: translateY(-2px); border-color: var(--teal); }
.resource-row .r-icon { width: 40px; height: 40px; color: var(--teal-dark); }
.resource-row .r-title { font-weight: 600; font-size: 16px; margin-bottom: 2px; color: var(--midnight); }
.resource-row .r-meta { color: var(--slate); font-size: 14px; }
.resource-row .r-right { display: flex; align-items: center; gap: 10px; }
.resource-row[hidden] { display: none; }
@media (max-width: 640px) {
  .resource-row { grid-template-columns: 36px minmax(0, 1fr); }
  .resource-row .r-right { grid-column: 2; justify-content: flex-start; }
}

/* ---------- Members ---------- */
.member-card { display: flex; gap: 16px; align-items: flex-start; }
.avatar {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  color: #fff;
}
.member-name { font-weight: 600; font-size: 16px; }
.member-country { color: var(--slate); font-size: 14px; margin-bottom: 8px; }
.member-card[hidden] { display: none; }

/* ---------- Program blocks ---------- */
.program {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 56px);
  align-items: start;
  padding-block: 40px;
  border-top: 1px solid var(--line);
}
.program:first-of-type { border-top: 0; padding-top: 8px; }
.program .facts { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.program .facts dt { font-weight: 600; font-size: 14px; color: var(--slate); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 14px; }
.program .facts dt:first-child { margin-top: 0; }
.program .facts dd { margin: 4px 0 0; }
@media (max-width: 800px) { .program { grid-template-columns: 1fr; } }

/* ---------- Accordion (FAQ) ---------- */
details.faq {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0;
}
details.faq + details.faq { margin-top: 12px; }
details.faq summary {
  cursor: pointer;
  padding: 18px 22px;
  font-weight: 600;
  font-family: var(--font-display);
  font-size: 16px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 44px;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: '+';
  font-size: 22px;
  font-weight: 400;
  color: var(--teal-dark);
  line-height: 1;
  transition: transform 0.15s ease-out;
}
details.faq[open] summary::after { transform: rotate(45deg); }
details.faq .faq-body { padding: 0 22px 20px; color: #334155; }

/* ---------- Forms ---------- */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(24px, 4vw, 40px); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--slate); font-size: 13px; }
.field input[type='text'], .field input[type='email'], .field select, .field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--midnight);
  font: inherit;
  font-size: 15px;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--teal-dark); outline: var(--focus); outline-offset: 0; }
.checks { display: grid; gap: 8px; }
.checks label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 15px; }
.checks input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--teal-dark); }
.form-note { background: var(--paper-dim); border: 1px dashed var(--line); border-radius: 10px; padding: 12px 16px; color: var(--slate); font-size: 14px; }

/* ---------- Secure contact ---------- */
.secure-block {
  background: var(--midnight);
  color: var(--paper);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 36px);
}
.secure-block h3 { color: var(--paper); }
.secure-block .key {
  font-family: var(--font-mono);
  font-size: 13.5px;
  background: var(--midnight-2);
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  max-width: 100%;
  color: #B8E6DF;
  white-space: nowrap;
}
.secure-block a { color: var(--teal); }
.secure-block a:hover { color: var(--paper); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.contact-grid > * { min-width: 0; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- Prose helpers ---------- */
.lede { font-size: 19px; color: #334155; }
.muted { color: var(--slate); }
.value-list { list-style: none; padding: 0; display: grid; gap: 14px; }
.value-list li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 20px; margin: 0; }
.value-list strong { display: block; font-family: var(--font-display); margin-bottom: 4px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--midnight); color: #C7D0DC; margin-top: var(--space-section); }
.footer-inner { padding-block: 56px 32px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 32px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: var(--paper); font-size: 14px; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 14px; }
.site-footer a { color: #C7D0DC; text-decoration: none; }
.site-footer a:hover { color: var(--teal); }
.footer-nav { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-nav a { display: inline-flex; align-items: center; min-height: 32px; }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-brand img { width: 40px; height: 40px; }
.footer-brand .brand-text { color: var(--paper); }
.news-form { display: flex; gap: 8px; }
.news-form input {
  flex: 1;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-dark);
  background: var(--midnight-2);
  color: var(--paper);
  font: inherit;
  font-size: 14.5px;
}
.news-form input::placeholder { color: var(--slate); }
.footer-bottom {
  border-top: 1px solid var(--line-dark);
  margin-top: 40px;
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: 13px;
  color: var(--slate);
}
.lang-switch { color: var(--slate); }

/* ---------- Reduced motion ---------- */
.demo-sent { color: var(--teal-dark); }
.site-footer .demo-sent { color: var(--teal); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .constellation { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
