/* Ruff Night — the web half of the Neko design system.
 *
 * Palette and rules are lifted from docs/reference/REDESIGN_PLAN.md §6 so the
 * site reads as the same object as the app. Three things carry most of that
 * resemblance and none of them is the colour: the paper grain, the uneven
 * hand-drawn corners, and SF Rounded.
 *
 * Light only, deliberately — the app forces light mode (LESSONS.md §4) and a
 * site that flips to dark next to it would look like a different product.
 * Every colour is therefore stated outright rather than inherited.
 */

:root {
  --paper:      #FCEFD5;  /* screen ground */
  --paper-deep: #F3DFB6;  /* wells, footer */
  --card:       #FFFAEB;  /* cards, panels */
  --ink:        #40301F;  /* primary text */
  --ink-soft:   #7D6749;  /* secondary text */
  --ink-faint:  #A89273;  /* tertiary */
  --rule:       rgba(96, 68, 32, 0.22);
  --accent:     #F4D072;
  --accent-deep:#DDB447;
  --sage:       #6F9350;  /* score great */
  --honey:      #C08A26;  /* score okay */
  --clay:       #BC6F62;  /* score rough */

  --measure: 34rem;       /* legal prose wants a short line */
}

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

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

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont,
               "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Paper grain. In the app this is a cached 128px noise tile multiplied over
 * every screen, and it is most of what reads as hand-made. Here it is the same
 * idea as an inline SVG turbulence — no external request, so it survives any
 * host, and it sits under the content rather than over it so text stays crisp. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='128'%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='128' height='128' filter='url(%23n)' opacity='0.22'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

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

/* ── Layout ──────────────────────────────────────────────────────────────── */

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.wrap-wide { max-width: 46rem; }

/* ── Masthead ────────────────────────────────────────────────────────────── */

.masthead {
  padding: 3rem 0 1.5rem;
  text-align: center;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}

.mark:hover { color: var(--accent-deep); }

.mark svg { display: block; }

/* ── Type ────────────────────────────────────────────────────────────────── */

h1 {
  font-size: 2.1rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0.5rem 0 0.35rem;
}

h2 {
  font-size: 1.3rem;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 2.75rem 0 0.75rem;
}

h3 {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 1.75rem 0 0.4rem;
}

p { margin: 0 0 1rem; }

a { color: var(--ink); text-decoration-color: var(--accent-deep); text-underline-offset: 3px; }
a:hover { color: var(--accent-deep); }

strong { font-weight: 700; }

.lede {
  font-size: 1.12rem;
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
}

.stamp {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin: 0 0 2rem;
}

ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; }
li { margin-bottom: 0.45rem; }
li::marker { color: var(--ink-faint); }

/* ── Cards: HandDrawnRect, four different corner radii per card ──────────── */

.card {
  background: var(--card);
  border: 1.5px solid var(--rule);
  padding: 1.35rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 22px 15px 24px 17px;
}

.card > :first-child { margin-top: 0; }
.card > :last-child  { margin-bottom: 0; }

.card + .card        { border-radius: 16px 23px 14px 25px; }
.card + .card + .card{ border-radius: 25px 16px 21px 13px; }

.card-accent {
  background: var(--accent);
  border-color: var(--accent-deep);
}

.card h3:first-child { margin-top: 0; }

/* A short, plain summary of what a section actually does. */
.plain {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* ── The data table on /privacy ──────────────────────────────────────────── */

.tablewrap {
  overflow-x: auto;
  margin: 1.25rem 0 1.5rem;
  border: 1.5px solid var(--rule);
  border-radius: 20px 14px 22px 16px;
  background: var(--card);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 30rem;
  font-size: 0.94rem;
}

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

thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  font-weight: 700;
}

tbody tr:last-child td { border-bottom: none; }

td:first-child { font-weight: 600; white-space: nowrap; }

.keep { color: var(--sage); font-weight: 600; white-space: nowrap; }
.hold { color: var(--honey); font-weight: 600; white-space: nowrap; }

/* ── Footer ──────────────────────────────────────────────────────────────── */

footer {
  margin-top: 4rem;
  padding: 2rem 0 3rem;
  border-top: 1.5px solid var(--rule);
  background: var(--paper-deep);
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  align-items: baseline;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

footer a { color: var(--ink-soft); }
footer .spacer { flex: 1 1 auto; }

/* ── Landing page only ───────────────────────────────────────────────────── */

.hero {
  text-align: center;
  padding: 1rem 0 0.5rem;
}

.hero h1 { font-size: 2.6rem; }

.points {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin: 2.5rem 0;
}

.points .card { margin: 0; }

@media (max-width: 30rem) {
  body { font-size: 16px; }
  h1 { font-size: 1.8rem; }
  .hero h1 { font-size: 2.1rem; }
  .wrap { padding: 0 1.15rem; }
}
