/* Field-guide look shared with the apps: warm paper, ink text, one accent per app. */
:root {
  --paper: #f6f1e7;
  --card: #fbf8f1;
  --sunken: #ece4d4;
  --line: #e2d7c3;
  --line-strong: #cdbfa6;
  --ink: #1f2a24;
  --ink-muted: #6b6253;
  --forest: #2f5d46;
  --forest-soft: #dce6dd;
  --ochre: #9a6a17;
  --ochre-soft: #f3e6c8;
  --rust: #b4572e;
  --rust-soft: #f6e6dc;
  --slate: #2f6383;
  --slate-soft: #dde8ef;
  --backdrop: #1e2a33;
  --shadow: 0 1px 2px rgb(31 42 36 / 6%), 0 8px 24px rgb(31 42 36 / 8%);
  --radius: 18px;
  --serif: 'Fraunces', 'Noto Serif SC', 'Songti SC', serif;
  --sans: 'Source Sans 3', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --wrap: 1120px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #161d19;
    --card: #1e2722;
    --sunken: #26302a;
    --line: #2f3a33;
    --line-strong: #3f4c44;
    --ink: #ece6d8;
    --ink-muted: #a89f8e;
    --forest: #7fb595;
    --forest-soft: #24352c;
    --ochre: #dcb062;
    --ochre-soft: #3a3020;
    --rust: #e08a62;
    --rust-soft: #3b2a22;
  --slate: #8fb8d4;
  --slate-soft: #213039;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 30%);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --paper: #161d19;
  --card: #1e2722;
  --sunken: #26302a;
  --line: #2f3a33;
  --line-strong: #3f4c44;
  --ink: #ece6d8;
  --ink-muted: #a89f8e;
  --forest: #7fb595;
  --forest-soft: #24352c;
  --ochre: #dcb062;
  --ochre-soft: #3a3020;
  --rust: #e08a62;
  --rust-soft: #3b2a22;
  --slate: #8fb8d4;
  --slate-soft: #213039;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 30%);
  color-scheme: dark;
}

/* Per-app accent, set on <body> or a card. */
.app-prep { --accent: var(--ochre); --accent-soft: var(--ochre-soft); }
.app-id { --accent: var(--forest); --accent-soft: var(--forest-soft); }
.app-note { --accent: var(--rust); --accent-soft: var(--rust-soft); }
.app-wiki { --accent: var(--slate); --accent-soft: var(--slate-soft); }

/* Bilingual text: both languages are in the page, the inactive one is hidden. */
html[lang='en'] .zh,
html[lang='zh-CN'] .en {
  display: none !important;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  color: var(--accent, var(--forest));
}
h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 {
  font-size: clamp(2.3rem, 5.5vw, 4rem);
}
h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.5rem);
}
h3 {
  font-size: 1.3rem;
}
p {
  margin: 0 0 1em;
}
.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}
.eyebrow {
  font: 600 0.78rem/1.4 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent, var(--forest));
  margin-bottom: 0.9em;
}
.lead {
  font-size: 1.2rem;
  color: var(--ink-muted);
  max-width: 40em;
}
.muted {
  color: var(--ink-muted);
}
.sci {
  font-family: var(--serif);
  font-style: italic;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font: 600 1.1rem var(--serif);
  white-space: nowrap;
}
.brand-icons {
  display: flex;
}
.brand-icons img {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 2px solid var(--paper);
  margin-left: -8px;
}
.brand-icons img:first-child {
  margin-left: 0;
}
.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.nav a {
  color: var(--ink-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
}
.nav a:hover {
  color: var(--ink);
  background: var(--sunken);
}
.nav a[aria-current='page'] {
  color: var(--ink);
  background: var(--accent-soft, var(--forest-soft));
}
.tools {
  display: flex;
  gap: 6px;
}
.tool {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  height: 34px;
  min-width: 34px;
  padding: 0 10px;
  border-radius: 999px;
  font: 600 0.85rem var(--sans);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.tool:hover {
  background: var(--sunken);
}
.tool svg {
  width: 16px;
  height: 16px;
}
.icon-sun {
  display: none;
}
:root[data-theme='dark'] .icon-sun {
  display: block;
}
:root[data-theme='dark'] .icon-moon {
  display: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .icon-sun {
    display: block;
  }
  :root:not([data-theme='light']) .icon-moon {
    display: none;
  }
}

/* Buttons and chips */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.15s, background 0.15s;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn-primary {
  background: var(--accent, var(--forest));
  color: var(--paper);
}
.btn-ghost {
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover {
  background: var(--sunken);
}
.btn[aria-disabled='true'] {
  cursor: default;
  opacity: 0.85;
}
.btn[aria-disabled='true']:hover {
  transform: none;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0 0 1.2em;
  list-style: none;
}
.chip {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--ink-muted);
}
.chip-soon {
  background: var(--accent-soft, var(--forest-soft));
  color: var(--accent, var(--forest));
}

/* Sections */
section {
  padding: 88px 0;
}
.section-head {
  max-width: 44em;
  margin-bottom: 48px;
}
.rule {
  border: 0;
  border-top: 1px dashed var(--line-strong);
  margin: 0;
}

/* Home hero */
.hero {
  padding: 72px 0 40px;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 48px;
  align-items: center;
}
.hero h1 em {
  white-space: nowrap;
  font-style: italic;
  color: var(--forest);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.collage {
  position: relative;
  aspect-ratio: 1 / 0.92;
}
.collage .desk {
  position: absolute;
  top: 8%;
  left: 6%;
  width: 94%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.collage .phone {
  position: absolute;
  width: 34%;
  bottom: 0;
}
.collage .phone.left {
  left: -2%;
}
.collage .phone.right {
  right: 2%;
  bottom: -6%;
}

/* Phone frame */
.phone {
  border-radius: 30px;
  padding: 8px;
  background: #121815;
  box-shadow: var(--shadow), 0 0 0 1px rgb(255 255 255 / 6%) inset;
}
.phone > img {
  border-radius: 23px;
  width: 100%;
}

/* Journey: three apps in trip order */
.journey {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  counter-reset: step;
}
.app-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.app-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.app-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--accent);
}
.app-card .when {
  font: 600 0.78rem var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.app-card .head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0 12px;
}
.app-card .head img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
}
.app-card h3 {
  margin: 0;
  font-size: 1.55rem;
}
.app-card .tag {
  color: var(--ink-muted);
  margin: 2px 0 0;
  font-size: 0.95rem;
}
.ticks {
  list-style: none;
  padding: 0;
  margin: 8px 0 24px;
}
.ticks li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 12px;
  line-height: 1.4;
}
.ticks li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.5em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid var(--accent);
}
.app-card .more {
  margin-top: auto;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
}
.app-card .more::after {
  content: ' →';
}
.app-card .more:hover {
  text-decoration: underline;
}
.app-card .stretch::before {
  content: '';
  position: absolute;
  inset: 0;
}

