/* Dewey site. Library paper and pine ink; teal only on things you can touch.
   Headlines use the system serif (New York on Apple, like the app's titles);
   stamps and call numbers use the system mono. No web fonts, no third parties. */

:root {
  --ink: #04342C;
  --deep: #0F6E56;
  --dew: #1D9E75;
  --ripple: #5DCAA5;
  --spray: #9FE1CB;
  --mist: #E1F5EE;

  --bg: #F4EFE4;
  --paper: #FFFCF5;
  --text: var(--ink);
  --muted: #4F6660;
  --line: #E2D9C6;
  --rule: #D6E6F0;
  --accent: var(--deep);
  --accent-text: #FFFFFF;
  --stamp: #B8430F;
  --stamp-ok: #0F6E56;
  --shadow: 0 1px 0 rgba(4, 52, 44, .06), 0 12px 32px -12px rgba(4, 52, 44, .22);
  --blend: multiply;

  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A1F1B;
    --paper: #102924;
    --text: var(--mist);
    --muted: #9DBDB3;
    --line: #1F443C;
    --rule: #173A33;
    --accent: var(--ripple);
    --accent-text: #04342C;
    --stamp: #F08A5D;
    --stamp-ok: var(--ripple);
    --shadow: 0 12px 32px -12px rgba(0, 0, 0, .6);
    --blend: normal;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A1F1B;
  --paper: #102924;
  --text: var(--mist);
  --muted: #9DBDB3;
  --line: #1F443C;
  --rule: #173A33;
  --accent: var(--ripple);
  --accent-text: #04342C;
  --stamp: #F08A5D;
  --stamp-ok: var(--ripple);
  --shadow: 0 12px 32px -12px rgba(0, 0, 0, .6);
  --blend: normal;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
code, kbd {
  font: .88em var(--mono);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: .05em .35em;
}

.wrap { max-width: 1120px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.1; letter-spacing: -.01em; }
h1 { font-size: clamp(3rem, 8vw, 5.6rem); margin: 18px 0 20px; letter-spacing: -.025em; }
h1 em { font-style: italic; color: var(--accent); }
h2 { font-size: clamp(1.9rem, 4vw, 2.75rem); margin: 0 0 18px; }
h3 { font-size: 1.2rem; margin: 0 0 6px; }

/* ---------- header ---------- */

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 22px; padding-bottom: 22px; }
.brand img { display: block; height: 36px; width: auto; }
.logo-dark { display: none !important; }
:root[data-theme="dark"] .logo-light { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none !important; }
  :root:not([data-theme="light"]) .logo-dark { display: block !important; }
}
.top nav { display: flex; align-items: center; gap: 22px; }
.top nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: .95rem; }
.top nav a:hover { color: var(--text); }

.theme {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--paper); color: var(--text); cursor: pointer;
}
.theme span {
  width: 14px; height: 14px; border-radius: 50%;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
  border: 1.5px solid currentColor;
}

/* ---------- stamps and call numbers ---------- */

.stamp {
  display: inline-block;
  font: 700 .8rem/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--stamp);
  border: 2px solid currentColor;
  border-radius: 4px;
  padding: .42em .6em .38em;
  white-space: nowrap;
  transform: rotate(var(--r, -3deg));
  filter: url(#ink);
  mix-blend-mode: var(--blend);
  opacity: .9;
}
.stamp.soon { color: var(--stamp-ok); font-size: 1rem; --r: -4deg; }

.call {
  display: inline-flex; align-items: baseline; gap: 10px;
  margin: 0 0 14px;
  font: 600 .75rem/1 var(--mono);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}
.call b {
  font-size: .85rem; color: var(--text);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 7px 4px;
}

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

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1.5px solid var(--text);
  background: transparent;
  color: var(--text);
  font: 600 1rem/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, background-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.quiet { border-color: transparent; text-decoration: underline; text-underline-offset: 4px; padding: 0 12px; }
.btn[disabled] { opacity: .5; cursor: default; transform: none; }
:focus-visible { outline: 3px solid var(--dew); outline-offset: 3px; }

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

