/* ==========================================================================
   KUM SLD — shared stylesheet
   Vanilla CSS, no build step, no JavaScript.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Warm neutral family — everything is tinted the same direction */
  --ink: #1b1a17;
  --ink-2: #4b4740;
  --ink-3: #7d776c;
  --ink-4: #a8a196;

  --paper: #fffefb;
  --wash: #f6f3ec;
  --wash-2: #efeade;
  --rule: #e2dccf;
  --rule-soft: #ece7db;

  /* One accent. Deep petrol blue — desaturated, reads as ink, not as a brand shout */
  --accent: #123b5e;
  --accent-hi: #1b5384;
  --accent-wash: #e9eef4;

  /* Secondary is used for marks and emphasis only, never for surfaces */
  --ember: #a75c26;
  --ember-wash: #f8efe5;

  --shadow-sm: 0 1px 2px rgba(40, 32, 20, 0.05);
  --shadow-md:
    0 1px 2px rgba(40, 32, 20, 0.04), 0 8px 24px -12px rgba(40, 32, 20, 0.16);
  --shadow-lg:
    0 1px 2px rgba(40, 32, 20, 0.04), 0 24px 48px -24px rgba(40, 32, 20, 0.22);

  --measure: 44rem;
  --gutter: clamp(1rem, 4vw, 2rem);

  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --z-skip: 100;
  --z-header: 50;
  --z-grain: 10;
}

/* --------------------------------------------------------------------------
   2. Fonts
   -------------------------------------------------------------------------- */

/* Geist for UI, Newsreader for display — a serif headline over a grotesk body
   gives these pages an editorial feel instead of a default-browser feel.
   The families are loaded via <link> in each page's <head>, not @import,
   so they do not block the stylesheet. Both fall back to system stacks. */

/* --------------------------------------------------------------------------
   3. Reset
   -------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--wash);
  color: var(--ink);
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.68;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ambient light behind the page — breaks the flat single-tone background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(
      70rem 40rem at 15% -10%,
      rgba(18, 59, 94, 0.07),
      transparent 60%
    ),
    radial-gradient(
      55rem 35rem at 95% 0%,
      rgba(167, 92, 38, 0.05),
      transparent 60%
    );
  pointer-events: none;
}

/* Paper grain — kills the sterile digital flatness */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.22;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   4. Skip link & focus
   -------------------------------------------------------------------------- */

.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: var(--z-skip);
  background: var(--accent);
  color: #fff;
  padding: 0.625rem 1rem;
  border-radius: 0 0 8px 8px;
  font-size: 0.9375rem;
  font-weight: 550;
  text-decoration: none;
  transition: top 180ms var(--ease);
}

.skip:focus {
  top: 0;
}

:focus-visible {
  outline: 2px solid var(--accent-hi);
  outline-offset: 3px;
  border-radius: 3px;
}

/* --------------------------------------------------------------------------
   5. Layout
   -------------------------------------------------------------------------- */

.wrap,
.masthead__inner,
.colophon__inner {
  width: 100%;
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main {
  padding-block: clamp(2rem, 5vw, 3.5rem) clamp(3rem, 8vw, 6rem);
}

/* Article + sticky table of contents */
.layout {
  display: grid;
  gap: clamp(1.5rem, 3vw, 3rem);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

@media (min-width: 68rem) {
  .layout--toc {
    grid-template-columns: minmax(0, 1fr) 15rem;
  }
}

.sheet {
  position: relative;
  max-width: var(--measure);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: clamp(1.75rem, 5vw, 3.5rem) clamp(1.25rem, 5vw, 3.25rem);
  box-shadow: var(--shadow-md);
}

/* Hairline highlight along the top edge — simulates a single light source */
.sheet::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.9) 20%,
    rgba(255, 255, 255, 0.9) 80%,
    transparent
  );
}