/* Principles */
.principles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}
.principle svg {
  width: 30px;
  height: 30px;
  color: var(--forest);
  margin-bottom: 12px;
}
.principle h3 {
  font-size: 1.15rem;
}
.principle p {
  color: var(--ink-muted);
  font-size: 0.97rem;
}

/* Detail page */
.app-hero {
  padding: 72px 0 56px;
}
.app-hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: center;
}
/* Download area: store buttons once released, a single Available soon button until then. */
.get {
  margin-top: 8px;
}
.get-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.get .btn {
  padding: 15px 30px;
  font-size: 1.05rem;
}
.get .platforms {
  margin: 12px 0 0 4px;
  color: var(--ink-muted);
  font-size: 0.92rem;
}
.app-hero-grid.desk {
  grid-template-columns: 1fr 1.25fr;
  gap: 48px;
}
.app-title {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}
.app-title img {
  width: 76px;
  height: 76px;
  border-radius: 19px;
  box-shadow: var(--shadow);
}
.app-title h1 {
  margin: 0;
}
.app-title .also {
  color: var(--ink-muted);
  font-size: 0.9rem;
}
.showcase-phones {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 22px;
}
.showcase-phones .phone {
  width: min(46%, 260px);
}
.showcase-phones .phone:nth-child(2) {
  margin-top: 56px;
}
.showcase-desk {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.shot {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--card);
  cursor: zoom-in;
  padding: 0;
  width: 100%;
  display: block;
}
/* A portrait capture, such as a dialog: kept narrower so it doesn't tower over its text */
.shot.tall {
  max-width: 380px;
}
.band {
  background: var(--card);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.specs {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px 28px;
  margin: 0;
}
.specs dt {
  font-weight: 600;
}
.specs dd {
  margin: 0;
  color: var(--ink-muted);
}
/* BirdWiki: a sample entry shown as a field-guide card */
.entry-sample {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.entry-kicker {
  font: 600 0.78rem/1.4 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.entry-sample h3 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}
.entry-sample .vs {
  font-style: italic;
  font-weight: 500;
  color: var(--ink-muted);
  font-size: 1.05rem;
}
.entry-sample .sci {
  color: var(--ink-muted);
  margin-bottom: 18px;
}
.entry-diff {
  display: grid;
  grid-template-columns: 110px 1fr;
  margin: 0;
}
.entry-diff dt,
.entry-diff dd {
  padding: 10px 0;
  border-top: 1px dashed var(--line-strong);
}
.entry-diff dt {
  font: 600 0.78rem/1.9 var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.entry-diff dd {
  margin: 0;
  font-size: 0.96rem;
}
.entry-source {
  margin: 14px 0 0;
  font-size: 0.82rem;
  color: var(--ink-muted);
}
@media (max-width: 720px) {
  .entry-diff {
    grid-template-columns: 1fr;
  }
  .entry-diff dd {
    border-top: 0;
    padding-top: 0;
  }
}

/* A full-width card under the three trip stages */
.app-card.wide {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 8px 40px;
  align-items: start;
}
.app-card.wide .ticks {
  margin: 14px 0 0;
}
@media (max-width: 920px) {
  .app-card.wide {
    grid-template-columns: 1fr;
  }
}

/* App pages: the hero's key points each jump to a story section below. */
.jump {
  list-style: none;
  padding: 0;
  margin: 4px 0 28px;
  max-width: 34em;
}
.jump a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-size: 1.08rem;
  line-height: 1.45;
  transition: color 0.2s;
}
.jump li:first-child a {
  border-top: 1px solid var(--line);
}
.jump .num,
.story .num {
  font: italic 600 0.95rem var(--serif);
  color: var(--accent);
}
.jump .num {
  flex: none;
  min-width: 1.7em;
}
.jump a::after {
  content: '↓';
  margin-left: auto;
  padding-left: 12px;
  color: var(--accent);
  opacity: 0.45;
  transition: transform 0.2s, opacity 0.2s;
}
.jump a:hover {
  color: var(--accent);
}
.jump a:hover::after {
  opacity: 1;
  transform: translateY(3px);
}
.story {
  scroll-margin-top: 64px;
}
.story-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 64px;
  align-items: center;
}
.story.flip .story-media {
  order: -1;
}
.story h2 {
  margin-top: 6px;
}
.story p {
  color: var(--ink-muted);
  font-size: 1.08rem;
}
.story .ticks {
  margin-bottom: 0;
}
.story-media {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 22px;
}
.story-media .phone {
  width: min(46%, 260px);
}
.story-media .phone:nth-child(2) {
  margin-top: 48px;
}
/* Stand-in until the real screenshot exists; the label says what it should show. */
.placeholder {
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.9rem;
  background: var(--sunken);
  border: 2px dashed var(--line-strong);
  border-radius: 12px;
  aspect-ratio: 16 / 10;
  width: 100%;
}
.placeholder strong {
  color: var(--ink);
}
.phone > .placeholder {
  aspect-ratio: 9 / 19.5;
  border-radius: 23px;
  border-color: rgb(255 255 255 / 18%);
}
.spec-card {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}
.spec-card .specs {
  grid-template-columns: 130px 1fr;
}
.siblings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.sibling {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.2s, box-shadow 0.2s;
}
.sibling:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.sibling img {
  width: 52px;
  height: 52px;
  border-radius: 13px;
}
.sibling strong {
  font: 600 1.2rem var(--serif);
  display: block;
}
.sibling span {
  color: var(--ink-muted);
  font-size: 0.93rem;
}
.note-box {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 14px 18px;
  border-radius: 0 12px 12px 0;
  font-size: 0.95rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 56px;
  color: var(--ink-muted);
  font-size: 0.92rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}
.site-footer a {
  color: var(--ink-muted);
}

/* Privacy policy and terms (tools/build_legal.py) */
.legal-page {
  padding: 40px 0 72px;
}
.legal-page .wrap {
  max-width: 760px;
}
.legal-back {
  font-size: 0.92rem;
  color: var(--ink-muted);
  margin-bottom: 2em;
}
.legal h1 {
  font-size: clamp(2rem, 4.5vw, 2.8rem);
}
.legal h2 {
  font-size: 1.45rem;
  margin-top: 1.8em;
}
.legal h3 {
  font-size: 1.12rem;
  margin-top: 1.5em;
}
.legal ul {
  padding-left: 1.3em;
  margin: 0 0 1em;
}
.legal li {
  margin-bottom: 0.4em;
}
.legal table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 0 0 1.2em;
  font-size: 0.94rem;
}
.legal th,
.legal td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
.legal th {
  background: var(--accent-soft);
}

