/* Study Stash's website. The colours are the app's own: Lagoon, the default theme (oklch 0.58 0.12 195), on the warm
   paper of the icon's tile, with its navy "S." for ink and the quick panel's yellow highlighter. No web fonts: the
   serif is the one the app writes notes in (New York on a Mac), and nothing loads from anyone else's server. */

:root {
  color-scheme: light dark;
  --paper: oklch(0.975 0.01 85);
  --paper-2: oklch(0.955 0.014 85);
  --card: oklch(0.99 0.006 85);
  --ink: oklch(0.27 0.05 262);
  --ink-2: oklch(0.43 0.035 258);
  --ink-3: oklch(0.58 0.025 255);
  --rule: oklch(0.88 0.015 85);
  --rule-2: oklch(0.92 0.012 85);
  --accent: oklch(0.52 0.11 195);
  --accent-ink: oklch(0.45 0.1 195);
  --accent-fill: oklch(0.58 0.12 195);
  --on-accent: #fff;
  --accent-soft: oklch(0.58 0.12 195 / 0.12);
  --navy: oklch(0.38 0.1 262);
  --mark: oklch(0.9 0.14 95 / 0.75);
  --night: oklch(0.2 0.035 262);
  --night-2: oklch(0.25 0.04 262);
  --night-ink: oklch(0.95 0.01 85);
  --night-ink-2: oklch(0.78 0.02 250);
  --shadow: 0 1px 2px oklch(0.3 0.04 262 / 0.06), 0 8px 24px -8px oklch(0.3 0.04 262 / 0.14);
  --shot-shadow: 0 2px 6px oklch(0.2 0.04 262 / 0.12), 0 30px 80px -20px oklch(0.2 0.06 262 / 0.45);

  --serif: "New York", ui-serif, "Iowan Old Style", Charter, "Charter BT", "Sitka Text", Cambria, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;

  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: oklch(0.19 0.025 262);
    --paper-2: oklch(0.225 0.028 262);
    --card: oklch(0.245 0.03 262);
    --ink: oklch(0.95 0.012 85);
    --ink-2: oklch(0.8 0.02 250);
    --ink-3: oklch(0.66 0.025 250);
    --rule: oklch(0.32 0.03 262);
    --rule-2: oklch(0.28 0.03 262);
    --accent: oklch(0.78 0.1 195);
    --accent-ink: oklch(0.8 0.09 195);
    --accent-fill: oklch(0.62 0.12 195);
    --accent-soft: oklch(0.7 0.12 195 / 0.16);
    --navy: oklch(0.8 0.06 262);
    --mark: oklch(0.6 0.11 95 / 0.55);
    --night: oklch(0.15 0.03 262);
    --night-2: oklch(0.2 0.035 262);
    --shadow: 0 1px 2px oklch(0 0 0 / 0.3), 0 8px 24px -8px oklch(0 0 0 / 0.5);
    --shot-shadow: 0 2px 6px oklch(0 0 0 / 0.3), 0 30px 80px -20px oklch(0 0 0 / 0.7);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2.5px solid var(--accent-fill); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--mark); color: inherit; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.015em; line-height: 1.12; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 1.4rem + 4.2vw, 4.4rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.6rem); }
h3 { font-size: 1.3rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; text-wrap: pretty; }
kbd { font: 500 0.85em/1 var(--mono); padding: 0.15em 0.4em; border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 5px; background: var(--card); white-space: nowrap; }
code { font: 0.9em var(--mono); background: var(--paper-2); padding: 0.1em 0.35em; border-radius: 5px; }

/* The highlighter the quick panel marks a match with, drawn a little uneven like a real one. */
mark, .hl {
  color: inherit;
  background: linear-gradient(100deg, transparent 0.2em, var(--mark) 0.35em, var(--mark) calc(100% - 0.3em), transparent calc(100% - 0.1em));
  background-size: 100% 0.62em;
  background-position: 0 88%;
  background-repeat: no-repeat;
  padding: 0 0.08em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 46rem; }
