/* HyKho public site — shared design tokens and page shell.
   Landing page (index.html) keeps its own hero styles inline; this sheet
   carries everything the three pages share plus the document-page styles
   used by support.html and privacy-policy.html. */

:root {
  --navy: #1E3A5C;
  --navy-deep: #12253C;
  --navy-mid: #2C5580;
  --amber: #F5911E;
  --cream: #faf8f5;
  --paper: #fffefc;
  --ink: #151512;
  --muted: #6a6a64;
  --muted-soft: #8a8a84;
  --hairline: rgba(0, 0, 0, 0.08);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --measure: 68ch;
  --hang: 30px;   /* hanging-numeral column; fixed so headings and body align */
}

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

html { overflow-x: hidden; }

body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--cream);
  color: var(--ink);
  font-family: "Archivo", -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
  font-optical-sizing: auto;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--navy);
  text-decoration: none;
  transition: color 0.25s var(--ease);
}
a:hover { color: var(--amber); }

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

::selection { background: var(--navy); color: #fff; }

img { display: block; }

/* ---------- SHARED NAV ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(20px, 5vw, 56px);
  background: rgba(250, 248, 245, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.nav__logo { display: flex; align-items: center; min-width: 0; flex-shrink: 1; }
.nav__logo img { height: 30px; max-width: 100%; }

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 40px);
  font-size: 15px;
  font-weight: 500;
  color: #4a4a46;
  min-width: 0;
  flex-shrink: 0;
}

.nav__links a { color: #4a4a46; }
.nav__links a:hover { color: var(--amber); }

/* compound selector so the pill's white text beats .nav__links a */
.nav__links a.nav__cta {
  padding: 10px 22px;
  background: var(--ink);
  color: #fff;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.16);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.nav__links a.nav__cta:hover {
  background: var(--navy);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 58, 92, 0.28);
}

.nav__links a.nav__cta:active { transform: translateY(0); }

/* ---------- SHARED FOOTER ---------- */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding: 48px clamp(20px, 5vw, 56px);
  border-top: 1px solid var(--hairline);
  font-size: 14px;
  color: var(--muted-soft);
}

.footer img { height: 24px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 28px; }

/* ---------- DOCUMENT PAGES (support / privacy) ----------
   These are reference documents, not marketing pages. The model is a printed
   manual: a masthead rule instead of a hero, a numbered section list in the
   margin, and typography carrying the hierarchy. No gradient bands, no cards,
   no decorative accents — nothing that would look wrong printed in one colour. */

.docpage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 clamp(32px, 6vw, 88px);
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 56px) clamp(72px, 10vw, 128px);
}

/* masthead: a rule and a title, the way a document letterhead works */
.masthead {
  grid-column: 1 / -1;
  padding: clamp(44px, 7vw, 80px) 0 clamp(28px, 4vw, 40px);
  border-bottom: 2px solid var(--ink);
}

