/* HipShip secondary pages — shared styles.
   Structure: tokens · base · header · buttons · page band · sections · legal layout · forms · footer · motion.
   No build step. Fonts are loaded per page from Google Fonts (Bricolage Grotesque, Instrument Sans, JetBrains Mono). */

/* ---------- tokens ---------- */
:root {
  /* brand */
  --navy: #050a30;
  --electric: #1746ff;
  --cyan: #19d3ff;
  --glow: #7fe3ff;
  --brand: #3fa9d8;        /* logo blue */
  --logo-ink: #0e1418;     /* logo pill, fixed in both themes */

  /* surface + text (light) */
  --ink: #0e1418;
  --paper: #f4f7f9;
  --card: #ffffff;
  --muted: #556169;
  --line: #d3dbe0;
  --link: #1746ff;         /* text links on paper */
  --accent-text: #17709b;  /* small labels on paper */
  --focus: #1746ff;
  --ok-bg: #e1f6ff;
  --ok-fg: #0b3c8c;
  --err-bg: #fdecea;
  --err-fg: #a1241a;

  /* always-dark bands (header, page band, footer) */
  --band-fg: #ffffff;
  --band-muted: #b9c6e6;
  --footer-bg: #050a30;

  --display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --wrap: 1120px;
  --gutter: 20px;
  --radius: 14px;
  --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eaf1f5;
    --paper: #0a0f14;
    --card: #131c23;
    --muted: #9fb0ba;
    --line: #26333c;
    --link: #7fe3ff;
    --accent-text: #7cc8ea;
    --focus: #7fe3ff;
    --ok-bg: #0c2a45;
    --ok-fg: #c9efff;
    --err-bg: #3a1512;
    --err-fg: #ffc9c2;
    --footer-bg: #03061f;
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: -0.02em; line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
[id] { scroll-margin-top: calc(var(--header-h) + 24px); }

.in {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.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 {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: #ffffff; color: var(--navy); padding: 10px 16px; border-radius: 999px; font-weight: 600;
}
.skip:focus { top: 12px; }

/* ---------- header ---------- */
.bar {
  position: sticky; top: 0; z-index: 20;
  background: #050a30f0;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  color: #ffffff;
  border-bottom: 1px solid #ffffff1f;
}
.bar .in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--header-h); }
.bar a:not(.btn) { color: inherit; }
.bar :focus-visible, .band :focus-visible, .site-footer :focus-visible { outline-color: #ffffff; }

.logo {
  display: inline-block;
  font-family: var(--display); font-weight: 800; font-style: italic; font-size: 24px; letter-spacing: -0.04em; line-height: 1.2;
  text-decoration: none;
  transform: skewX(-6deg);
  background: var(--logo-ink); color: #ffffff;
  padding: 3px 13px 6px; border-radius: 12px;
  border: 1px solid #ffffff3d;
}
.logo b { color: var(--brand); font-weight: 800; }

.nav { display: flex; align-items: center; gap: 22px; font-weight: 500; font-size: 15px; }
.nav a { text-decoration: none; }
.nav a:not(.btn):hover { text-decoration: underline; text-underline-offset: 5px; }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--cyan); text-decoration-thickness: 2px; text-underline-offset: 6px; }

.nav-toggle {
  display: none;
  align-items: center; gap: 8px;
  font: 600 14px/1 var(--body);
  color: #ffffff; background: transparent;
  border: 1.5px solid #ffffff66; border-radius: 999px;
  padding: 10px 14px; cursor: pointer;
}
.nav-toggle .bars { width: 16px; height: 10px; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; }

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--navy);
    border-bottom: 1px solid #ffffff1f;
    padding: 8px max(var(--gutter), env(safe-area-inset-left, 0px)) 20px;
    font-size: 17px;
  }
  .nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid #ffffff1f; }
  .nav .btn { margin-top: 16px; justify-content: center; }
  /* With JS the menu starts closed; without JS it simply stays open below the bar. */
  .js .nav { display: none; }
  .js .nav.open { display: flex; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 16px/1 var(--body);
  padding: 15px 24px; border-radius: 999px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: transform .18s cubic-bezier(.2,.8,.2,1), background .15s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 11px 18px; font-size: 14px; }
