/*
 * Cove — shared site styles
 * Used by both docs/index.html (landing) and docs/privacy/index.html.
 *
 * Self-contained: no @import, no Google Fonts, no external assets.
 * Hosted from the same GitHub Pages origin as the HTML, so this file
 * does not introduce any third-party network requests.
 *
 * --------------------------------------------------------------------
 * Sea-beach palette
 *
 *   Light mode: warm bone-white sand background, deep tidepool-teal
 *     ink, turquoise accent, pale-coral shell highlight.
 *   Dark mode:  moonlit tidepool — deep teal surface, warm sand text,
 *     bright-foam turquoise accent, sunset-coral warning.
 *
 * Contrast ratios were chosen so every ink token clears WCAG AA against
 * its corresponding surface. Test with the browser devtools "contrast"
 * inspector if you swap any value.
 * --------------------------------------------------------------------
 */

:root {
  --bg: #fdf6e7;            /* dry sand */
  --surface: #fffbf0;       /* sun-bleached shell */
  --surface-alt: #f3e9d2;   /* damp sand */
  --ink: #0f3a44;           /* deep tidepool */
  --ink-soft: #2f6770;      /* shallow water */
  --ink-muted: #7a8a8a;     /* driftwood grey */
  --rule: #e6d8b8;          /* wet-sand line */
  --accent: #0d8a8a;        /* turquoise */
  --accent-soft: #d6efe9;   /* sea-foam */
  --shell: #f0c2a8;         /* pale coral */
  --coral: #d9755a;         /* sunset-coral */
  --warn-bg: #fdebd2;
  --warn-rule: #e6c79a;
  --warn-ink: #6b3d18;

  /* Noise-color swatches used by the shell grid */
  --noise-brown: #8a6a3d;
  --noise-pink:  #e9a5a0;
  --noise-gray:  #9aa4a8;
  --noise-white: #ecebe4;
  --noise-blue:  #6a9fcb;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d2530;          /* night ocean */
    --surface: #133544;     /* deep reef */
    --surface-alt: #194253; /* lit tidepool */
    --ink: #f4e8d3;         /* moonlit sand */
    --ink-soft: #c9dcd9;    /* foam */
    --ink-muted: #8aa6a5;   /* wet stone */
    --rule: #1f4a5a;        /* coral shadow */
    --accent: #5dd5cf;      /* foam crest */
    --accent-soft: #1c4855; /* still water */
    --shell: #e8a87c;       /* sunset coral */
    --coral: #f0a98e;
    --warn-bg: #3a2918;
    --warn-rule: #6b4a28;
    --warn-ink: #f0c79a;

    --noise-brown: #b08c5e;
    --noise-pink:  #f0b6b1;
    --noise-gray:  #b6c0c4;
    --noise-white: #f5f3ea;
    --noise-blue:  #8fbfe5;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /*
   * Subtle horizon: a very faint band of sea-foam across the top of the
   * page so it reads as "beach looking out at sea". Static, no scroll
   * attachment (which janks on iOS).
   */
  background-image:
    radial-gradient(ellipse 120% 40% at 50% 0%,
      var(--accent-soft) 0%,
      transparent 55%);
  background-repeat: no-repeat;
  background-size: 100% 480px;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

/* ------------------------------------------------------------------ */
/* Site header (shared between pages)                                  */
/* ------------------------------------------------------------------ */

header.cove {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}

header.cove .brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

/*
 * Brand mark: sun rising over a horizon line. The top half is a warm
 * sun-disc (coral → sand), the bottom half is calm sea (turquoise).
 * Rendered with pure CSS gradients so the page stays asset-free.
 */
header.cove .mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: 0 0 40px;
  background: linear-gradient(
    to bottom,
    var(--shell) 0%,
    var(--shell) 48%,
    var(--accent) 52%,
    var(--accent) 100%
  );
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent),
    0 1px 2px color-mix(in srgb, var(--ink) 6%, transparent);
  position: relative;
  overflow: hidden;
}

