/* FinMaxxing legal and support pages.
   Colours from Product Documentation/FinMaxxing/brand.md (draft v0.1).
   Contrast checked (WCAG 2.1):
   light  navy on cream 15.9:1, coral deep on cream 5.2:1, muted on cream 5.7:1,
          white on coral deep 5.5:1, navy on gold 10.9:1
   dark   text on bg 16.9:1, coral text on bg 7.3:1, muted on bg 8.7:1,
          coral text on surface 6.7:1 */

/* Fonts are served from this site, not Google Fonts, so visiting sends nothing to a third party.
   Fredoka and Nunito are under the SIL Open Font License (fonts/*-OFL.txt). */
@font-face { font-family: "Fredoka"; src: url("fonts/Fredoka_600SemiBold.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("fonts/Fredoka_700Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("fonts/Nunito_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("fonts/Nunito_700Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("fonts/Nunito_800ExtraBold.ttf") format("truetype"); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("fonts/Nunito_900Black.ttf") format("truetype"); font-weight: 900; font-style: normal; font-display: swap; }

:root {
  --bg: #FFF7F0;          /* cream */
  --surface: #FFFFFF;
  --text: #0B1B3F;        /* navy */
  --muted: #5A6278;
  --line: #F0E3D8;
  --link: #C8282F;        /* coral deep */
  --button-bg: #C8282F;
  --button-text: #FFFFFF;
  --button-edge: #8E1A20; /* coral shadow */
  --banner-bg: #FFC83D;   /* gold */
  --banner-text: #0B1B3F;
  --banner-edge: #E8A700;
  --focus: #0B1B3F;
  --todo-bg: #FFF1C9;
  --todo-text: #0B1B3F;
  --radius-control: 16px;
  --radius-card: 20px;
  --font-display: "Fredoka", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B1426;
    --surface: #121D35;
    --text: #F3F5FA;
    --muted: #A9B2C7;
    --line: #24304A;
    --link: #FF7A7E;
    --button-bg: #C8282F;
    --button-text: #FFFFFF;
    --button-edge: #8E1A20;
    --focus: #FFC83D;
    --todo-bg: #3A3216;
    --todo-text: #F3F5FA;
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;   /* 17px body */
  line-height: 1.55;
  overflow-wrap: break-word;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 10;
  padding: 12px 16px;
  background: var(--button-bg);
  color: var(--button-text);
  border-radius: var(--radius-control);
  font-weight: 800;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.draft-banner {
  background: var(--banner-bg);
  color: var(--banner-text);
  border-bottom: 4px solid var(--banner-edge);
  padding: 10px 16px;
  text-align: center;
  font-weight: 800;
}
.draft-banner p { margin: 0; }

.site-header,
main,
.site-footer {
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-top: 20px;
  padding-bottom: 12px;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--link);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: inline-block;
  padding: 10px 0;          /* 44px tap height with line-height */
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}
.site-nav a:hover { color: var(--link); text-decoration: underline; }
.site-nav a[aria-current="page"] {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

main { padding-bottom: 40px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}
h1 { font-size: clamp(2rem, 7vw, 2.5rem); margin: 16px 0 8px; }
h2 { font-size: 1.5rem; margin: 40px 0 8px; padding-top: 8px; border-top: 2px solid var(--line); }
h3 { font-size: 1.2rem; margin: 24px 0 4px; }

p, ul, ol { margin: 0 0 14px; }
ul, ol { padding-left: 1.3rem; }
li { margin-bottom: 6px; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

.meta { color: var(--muted); font-size: 0.95rem; margin-bottom: 20px; }

.lede { font-size: 1.15rem; }

.card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  margin: 16px 0;
}
.card > :last-child { margin-bottom: 0; }
.card h2, .card h3 { border-top: 0; padding-top: 0; margin-top: 0; }

.toc ol { margin-bottom: 0; }

.todo {
  background: var(--todo-bg);
  color: var(--todo-text);
  border-radius: 6px;
  padding: 0 4px;
  font-weight: 700;
  white-space: normal;
}

.table-wrap { overflow-x: auto; margin: 0 0 16px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
  background: var(--surface);
  border-radius: 12px;
}
caption { text-align: left; font-weight: 800; padding: 0 0 6px; }
th, td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
th { font-weight: 800; }

/* Stack tables into cards on narrow screens so nothing scrolls sideways. */
@media (max-width: 34rem) {
  table.stack, table.stack tbody, table.stack tr, table.stack td, table.stack th[scope="row"] { display: block; width: 100%; }
  table.stack caption { display: block; width: 100%; }
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stack tr { border-bottom: 2px solid var(--line); padding: 8px 0; }
  table.stack td, table.stack th[scope="row"] { border-bottom: 0; padding: 4px 12px; }
  table.stack td::before { content: attr(data-label) ": "; font-weight: 800; }
}

.button-list {
  display: grid;
  gap: 14px;
  margin: 20px 0;
  padding: 0;
  list-style: none;
}
.button {
  display: block;
  min-height: 52px;
  padding: 14px 20px;
  border-radius: var(--radius-control);
  background: var(--button-bg);
  color: var(--button-text);
  box-shadow: 0 5px 0 var(--button-edge);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
}
.button:hover { text-decoration: underline; }
.button:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--button-edge); }
.button span { display: block; text-transform: none; letter-spacing: 0; font-weight: 700; font-size: 0.95rem; }

@media (prefers-reduced-motion: reduce) {
  .button:active { transform: none; }
}

.services { list-style: none; padding: 0; }
.services li { padding: 12px 0; border-bottom: 1px solid var(--line); margin: 0; }
.services strong { display: block; }

.site-footer {
  border-top: 2px solid var(--line);
  padding-top: 20px;
  padding-bottom: 40px;
  color: var(--muted);
  font-size: 0.95rem;
}
.site-footer p { margin-bottom: 8px; }