/* --------------------------------------------------------------------------
   6. Masthead
   -------------------------------------------------------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgba(255, 254, 251, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--rule);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.6);
}

.masthead__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.875rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-decoration: none;
}

.brand__mark {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 7px;
  flex: none;
  box-shadow: var(--shadow-sm);
}

.brand__sub {
  color: var(--ink-3);
  font-weight: 400;
}

.nav {
  display: flex;
  gap: 0.375rem;
  font-size: 0.9375rem;
}

.nav a {
  position: relative;
  color: var(--ink-2);
  text-decoration: none;
  padding: 0.375rem 0.75rem;
  border-radius: 7px;
  transition:
    color 180ms var(--ease),
    background-color 180ms var(--ease);
}

.nav a:hover {
  color: var(--accent);
  background: var(--accent-wash);
}

.nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 550;
  background: var(--wash-2);
}

/* --------------------------------------------------------------------------
   7. Typography
   -------------------------------------------------------------------------- */

h1,
h2,
h3 {
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  color: var(--ink);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.125rem, 6vw, 3rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.022em;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: clamp(1.375rem, 3vw, 1.625rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.014em;
  margin: 3rem 0 0.875rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule-soft);
  scroll-margin-top: 6rem;
}

h2:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 2.5rem;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.008em;
  margin: 2rem 0 0.5rem;
}

p,
li,
td {
  color: var(--ink-2);
  text-wrap: pretty;
}

p {
  margin: 0 0 1.125rem;
}

ul,
ol {
  margin: 0 0 1.25rem;
  padding-left: 1.375rem;
}

li {
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

li::marker {
  color: var(--ink-4);
}

ol li::marker {
  font-variant-numeric: tabular-nums;
  font-weight: 550;
  color: var(--ink-3);
}

strong {
  color: var(--ink);
  font-weight: 600;
}

a {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  text-underline-offset: 0.18em;
  transition: color 160ms var(--ease), text-decoration-color 160ms var(--ease);
}

a:hover {
  color: var(--accent-hi);
  text-decoration-color: currentColor;
}

.lede {
  font-size: clamp(1.0625rem, 2vw, 1.1875rem);
  line-height: 1.6;
  color: var(--ink-2);
  margin-bottom: 1.25rem;
  max-width: 38rem;
}

.stamp {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 550;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.stamp::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: var(--rule);
}

.eyebrow {
  display: block;
  font-family: "Geist", sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: 0.875rem;
}

/* --------------------------------------------------------------------------
   8. Callouts
   -------------------------------------------------------------------------- */

.callout {
  position: relative;
  background: var(--accent-wash);
  border-radius: 12px;
  padding: 1.25rem 1.375rem;
  margin: 1.75rem 0 2rem;
  font-size: 0.9375rem;
  box-shadow: inset 0 0 0 1px rgba(18, 59, 94, 0.09);
}

.callout::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.125rem;
  bottom: 1.125rem;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.callout > :last-child {
  margin-bottom: 0;
}

.callout--warn {
  background: var(--ember-wash);
  box-shadow: inset 0 0 0 1px rgba(167, 92, 38, 0.14);
}

.callout--warn::before {
  background: var(--ember);
}

/* --------------------------------------------------------------------------
   9. Contact cards
   -------------------------------------------------------------------------- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.75rem;
  padding: 0;
  list-style: none;
}

.contact-grid li {
  margin: 0;
  padding: 1rem 1.125rem;
  background: var(--wash);
  border-radius: 11px;
  box-shadow: inset 0 0 0 1px var(--rule-soft);
  transition:
    background-color 180ms var(--ease),
    box-shadow 180ms var(--ease);
}

.contact-grid li:hover {
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--rule), var(--shadow-sm);
}

.contact-grid .label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-4);
  margin-bottom: 0.3rem;
}

.contact-grid .value {
  display: block;
  color: var(--ink);
  font-weight: 550;
  font-size: 0.9375rem;
  line-height: 1.45;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}

a.value {
  text-decoration: none;
}

a.value:hover {
  color: var(--accent-hi);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

/* --------------------------------------------------------------------------
   10. Feature list (index)
   -------------------------------------------------------------------------- */

.capabilities {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  border-top: 1px solid var(--rule-soft);
}

.capabilities li {
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  gap: 0.25rem 0.75rem;
  align-items: baseline;
  margin: 0;
  padding: 0.9375rem 0;
  border-bottom: 1px solid var(--rule-soft);
}

.capabilities .idx {
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-4);
  letter-spacing: 0.04em;
}

