/* DiveSaveEd — one shared stylesheet. No web fonts, no external requests. */

:root {
  --sand:        #FBF6EC;
  --sand-2:      #F4ECDD;
  --sand-3:      #EADFC9;
  --ink:         #14181B;
  --ink-2:       #3C464C;
  --ink-3:       #6A757C;
  --ocean:       #1A8A94;
  --ocean-deep:  #12666E;
  --coral:       #FF7A59;
  --coral-deep:  #D8532F;

  --bg:          var(--sand);
  --bg-raised:   #FFFFFF;
  --bg-sunken:   var(--sand-2);
  --fg:          var(--ink);
  --fg-muted:    var(--ink-2);
  --fg-faint:    var(--ink-3);
  --accent:      var(--ocean);
  --accent-hover:var(--ocean-deep);
  --accent-soft: rgba(26, 138, 148, 0.10);
  --warn:        var(--coral-deep);
  --warn-soft:   rgba(255, 122, 89, 0.13);
  --border:      #E2D8C4;
  --border-soft: #EFE7D7;
  --shadow:      0 1px 2px rgba(20, 24, 27, .05), 0 8px 24px -12px rgba(20, 24, 27, .18);
  --shadow-lg:   0 2px 4px rgba(20, 24, 27, .06), 0 24px 60px -24px rgba(20, 24, 27, .30);

  --radius:      12px;
  --radius-lg:   18px;
  --measure:     44rem;
  --wide:        68rem;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Apple SD Gothic Neo",
          "Noto Sans CJK KR", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          var(--ink);
    --bg-raised:   #1B2126;
    --bg-sunken:   #101417;
    --fg:          #ECEFF1;
    --fg-muted:    #B6C0C6;
    --fg-faint:    #8B979E;
    --accent:      #3FB6BE;
    --accent-hover:#6BD0D6;
    --accent-soft: rgba(63, 182, 190, 0.13);
    --warn:        #FF9877;
    --warn-soft:   rgba(255, 122, 89, 0.15);
    --border:      #2C353B;
    --border-soft: #232B31;
    --shadow:      0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
    --shadow-lg:   0 2px 4px rgba(0, 0, 0, .4), 0 24px 60px -24px rgba(0, 0, 0, .8);
  }
}

/* ---------- base ---------- */

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

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

h1, h2, h3, h4 {
  line-height: 1.22;
  letter-spacing: -0.015em;
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 2.85rem); font-weight: 800; }
h2 { font-size: clamp(1.35rem, 1.1rem + 1.1vw, 1.75rem); font-weight: 700; margin-top: 2.2em; }
h3 { font-size: 1.15rem; font-weight: 650; margin-top: 1.9em; }
h4 { font-size: 1rem;    font-weight: 650; margin-top: 1.6em; }

p, ul, ol { margin: 0 0 1.1em; }
li { margin-bottom: .4em; }
li > ul, li > ol { margin-top: .4em; }

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

strong { font-weight: 650; }

code, kbd, samp {
  font-family: var(--mono);
  font-size: .875em;
}

:not(pre) > code {
  background: var(--bg-sunken);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: .12em .38em;
  word-break: break-word;
}

kbd {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: .1em .45em;
  font-size: .85em;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
}

pre {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin: 0 0 1.2em;
  overflow-x: auto;
  font-size: .95rem;
  line-height: 1.5;
}
pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: .9rem;
  white-space: pre;
}

blockquote {
  margin: 1.4em 0;
  padding: .2em 0 .2em 1.1em;
  border-left: 3px solid var(--accent);
  color: var(--fg-muted);
}

/* ---------- layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: 1.25rem;
}
.wrap-wide { max-width: var(--wide); }

main { padding-bottom: 4rem; }

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem; top: .6rem;
  position: fixed;
  z-index: 20;
  background: var(--bg-raised);
  color: var(--fg);
  padding: .5rem .9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
  padding-block: .6rem;
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.02em;
  margin-right: auto;
}
.nav-brand img { width: 26px; height: 26px; border-radius: 6px; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
  font-size: .93rem;
}
.nav-links a {
  color: var(--fg-muted);
  text-decoration: none;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a.cta {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- breadcrumbs ---------- */

