/* Rook — dark-themed shared stylesheet
 * Single source of truth for index, privacy, terms, and changelog.
 * Soft graphite dark (not pure black) with indigo accent matching the
 * iOS app's AccentColor.
 */

:root {
  --bg:           #14151a;     /* soft graphite, slight blue-violet bias */
  --bg-2:         #1a1c22;     /* slightly raised */
  --bg-elevated:  #1f2128;     /* sections / nav background */
  --card:         #1c1e25;     /* surfaces */
  --card-2:       #23262e;     /* chips / inline pills */
  --border:       rgba(255, 255, 255, 0.08);
  --hairline:     rgba(255, 255, 255, 0.05);
  --text:         #f3f4f8;     /* primary label */
  --text-muted:   #b9bcc6;     /* secondary, ~10:1 on --bg */
  --text-faint:   #8a8d97;
  --accent:       #7c8bff;     /* lifted indigo for stronger glow on graphite */
  --accent-2:     #6173ff;     /* app AccentColor dark */
  --accent-soft:  rgba(124, 139, 255, 0.14);
  --green:        #30d158;
  --orange:       #ff9f0a;
  --red:          #ff453a;

  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─────────────────────────────────────────────────────────────────────
   LANDING — single-viewport home page
   ───────────────────────────────────────────────────────────────────── */

body.landing {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  /* Layered indigo glow on graphite */
  background:
    radial-gradient(1200px 640px at 50% -8%, rgba(124, 139, 255, 0.22), transparent 60%),
    radial-gradient(900px 520px at 12% 110%, rgba(124, 139, 255, 0.10), transparent 60%),
    radial-gradient(900px 520px at 88% 110%, rgba(97, 115, 255, 0.08), transparent 60%),
    linear-gradient(180deg, #181a21 0%, var(--bg) 60%, #101117 100%);
  position: relative;
}
/* Faint grain / noise to break banding on dark gradients */
body.landing::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
  z-index: 0;
}
.landing > * { position: relative; z-index: 1; }

.landing-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px 16px;
  text-align: center;
  gap: 36px;
}

.hero-block { max-width: 640px; }
.hero-block .icon {
  width: 100px; height: 100px;
  border-radius: 24px;
  display: block;
  margin: 0 auto 24px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 8px 28px rgba(0,0,0,0.55),
    0 24px 70px rgba(124, 139, 255, 0.32);
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.hero-block .icon:hover { transform: translateY(-2px) scale(1.02); }
.hero-block h1 {
  font-size: clamp(32px, 4.8vw, 48px);
  font-weight: 700;
  letter-spacing: -1.1px;
  line-height: 1.06;
  color: var(--text);
  margin-bottom: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #c8ccdb 110%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-block .lede {
  font-size: clamp(15px, 1.6vw, 17.5px);
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.55;
}

/* Three security/privacy/feature pillars */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 920px;
}
.pillar {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)),
    var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 22px 20px;
  text-align: left;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 1px 2px rgba(0,0,0,0.3);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.pillar:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 139, 255, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 8px 24px rgba(0,0,0,0.4),
    0 0 0 1px rgba(124, 139, 255, 0.05);
}
.pillar .kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.pillar .kicker::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.pillar p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* At-a-glance chip strip */
.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 780px;
}
.chips li {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 6px 13px;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.landing-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px max(28px, calc(env(safe-area-inset-right, 0px) + 20px)) max(22px, calc(env(safe-area-inset-bottom, 0px) + 14px)) max(28px, calc(env(safe-area-inset-left, 0px) + 20px));
  font-size: 12.5px;
  color: var(--text-faint);
  border-top: 1px solid var(--hairline);
}
.landing-foot .links { display: flex; gap: 18px; flex-wrap: wrap; }
.landing-foot a { color: var(--text-faint); }
.landing-foot a:hover { color: var(--text); text-decoration: none; }

