/* ---------------------------------------------------------------------------
 * Inkissed — the shared stylesheet. Every page links it (check:html enforces
 * that), and the CSP forbids inline styles, so all styling lives in files.
 *
 * Mobile-first: base rules are for a ~390 px phone in portrait; min-width
 * media queries widen from there. Two themes share one set of components:
 * body[data-theme="rouge"] for content pages, body[data-theme="neon"] for
 * account, settings and legal pages. Token values match the iOS palette.
 * ------------------------------------------------------------------------ */

:root {
  color-scheme: dark;

  /* Rouge Night */
  --rouge-bg: #140b10;
  --rouge-surface: #1f1218;
  --rouge-surface-2: #2b1820;
  --rouge-kiss: #e8335a;
  --rouge-kiss-deep: #c41f47;
  --rouge-blush: #f4b6c2;
  --rouge-cream: #fff3ea;
  --rouge-text-2: #cdb4bb;
  --rouge-text-3: #8f7781;

  /* Neon Kiss */
  --neon-bg: #0b0b10;
  --neon-magenta: #ff2d95;
  --neon-violet: #7b5cff;
  --neon-text: #f5f3ff;
  --neon-text-2: #a9a6c2;

  --font-display: "Fraunces", ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --gutter: 16px;
  --max: 1200px;
  --radius: 16px;
  --tap: 44px;
}

body[data-theme="rouge"] {
  --bg: var(--rouge-bg);
  --surface: var(--rouge-surface);
  --surface-2: var(--rouge-surface-2);
  --accent: var(--rouge-kiss);
  --accent-fill: var(--rouge-kiss-deep);
  --text: var(--rouge-cream);
  --text-2: var(--rouge-text-2);
  --text-3: var(--rouge-text-3);
  --line: rgb(255 255 255 / 0.08);
}

body[data-theme="neon"] {
  --bg: var(--neon-bg);
  --surface: rgb(255 255 255 / 0.05);
  --surface-2: rgb(255 255 255 / 0.09);
  --accent: var(--neon-magenta);
  --accent-fill: var(--neon-magenta);
  --text: var(--neon-text);
  --text-2: var(--neon-text-2);
  --text-3: var(--neon-text-2);
  --line: rgb(255 255 255 / 0.1);
}

/* --- Base ------------------------------------------------------------------ */

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

main { flex: 1 0 auto; }

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

a { color: inherit; }

h1,
h2,
h3 { margin: 0; line-height: 1.15; overflow-wrap: anywhere; }

p,
ul { margin: 0; }

/* Content column. Side padding never drops under the safe area, so a phone in
 * landscape keeps text clear of the notch and the rounded corners. */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

/* --- Accessibility (kept from lastwake-com's site.css) --------------------- */

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip {
  position: absolute;
  left: 12px;
  top: -120px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 16px;
  border-radius: 999px;
  background: var(--accent-fill);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus { top: calc(8px + env(safe-area-inset-top, 0px)); }

/* --- Masthead -------------------------------------------------------------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: env(safe-area-inset-top, 0px);
  min-height: 64px;
}

.wordmark {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font: italic 600 clamp(26px, 7vw, 32px)/1 var(--font-display);
  letter-spacing: -0.01em;
  text-decoration: none;
}

/* The brush tail under the wordmark: a skewed stroke in the accent colour. */
.wordmark::after {
  content: "";
  position: absolute;
  left: 52%;
  right: -6px;
  bottom: 7px;
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
  transform: skewX(-24deg);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-2);
  font: 600 12px/1 var(--font-body);
  letter-spacing: 0.06em;
}

/* --- Buttons ---------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-fill);
  color: var(--text);
  font: 600 16px/1 var(--font-body);
  text-decoration: none;
  touch-action: manipulation;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.12s ease;
}

.btn:active { transform: scale(0.98); filter: brightness(0.92); }

body[data-theme="neon"] .btn {
  background: linear-gradient(135deg, var(--neon-magenta), var(--neon-violet));
  color: #fff;
}

@media (hover: hover) {
  .btn:hover { filter: brightness(1.08); }
}

/* --- Legal and other text pages ------------------------------------------- */

.prose {
  max-width: 68ch;
  padding-block: 12px 56px;
}

.prose h1 {
  font: 800 clamp(30px, 9vw, 44px)/1.05 var(--font-body);
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.neon-title {
  background: linear-gradient(135deg, var(--neon-magenta), var(--neon-violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.prose .updated { margin-top: 10px; color: var(--text-3); font-size: 14px; }

.prose .summary {
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
}

.prose h2 {
  margin-top: 34px;
  color: var(--text);
  font: 700 15px/1.3 var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.prose h3 { margin-top: 22px; font: 600 17px/1.35 var(--font-body); }

.prose p,
.prose ul { margin-top: 12px; color: var(--text-2); font-size: 16px; line-height: 1.65; }

.prose ul { padding-left: 1.2em; }

.prose li + li { margin-top: 6px; }

.prose a { color: var(--accent); text-underline-offset: 3px; }

.prose a.btn { color: var(--text); }

body[data-theme="neon"] .prose a.btn { color: #fff; }

.prose strong { color: var(--text); }

.prose .actions { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; }

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

.site-footer {
  margin-top: 40px;
  padding-top: 18px;
  padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 4px;
  margin-inline: -10px;
}

.site-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 10px;
  color: var(--text-2);
  font-size: 15px;
  text-decoration: none;
  touch-action: manipulation;
}

.site-footer nav a:active { color: var(--accent); }

@media (hover: hover) {
  .site-footer nav a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
}

.fineprint { margin-top: 8px; color: var(--text-3); font-size: 13px; }

/* --- Not found -------------------------------------------------------------- */

.lost { padding: clamp(40px, 14vh, 120px) 0 48px; }

.lost h1 { font: italic 600 clamp(34px, 10vw, 56px)/1.05 var(--font-display); }

.lost p { margin: 14px 0 26px; color: var(--text-2); max-width: 34ch; }

/* --- Motion ----------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
