/* =============================================================
   iAssistence — "Independent Field Guide" design system
   Cool paper + deep indigo ink + warm amber annotation accent.
   One file, no external requests. Mobile-first.
   ============================================================= */

/* ---- Tokens ------------------------------------------------- */
:root {
  --ink:        #1C2440;   /* deep indigo — primary text / brand */
  --ink-soft:   #45506B;   /* secondary text */
  --ink-faint:  #6B7488;   /* captions, meta */
  --paper:      #FBFCFE;   /* cool page background */
  --surface:    #FFFFFF;   /* cards */
  --muted:      #EDF1F8;   /* soft blue-grey fill */
  --line:       #DCE3F0;   /* hairline borders */

  --amber:      #E8912B;   /* signature accent — annotation / steps */
  --amber-ink:  #8A5410;   /* readable amber text on light */
  --amber-soft: #FDF1DE;   /* amber tint fill */

  --green:      #148A63;   /* Tips */
  --green-soft: #E2F4EC;
  --rose:       #BE3A50;   /* Common problems / warnings */
  --rose-soft:  #FBE7EB;

  --radius:     14px;
  --radius-sm:  9px;
  --shadow:     0 1px 2px rgba(28,36,64,.05), 0 8px 24px rgba(28,36,64,.06);
  --shadow-sm:  0 1px 2px rgba(28,36,64,.06);

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, monospace;

  --wrap: 1120px;
  --measure: 720px;   /* readable text column */
}

/* ---- Reset-ish --------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  font-size: clamp(1rem, 0.97rem + 0.15vw, 1.075rem);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--amber-ink); }

h1, h2, h3, h4 { line-height: 1.2; color: var(--ink); font-weight: 700; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 1.5rem + 2.4vw, 3.15rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.4rem, 1.2rem + 1vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p  { margin: 0 0 1rem; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }

/* ---- Accessibility helpers --------------------------------- */
.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;
}
.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 0 0 8px 8px;
  transition: top .15s ease;
}
.skip-link:focus { top: 0; color: #fff; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 3px; }

/* ---- Header / nav ------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,252,254,.88);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 1rem; }
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand__name { font-size: 1.35rem; letter-spacing: -0.02em; color: var(--ink); font-weight: 400; }
.brand__i { color: #000; font-weight: 800; font-size: 1.25em; line-height: 1; }

.primary-nav ul { list-style: none; display: flex; gap: .35rem; margin: 0; padding: 0; }
.primary-nav a {
  display: block; padding: .5rem .7rem; border-radius: 8px; text-decoration: none;
  color: var(--ink-soft); font-weight: 550; font-size: .95rem;
}
.primary-nav a:hover { background: var(--muted); color: var(--ink); }
.primary-nav a.is-active { color: var(--ink); background: var(--amber-soft); box-shadow: inset 0 -2px 0 var(--amber); }

.nav-toggle { display: none; }

/* ---- Buttons ----------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .7rem 1.15rem; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  background: var(--ink); color: #fff; transition: transform .12s ease, background .12s ease;
}
.btn:hover { color: #fff; transform: translateY(-1px); background: #141b33; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--muted); color: var(--ink); }
.btn--small { padding: .45rem .85rem; font-size: .9rem; }
.btn__arrow { transition: transform .12s ease; }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ---- Shared section rhythm --------------------------------- */
.section { padding-block: clamp(2.75rem, 2rem + 4vw, 4.75rem); }
.section--tight { padding-block: clamp(2rem, 1.5rem + 2vw, 3rem); }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--mono); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--amber-ink); font-weight: 600; margin: 0 0 .9rem;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--amber); border-radius: 2px; }
.lede { font-size: clamp(1.08rem, 1rem + .4vw, 1.28rem); color: var(--ink-soft); max-width: var(--measure); }
.center { text-align: center; }
.center .lede, .center .eyebrow { margin-inline: auto; }
.center .eyebrow { justify-content: center; }