/* Landing responsive — collapse pillars at narrow widths */
@media (max-width: 760px) {
  .pillars { grid-template-columns: 1fr; }
  /* Respect dynamic island / notch and start below status bar */
  .landing-main {
    gap: 22px;
    padding: max(28px, calc(env(safe-area-inset-top, 0px) + 18px)) 20px 12px;
    justify-content: flex-start;
  }
  .hero-block .icon { width: 80px; height: 80px; border-radius: 18px; margin-bottom: 16px; }
  .hero-block h1 { margin-bottom: 12px; }
  .pillar { padding: 18px 18px 16px; }
  /* Remove bottom-corner glows — on mobile the page is short enough that they
     form a visible blue band across the bottom rather than peeking from below. */
  body.landing {
    background:
      radial-gradient(900px 400px at 50% -6%, rgba(124, 139, 255, 0.18), transparent 60%),
      linear-gradient(180deg, #181a21 0%, var(--bg) 60%, #101117 100%);
  }
}
/* Tighter layout for small phones (iPhone SE and similar) */
@media (max-width: 390px) {
  .landing-main { gap: 20px; padding: 24px 16px 8px; }
  .pillars { gap: 10px; }
  .pillar { padding: 16px 16px 14px; border-radius: 14px; }
  .chips { gap: 6px; }
  .chips li { font-size: 12px; padding: 5px 11px; }
}

/* ─────────────────────────────────────────────────────────────────────
   INNER PAGES — privacy / terms / changelog
   Shared layout primitives, dark-themed.
   ───────────────────────────────────────────────────────────────────── */

.container { max-width: 760px; margin: 0 auto; padding: 0 24px; }

.subpage-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--hairline);
  position: sticky; top: 0;
  background: rgba(20, 21, 26, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  z-index: 100;
}
.subpage-nav .brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.subpage-nav .brand img { width: 26px; height: 26px; border-radius: 6px; }
.subpage-nav .brand span { font-size: 14.5px; font-weight: 600; letter-spacing: -0.2px; }
.subpage-nav .back { font-size: 13.5px; color: var(--text-muted); }
.subpage-nav .back:hover { color: var(--text); text-decoration: none; }

.subpage-foot {
  border-top: 1px solid var(--hairline);
  margin-top: 32px;
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-faint);
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}
.subpage-foot a { color: var(--text-faint); }
.subpage-foot a:hover { color: var(--text); text-decoration: none; }
.subpage-foot .footer-links { display: flex; gap: 18px; flex-wrap: wrap; }

.page-header {
  padding: 48px 0 28px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 32px;
}
.page-header .label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--accent);
  margin-bottom: 10px;
}
.page-header h1 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.6px;
  margin-bottom: 6px;
  color: var(--text);
}
.page-header .meta { font-size: 12.5px; color: var(--text-faint); }

.callout {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 28px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.55;
}

article { padding-bottom: 64px; }
article h2 {
  font-size: 17px;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 10px;
  letter-spacing: -0.2px;
  color: var(--text);
}
article h2:first-child { margin-top: 0; }
article p { font-size: 14.5px; color: var(--text-muted); margin-bottom: 12px; line-height: 1.6; }
article li { font-size: 14.5px; color: var(--text-muted); margin-bottom: 6px; line-height: 1.6; }
article strong { color: var(--text); font-weight: 600; }
article ul { padding-left: 20px; margin-bottom: 16px; }

article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin: 14px 0 22px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  overflow: hidden;
}
article th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-elevated);
  color: var(--text-faint);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--hairline);
}
article td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
  color: var(--text-muted);
  vertical-align: top;
}
article td:first-child { color: var(--text); font-weight: 500; }
article tr:last-child td { border-bottom: none; }

.legal-block {
  background: var(--bg-elevated);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Changelog */
.release { margin-bottom: 48px; }
.release-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 22px; flex-wrap: wrap;
}
.release-version { font-size: 22px; font-weight: 700; letter-spacing: -0.4px; color: var(--text); }
.release-date { font-size: 12.5px; color: var(--text-faint); }
.release-tag {
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}

.change-group { margin-bottom: 22px; }
.change-group-title {
  font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--text-faint);
  margin-bottom: 10px; padding-left: 14px;
}

.changes {
  list-style: none;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  overflow: hidden;
}
.changes li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
  font-size: 14px; color: var(--text-muted); line-height: 1.5;
}
.changes li:last-child { border-bottom: none; }
.pill {
  flex-shrink: 0;
  font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px;
  margin-top: 2px;
}
.pill-new      { background: var(--accent-soft);                                   color: var(--accent); }
.pill-fix      { background: color-mix(in srgb, var(--green) 16%, transparent);    color: var(--green); }
.pill-improve  { background: color-mix(in srgb, var(--orange) 16%, transparent);   color: var(--orange); }
.pill-security { background: color-mix(in srgb, var(--red) 16%, transparent);      color: var(--red); }
