/* StillFree — one stylesheet, no build step, no external requests. */

:root {
  color-scheme: light dark;

  --canvas: #fbfaf8;
  --surface: #ffffff;
  --text: #1a1917;
  --text-secondary: #55524d;
  --text-tertiary: #86827b;
  --hairline: #e6e2dc;
  --accent: #4f46c9;
  --accent-soft: #eeedfb;
  --measure: 34rem;

  --store-bg: #111010;
  --store-fg: #ffffff;
  --store-sub: #b9b6b1;
  --device-shadow: 0 30px 60px -32px rgba(0, 0, 0, 0.55), 0 2px 5px rgba(0, 0, 0, 0.25);
  --shot-light: block;
  --shot-dark: none;
}

/* The reader's choice wins over the system; with no choice stored, the system wins. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #131211;
    --surface: #1c1b19;
    --text: #f2efea;
    --text-secondary: #b3aea6;
    --text-tertiary: #837e76;
    --hairline: #2e2c29;
    --accent: #a6a0f5;
    --accent-soft: #1e1c33;

    --store-bg: #f4f1ec;
    --store-fg: #121110;
    --store-sub: #5d5a55;
    --device-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9);
    --shot-light: none;
    --shot-dark: block;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
    --canvas: #131211;
    --surface: #1c1b19;
    --text: #f2efea;
    --text-secondary: #b3aea6;
    --text-tertiary: #837e76;
    --hairline: #2e2c29;
    --accent: #a6a0f5;
    --accent-soft: #1e1c33;

    --store-bg: #f4f1ec;
    --store-fg: #121110;
    --store-sub: #5d5a55;
    --device-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9);
    --shot-light: none;
    --shot-dark: block;
    color-scheme: dark;
}

:root[data-theme="light"] { color-scheme: light; }

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

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

body {
  margin: 0;
  padding: 0 1.25rem 4rem;
  background: var(--canvas);
  color: var(--text);
  font: 400 1rem/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "kern";
  text-rendering: optimizeLegibility;
}

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

/* Header ------------------------------------------------------------- */

header.site {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 2.5rem;
}

header.site .name {
  display: inline-block;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

header.site .tagline {
  margin: 0.25rem 0 0;
  color: var(--text-tertiary);
  font-size: 0.9375rem;
}

nav.site { margin-top: 1.5rem; }

nav.site a {
  display: inline-block;
  margin-right: 1.25rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}

nav.site a:hover { color: var(--text); border-bottom-color: var(--hairline); }
nav.site a[aria-current="page"] { color: var(--accent); font-weight: 500; }

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

h1 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 2.75rem 0 0.75rem;
  padding-top: 0.25rem;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.75rem 0 0.5rem;
}

p { margin: 0 0 1rem; }

p.lede {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.effective {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin: 0 0 2.5rem;
}

ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; }
li { margin-bottom: 0.4rem; }
li::marker { color: var(--text-tertiary); }

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

strong { font-weight: 600; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875em;
  background: var(--accent-soft);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* Components --------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 1.25rem 1.375rem;
  margin: 1.5rem 0;
}

.card p:last-child, .card ul:last-child, .card ol:last-child { margin-bottom: 0; }

.card h3 { margin-top: 0; }

.contact {
  background: var(--accent-soft);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 1.25rem 1.375rem;
  margin: 2rem 0;
}

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

.contact a { font-weight: 500; }

details {
  border-bottom: 1px solid var(--hairline);
  padding: 0.9rem 0;
}

details summary {
  cursor: pointer;
  font-weight: 500;
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

details summary::-webkit-details-marker { display: none; }

details summary::before {
  content: "+";
  color: var(--accent);
  font-weight: 600;
  width: 0.9rem;
  flex: none;
}

details[open] summary::before { content: "\2212"; }

details summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

details .body { padding: 0.75rem 0 0.25rem 1.4rem; }
details .body p:last-child, details .body ol:last-child, details .body ul:last-child { margin-bottom: 0; }

.facts { border-top: 1px solid var(--hairline); margin: 1.5rem 0 0; }

.facts .row {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.9375rem;
}

.facts .row dt { color: var(--text-secondary); margin: 0; }
.facts .row dd { margin: 0; text-align: right; font-weight: 500; }

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

footer.site {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

footer.site a { color: var(--text-secondary); }
footer.site p { margin: 0 0 0.4rem; }

/* Accessibility ------------------------------------------------------ */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 0 0 8px 0;
  z-index: 10;
}

.skip:focus { left: 0; }

a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

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

@media (max-width: 30rem) {
  header.site { padding-top: 2rem; }
  h1 { font-size: 1.5rem; }
  .facts .row { flex-direction: column; gap: 0.15rem; }
  .facts .row dd { text-align: left; }
}


/* Home page ----------------------------------------------------------
   The legal pages keep the narrow reading measure; the home page is a
   showcase, so it gets room and puts prose back into a column of its own. */

:root { --measure-wide: 64rem; }

body.home .wrap { max-width: var(--measure-wide); }
body.home .prose { max-width: var(--measure); }

.hero {
  display: grid;
  gap: 2.5rem;
  align-items: center;
  padding: 1.5rem 0 0;
}

.hero h1 { font-size: 2.25rem; letter-spacing: -0.03em; }

.hero .lede {
  font-size: 1.1875rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.hero .prose { max-width: 32rem; }

/* App Store style badge ----------------------------------------------
   Not Apple's own badge artwork: that one may only be used to link to a live
   App Store page, and there is not one yet. */

.store {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--store-bg);
  color: var(--store-fg);
  border-radius: 15px;
  padding: 0.7rem 1.4rem 0.7rem 1.1rem;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.26);
  cursor: default;
  user-select: none;
  margin: 0;
}

