/* ============================================================================
   Koydo Life — shared design system for the document pages
   (support / privacy / terms / account delete / not-found).

   The marketing page at "/" carries this same system inline so it renders
   with zero blocking requests. These document pages share this one file so
   the whole domain reads as a single product.

   PALETTE + MEASURED CONTRAST (WCAG 2.2 AA needs 4.5:1 body, 3:1 large/UI)
   Light  ground #FBF7F1 · card #FFFFFF
     ink      #123D37 on ground = 11.25:1   on card = 12.01:1   (AAA)
     muted    #4A5F5A on ground =  6.40:1   on card =  6.83:1   (AA)
     link     #9C4326 on ground =  6.06:1   on card =  6.47:1   (AA)
     button   #FFFFFF on #A84A2B =  5.71:1                      (AA)
   Dark   ground #0D1B19 · card #122624
     ink      #F2EDE5 on ground = 15.17:1   on card = 13.57:1   (AAA)
     muted    #A9BDB7 on ground =  8.97:1   on card =  8.02:1   (AAA)
     link     #F09267 on ground =  7.59:1   on card =  6.78:1   (AAA)
     button   #0D1B19 on #F09267 =  7.59:1                      (AAA)
   Koydo orange #D36124 is 3.57:1 on cream — it is used ONLY for the koydo
   wordmark, which WCAG exempts as a logotype. Never for words.
   ========================================================================= */

:root {
  color-scheme: light dark;

  --wrap: 78rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);

  --ground: #fbf7f1;
  --ground-2: #f4ede3;
  --card: #ffffff;
  --ink: #123d37;
  --muted: #4a5f5a;
  --line: #e6ded1;
  --line-strong: #d6cabb;
  --link: #9c4326;
  --btn-bg: #a84a2b;
  --btn-fg: #ffffff;
  --brand: #d36124;          /* logotype only */
  --amber-bg: #fdf3e3;
  --amber-line: #e9cf9f;
  --amber-ink: #7a4d13;      /* 6.62:1 on #fdf3e3 */
  --shadow: 0 1px 2px rgb(18 61 55 / 6%), 0 10px 30px -18px rgb(18 61 55 / 32%);

  --sans: -apple-system, BlinkMacSystemFont, "Avenir Next", "Segoe UI Variable Text",
    "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, "Source Serif 4",
    Georgia, "Noto Serif", "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0d1b19;
    --ground-2: #101f1d;
    --card: #122624;
    --ink: #f2ede5;
    --muted: #a9bdb7;
    --line: #223b36;
    --line-strong: #2e4b45;
    --link: #f09267;
    --btn-bg: #f09267;
    --btn-fg: #0d1b19;
    --brand: #f0a071;
    --amber-bg: #2a2119;
    --amber-line: #4e3d26;
    --amber-ink: #f0cf9c;    /* 9.9:1 on #2a2119 */
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 14px 34px -20px rgb(0 0 0 / 70%);
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  overflow-x: clip;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; }
img { height: auto; display: block; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 99;
  padding: 0.85rem 1.25rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 650;
  border-radius: 0 0 0.75rem 0;
}
.skip:focus { left: 0; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- masthead ---------- */

.masthead {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: saturate(1.4) blur(12px);
}
.masthead__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
  flex-wrap: wrap;
}
.lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 44px;
  text-decoration: none;
  color: inherit;
}
.lockup__mark { width: 5.25rem; color: var(--brand); display: block; }
.lockup__rule { width: 1px; height: 1.15rem; background: var(--line-strong); }
.lockup__name {
  font-weight: 650;
  letter-spacing: -0.012em;
  font-size: 1.0625rem;
  color: var(--ink);
}
.masthead__links {
  display: flex;
  gap: 0.35rem 1.25rem;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.9375rem;
}
.masthead__links a {
  color: var(--muted);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.masthead__links a:hover,
.masthead__links a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

/* ---------- document body ---------- */

.doc { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(3rem, 7vw, 5.5rem); }
.doc__inner { max-width: 46rem; }

.eyebrow {
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.eyebrow::before {
  content: "";
  width: 1.6rem;
  height: 2px;
  background: var(--btn-bg);
  border-radius: 2px;
  flex: none;
}

.doc h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.4rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  text-wrap: balance;
}
.doc h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.3rem, 1.15rem + 0.7vw, 1.65rem);
  line-height: 1.2;
  letter-spacing: -0.012em;
  margin: 2.5rem 0 0.6rem;
}
.doc h3 {
  font-size: 1.0625rem;
  font-weight: 650;
  margin: 1.75rem 0 0.4rem;
}
.doc p { margin: 0 0 1.05rem; max-width: 42rem; }
.doc ul { margin: 0 0 1.05rem; padding-left: 1.15rem; max-width: 42rem; }
.doc li { margin-bottom: 0.5rem; }
.doc li::marker { color: var(--btn-bg); }