.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
  padding-top: 40px;
  padding-bottom: 80px;
}
.lede { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--muted); max-width: 30em; margin: 0 0 30px; }
.get { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fine { color: var(--muted); font-size: .9rem; margin: 14px 0 0; }

/* The library due-date card: the hero's To Do you can tick off. */
.card-stage { display: flex; justify-content: center; }
.libcard {
  width: 100%; max-width: 440px;
  background: var(--paper);
  border-radius: 6px;
  box-shadow: var(--shadow);
  transform: rotate(1.5deg);
  padding: 0 0 14px;
  position: relative;
}
.libcard-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 26px 22px 12px;
  border-bottom: 2px solid var(--stamp);
  position: relative;
}
.libcard-head p { margin: 0; font: 700 .8rem/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; }
.libcard-head .libcard-count { color: var(--muted); letter-spacing: .08em; }
.hole {
  position: absolute; top: 9px; left: 50%;
  width: 12px; height: 12px; margin-left: -6px;
  border-radius: 50%; background: var(--bg);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .2);
}
.libcard-rows { list-style: none; margin: 0; padding: 0; }
.libcard-rows li { border-bottom: 1px solid var(--rule); }
.libcard-rows button {
  all: unset;
  box-sizing: border-box;
  display: grid; grid-template-columns: 104px 1fr; align-items: center; gap: 12px;
  width: 100%;
  min-height: 62px;
  padding: 8px 22px 8px 14px;
  cursor: pointer;
  position: relative;
}
.libcard-rows button:focus-visible { outline: 3px solid var(--dew); outline-offset: -3px; }
.libcard-rows button:hover { background: color-mix(in srgb, var(--dew) 6%, transparent); }
.when { position: relative; display: grid; place-items: center; height: 40px; border-right: 1px solid var(--rule); padding-right: 8px; }
.when .stamp { font-size: .72rem; }
.when .stamp.ok { color: var(--stamp-ok); }
.when .stamp.due { color: var(--text); opacity: .7; }
.what { font-weight: 600; line-height: 1.3; transition: opacity .2s ease; }
.what small { display: block; font-weight: 400; font-size: .85rem; color: var(--muted); margin-top: 2px; }
li.done .when .stamp:not(.done-stamp) { opacity: .18; transition: opacity .2s ease; }
li.done .what { opacity: .45; text-decoration: line-through; text-decoration-thickness: 1.5px; }
.libcard-foot { margin: 12px 22px 0; font-size: .82rem; color: var(--muted); }

.when .done-stamp {
  position: absolute;
  color: var(--stamp-ok);
  font-size: .78rem;
  background: var(--paper);
  --r: -9deg;
  animation: thunk .28s cubic-bezier(.2, .9, .3, 1.3) both;
}
@keyframes thunk {
  0% { transform: scale(1.8) rotate(-2deg); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: scale(1) rotate(var(--r)); opacity: .92; }
}

/* ---------- bands ---------- */

.band { padding-top: 88px; padding-bottom: 88px; border-top: 1px solid var(--line); }
.band p { max-width: 34em; }
.split { display: grid; grid-template-columns: 1fr 1.15fr; gap: 56px; align-items: center; }
.split.flip > :first-child { order: 2; }
.aside { font-size: .88rem; color: var(--muted); }

.shot-frame { margin: 0; }
.shot-frame img {
  display: block;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #fff;
}
.shot-frame figcaption { font-size: .85rem; color: var(--muted); margin-top: 10px; }

/* ---------- grade what-if ---------- */

.gradecard {
  background: var(--paper);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 26px 26px 22px;
}
.gc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.gc-course { margin: 0; font-family: var(--serif); font-size: 1.5rem; font-weight: 700; }
.gc-sub { margin: 0; color: var(--muted); font-size: .9rem; }
.gc-grade { margin: 0; display: flex; align-items: baseline; gap: 10px; font-family: var(--serif); }
.gc-grade [data-g-letter] { font-size: 3.4rem; font-weight: 700; line-height: 1; color: var(--accent); }
.gc-grade [data-g-num] { font: 600 1.5rem var(--sans); font-variant-numeric: tabular-nums; }
.gc-cats { list-style: none; padding: 0; margin: 20px 0; border-top: 1px solid var(--line); }
.gc-cats li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.gc-cats i { font-style: normal; color: var(--muted); font-size: .85rem; margin-left: 6px; }
.gc-what { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 8px; }
.gc-what output { font-variant-numeric: tabular-nums; }
.gc-line { margin: 12px 0 0; font-size: .95rem; color: var(--muted); min-height: 3em; }
.gc-line b { color: var(--text); }
.gc-line .down { color: var(--stamp); }

input[type="range"] { width: 100%; accent-color: var(--accent); height: 28px; cursor: pointer; }

/* ---------- archive shelf ---------- */

.shelf { background: var(--paper); border-radius: 16px; box-shadow: var(--shadow); padding: 28px 26px 24px; }
.books { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding: 0 6px; }
.books span {
  flex: 1 1 0;
  height: var(--h);
  background: var(--c);
  border-radius: 3px 3px 1px 1px;
  color: #fff;
  font: 600 .72rem/1 var(--sans);
  letter-spacing: .04em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: flex; align-items: center; justify-content: flex-start;
  padding: 10px 0;
  box-shadow: inset -3px 0 0 rgba(0, 0, 0, .15), inset 3px 0 0 rgba(255, 255, 255, .08);
  white-space: nowrap;
  overflow: hidden;
}
.books .new {
  opacity: 0;
  transform: rotate(180deg) translateY(30px);
  transition: opacity .4s ease, transform .5s cubic-bezier(.2, .9, .3, 1.2);
}
.books .new.in { opacity: 1; transform: rotate(180deg) translateY(0); }
.shelf-board { height: 10px; background: color-mix(in srgb, var(--text) 75%, var(--bg)); border-radius: 2px; margin-bottom: 20px; }
.saving ul { list-style: none; margin: 0 0 18px; padding: 0; font: .88rem/1.4 var(--mono); }
.saving li { padding: 5px 0 5px 26px; position: relative; color: var(--muted); border-bottom: 1px dashed var(--line); }
.saving li::before { content: ""; position: absolute; left: 4px; top: 50%; width: 10px; height: 10px; margin-top: -6px; border: 1.5px solid var(--line); border-radius: 50%; }
.saving li.got { color: var(--text); }
.saving li.got::before { border-color: var(--dew); background: var(--dew); }