.store svg { width: 26px; height: 26px; flex: 0 0 auto; fill: currentColor; }

.store .label { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }

.store .small {
  font-size: 0.6875rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--store-sub);
}

.store .big { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; }

.store .soon {
  position: absolute;
  top: -0.55rem;
  right: -0.55rem;
  padding: 0.18rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  border-radius: 999px;
  color: #2a1c05;
  background: linear-gradient(180deg, #fcc843, #f3a515);
  box-shadow: 0 4px 12px rgba(243, 165, 21, 0.35);
}

.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.25rem; margin: 1.75rem 0 0; }
.cta .note { font-size: 0.9375rem; color: var(--text-tertiary); margin: 0; max-width: 17rem; }

/* Benefits ------------------------------------------------------------ */

.benefits {
  display: grid;
  gap: 1.25rem;
  margin: 3rem 0 0;
  padding: 1.75rem 0 0;
  border-top: 1px solid var(--hairline);
}

.benefit h3 { margin: 0.6rem 0 0.3rem; font-size: 1rem; }
.benefit p { margin: 0; font-size: 0.9375rem; color: var(--text-secondary); }
.benefit svg { width: 22px; height: 22px; stroke: var(--accent); fill: none; stroke-width: 1.7; }

/* Device frame -------------------------------------------------------- */

.device {
  max-width: 17.5rem;
  margin: 0 auto;
  background: linear-gradient(160deg, #3a3a3d, #121214 38%, #1d1d20 72%, #434347);
  border-radius: 2.75rem;
  padding: 0.5rem;
  box-shadow: var(--device-shadow);
}

.device .screen {
  border-radius: 2.3rem;
  overflow: hidden;
  background: var(--canvas);
  display: block;
}

.device img { display: block; width: 100%; height: auto; }

.device .light { display: var(--shot-light); }
.device .dark { display: var(--shot-dark); }

.shots { display: grid; gap: 2.5rem; margin: 2.5rem 0 0; }
.shots figure { margin: 0; }

.shots figcaption {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 1.125rem;
  max-width: 20rem;
  margin-left: auto;
  margin-right: auto;
}

/* Grid of cards ------------------------------------------------------- */

.grid { display: grid; gap: 1.25rem; margin: 1.5rem 0; }
.grid .card { margin: 0; }

/* Closing call to action ---------------------------------------------- */

.closing {
  background: var(--accent-soft);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  padding: 2rem 1.75rem;
  margin: 3rem 0 0;
  text-align: center;
}

.closing h2 { margin: 0 0 0.5rem; font-size: 1.375rem; }
.closing p { color: var(--text-secondary); max-width: 30rem; margin: 0 auto 1.5rem; }
.closing .cta { justify-content: center; }
.closing .cta .note { text-align: left; }

/* Wide screens -------------------------------------------------------- */

@media (min-width: 40rem) {
  .benefits { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
}

@media (min-width: 46rem) {
  .grid { grid-template-columns: 1fr 1fr; }
  .shots { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
  body.home .facts { columns: 2; column-gap: 3rem; }
  body.home .facts .row { break-inside: avoid; }
}

@media (min-width: 58rem) {
  .hero { grid-template-columns: 1.1fr 0.9fr; gap: 3.5rem; padding-top: 2.5rem; }
  .hero .device { margin: 0 0 0 auto; }
  .hero h1 { font-size: 2.875rem; }
}

/* Theme switch --------------------------------------------------------
   Hidden until the script shows it, so a reader without JavaScript is not
   offered a control that cannot work. */

.theme {
  position: absolute;
  top: 3rem;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 0.4rem 0.85rem 0.4rem 0.7rem;
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.theme:hover { color: var(--text); }

.theme svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.6; }

.theme .on { display: none; }
.theme[data-mode="system"] .sys,
.theme[data-mode="light"] .lgt,
.theme[data-mode="dark"] .drk { display: inline-flex; }

header.site { position: relative; }

@media (max-width: 30rem) {
  .theme { top: 2rem; padding: 0.35rem 0.6rem; }
  .theme .word { display: none; }
}

.theme .on { align-items: center; gap: 0.45rem; }

/* The closing badge stands alone and centred; the note sits under it, not beside. */
.closing .cta { flex-direction: column; align-items: center; gap: 1.125rem; }
.closing .cta .note { text-align: center; max-width: 24rem; }
