/* ==========================================================================
   ioHelps — style.css
   Lightweight, mobile-first, no external fonts or assets. Light & dark themes
   via prefers-color-scheme. One stylesheet keeps requests (and load time) low.
   ========================================================================== */

/* ---- Design tokens ------------------------------------------------------- */
:root {
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --brand-tint: #eef2ff;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-card: #ffffff;
  --text: #1e293b;
  --text-soft: #475569;
  --text-mute: #64748b;
  --border: #e2e8f0;
  --ok: #047857;
  --ok-tint: #ecfdf5;
  --warn: #b45309;
  --warn-tint: #fffbeb;
  --note: #0369a1;
  --note-tint: #f0f9ff;
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.06);
  --radius: 14px;
  --container: 1120px;
  --space: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #818cf8;
    --brand-dark: #a5b4fc;
    --brand-tint: #1e1b4b;
    --bg: #0f172a;
    --bg-soft: #111a2e;
    --bg-card: #16213a;
    --text: #e2e8f0;
    --text-soft: #cbd5e1;
    --text-mute: #94a3b8;
    --border: #253150;
    --ok: #34d399;
    --ok-tint: #0d2b22;
    --warn: #fbbf24;
    --warn-tint: #2b210b;
    --note: #7dd3fc;
    --note-tint: #0b2233;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  }
}

/* ---- Base ---------------------------------------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: clamp(16px, 1rem + 0.15vw, 18px);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--brand-dark); }
a:hover { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; color: var(--text); }
h1 { font-size: clamp(1.9rem, 1.4rem + 2.2vw, 2.9rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.4rem, 1.15rem + 1vw, 1.9rem); letter-spacing: -.01em; }
h3 { font-size: 1.2rem; }
p { color: var(--text-soft); }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

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

/* ---- Header + nav -------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--border);
}
.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; font-weight: 800; font-size: 1.2rem; color: var(--text); text-decoration: none; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--brand-tint); color: var(--brand-dark); }
.brand-mark .ico { width: 20px; height: 20px; }

.nav-list { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; align-items: center; }
.nav-item { position: relative; }
/* Links and dropdown-parent buttons share one look */
.nav-link {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 12px; border-radius: 9px; text-decoration: none;
  color: var(--text-soft); font-weight: 600; font-size: .95rem;
  font-family: inherit; background: none; border: 0; cursor: pointer; white-space: nowrap;
}
.nav-link:hover, .nav-parent:hover { background: var(--bg-soft); color: var(--text); }
.nav-link.active { color: var(--brand-dark); background: var(--brand-tint); }
.nav-parent .caret { transition: transform .2s ease; }

/* Submenu (dropdown) */
.submenu {
  list-style: none; margin: 0; padding: 6px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow); min-width: 230px;
}
.submenu a {
  display: block; padding: 9px 12px; border-radius: 8px; text-decoration: none;
  color: var(--text-soft); font-weight: 600; font-size: .92rem;
}
.submenu a:hover { background: var(--bg-soft); color: var(--text); }
.submenu a.active { color: var(--brand-dark); background: var(--brand-tint); }

/* Desktop: dropdowns float, revealed on hover or keyboard focus */
@media (min-width: 861px) {
  .submenu {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .16s ease, transform .16s ease, visibility .16s;
  }
  .has-submenu:hover > .submenu,
  .has-submenu:focus-within > .submenu {
    opacity: 1; visibility: visible; transform: translateY(0);
  }
  .has-submenu:hover .caret,
  .has-submenu:focus-within .caret { transform: rotate(180deg); }
}

.nav-toggle { display: none; flex-direction: column; gap: 5px; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card); cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .primary-nav {
    position: fixed; inset: 64px 0 auto 0; background: var(--bg);
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
    max-height: 0; overflow: hidden; transition: max-height .28s ease;
  }
  .primary-nav.open { max-height: 85vh; overflow-y: auto; }
  .nav-list { flex-direction: column; align-items: stretch; padding: 12px 20px 20px; gap: 2px; }
  .nav-item { position: static; }
  .nav-link { padding: 12px; border-radius: 10px; font-size: 1.05rem; width: 100%; justify-content: space-between; }
  .nav-parent { text-align: left; }

  /* Submenu collapses as an accordion; opens when its <li> gets .open via JS */
  .submenu {
    border: 0; box-shadow: none; background: transparent; border-radius: 0;
    min-width: 0; padding: 0 0 4px 10px; margin: 2px 0 6px;
    border-left: 2px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
  }
  .has-submenu.open > .submenu { max-height: 420px; }
  .has-submenu.open > .nav-parent .caret { transform: rotate(180deg); }
  .submenu a { padding: 11px 12px; font-size: 1rem; }
}

/* ---- Independence ribbon ------------------------------------------------- */
.ribbon {
  background: var(--brand-tint);
  border-bottom: 1px solid var(--border);
  color: var(--text-soft);
  font-size: .82rem;
  text-align: center;
  padding: 8px 0;
}

/* ---- Sections / spacing -------------------------------------------------- */
.section { padding: clamp(40px, 6vw, 72px) 0; }
.section--soft { background: var(--bg-soft); }
.section-head { max-width: 760px; margin-bottom: 32px; }
.section-head p { font-size: 1.08rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; font-weight: 700; color: var(--brand-dark); margin: 0 0 8px; }