/* Lightbox */
dialog.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 94vw;
  max-height: 92vh;
}
dialog.lightbox::backdrop {
  background: rgb(10 14 12 / 82%);
}
dialog.lightbox img {
  max-width: 94vw;
  max-height: 92vh;
  border-radius: 10px;
}

/* Reveal on scroll. Hidden only once main.js has marked the page (html.reveal-ready), so the
   content still shows without JavaScript, to crawlers, and in print. */
.reveal-ready .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.reveal-ready .reveal.in {
  opacity: 1;
  transform: none;
}
@media print {
  .reveal-ready .reveal {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal-ready .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Responsive */
@media (max-width: 920px) {
  .hero-grid,
  .app-hero-grid,
  .app-hero-grid.desk,
  .story-grid {
    grid-template-columns: 1fr;
  }
  .story-grid {
    gap: 40px;
  }
  .story.flip .story-media {
    order: 0;
  }
  .journey {
    grid-template-columns: 1fr 1fr;
  }
  .principles {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 720px) {
  body {
    font-size: 16px;
  }
  .wrap {
    padding: 0 16px;
  }
  section {
    padding: 60px 0;
  }
  .nav {
    display: none;
  }
  .tools {
    margin-left: auto;
  }
  .journey,
  .siblings,
  .principles {
    grid-template-columns: 1fr;
  }
  .specs,
  .spec-card .specs {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .spec-card {
    padding: 20px;
  }
  .specs dd {
    margin-bottom: 12px;
  }
  .app-title img {
    width: 60px;
    height: 60px;
  }
}
