/* Almi web — Japandy Tactile.
   Palette lifted verbatim from Almi/Shared/Extensions/Color+Theme.swift so the
   site and the app stay in step. Type is the system stack: San Francisco on
   Apple devices, which is both the platform-correct choice and 0 bytes over the
   wire — Poppins would have cost ~300KB on a privacy policy. */

:root {
  --paper-bg: #f3ece1;
  --paper-sheet: #f9f4ec;
  --paper-sheet-border: #e2d9ce;
  --paper-divider: #d1c7bb;
  --paper-bright: #fdfaf4;

  --ink-primary: #261d16;
  --ink-secondary: #665c52;
  --ink-tertiary: #7f7770;

  --clay: #ac654b;
  --sage: #607a60;
  --plum: #7a6d93;

  --sheet-shadow: rgba(74, 55, 30, .10);
  --sheet-shadow-soft: rgba(74, 55, 30, .06);

  --measure: 34rem;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper-bg: #1e1611;
    --paper-sheet: #2b221c;
    --paper-sheet-border: #3e332c;
    --paper-divider: #463b33;
    --paper-bright: #433831;

    --ink-primary: #e9e4dd;
    --ink-secondary: #9e978f;
    --ink-tertiary: #877f77;

    --clay: #db997b;
    --sage: #92ad92;
    --plum: #b0a3cc;

    --sheet-shadow: rgba(0, 0, 0, .38);
    --sheet-shadow-soft: rgba(0, 0, 0, .22);
  }
}

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

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

body {
  margin: 0;
  padding: clamp(1.5rem, 5vw, 4rem) 1.25rem clamp(3rem, 8vw, 6rem);
  background: var(--paper-bg);
  color: var(--ink-primary);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  /* Fluid but never below 16px — iOS zooms the page on smaller body text. */
  font-size: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  line-height: 1.65;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
}

main {
  max-width: var(--measure);
  margin: 0 auto;
}

/* ---- Type scale ------------------------------------------------------- */
/* Tighter tracking as size goes up, the way SF's optical sizes behave. */

h1 {
  font-size: clamp(2rem, 1.7rem + 1.5vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -.028em;
  font-weight: 700;
  margin: 0 0 .4rem;
}

h2 {
  font-size: clamp(1.1rem, 1.05rem + .25vw, 1.3rem);
  line-height: 1.3;
  letter-spacing: -.012em;
  font-weight: 600;
  margin: 3rem 0 .75rem;
}

h2 + p, h2 + ul, h2 + table { margin-top: 0; }

p { margin: 0 0 1.15rem; }

.lede {
  font-size: clamp(1.0625rem, 1rem + .3vw, 1.25rem);
  line-height: 1.5;
  color: var(--ink-secondary);
  letter-spacing: -.01em;
}

.updated {
  color: var(--ink-tertiary);
  font-size: .875rem;
  letter-spacing: .01em;
  margin: 0 0 2.75rem;
}

strong { font-weight: 600; }

/* ---- Links ------------------------------------------------------------ */

a {
  color: var(--clay);
  text-decoration-color: color-mix(in srgb, var(--clay) 35%, transparent);
  text-underline-offset: .2em;
  text-decoration-thickness: from-font;
}

a:hover { text-decoration-color: currentColor; }

/* Visible keyboard focus — never rely on the hover affordance alone. */
a:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ---- Lists ------------------------------------------------------------ */

ul { padding-left: 1.15rem; margin: 0 0 1.15rem; }
li { margin: .4rem 0; }
li::marker { color: var(--sage); }

/* ---- Paper sheets ----------------------------------------------------- */
/* The tactile bit: surfaces sit *on* the paper, lifted by a warm-tinted
   shadow rather than a hard border. */

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.25rem 0 1.75rem;
  font-size: .9375rem;
  line-height: 1.5;
  background: var(--paper-sheet);
  border: 1px solid var(--paper-sheet-border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px var(--sheet-shadow-soft), 0 6px 16px -6px var(--sheet-shadow);
  overflow: hidden;
}

th, td {
  text-align: left;
  padding: .7rem .9rem;
  vertical-align: top;
}

th {
  font-weight: 600;
  font-size: .8125rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--ink-tertiary);
  background: color-mix(in srgb, var(--paper-bright) 60%, transparent);
}

tr + tr td, thead + tbody td { border-top: 1px solid var(--paper-divider); }
td:first-child { font-weight: 500; }

.note {
  background: var(--paper-sheet);
  border: 1px solid var(--paper-sheet-border);
  /* Clay edge marks this as the one thing to actually stop and read. */
  border-left: 3px solid var(--clay);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin: 1.75rem 0;
  box-shadow: 0 1px 2px var(--sheet-shadow-soft), 0 6px 16px -6px var(--sheet-shadow);
}

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

/* ---- Footer ----------------------------------------------------------- */

footer {
  margin-top: 4.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--paper-divider);
  color: var(--ink-tertiary);
  font-size: .875rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  align-items: center;
}

footer a {
  color: var(--ink-secondary);
  text-decoration: none;
  /* 44px tall tap target on touch, per HIG, without visually growing the row. */
  padding: .6rem 0;
}

footer a:hover { color: var(--clay); }

footer .brand {
  font-weight: 600;
  color: var(--ink-primary);
  margin-right: auto;
}

/* ---- Landing ---------------------------------------------------------- */

.hero { margin-bottom: 3.5rem; }

.mark {
  width: 3rem;
  height: 3rem;
  border-radius: 22.5%; /* iOS squircle, near enough at this size */
  background: linear-gradient(160deg, var(--clay), color-mix(in srgb, var(--clay) 70%, var(--plum)));
  display: grid;
  place-items: center;
  color: var(--paper-bright);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -.03em;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 4px var(--sheet-shadow-soft), 0 10px 24px -10px var(--sheet-shadow);
}

.status {
  display: inline-block;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--sage);
  background: color-mix(in srgb, var(--sage) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--sage) 25%, transparent);
  border-radius: 999px;
  padding: .3rem .75rem;
}

/* ---- Preferences ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --ink-secondary: var(--ink-primary);
    --ink-tertiary: var(--ink-primary);
    --paper-divider: var(--ink-tertiary);
  }
  a { text-decoration-color: currentColor; }
}

@media print {
  body { background: #fff; color: #000; padding: 0; }
  .note, table { box-shadow: none; }
  footer { border-color: #ccc; }
}