.masthead__kicker {
  margin: 0 0 auto;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.masthead h1 {
  margin: 10px 0 0;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.masthead__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
  margin: 18px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.masthead__meta span { display: block; }

/* margin navigation — a table of contents, like a manual's */
.docnav {
  align-self: start;
  padding-top: 44px;
  font-size: 14px;
  line-height: 1.5;
}

.docnav__label {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-soft);
}

.docnav ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.docnav li { counter-increment: toc; margin-bottom: 2px; }

.docnav a {
  display: grid;
  grid-template-columns: 1.9em 1fr;
  padding: 5px 0;
  color: var(--muted);
  border-bottom: 1px solid transparent;
}

.docnav a::before {
  content: counter(toc) ".";
  color: var(--muted-soft);
  font-variant-numeric: tabular-nums;
}

.docnav a:hover { color: var(--ink); }
.docnav a[aria-current="true"] { color: var(--ink); font-weight: 500; }

/* body column */
.doc { padding-top: 44px; min-width: 0; }

.doc__lede {
  margin: 0 0 28px;
  font-size: clamp(17px, 2vw, 19px);
  line-height: 1.55;
  color: #33332f;
  text-wrap: pretty;
}

/* numbered sections, hanging in the margin like a spec document */
.doc section { counter-increment: sec; padding-top: 40px; }
.doc { counter-reset: sec; }

.doc section > h2 {
  display: grid;
  grid-template-columns: var(--hang) 1fr;
  margin: 0 0 14px;
  font-size: clamp(19px, 2.4vw, 22px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-wrap: balance;
  scroll-margin-top: 96px;
}

.doc section > h2::before {
  content: counter(sec) ".";
  color: var(--muted-soft);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.doc h3 {
  margin: 26px 0 6px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.doc p { margin: 0 0 15px; text-wrap: pretty; }
.doc > section > p,
.doc > section > ul,
.doc > section > ol,
.doc > section > table { margin-left: var(--hang); }

.doc ul, .doc ol { margin-top: 0; margin-bottom: 16px; padding-left: 20px; }
.doc li { margin-bottom: 7px; }
.doc li::marker { color: var(--muted-soft); }
.doc strong { font-weight: 600; }

/* a plain indented note — no box, no tint, no coloured bar */
.note {
  margin: 22px 0 22px var(--hang);
  padding-left: 18px;
  border-left: 2px solid var(--ink);
  font-size: 15px;
}

.note p { margin-bottom: 10px; }
.note p:last-child { margin-bottom: 0; }

/* definition table: ruled rows, the way a datasheet prints */
.doc table {
  width: 100%;
  margin: 4px 0 20px var(--hang);
  width: calc(100% - var(--hang));
  border-collapse: collapse;
  font-size: 15px;
  text-align: left;
}

.doc thead th {
  padding: 0 16px 8px 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-soft);
  border-bottom: 1px solid var(--ink);
}

.doc tbody td {
  padding: 14px 16px 14px 0;
  vertical-align: baseline;
  border-bottom: 1px solid var(--hairline);
}

.doc tbody td:last-child { padding-right: 0; }
.doc tbody tr:last-child td { border-bottom: 0; }
.doc tbody td:first-child { width: 38%; }

/* FAQ: a numbered question list, not a stack of cards */
.qa { counter-reset: qa; margin-left: var(--hang); }

.qa__item {
  counter-increment: qa;
  padding: 22px 0;
  border-bottom: 1px solid var(--hairline);
}

.qa__item:first-child { border-top: 1px solid var(--hairline); }

.qa__q {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.qa__item p:last-child,
.qa__item ul:last-child,
.qa__item ol:last-child { margin-bottom: 0; }

/* contact block: a plain labelled list */
.contact {
  margin: 4px 0 0 var(--hang);
  font-size: 15px;
}

.contact div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--hairline);
}

.contact dt, .contact .k { color: var(--muted); }

.doc__end {
  margin: 44px 0 0 var(--hang);
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  font-size: 13.5px;
  color: var(--muted);
}

/* ---------- RESPONSIVE ---------- */

/* two columns once there is room for a margin table of contents */
@media (min-width: 900px) {
  .docpage { grid-template-columns: 210px minmax(0, 1fr); }
  .docnav { position: sticky; top: 88px; }
}

@media (max-width: 899px) {
  /* the TOC becomes a plain inline list above the body */
  .docnav {
    padding-top: 28px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--hairline);
  }
  .docnav ol {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 22px;
    padding-bottom: 16px;
  }
  .docnav a { grid-template-columns: 1.4em 1fr; }
  .doc { padding-top: 28px; }
}

@media (max-width: 720px) {
  .footer { justify-content: flex-start; flex-direction: column; align-items: flex-start; }

  /* drop the hanging indent — too costly on a narrow measure */
  .doc > section > p,
  .doc > section > ul,
  .doc > section > ol,
  .doc > section > table,
  .qa, .contact, .note, .doc__end { margin-left: 0; }

  .doc section > h2,
  .docnav a { grid-template-columns: 1.5em 1fr; }

  .note { margin-left: 0; }
  .doc table { width: 100%; margin-left: 0; }

  /* stacked table: header row hidden, each cell labelled by data-label */
  .doc thead { display: none; }
  .doc table, .doc tbody, .doc tr, .doc td { display: block; width: 100%; }
  .doc tbody tr { padding: 16px 0; border-bottom: 1px solid var(--hairline); }
  .doc tbody tr:last-child { border-bottom: 0; }
  .doc tbody td { width: auto; padding: 0 0 10px; border-bottom: 0; }
  .doc tbody td:first-child { width: auto; }
  .doc tbody td:last-child { padding-bottom: 0; }
  .doc tbody td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-soft);
  }

  .contact div { grid-template-columns: 1fr; gap: 2px; }
}

@media (max-width: 520px) {
  .nav { padding-left: 20px; padding-right: 20px; }
  .nav__logo img { height: 26px; }
  .nav__links { gap: 14px; font-size: 14px; }
  .nav__links a.nav__cta { padding: 9px 16px; font-size: 13px; }
}

@media (max-width: 380px) {
  .nav__links a:not(.nav__cta) { display: none; }
}

/* these pages get printed and filed — make that work properly */
@media print {
  .nav, .docnav, .footer { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; line-height: 1.45; }
  .docpage { display: block; max-width: none; padding: 0; }
  .doc { padding-top: 18pt; }
  .doc section { padding-top: 16pt; break-inside: avoid-page; }
  .doc section > h2 { break-after: avoid-page; }
  a { color: #000; text-decoration: underline; }
  /* print the destination of external links */
  .doc a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; word-break: break-all; }
  .masthead { border-bottom: 1.5pt solid #000; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