/* ---- Hero ---------------------------------------------------------------- */
.hero { padding: clamp(48px, 7vw, 88px) 0; background: linear-gradient(180deg, var(--brand-tint), var(--bg) 70%); }
.hero p.lede { font-size: clamp(1.05rem, 1rem + .4vw, 1.3rem); color: var(--text-soft); max-width: 620px; }
.hero h1 { max-width: 760px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 700;
  padding: 13px 22px; border-radius: 11px; text-decoration: none; border: 1px solid transparent;
  cursor: pointer; font-size: 1rem;
}
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); color: #fff; }
.btn--ghost { background: var(--bg-card); color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand-dark); }
.btn .ico { width: 18px; height: 18px; }

/* ---- Card grids ---------------------------------------------------------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; text-decoration: none; color: inherit; box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease;
}
a.card:hover { transform: translateY(-3px); border-color: var(--brand); }
.card-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 11px; background: var(--brand-tint); color: var(--brand-dark); }
.card h3 { margin: 0; }
.card p { margin: 0; font-size: .95rem; color: var(--text-mute); }
.card .more { margin-top: auto; font-weight: 700; color: var(--brand-dark); font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; }
.card .more .ico { width: 16px; height: 16px; }

.group-title { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; }
.group-title .ico { color: var(--brand-dark); }

/* ---- "How it works" steps ------------------------------------------------ */
.steps-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.step-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.step-num { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; margin-bottom: 10px; }
.step-item h3 { margin: 0 0 6px; }
.step-item p { margin: 0; font-size: .95rem; }

/* ---- Article / guide layout --------------------------------------------- */
.article-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 40px; align-items: start; }
.toc { position: sticky; top: 96px; }
.toc h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-mute); margin: 0 0 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.toc a { display: block; padding: 6px 10px; border-radius: 8px; font-size: .92rem; color: var(--text-soft); text-decoration: none; border-left: 2px solid transparent; }
.toc a:hover { background: var(--bg-soft); color: var(--text); }

.guide {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(22px, 3vw, 36px); margin-bottom: 28px; box-shadow: var(--shadow); scroll-margin-top: 90px;
}
.guide > h2 { margin-top: 0; display: flex; align-items: center; gap: 12px; }
.guide h3 { margin: 26px 0 8px; color: var(--text); }
.guide ol, .guide ul { padding-left: 22px; color: var(--text-soft); }
.guide li { margin: 8px 0; }
.guide li::marker { color: var(--brand-dark); font-weight: 700; }

/* Callouts */
.callout { border-radius: 12px; padding: 14px 18px; margin: 16px 0; border: 1px solid; }
.callout p:last-child { margin-bottom: 0; }
.callout p:first-child { margin-top: 0; }
.callout strong { color: var(--text); }
.callout--note { background: var(--note-tint); border-color: color-mix(in srgb, var(--note) 35%, transparent); }
.callout--warn { background: var(--warn-tint); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.callout--ok   { background: var(--ok-tint);   border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.callout__label { font-weight: 800; font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; display: block; margin-bottom: 4px; }
.callout--note .callout__label { color: var(--note); }
.callout--warn .callout__label { color: var(--warn); }
.callout--ok   .callout__label { color: var(--ok); }

.support-block { background: var(--bg-soft); border: 1px dashed var(--border); border-radius: 12px; padding: 16px 18px; margin: 16px 0; }
.support-block h3 { margin-top: 0; }

@media (max-width: 900px) {
  .article-wrap { grid-template-columns: 1fr; }
  .toc { position: static; margin-bottom: 8px; }
  .toc ul { flex-direction: row; flex-wrap: wrap; }
}

/* ---- Prose (legal / about) ---------------------------------------------- */
.prose { max-width: 760px; }
.prose h2 { margin-top: 40px; }
.prose h3 { margin-top: 24px; }
.prose ul { color: var(--text-soft); }
.prose .callout { max-width: 100%; }
.updated { color: var(--text-mute); font-size: .9rem; }

/* ---- Breadcrumb ---------------------------------------------------------- */
.crumbs { font-size: .88rem; color: var(--text-mute); padding: 16px 0 0; }
.crumbs a { color: var(--text-mute); text-decoration: none; }
.crumbs a:hover { color: var(--brand-dark); text-decoration: underline; }

/* ---- Contact ------------------------------------------------------------- */
.contact-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.email-line { font-size: 1.25rem; font-weight: 700; margin: 8px 0 4px; word-break: break-all; }

/* ---- Footer -------------------------------------------------------------- */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--border); margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; padding: 44px 20px 28px; }
.footer-col h2.footer-h { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-mute); margin: 0 0 12px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-col a { color: var(--text-soft); text-decoration: none; font-size: .95rem; }
.footer-col a:hover { color: var(--brand-dark); }
.brand--footer { font-size: 1.1rem; }
.footer-tag { color: var(--text-mute); font-size: .92rem; margin: 10px 0 0; }
.footer-legal { border-top: 1px solid var(--border); background: var(--bg); }
.footer-legal .container { padding-block: 22px; }
.footer-legal p { font-size: .84rem; color: var(--text-mute); margin: 0 0 8px; max-width: 900px; }
.footer-legal .copyright { margin-top: 12px; }

@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-col:first-child { grid-column: 1 / -1; }
}

/* ---- Utilities ----------------------------------------------------------- */
.mt-0 { margin-top: 0; }
.center { text-align: center; }
.lead-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.lead-list li { padding-left: 26px; position: relative; color: var(--text-soft); }
.lead-list li::before { content: "→"; position: absolute; left: 0; color: var(--brand-dark); font-weight: 700; }

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