.skip { position: absolute; left: -999px; top: 0.5rem; z-index: 10; background: var(--card); padding: 0.5rem 0.9rem; border-radius: 8px; }
.skip:focus { left: 0.75rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-head { position: sticky; top: 0; z-index: 5; background: color-mix(in oklch, var(--paper) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.site-head.scrolled { border-bottom-color: var(--rule); }
.site-head .wrap { display: flex; align-items: center; gap: 1rem; min-height: 3.75rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; font: 600 1.05rem/1 var(--sans); letter-spacing: -0.01em; margin-right: auto; }
.brand img { width: 30px; height: 30px; border-radius: 7px; box-shadow: 0 0 0 0.5px oklch(0.3 0.04 262 / 0.2), 0 1px 3px oklch(0.3 0.04 262 / 0.15); }
.nav { display: flex; align-items: center; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.nav a { display: block; padding: 0.45rem 0.7rem; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 0.9375rem; }
.nav a:hover { color: var(--ink); background: var(--paper-2); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav .gh svg { width: 20px; height: 20px; display: block; fill: currentColor; }
@media (max-width: 640px) {
  .nav .hide-sm { display: none; }
  .nav a { padding: 0.45rem 0.5rem; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem; min-height: 3rem; padding: 0.7rem 1.2rem 0.7rem 1rem;
  border-radius: 12px; font: 600 1rem/1.15 var(--sans); text-decoration: none; letter-spacing: -0.005em;
  border: 1px solid transparent; transition: transform 0.12s ease, box-shadow 0.2s ease, background-color 0.2s;
}
.btn svg { width: 22px; height: 22px; flex: none; fill: currentColor; }
.btn small { display: block; font-weight: 400; font-size: 0.8125rem; opacity: 0.82; margin-top: 0.15rem; }
.btn-primary { background: var(--accent-fill); color: var(--on-accent); box-shadow: 0 1px 0 oklch(1 0 0 / 0.25) inset, 0 6px 18px -6px oklch(0.5 0.12 195 / 0.7); }
.btn-primary:hover { background: color-mix(in oklch, var(--accent-fill) 88%, black); }
.btn-quiet { background: var(--card); color: var(--ink); border-color: var(--rule); box-shadow: var(--shadow); }
.btn-quiet:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btns { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Hero */
.hero { padding: clamp(3rem, 8vw, 6.5rem) 0 0; position: relative; }
.eyebrow { display: inline-flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; font: 500 0.8125rem/1.3 var(--mono); letter-spacing: 0.02em; color: var(--ink-3); margin: 0 0 1.4rem; padding: 0; list-style: none; }
.eyebrow li + li::before { content: "·"; margin-right: 0.9rem; color: var(--rule); }
.hero h1 { max-width: 15ch; }
.lede { font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem); line-height: 1.55; color: var(--ink-2); max-width: 36rem; margin: 1.4rem 0 2rem; }
.fine { font-size: 0.875rem; color: var(--ink-3); margin: 0.9rem 0 0; }
.fine a { color: inherit; }

.stage {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  position: relative;
  padding: clamp(1.2rem, 4vw, 3.5rem) clamp(0.6rem, 4vw, 3.5rem) 0;
  border-radius: 22px 22px 0 0;
  background:
    radial-gradient(120% 90% at 85% 0%, oklch(0.42 0.12 300 / 0.55), transparent 60%),
    radial-gradient(90% 80% at 10% 100%, oklch(0.45 0.12 240 / 0.6), transparent 65%),
    linear-gradient(160deg, oklch(0.22 0.05 262), oklch(0.16 0.04 262));
  overflow: hidden;
}
.stage img { border-radius: 12px 12px 0 0; box-shadow: var(--shot-shadow); margin: 0 auto; }

/* Sections */
section { padding: clamp(4rem, 9vw, 7rem) 0; }
.band { background: var(--paper-2); border-top: 1px solid var(--rule-2); border-bottom: 1px solid var(--rule-2); }
.kicker { font: 500 0.8125rem/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 1rem; }
.section-head { max-width: 40rem; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section-head p { color: var(--ink-2); font-size: 1.125rem; margin-top: 1rem; }

/* How a lecture becomes notes: a ruled notebook margin, not cards. */
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1.5px solid var(--ink); counter-reset: step; }
.flow li { padding: 1.4rem 1.4rem 0 0; counter-increment: step; position: relative; }
.flow li + li { padding-left: 1.4rem; border-left: 1px solid var(--rule); }
.flow li::before { content: counter(step, decimal-leading-zero); display: block; font: 500 0.8125rem/1 var(--mono); color: var(--ink-3); margin-bottom: 1.1rem; }
.flow h3 { margin-bottom: 0.5rem; }
.flow p { color: var(--ink-2); font-size: 0.975rem; margin: 0; }
@media (max-width: 860px) {
  .flow { grid-template-columns: 1fr 1fr; row-gap: 2rem; }
  .flow li:nth-child(3) { border-left: 0; padding-left: 0; }
}
@media (max-width: 520px) {
  .flow { grid-template-columns: 1fr; border-top: 0; }
  .flow li, .flow li + li { border-left: 0; padding: 1.2rem 0 0; border-top: 1px solid var(--rule); }
  .flow li:first-child { border-top: 1.5px solid var(--ink); }
}

/* A feature with its screenshot, alternating sides. */
.feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.feature + .feature { margin-top: clamp(4rem, 9vw, 7rem); }
.feature.flip { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
.feature.flip > :first-child { order: 2; }
.feature h3 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); margin-bottom: 1rem; }
.feature p { color: var(--ink-2); }
.feature ul { padding: 0; margin: 1.2rem 0 0; list-style: none; }
.feature li { padding: 0.55rem 0 0.55rem 1.6rem; border-top: 1px solid var(--rule-2); position: relative; color: var(--ink-2); font-size: 0.975rem; }
.feature li::before { content: ""; position: absolute; left: 0.2rem; top: 1.05rem; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--accent-fill); }
/* The screenshots bring their own wallpaper, so they only need rounding and a shadow. */
.shot img { border-radius: 14px; margin: 0 auto; box-shadow: var(--shot-shadow); }
.shot.tall img { max-height: 36rem; width: auto; }
@media (max-width: 860px) {
  .feature, .feature.flip { grid-template-columns: 1fr; }
  .feature.flip > :first-child { order: 0; }
}

/* One computer or two */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.pair > div { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: clamp(1.4rem, 3vw, 2.2rem); }
.pair h3 { margin: 1.2rem 0 0.6rem; }
.pair p { color: var(--ink-2); margin: 0; }
.pair svg { width: 100%; height: auto; display: block; max-height: 9rem; }
.pair svg .box { fill: var(--paper-2); stroke: var(--rule); }
.pair svg .lib { fill: var(--accent-soft); stroke: var(--accent); }
.pair svg text { fill: var(--ink-2); font: 500 12px var(--sans); }
.pair svg .line { stroke: var(--ink-3); stroke-dasharray: 3 4; fill: none; }
.pair svg .arrow { fill: var(--ink-3); }
@media (max-width: 760px) { .pair { grid-template-columns: 1fr; } }

/* The privacy promise, on the app's night wallpaper. */
.night { background: radial-gradient(80% 120% at 100% 0%, oklch(0.35 0.1 290 / 0.45), transparent 60%), linear-gradient(170deg, var(--night-2), var(--night)); color: var(--night-ink); }
.night .kicker { color: oklch(0.8 0.1 195); }
.night h2 { color: var(--night-ink); max-width: 18ch; }
.night a { color: oklch(0.82 0.1 195); }
.promises { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem 2.5rem; margin-top: 3rem; padding: 0; list-style: none; }
.promises li { border-top: 1px solid oklch(1 0 0 / 0.16); padding-top: 1.2rem; color: var(--night-ink-2); font-size: 0.975rem; }
.promises strong { display: block; color: var(--night-ink); font: 600 1.15rem/1.3 var(--serif); margin-bottom: 0.45rem; }
@media (max-width: 860px) { .promises { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .promises { grid-template-columns: 1fr; } }

/* Download */
.download { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.dl { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: clamp(1.4rem, 3vw, 2rem); display: flex; flex-direction: column; gap: 1rem; }
.dl.here { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dl .os { display: flex; align-items: center; gap: 0.7rem; }
.dl .os svg { width: 28px; height: 28px; fill: var(--ink); }
.dl h3 { font-size: 1.5rem; }
.dl p { color: var(--ink-2); font-size: 0.95rem; margin: 0; }
.dl .btn { align-self: flex-start; }
.dl .tag { font: 500 0.75rem/1 var(--mono); color: var(--accent-ink); background: var(--accent-soft); padding: 0.3rem 0.5rem; border-radius: 6px; margin-left: auto; visibility: hidden; }
.dl.here .tag { visibility: visible; }
@media (max-width: 760px) { .download { grid-template-columns: 1fr; } }

.cta-phone { display: grid; grid-template-columns: auto 1fr auto; gap: 1.5rem 2rem; align-items: center; background: var(--card); border: 1px solid var(--rule); border-radius: 20px; padding: clamp(1.4rem, 4vw, 2.5rem); }
.cta-phone .phone-mark { width: 3.5rem; height: 3.5rem; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.cta-phone .phone-mark svg { width: 26px; height: 26px; }
.cta-phone h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
.cta-phone p { color: var(--ink-2); margin: 0.5rem 0 0; }
@media (max-width: 720px) { .cta-phone { grid-template-columns: 1fr; } }

/* Long-form pages: the phone guide, privacy, terms, support. */
.page-head { padding: clamp(3rem, 7vw, 5rem) 0 clamp(1.5rem, 4vw, 2.5rem); }
.page-head h1 { font-size: clamp(2.2rem, 1.5rem + 3vw, 3.4rem); max-width: 20ch; }
.page-head .lede { margin-bottom: 0; }
.updated { font: 500 0.8125rem/1.3 var(--mono); color: var(--ink-3); margin: 1.2rem 0 0; }
.prose { padding-bottom: clamp(4rem, 9vw, 6rem); }
.prose h2 { font-size: clamp(1.45rem, 1.2rem + 0.8vw, 1.85rem); margin: 3rem 0 1rem; padding-top: 1.6rem; border-top: 1px solid var(--rule); scroll-margin-top: 5rem; }
.prose h3 { font-size: 1.15rem; margin: 2rem 0 0.6rem; scroll-margin-top: 5rem; }
.prose p, .prose li { color: var(--ink-2); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1.2em; }
.prose li { margin: 0.35rem 0; }
.prose li::marker { color: var(--ink-3); }
.prose > :first-child { margin-top: 0; }
.callout { border-left: 3px solid var(--accent-fill); background: var(--accent-soft); padding: 1rem 1.2rem; border-radius: 0 10px 10px 0; margin: 1.5rem 0; }
.callout p:last-child { margin-bottom: 0; }
.callout p { color: var(--ink); }
.toc { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 1.8rem 0 0; }
.toc a { display: block; font-size: 0.875rem; padding: 0.4rem 0.75rem; border: 1px solid var(--rule); border-radius: 999px; text-decoration: none; color: var(--ink-2); background: var(--card); }
.toc a:hover { border-color: var(--ink-3); color: var(--ink); }

/* The phone guide's numbered steps. */
.steps { list-style: none; padding: 0; margin: 1.5rem 0 0; counter-reset: s; }
.steps > li { counter-increment: s; position: relative; padding: 0 0 2rem 3.4rem; margin: 0; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: -0.1rem; width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; font: 600 1rem/1 var(--serif); color: var(--accent-ink); background: var(--accent-soft); border: 1px solid color-mix(in oklch, var(--accent) 35%, transparent); }
.steps > li::after { content: ""; position: absolute; left: 1.1rem; top: 2.4rem; bottom: 0.3rem; width: 1px; background: var(--rule); }
.steps > li:last-child::after { display: none; }
.steps h3 { margin: 0 0 0.5rem; font-size: 1.2rem; }
.platforms { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0 0; }
.platforms > div { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 1rem 1.1rem; }
.platforms h4 { margin: 0 0 0.5rem; font: 600 0.95rem/1.3 var(--sans); color: var(--ink); display: flex; align-items: center; gap: 0.45rem; }
.platforms h4 svg { width: 16px; height: 16px; fill: currentColor; }
.platforms ol { margin: 0; padding-left: 1.1rem; font-size: 0.95rem; }
@media (max-width: 620px) { .platforms { grid-template-columns: 1fr; } }

.faq details { border-top: 1px solid var(--rule); padding: 0.2rem 0; }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; list-style: none; padding: 1rem 2rem 1rem 0; font-weight: 600; color: var(--ink); position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 0.3rem; top: 1.35rem; width: 0.55rem; height: 0.55rem; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(45deg); transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(-135deg); top: 1.6rem; }
.faq details > :not(summary) { margin-top: 0; }
.faq details > p:last-child, .faq details > ul:last-child { margin-bottom: 1.1rem; }

.table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: 0.95rem; }
.table th, .table td { text-align: left; vertical-align: top; padding: 0.7rem 0.8rem 0.7rem 0; border-top: 1px solid var(--rule); color: var(--ink-2); }
.table th { color: var(--ink); font-weight: 600; width: 32%; }
.table-scroll { overflow-x: auto; }

.contact { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 2rem 0; }
.contact a { display: block; text-decoration: none; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.3rem 1.3rem 1.4rem; color: var(--ink); transition: border-color 0.2s, transform 0.12s; }
.contact a:hover { border-color: var(--accent); }
.contact strong { display: block; font: 600 1.15rem/1.3 var(--serif); margin-bottom: 0.4rem; }
.contact span { display: block; color: var(--ink-2); font-size: 0.95rem; }
@media (max-width: 760px) { .contact { grid-template-columns: 1fr; } }

/* Footer */
.site-foot { border-top: 1px solid var(--rule); padding: 3rem 0 3.5rem; font-size: 0.9rem; color: var(--ink-3); }
.site-foot .wrap { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem 3rem; align-items: start; }
.site-foot .brand { font-size: 0.95rem; margin-bottom: 0.7rem; }
.site-foot .brand img { width: 24px; height: 24px; border-radius: 6px; }
.site-foot p { margin: 0; max-width: 30rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; list-style: none; margin: 0; padding: 0; }
.foot-links a { color: var(--ink-2); text-decoration: none; }
.foot-links a:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 640px) { .site-foot .wrap { grid-template-columns: 1fr; } }

/* The 404 page */
.lost { min-height: 60vh; display: grid; place-items: center; text-align: center; }
.lost h1 { max-width: none; }
.lost p { color: var(--ink-2); }
.lost .btns { justify-content: center; }