.stamp {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0 0 1.75rem;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: clamp(1.1rem, 3vw, 1.6rem);
  box-shadow: var(--shadow);
  margin: 0 0 1.5rem;
}
.panel > :last-child { margin-bottom: 0; }
.panel--warm {
  background: var(--amber-bg);
  border-color: var(--amber-line);
  color: var(--amber-ink);
  box-shadow: none;
}
.panel--warm a { color: inherit; }

.lede { font-size: 1.125rem; color: var(--muted); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.75rem 0 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.7rem 1.35rem;
  border-radius: 999px;
  font-weight: 650;
  font-size: 1rem;
  text-decoration: none;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid transparent;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
.btn:hover { text-decoration: none; box-shadow: var(--shadow); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

@media (prefers-reduced-motion: no-preference) {
  .btn:hover { transform: translateY(-2px); }
}

/* ---------- footer (static rendering of the shared Koydo SiteFooter) ---------- */

.kfoot {
  border-top: 1px solid var(--line);
  background: var(--ground-2);
  padding-block: clamp(2.5rem, 5vw, 3.5rem) 0;
  font-size: 0.9375rem;
}
.kfoot__top {
  display: grid;
  gap: 2rem clamp(1rem, 3vw, 2.5rem);
  grid-template-columns: 1fr;
  padding-bottom: 2.5rem;
}
@media (min-width: 40rem) { .kfoot__top { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 62rem) { .kfoot__top { grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); } }

.kfoot__brand { max-width: 24rem; }
.kfoot__mark { width: 6rem; color: var(--brand); display: block; margin-bottom: 0.9rem; }
.kfoot__brand p { color: var(--muted); margin: 0 0 1rem; }

.kfoot__cols {
  display: grid;
  gap: 2rem clamp(1rem, 3vw, 2.5rem);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-column: 1 / -1;
}
@media (min-width: 62rem) {
  .kfoot__cols { grid-column: 2 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 78rem) {
  .kfoot__cols { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.kfoot h2 {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 0.85rem;
}
.kfoot ul { list-style: none; margin: 0; padding: 0; }
.kfoot li { margin-bottom: 0.15rem; }
.kfoot li a {
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  line-height: 1.3;
}
.kfoot li a:hover { color: var(--link); text-decoration: underline; }
.kfoot__viewall { font-weight: 650; color: var(--link) !important; }

.kfoot__social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.25rem;
}
.kfoot__social a {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border-radius: 999px;
}
.kfoot__social a:hover { color: var(--link); background: color-mix(in srgb, var(--link) 10%, transparent); }
.kfoot__social svg { width: 1.0625rem; height: 1.0625rem; fill: currentColor; }

.kfoot__bar {
  border-top: 1px solid var(--line);
  padding-block: 1.1rem 1.35rem;
  color: var(--muted);
  font-size: 0.8125rem;
}
.kfoot__bar div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.kfoot__bar span[aria-hidden="true"] { opacity: 0.5; }