/* ---------- promises ---------- */

.index-card {
  background: var(--paper);
  background-image: repeating-linear-gradient(transparent 0 37px, var(--rule) 37px 38px);
  background-position: 0 70px;
  border-radius: 6px;
  box-shadow: var(--shadow);
  padding: 30px 32px 24px;
  max-width: 780px;
  border-top: 3px solid var(--stamp);
  transform: rotate(-.5deg);
}
.promises { margin: 0; padding: 0; list-style: none; counter-reset: p; }
.promises li { counter-increment: p; padding: 10px 0 10px 44px; position: relative; line-height: 1.55; }
.promises li::before {
  content: "✕";
  position: absolute; left: 4px; top: 9px;
  font: 700 1rem var(--mono);
  color: var(--stamp);
}
.card-foot { margin: 16px 0 0; font-size: .9rem; color: var(--muted); }

/* ---------- install ---------- */

.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); margin-bottom: 28px; }
.tabs button {
  border: 0; background: transparent; color: var(--muted);
  font: 600 .95rem var(--sans);
  padding: 9px 18px; border-radius: 999px; cursor: pointer; min-height: 40px;
}
.tabs button[aria-selected="true"] { background: var(--text); color: var(--bg); }
.pane-lede { font-size: 1.1rem; }
.steps { list-style: none; padding: 0; margin: 28px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
#pane-android .steps { grid-template-columns: repeat(2, 1fr); max-width: 760px; }
.steps li { counter-increment: step; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.steps li::before { content: counter(step); display: block; font: 700 2rem/1 var(--serif); color: var(--accent); margin-bottom: 12px; }
.steps p { margin: 0 0 8px; }
.note { color: var(--muted); font-size: .92rem; }
details { margin-top: 12px; }
summary { cursor: pointer; font-weight: 600; }
.phones { margin: 48px 0 0; }
.phones img { display: block; margin: 0 auto; max-height: 560px; width: auto; }

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

.faq { max-width: 760px; border-top: 1px solid var(--line); }
.faq details { margin: 0; border-bottom: 1px solid var(--line); }
.faq summary { padding: 18px 0; font-size: 1.1rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 1.4rem/1 var(--mono); color: var(--muted); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 20px; color: var(--muted); }

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

.foot {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding-top: 32px; padding-bottom: 48px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: .9rem;
}
.foot p { margin: 0; flex: 1 1 280px; }
.foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.foot a { color: var(--muted); }

/* ---------- legal pages and 404 ---------- */

.doc { max-width: 720px; padding-top: 32px; padding-bottom: 80px; }
.doc h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); }
.doc h2 { font-size: 1.5rem; margin-top: 44px; }
.doc .updated { color: var(--muted); font-size: .92rem; }
.doc .summary {
  background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: 8px; padding: 18px 22px; margin: 28px 0;
}
.doc .summary ul { margin: 8px 0 0; padding-left: 20px; }
.doc li { margin: 6px 0; }
.doc table { width: 100%; border-collapse: collapse; font-size: .95rem; margin: 12px 0; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); }
.doc th { font-weight: 600; }

.lost { min-height: 70vh; display: grid; place-content: center; text-align: center; gap: 4px; }
.lost .stamp { font-size: 1.1rem; justify-self: center; --r: -6deg; margin-bottom: 18px; }
.lost p { color: var(--muted); }

/* ---------- small screens ---------- */

@media (max-width: 860px) {
  .hero, .split { grid-template-columns: 1fr; gap: 40px; }
  .split.flip > :first-child { order: 0; }
  .hero { padding-top: 16px; padding-bottom: 64px; }
  .steps, #pane-android .steps { grid-template-columns: 1fr; }
  .band { padding-top: 64px; padding-bottom: 64px; }
}
@media (max-width: 560px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .top nav a { display: none; }
  .libcard { transform: none; }
  .libcard-rows button { grid-template-columns: 88px 1fr; padding-right: 14px; }
  .index-card { padding: 24px 20px 20px; transform: none; }
  .promises li { padding-left: 34px; }
  .gradecard, .shelf { padding: 22px 18px 18px; }
}

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