.crumbs {
  font-size: .87rem;
  color: var(--fg-faint);
  margin: 1.6rem 0 .6rem;
}
.crumbs a { color: var(--fg-muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs span[aria-current] { color: var(--fg-faint); }

/* ---------- hero ---------- */

.hero {
  padding: 3rem 0 1rem;
  text-align: center;
}
.hero img.logo {
  width: 104px; height: 104px;
  margin: 0 auto 1.4rem;
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.hero h1 { margin-bottom: .35em; }
.tagline {
  font-size: clamp(1.05rem, 1rem + .4vw, 1.2rem);
  color: var(--fg-muted);
  max-width: 40rem;
  margin: 0 auto 1.4rem;
  text-wrap: pretty;
}
.badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: 1.7rem;
}
.badge {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .01em;
  padding: .25rem .6rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

.shot {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin: 2rem auto 0;
  background: var(--bg-raised);
}
.shot img { width: 100%; }
figure { margin: 2rem 0; }
figcaption {
  font-size: .87rem;
  color: var(--fg-faint);
  text-align: center;
  margin-top: .7rem;
}

/* light/dark screenshot swap */
.only-light { display: block; }
.only-dark  { display: none; }
@media (prefers-color-scheme: dark) {
  .only-light { display: none; }
  .only-dark  { display: block; }
}

/* ---------- buttons ---------- */

.btn-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .7rem;
  margin: 1.6rem 0 .8rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font: inherit;
  font-weight: 600;
  font-size: .98rem;
  padding: .68rem 1.35rem;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
  transition: transform .12s ease, background-color .12s ease, border-color .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  .btn-primary { color: #0B1013; }
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
@media (prefers-color-scheme: dark) {
  .btn-primary:hover { color: #0B1013; }
}
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--fg-muted);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}
/* The donation CTA. It was written as `class="cta"` but the only rule for that class was
   `.nav-links a.cta`, so the one button the support page exists to present rendered as a plain
   text link. It gets its own class rather than reusing `.cta`, which already means "the primary
   nav action" on the Download link. Coral rather than the site's teal accent, matching the app's
   own Support button. */
.cta-donate {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.4rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #FF8E6C, var(--coral-deep));
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(216, 83, 47, .3), 0 8px 20px -10px rgba(216, 83, 47, .6);
}
.cta-donate::before { content: "\2665"; font-size: 1.05em; line-height: 1; }
.cta-donate:hover { background: linear-gradient(180deg, #FF9A7C, #C2481F); color: #fff; }
.cta-donate:active { transform: translateY(1px); }

/* The support-page banner. Full-bleed within the measure, and it carries its own dark palette,
   so it needs no light/dark variants. */
.support-hero {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 1.8rem;
  border-radius: 18px;
  font-family: var(--sans);
}

.btn-note {
  text-align: center;
  font-size: .85rem;
  color: var(--fg-faint);
  margin: 0 0 1rem;
}

/* ---------- cards ---------- */

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin: 1.6rem 0 2rem;
  padding: 0;
  list-style: none;
}
.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin: 0;
  box-shadow: var(--shadow);
}
.card h3 {
  margin: 0 0 .35em;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}
.card p { margin: 0; font-size: .95rem; color: var(--fg-muted); }
.card a { text-decoration: none; }
.card a:hover { text-decoration: underline; }

/* ---------- callouts ---------- */

.note, .warn {
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin: 1.6rem 0;
  border: 1px solid;
  font-size: .97rem;
}
.note {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 32%, transparent);
}
.warn {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--coral) 45%, transparent);
}
.note > :last-child, .warn > :last-child { margin-bottom: 0; }
.note strong, .warn strong { display: block; margin-bottom: .25em; }
.warn strong { color: var(--warn); }
.note strong { color: var(--accent); }

/* ---------- tables ---------- */

.table-wrap {
  overflow-x: auto;
  margin: 1.4rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: .95rem;
  min-width: 30rem;
}
th, td {
  text-align: left;
  padding: .65rem .9rem;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
thead th {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--fg-faint);
  background: var(--bg-sunken);
}
tbody tr:last-child td { border-bottom: 0; }

/* ---------- steps ---------- */

ol.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 1.4rem 0 1.8rem;
}
ol.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 2.6rem;
  margin-bottom: 1.1rem;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: .05em;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: .88rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}
@media (prefers-color-scheme: dark) {
  ol.steps > li::before { color: #0B1013; }
}
ol.steps > li > :last-child { margin-bottom: 0; }

/* ---------- FAQ ---------- */

.qa {
  border-top: 1px solid var(--border-soft);
  padding-top: 1.4rem;
  margin-top: 1.4rem;
}
.qa:first-of-type { border-top: 0; }
.qa h2, .qa h3 { margin-top: 0; }

/* ---------- toc ---------- */

.toc {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin: 1.8rem 0 2.2rem;
  font-size: .95rem;
}
.toc p {
  margin: 0 0 .5em;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.toc ol { margin: 0; padding-left: 1.2rem; }
.toc li { margin-bottom: .25em; }

/* the answer-first summary box, for answer engines and humans in a hurry */
.answer {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin: 1.8rem 0 2rem;
  box-shadow: var(--shadow);
}
.answer > :last-child { margin-bottom: 0; }
.answer pre { margin-bottom: .8em; }
.answer h2, .answer h3 {
  margin-top: 0;
  font-size: 1.02rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--fg-faint);
  font-weight: 700;
}

.lede {
  font-size: 1.1rem;
  color: var(--fg-muted);
  text-wrap: pretty;
}

.path {
  display: block;
  font-family: var(--mono);
}

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--border);
  background: var(--bg-sunken);
  padding: 2.2rem 0 3rem;
  font-size: .87rem;
  color: var(--fg-faint);
  line-height: 1.6;
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem 1.1rem;
  margin-bottom: 1.2rem;
  padding: 0;
  list-style: none;
}
.foot-links a { color: var(--fg-muted); text-decoration: none; }
.foot-links a:hover { color: var(--accent); text-decoration: underline; }
.foot p { margin: 0 0 .8em; }
.foot p:last-child { margin-bottom: 0; }
.foot-credit a { color: var(--fg-muted); }
.foot-credit a:hover { color: var(--accent); }

@media (max-width: 480px) {
  body { font-size: 16px; }
  .hero { padding-top: 2rem; }
  .btn { width: 100%; justify-content: center; }
}