/* ---- Hero -------------------------------------------------- */
.hero { position: relative; overflow: hidden; }
.hero::before {  /* faint annotation grid — atmosphere, not decoration overload */
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
                    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(120% 80% at 80% 0%, #000 0%, transparent 62%);
          mask-image: radial-gradient(120% 80% at 80% 0%, #000 0%, transparent 62%);
  opacity: .5;
}
.hero__inner { position: relative; z-index: 1; display: grid; gap: clamp(2rem, 4vw, 3.5rem); grid-template-columns: 1fr; align-items: center; padding-block: clamp(2.75rem, 2rem + 5vw, 5rem); }
.hero__title { margin-bottom: .35em; }
.hero__title mark { background: linear-gradient(transparent 62%, var(--amber-soft) 62%); color: inherit; padding: 0 .05em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.6rem; }

/* Field-guide sample card in hero — shows the product's world */
.guide-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.25rem 1.35rem; max-width: 420px;
}
.guide-card__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .85rem; }
.guide-card__label { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.guide-card h3 { margin: 0; font-size: 1.15rem; }

/* ---- Spec chips (compatibility) — signature detail --------- */
.spec-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--mono); font-size: .76rem; letter-spacing: .02em;
  background: var(--muted); color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 999px; padding: .3rem .7rem;
}
.chip b { color: var(--ink); font-weight: 600; }
.chip--amber { background: var(--amber-soft); border-color: #f2d8ab; color: var(--amber-ink); }

/* ---- Numbered steps — the annotation rail ------------------ */
.steps { list-style: none; counter-reset: step; margin: 1.25rem 0; padding: 0; }
.steps > li {
  position: relative; counter-increment: step;
  padding: .1rem 0 1.15rem 3.1rem; margin: 0;
}
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: -.1rem;
  width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--amber-soft); color: var(--amber-ink);
  border: 1.5px solid var(--amber); font-family: var(--mono); font-weight: 600;
  display: grid; place-items: center; font-size: .95rem;
}
.steps > li::after {  /* connecting rail */
  content: ""; position: absolute; left: calc(1.05rem - 1px); top: 2.1rem; bottom: 0;
  width: 2px; background: var(--line);
}
.steps > li:last-child { padding-bottom: 0; }
.steps > li:last-child::after { display: none; }
.steps strong { color: var(--ink); }

/* ---- Callout boxes ----------------------------------------- */
.callout {
  border: 1px solid var(--line); border-left: 4px solid var(--ink-faint);
  background: var(--surface); border-radius: var(--radius-sm);
  padding: 1rem 1.15rem; margin: 1.25rem 0;
}
.callout > :last-child { margin-bottom: 0; }
.callout__title { font-weight: 700; margin: 0 0 .35rem; display: flex; align-items: center; gap: .5rem; font-size: 1rem; }
.callout--tip     { border-left-color: var(--green); background: var(--green-soft); }
.callout--tip .callout__title { color: var(--green); }
.callout--problem { border-left-color: var(--rose); background: var(--rose-soft); }
.callout--problem .callout__title { color: var(--rose); }
.callout--note    { border-left-color: var(--amber); background: var(--amber-soft); }
.callout--note .callout__title { color: var(--amber-ink); }