/* Sun reflection ripple across the sea half */
header.cove .mark::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: var(--accent-soft);
  border-radius: 999px;
  opacity: 0.7;
  box-shadow:
    0 4px 0 -1px var(--accent-soft),
    0 -4px 0 -1px var(--accent-soft);
}

header.cove .brand {
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}

header.cove .brand-sub {
  color: var(--ink-muted);
  font-size: 0.9em;
}

header.cove nav {
  margin-left: auto;
  display: flex;
  gap: 18px;
  font-size: 0.95em;
}

header.cove nav a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 120ms ease, border-color 120ms ease;
}

header.cove nav a:hover,
header.cove nav a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ------------------------------------------------------------------ */
/* Typography                                                          */
/* ------------------------------------------------------------------ */

h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.35rem;
  line-height: 1.3;
  margin: 56px 0 12px;
  letter-spacing: -0.005em;
  padding-top: 8px;
}

h3 {
  font-size: 1.05rem;
  line-height: 1.35;
  margin: 32px 0 8px;
  color: var(--ink-soft);
}

h2 .num, h3 .num {
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  margin-right: 0.4em;
  font-weight: 500;
}

p { margin: 0 0 14px; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover { text-decoration-thickness: 2px; }

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

ul {
  margin: 0 0 14px;
  padding-left: 1.4em;
}

li { margin: 6px 0; }

code, kbd, samp {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  font-size: 0.92em;
  background: var(--surface-alt);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--ink-soft);
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 40px 0;
}

/* ------------------------------------------------------------------ */
/* Hero (landing page only)                                            */
/* ------------------------------------------------------------------ */

.hero {
  text-align: center;
  padding: 24px 0 8px;
}

.hero .mark-lg {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto 20px;
  background: linear-gradient(
    to bottom,
    var(--shell) 0%,
    var(--shell) 48%,
    var(--accent) 52%,
    var(--accent) 100%
  );
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent),
    0 4px 18px color-mix(in srgb, var(--accent) 18%, transparent);
  position: relative;
  overflow: hidden;
}

.hero .mark-lg::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
  width: 60%;
  height: 3px;
  background: var(--accent-soft);
  border-radius: 999px;
  opacity: 0.7;
  box-shadow:
    0 7px 0 -1px var(--accent-soft),
    0 -7px 0 -1px var(--accent-soft);
}

.hero h1 {
  font-size: 3rem;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.hero .tagline {
  font-size: 1.2rem;
  color: var(--ink-soft);
  margin: 0 0 28px;
  font-style: italic;
}

/* ------------------------------------------------------------------ */
/* Intro / lede paragraph                                              */
/* ------------------------------------------------------------------ */

.lede {
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0 0 24px;
}

/* ------------------------------------------------------------------ */
/* Shell grid                                                          */
/* ------------------------------------------------------------------ */

.shell-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 24px 0 8px;
}

.shell-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.shell-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--ink) 10%, transparent);
}

/*
 * Each shell card gets a soft gradient hint of its noise color in the
 * top-right corner — visible enough to differentiate at a glance, faint
 * enough not to fight the text.
 */
.shell-card::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--noise-color, var(--accent)) 0%, transparent 65%);
  opacity: 0.35;
  pointer-events: none;
}

.shell-card[data-noise="brown"] { --noise-color: var(--noise-brown); }
.shell-card[data-noise="pink"]  { --noise-color: var(--noise-pink);  }
.shell-card[data-noise="gray"]  { --noise-color: var(--noise-gray);  }
.shell-card[data-noise="white"] { --noise-color: var(--noise-white); }
.shell-card[data-noise="blue"]  { --noise-color: var(--noise-blue);  }

.shell-card h3 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 1.1rem;
}

.shell-card .mood {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 0.95em;
  line-height: 1.45;
}

.shell-card .noise-tag {
  display: inline-block;
  font-size: 0.78em;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--rule);
}

/* ------------------------------------------------------------------ */
/* Feature list                                                        */
/* ------------------------------------------------------------------ */

.feature-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 24px;
}

.feature-list li {
  position: relative;
  padding-left: 26px;
  line-height: 1.5;
  margin: 0;
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(
    to bottom,
    var(--shell) 0%,
    var(--shell) 48%,
    var(--accent) 52%,
    var(--accent) 100%
  );
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent);
}