/* --------------------------------------------------------------------------
   11. Tables
   -------------------------------------------------------------------------- */

.table-scroll {
  overflow-x: auto;
  margin: 0 0 1.75rem;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 26rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

thead th {
  font-family: "Geist", sans-serif;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-3);
  padding: 0 0.875rem 0.625rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
}

tbody th {
  font-family: "Geist", sans-serif;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

tbody th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.9375rem 0.875rem;
  border-bottom: 1px solid var(--rule-soft);
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

/* --------------------------------------------------------------------------
   12. FAQ disclosure
   -------------------------------------------------------------------------- */

.faq {
  border-bottom: 1px solid var(--rule-soft);
}

.faq:first-of-type {
  border-top: 1px solid var(--rule-soft);
}

.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0.25rem;
  font-weight: 550;
  color: var(--ink);
  transition: color 160ms var(--ease);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary:hover {
  color: var(--accent);
}

.faq summary::after {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 1.5px solid var(--ink-4);
  border-bottom: 1.5px solid var(--ink-4);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 220ms var(--ease), border-color 160ms var(--ease);
}

.faq[open] summary {
  color: var(--accent);
}

.faq[open] summary::after {
  transform: rotate(225deg) translate(-2px, -2px);
  border-color: var(--accent);
}

.faq__body {
  padding: 0 0.25rem 1.25rem;
  font-size: 0.9375rem;
  animation: reveal 260ms var(--ease);
}

.faq__body > :last-child {
  margin-bottom: 0;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   13. Table of contents
   -------------------------------------------------------------------------- */

.toc {
  display: none;
}

@media (min-width: 68rem) {
  .toc {
    display: block;
    position: sticky;
    top: 6rem;
    font-size: 0.875rem;
  }

  .toc__title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--ink-4);
    margin: 0 0 0.75rem 0.75rem;
  }

  .toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 1px solid var(--rule);
  }

  .toc li {
    margin: 0;
    padding: 0;
  }

  .toc a {
    display: block;
    padding: 0.3125rem 0.75rem;
    margin-left: -1px;
    border-left: 1px solid transparent;
    color: var(--ink-3);
    text-decoration: none;
    line-height: 1.4;
    transition:
      color 160ms var(--ease),
      border-color 160ms var(--ease);
  }

  .toc a:hover {
    color: var(--accent);
    border-left-color: var(--accent);
  }
}

/* --------------------------------------------------------------------------
   14. Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6875rem 1.25rem;
  border-radius: 9px;
  font-size: 0.9375rem;
  font-weight: 550;
  text-decoration: none;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(18, 59, 94, 0.2), 0 6px 16px -8px rgba(18, 59, 94, 0.5);
  transition:
    background-color 180ms var(--ease),
    transform 120ms var(--ease),
    box-shadow 180ms var(--ease);
}

.btn:hover {
  background: var(--accent-hi);
  color: #fff;
  box-shadow: 0 1px 2px rgba(18, 59, 94, 0.22), 0 10px 22px -8px rgba(18, 59, 94, 0.5);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(18, 59, 94, 0.25);
}

.btn--quiet {
  background: transparent;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--rule);
}

.btn--quiet:hover {
  background: var(--accent-wash);
  color: var(--accent-hi);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.75rem 0 0;
}

/* --------------------------------------------------------------------------
   15. Footer
   -------------------------------------------------------------------------- */

.colophon {
  border-top: 1px solid var(--rule);
  background: var(--paper);
  padding-block: 2rem;
  font-size: 0.875rem;
  color: var(--ink-3);
}

.colophon__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  justify-content: space-between;
  align-items: center;
}

.colophon nav {
  display: flex;
  gap: 1.25rem;
}

.colophon a {
  color: var(--ink-2);
  text-decoration: none;
}

.colophon a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

/* --------------------------------------------------------------------------
   16. 404
   -------------------------------------------------------------------------- */

.notfound {
  text-align: left;
  max-width: 34rem;
}

.notfound__code {
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(4rem, 16vw, 7rem);
  font-weight: 400;
  font-style: italic;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--rule);
  margin: 0 0 0.5rem;
  font-variant-numeric: tabular-nums;
}