.btn-white { background: #ffffff; color: var(--navy); }
.btn-white:hover { background: #d9f6ff; }
.btn-line { border-color: currentColor; background: transparent; color: inherit; }
.btn-line:hover { background: #ffffff1a; }
.btn-solid { background: var(--electric); color: #ffffff; }
.btn-solid:hover { background: #0f36d6; }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn .arr { display: inline-block; transition: transform .18s; }
.btn:hover .arr { transform: translateX(4px); }

/* ---------- page band (navy → electric → cyan) ---------- */
.band {
  position: relative; overflow: hidden;
  color: var(--band-fg);
  background:
    radial-gradient(120% 140% at 88% 150%, #19d3ff 0%, #19d3ff00 55%),
    radial-gradient(90% 120% at 12% 120%, #1746ff 0%, #1746ff00 62%),
    radial-gradient(70% 90% at 60% 0%, #0b2aa8 0%, #0b2aa800 70%),
    var(--navy);
}
.band .in { padding-top: 56px; padding-bottom: 60px; position: relative; }
.band .eyebrow { color: var(--glow); margin-bottom: 14px; }
.band h1 { font-size: clamp(38px, 6vw, 68px); line-height: .98; font-weight: 800; max-width: 14em; }
.band .lede { font-size: 19px; max-width: 36em; margin: 20px 0 0; }
.band .meta {
  font-family: var(--mono); font-size: 13px; letter-spacing: .04em;
  margin: 22px 0 0; color: #ffffff;
}
.band .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.band a:not(.btn) { color: #ffffff; }
.band-compact .in { padding-top: 44px; padding-bottom: 46px; }
.band-compact h1 { font-size: clamp(34px, 5vw, 56px); }

/* ---------- generic sections ---------- */
.blk { padding-block: 72px; }
.blk h2 { font-size: clamp(30px, 4.2vw, 48px); font-weight: 800; line-height: 1.02; }
.blk .sub { color: var(--muted); font-size: 18px; margin: 14px 0 0; max-width: 38em; }
.blk .eyebrow { color: var(--accent-text); margin-bottom: 14px; }
.prose { max-width: 34em; font-size: 19px; }
.prose p { line-height: 1.65; }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px; }
.card .k { font: 600 12px var(--mono); color: var(--accent-text); display: block; margin-bottom: 16px; letter-spacing: .08em; }
.card h3 { font-size: 23px; font-weight: 700; margin-bottom: 8px; }
.card p { margin: 0; color: var(--muted); font-size: 16px; }
@media (max-width: 860px) { .cards { grid-template-columns: minmax(0, 1fr); } }

.dark {
  color: #ffffff;
  background:
    radial-gradient(110% 120% at 90% 125%, #19d3ff 0%, #19d3ff00 52%),
    radial-gradient(90% 100% at 8% 0%, #1746ff 0%, #1746ff00 65%),
    var(--navy);
}
.dark .eyebrow { color: var(--glow); }
.dark .sub { color: #e3ebff; }
.grid4 { margin-top: 40px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: #ffffff33; border: 1px solid #ffffff33; border-radius: var(--radius); overflow: hidden; }
.cell { background: #050a30d9; padding: 26px 22px; }
.cell .k { font: 600 12px var(--mono); color: var(--glow); display: block; margin-bottom: 16px; letter-spacing: .08em; }
.cell h3 { font-size: 21px; font-weight: 700; margin-bottom: 8px; }
.cell p { margin: 0; color: #d5def5; font-size: 15.5px; }
@media (max-width: 900px) { .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .grid4 { grid-template-columns: minmax(0, 1fr); } }

/* hub list (index.html) */
.note { border: 1px dashed var(--line); border-radius: var(--radius); padding: 14px 18px; font-family: var(--mono); font-size: 13px; color: var(--muted); background: var(--card); margin: 0 0 32px; }
.hub { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.hub li { border-bottom: 1px solid var(--line); }
.hub a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 20px; align-items: baseline; padding: 20px 4px; text-decoration: none; color: var(--ink); }
.hub a:hover b { text-decoration: underline; text-underline-offset: 5px; }
.hub b { font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.hub .file { font-family: var(--mono); font-size: 13px; color: var(--accent-text); }
.hub .what { grid-column: 1 / -1; color: var(--muted); font-size: 16px; }

/* ---------- legal layout ---------- */
.doc .in {
  display: grid;
  grid-template-columns: 260px minmax(0, 34em);  /* 34em of body text is roughly 70 characters per line */
  gap: 88px;
  align-items: start;
  padding-top: 56px; padding-bottom: 96px;
}
.toc { position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; padding-right: 6px; font-size: 14.5px; line-height: 1.35; }
.toc summary {
  font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text);
  list-style: none; cursor: default; padding-bottom: 12px; border-bottom: 2px solid var(--ink); margin-bottom: 8px;
}
.toc summary::-webkit-details-marker { display: none; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc ol ol { padding-left: 14px; }
.toc ol a { display: block; padding: 7px 10px 7px 12px; color: var(--muted); text-decoration: none; border-left: 2px solid var(--line); }
.toc ol a:hover { color: var(--ink); }
.toc ol a[aria-current="true"] { color: var(--ink); font-weight: 600; border-left-color: var(--electric); }
.toc .pdf { display: inline-flex; margin-top: 18px; }

@media (prefers-color-scheme: dark) { .toc ol a[aria-current="true"] { border-left-color: var(--cyan); } }

@media (min-width: 961px) {
  .toc summary { pointer-events: none; }
}
@media (max-width: 960px) {
  .doc .in { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 28px; padding-bottom: 64px; }
  .toc { position: static; max-height: none; overflow: visible; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
  .toc summary { cursor: pointer; padding: 16px 18px; margin: 0; border-bottom: 0; display: flex; justify-content: space-between; align-items: center; }
  .toc summary::after { content: "+"; font-size: 18px; line-height: 1; }
  .toc details[open] summary::after { content: "–"; }
  .toc details[open] summary { border-bottom: 1px solid var(--line); }
  .toc ol.top { padding: 8px 12px 12px; }
  .toc ol a { border-left: 0; padding: 9px 6px; }
  .toc ol a[aria-current="true"] { font-weight: 500; color: var(--muted); }
  .toc .pdf { display: none; }
}

.doc-body { font-size: 17px; line-height: 1.7; min-width: 0; }
.doc-body > :first-child { margin-top: 0; }
.doc-body h2 { font-size: clamp(24px, 3vw, 30px); font-weight: 800; margin: 2.2em 0 .7em; padding-top: .9em; border-top: 1px solid var(--line); }
.doc-body h2:first-child { border-top: 0; padding-top: 0; }
.doc-body h3 { font-size: 20px; font-weight: 700; margin: 1.8em 0 .6em; letter-spacing: -0.01em; }
.doc-body h4 { font-family: var(--mono); font-size: 12.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); margin: 2em 0 .8em; line-height: 1.4; }
.doc-body h2 .num, .doc-body h3 .num { font-family: var(--mono); font-size: .72em; font-weight: 600; color: var(--accent-text); letter-spacing: 0; margin-right: .5em; }
.doc-body ul, .doc-body ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.doc-body li { margin-bottom: .55em; }
.doc-body li > ul, .doc-body li > ol { margin-top: .55em; }
.doc-body address { font-style: normal; margin: 0 0 1em; }
.doc-body .lead-in { color: var(--muted); }
.anchor { margin-left: .4em; font-family: var(--mono); font-size: .7em; font-weight: 400; text-decoration: none; color: var(--muted); opacity: 0; }
h2:hover .anchor, h3:hover .anchor, h4:hover .anchor, .anchor:focus-visible { opacity: 1; }
@media (hover: none) { .anchor { display: none; } }

/* Clauses whose label is part of the source text — a), (i), IV., 5.1 — keep that label verbatim in a hanging column. */
.clauses { list-style: none; padding-left: 0 !important; }
.clauses > li, p.clause { position: relative; padding-left: 3.5em; }
.clauses > li > .mk, p.clause > .mk { position: absolute; left: 0; top: 0; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.clauses.narrow > li { padding-left: 2.2em; }
.clauses p { margin: .55em 0 0; }
.clauses > li > p:first-of-type { margin-top: .55em; }

.doc-end { margin-top: 3em; padding-top: 1.6em; border-top: 2px solid var(--ink); display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.doc-end .btn-line { color: var(--ink); }
.doc-end .btn-line:hover { background: #1746ff14; }

/* ---------- forms ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 48px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr); gap: 32px; } }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; }
@media (max-width: 520px) { .panel { padding: 22px 18px; } }
.panel h2 { font-size: 28px; font-weight: 800; margin-bottom: 20px; }
.form { display: grid; gap: 18px; }
.form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 520px) { .form .row2 { grid-template-columns: 1fr; } }
.fld { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.fld label { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.fld input, .fld textarea {
  font: 500 17px/1.4 var(--body);
  width: 100%; min-width: 0;
  padding: 13px 14px;
  border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--paper); color: var(--ink);
}
.fld textarea { resize: vertical; min-height: 140px; }
.fld input:focus-visible, .fld textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.form .btn { justify-self: start; }
.form-status { margin: 0; padding: 13px 16px; border-radius: 10px; font-size: 16px; font-weight: 500; }
.form-status:empty { display: none; }
.form-status[data-state="ok"] { background: var(--ok-bg); color: var(--ok-fg); }
.form-status[data-state="error"] { background: var(--err-bg); color: var(--err-fg); }
.form-status a { color: inherit; }

.contact { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.contact li { padding: 18px 0; border-bottom: 1px solid var(--line); }
.contact .eyebrow { color: var(--accent-text); margin-bottom: 6px; }
.contact a { font-family: var(--mono); font-size: 18px; font-weight: 600; color: var(--ink); text-decoration: none; }
.contact a:hover { text-decoration: underline; }

/* ---------- footer ---------- */
.site-footer { background: var(--footer-bg); color: var(--band-muted); font-size: 15px; }
.site-footer .in { padding-top: 56px; padding-bottom: 28px; }
.site-footer .cols { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); gap: 36px 32px; }
.site-footer h2 { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--glow); margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.site-footer a { color: #e6ecfb; text-decoration: none; }
.site-footer a:hover { color: #ffffff; text-decoration: underline; }
.site-footer .mono { font-family: var(--mono); font-size: 14px; }
.site-footer .legal { margin-top: 44px; padding-top: 20px; border-top: 1px solid #ffffff1f; font-size: 13.5px; }
@media (max-width: 820px) { .site-footer .cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .site-footer .brand { grid-column: 1 / -1; } }
@media (max-width: 440px) { .site-footer .cols { grid-template-columns: minmax(0, 1fr); } }

/* ---------- small screens ---------- */
@media (max-width: 520px) {
  body { font-size: 16px; }
  :root { --gutter: 16px; }
  .band .in { padding-top: 40px; padding-bottom: 44px; }
  .band-compact .in { padding-top: 32px; padding-bottom: 36px; }
  .blk { padding-block: 52px; }
  .prose { font-size: 17.5px; }
  .doc-body { font-size: 16.5px; }
  .clauses > li, p.clause { padding-left: 3.1em; }
  .hub b { font-size: 21px; }
}

/* ---------- motion + print ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .bar, .toc, .site-footer, .doc-end, .skip, .band .actions { display: none !important; }
  .band { background: none; color: #000; }
  .band .eyebrow, .band .meta { color: #000; }
  .doc .in { display: block; padding: 0; }
  body { background: #fff; color: #000; }
}

/* heading anchor glyph (kept out of the HTML text so copied text stays verbatim) */
.anchor::before { content: "#"; }

/* lists that belong to a numbered clause line up with the clause text */
p.clause + ul, p.clause + ol { margin-left: 3.5em; }
@media (max-width: 520px) { p.clause + ul, p.clause + ol { margin-left: 1.6em; } }