/* ------------------------------------------------------------------ */
/* Store / download                                                    */
/* ------------------------------------------------------------------ */

.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0 0;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.store-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 16%, transparent);
}

.store-btn[aria-disabled="true"] {
  opacity: 0.6;
  pointer-events: none;
  cursor: not-allowed;
}

.store-btn .store-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  color: var(--accent);
}

.store-btn .store-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.store-btn .store-label-1 {
  display: block;
  font-size: 0.7em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  line-height: 1.1;
}

.store-btn .store-label-2 {
  display: block;
  font-size: 1em;
  font-weight: 600;
  line-height: 1.2;
}

/* ------------------------------------------------------------------ */
/* Metadata bar (privacy page)                                         */
/* ------------------------------------------------------------------ */

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: var(--ink-muted);
  font-size: 0.92em;
  margin: 0 0 24px;
}

.meta span strong {
  color: var(--ink-soft);
  font-weight: 500;
}

/* ------------------------------------------------------------------ */
/* TLDR / callout                                                      */
/* ------------------------------------------------------------------ */

.tldr {
  background: var(--accent-soft);
  border: 1px solid var(--shell);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 24px 0 32px;
}

.tldr h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.tldr ul { margin: 0; padding-left: 1.2em; }

/* ------------------------------------------------------------------ */
/* Tables                                                              */
/* ------------------------------------------------------------------ */

.table-wrap {
  overflow-x: auto;
  margin: 12px 0 18px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
}

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

th {
  background: var(--surface-alt);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.88em;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

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

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

.site-footer {
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  font-size: 0.9em;
  color: var(--ink-muted);
}

.site-footer nav {
  display: flex;
  gap: 18px;
  margin-right: auto;
}

.site-footer a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}

.site-footer a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.footnote {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-size: 0.88em;
  color: var(--ink-muted);
}

/* ------------------------------------------------------------------ */
/* Anchored sections (privacy page)                                    */
/* ------------------------------------------------------------------ */

a.anchor {
  color: var(--ink-muted);
  text-decoration: none;
  opacity: 0;
  margin-left: 0.4em;
  font-weight: 400;
  transition: opacity 120ms ease;
}

h2:hover a.anchor,
h3:hover a.anchor { opacity: 1; }

:target {
  scroll-margin-top: 24px;
}

h2:target,
h3:target {
  background: linear-gradient(transparent 60%, var(--accent-soft) 60%);
}

/* ------------------------------------------------------------------ */
/* Reduced motion                                                      */
/* ------------------------------------------------------------------ */

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

/* ------------------------------------------------------------------ */
/* Small screens                                                       */
/* ------------------------------------------------------------------ */

@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { padding: 32px 18px 72px; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.2rem; margin-top: 44px; }
  h3 { font-size: 1rem; }
  .hero h1 { font-size: 2.2rem; }
  .hero .tagline { font-size: 1.05rem; }
  .hero .mark-lg { width: 72px; height: 72px; }
  .tldr { padding: 16px 18px; }
  th, td { padding: 8px 10px; }
  header.cove nav { gap: 14px; font-size: 0.9em; }
  .site-footer { flex-direction: column; align-items: flex-start; }
}

/* ------------------------------------------------------------------ */
/* Print                                                               */
/* ------------------------------------------------------------------ */

@media print {
  :root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-alt: #f3f3f3;
    --ink: #000;
    --ink-soft: #222;
    --ink-muted: #444;
    --rule: #ccc;
    --accent: #003a6b;
    --accent-soft: #f3f3f3;
  }
  body {
    font-size: 11pt;
    background-image: none;
  }
  .wrap { max-width: none; padding: 0; }
  header.cove .mark,
  .hero .mark-lg { display: none; }
  header.cove nav,
  .site-footer nav,
  .store-buttons { display: none; }
  a { color: inherit; text-decoration: none; }
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #555;
  }
  h2, h3 { page-break-after: avoid; }
  .tldr, .table-wrap, .shell-card { page-break-inside: avoid; }
}