/* Prominent disclaimer strip */
.disclaimer-bar {
  background: var(--ink); color: #e9edf7; border-radius: var(--radius);
  padding: clamp(1.15rem, 1rem + 1vw, 1.6rem) clamp(1.25rem, 1rem + 1.5vw, 1.9rem);
  display: flex; gap: 1rem; align-items: flex-start;
}
.disclaimer-bar svg { flex: none; margin-top: .15rem; }
.disclaimer-bar p { margin: 0; font-size: .96rem; color: #dfe4f2; }
.disclaimer-bar a { color: #fff; }

/* ---- Card grid (pillars, guide list) ----------------------- */
.grid { display: grid; gap: 1.15rem; }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem; box-shadow: var(--shadow-sm);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
  display: flex; flex-direction: column;
}
a.card, .card--link { text-decoration: none; color: inherit; }
a.card:hover, .card--link:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #c7d2e8; color: inherit; }
.card__icon {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  background: var(--amber-soft); color: var(--amber-ink); margin-bottom: .9rem;
}
.card h3 { margin-bottom: .35rem; }
.card p { color: var(--ink-soft); margin-bottom: 1rem; font-size: .97rem; }
.card__more { margin-top: auto; font-weight: 600; color: var(--amber-ink); font-size: .95rem; }
.card__more::after { content: " →"; }

/* Numbered index of guides */
.index-list { list-style: none; margin: 1.5rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.index-list li { border-bottom: 1px solid var(--line); }
.index-list a { display: flex; align-items: baseline; gap: 1rem; padding: 1.1rem .25rem; text-decoration: none; }
.index-list a:hover { background: var(--muted); }
.index-list .num { font-family: var(--mono); color: var(--amber-ink); font-size: .85rem; min-width: 2.2rem; }
.index-list .txt strong { display: block; color: var(--ink); font-size: 1.08rem; }
.index-list .txt span { color: var(--ink-soft); font-size: .95rem; }

/* ---- Long-form article layout ------------------------------ */
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2.2rem; }
.prose h3 { margin-top: 1.6rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: .4rem; }
.prose > .spec-chips { margin-top: 1.25rem; }
.article-meta { color: var(--ink-faint); font-size: .9rem; font-family: var(--mono); margin-bottom: 1rem; }

/* Table of contents inside guide pages */
.toc { background: var(--muted); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.35rem; }
.toc h2 { font-size: 1rem; margin: 0 0 .6rem; }
.toc ol { margin: 0; padding-left: 1.2rem; columns: 2; column-gap: 1.5rem; }
.toc a { color: var(--ink-soft); }

/* Guide unit on hub pages */
.guide { padding-top: 2rem; border-top: 1px solid var(--line); margin-top: 2.5rem; scroll-margin-top: 80px; }
.guide:first-of-type { border-top: 0; margin-top: 1rem; padding-top: 0; }

/* ---- Footer ------------------------------------------------ */
.site-footer { background: #151b30; color: #c7cee0; margin-top: 3rem; padding-block: clamp(2.5rem, 2rem + 2vw, 3.5rem); }
.site-footer a { color: #dfe4f2; }
.site-footer a:hover { color: #fff; }
.site-footer__notice { font-size: .9rem; color: #9aa4c0; max-width: 70ch; margin: 0 0 2rem; border-left: 3px solid var(--amber); padding-left: 1rem; }
.site-footer__cols { display: grid; gap: 1.5rem 2rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 2rem; }
.site-footer__col h2 { color: #fff; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .8rem; }
.site-footer__col ul { list-style: none; margin: 0; padding: 0; }
.site-footer__col li { margin-bottom: .5rem; }
.site-footer__col a { text-decoration: none; font-size: .95rem; }
.site-footer__brand { font-weight: 700; color: #fff; font-size: 1.1rem; }
.site-footer__tag { color: #9aa4c0; font-size: .9rem; margin-top: .3rem; }
.site-footer__legal { border-top: 1px solid #2a3252; padding-top: 1.5rem; font-size: .82rem; color: #8b95b3; margin: 0; }

/* ---- Cookie note ------------------------------------------- */
.cookie-note {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 60;
  max-width: 640px; margin-inline: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem 1.15rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
/* Reassert hiding: a class's display:flex otherwise overrides the [hidden] attribute. */
.cookie-note[hidden] { display: none; }
.cookie-note p { margin: 0; font-size: .9rem; color: var(--ink-soft); flex: 1 1 260px; }

/* ---- Contact block ----------------------------------------- */
.contact-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 1.75rem; text-align: center; max-width: 520px;
}
.contact-card a.email { font-size: 1.25rem; font-weight: 700; color: var(--amber-ink); word-break: break-all; }

/* ---- Utilities --------------------------------------------- */
.mt-0 { margin-top: 0; }
.stack > * + * { margin-top: 1rem; }
.bg-muted { background: var(--muted); }
.rule { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

/* ---- Responsive nav ---------------------------------------- */
@media (max-width: 820px) {
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border: 1px solid var(--line); background: var(--surface);
    border-radius: 10px; cursor: pointer; position: relative;
  }
  .nav-toggle__bar, .nav-toggle__bar::before, .nav-toggle__bar::after {
    content: ""; position: absolute; width: 20px; height: 2px; background: var(--ink); border-radius: 2px;
    transition: transform .2s ease, opacity .2s ease;
  }
  .nav-toggle__bar { left: 12px; }
  .nav-toggle__bar::before { top: -6px; left: 0; }
  .nav-toggle__bar::after  { top:  6px; left: 0; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar::after  { transform: translateY(-6px) rotate(-45deg); }

  .primary-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
  }
  .primary-nav.is-open { max-height: 420px; }
  .primary-nav ul { flex-direction: column; padding: .5rem clamp(1rem, 4vw, 2rem) 1rem; gap: .15rem; }
  .primary-nav a { padding: .7rem .7rem; }
}

@media (min-width: 860px) {
  .hero__inner { grid-template-columns: 1.15fr .85fr; }
}

/* ---- Motion / print preferences ---------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
