/* FMD product site (fmd.andgreen.org) — mockup A, chosen 2026-09-24: paper + ink green.
   Served as /assets/site.<hash>.css by render_changelog.py; edit it here, never in _site/.
   Values continue the old one-page changelog site.
   Rules borrowed from careerops DESIGN.md: one hue, borders not shadows, almost no motion,
   one primary button, CJK guards (break-word, never anywhere).

   Breakpoint: 760px, the same width at which the current site drops to one column.
   Above it the closing "coming soon / changelog" pair sits side by side; at or below it
   everything is a single column AND the CJK/overflow guards switch on. Keep the two in
   one media query so they can never drift apart (641–760px was unguarded when the guard
   used careerops' 640px while the layout switched at 760px). */

:root {
  color-scheme: light dark;
  --paper: #f7f5f0;
  --ink: #242623;
  --muted: #646861;      /* 5.22:1 on paper */
  --accent: #336c68;     /* 5.53:1 on paper */
  --accent-strong: #29575a;
  --on-accent: #ffffff;  /* 5.9:1 on accent */
  --line: #dcded7;
  --card: #fffdfa;
  --shot-line: #d4d6ce;
  --focus: #336c68;

  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC",
    "Microsoft JhengHei", system-ui, sans-serif;
  --measure: 40rem;
  --wide: 60rem;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171b1a;
    --ink: #e8e9e4;
    --muted: #a8afa9;    /* 7.8:1 on paper */
    --accent: #9ac9be;   /* 9.5:1 on paper */
    --accent-strong: #b6dbd2;
    --on-accent: #14201d;
    --line: #333a37;
    --card: #202523;
    --shot-line: #3a423f;
    --focus: #9ac9be;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 450;
  line-height: 1.75;
  letter-spacing: 0.01em;
  /* CJK guard: break-word, NEVER anywhere (anywhere shrinks min-content to one glyph). */
  overflow-wrap: break-word;
}

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

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

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

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

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

p {
  margin: 0;
  text-wrap: pretty;
}

code,
kbd {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.88em;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05em 0.3em;
}

/* Desktop: keep short CJK headings from splitting mid-word. Phones: normal (see guard). */
.keep {
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* ── Skip link ─────────────────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: var(--gutter);
  top: 8px;
  z-index: 10;
  padding: 0.5rem 0.9rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 6px;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: none;
  color: var(--paper);
}

/* ── Header ────────────────────────────────────────────────────────────────── */
.site-header {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 20px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand:hover {
  color: var(--ink);
}

.site-nav {
  display: flex;
  gap: 20px;
  font-size: 0.9375rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}

/* ── Layout columns ────────────────────────────────────────────────────────── */
main {
  padding: 0 var(--gutter);
}

/* Skip-link target: programmatic focus should not draw a box around the whole page. */
main:focus {
  outline: none;
}

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

.wide {
  max-width: var(--wide);
  margin-inline: auto;
}

/* ── Hero ──────────────────────────────────────────────────────────────────── */
.hero {
  padding: 72px 0 40px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.hero h1 {
  font-size: 2.75rem;
  line-height: 1.22;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.hero h1 .line {
  display: block;
}

.lead {
  max-width: 34rem;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: 1.125rem;
  line-height: 1.75;
  text-wrap: balance;
}

.actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px 24px;
}

/* Primary button: the only filled control on the page. Text sits in ONE span so the
   sentence never splits into separate flex items. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  max-width: 100%;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}

.button > span {
  min-width: 0;
}

.button:hover {
  background: var(--accent-strong);
  color: var(--on-accent);
}

.text-link {
  font-weight: 500;
}

.shot.hero-shot {
  margin: 56px auto 0;
}

/* ── Screenshots ───────────────────────────────────────────────────────────── */
.shot {
  margin: 0 auto;
}

.shot .frame {
  display: block;
  overflow: hidden;
  border: 1px solid var(--shot-line);
  border-radius: 10px;
  background: var(--card);
}

.shot figcaption {
  max-width: var(--measure);
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.6;
  text-align: left;
}

/* ── Features ──────────────────────────────────────────────────────────────── */
.features {
  padding-top: 40px;
}

.section-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.feature {
  max-width: var(--wide);
  margin-inline: auto;
  padding: 56px 0 24px;
  border-top: 1px solid var(--line);
}

.feature + .feature {
  margin-top: 40px;
}

.feature h2 {
  font-size: 1.5rem;
  text-wrap: balance;
}

.feature .measure > p + p,
.feature h2 + p {
  margin-top: 14px;
}

.feature .shot {
  margin-top: 32px;
}

.nowrap {
  white-space: nowrap;
}

/* Phone-framed screenshots: the <picture> elements switch to phone sources at
   max-width 600px, so captions that describe the frame switch at the same width. */
.only-narrow {
  display: none;
}

@media (max-width: 600px) {
  .only-wide {
    display: none;
  }

  .only-narrow {
    display: inline;
  }
}

.note-quiet {
  color: var(--muted);
  font-size: 0.9375rem;
}

/* ── Closing pair: coming soon + changelog ─────────────────────────────────── */
.closing {
  margin: 72px auto 0;
  padding-top: 40px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 32px 48px;
}

.closing h2 {
  font-size: 1.125rem;
}

.closing p {
  margin-top: 8px;
}

.closing .panel {
  min-width: 0;
}

.soon {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--card);
}

.changelog-panel {
  padding: 20px 0;
}

.changelog-panel .more {
  display: inline-block;
  margin-top: 12px;
  font-weight: 500;
}

/* ── Footer ────────────────────────────────────────────────────────────────── */
.site-footer {
  max-width: var(--wide);
  margin: 96px auto 0;
  padding: 28px var(--gutter) 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

.site-footer p + p {
  margin-top: 4px;
}

.site-footer .footer-build {
  margin-top: 12px;
  font-size: 0.8125rem;
}

/* ── Changelog pages (/changelog/, /en/changelog/) ─────────────────────────────
   Wide screens: version list in a sticky left column, release notes on the right.
   At 760px and below (see the guard query) it becomes one column and the version list
   turns into a horizontally scrolling strip, as on the old one-page site. */
.log-shell {
  max-width: var(--wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 10.5rem minmax(0, 1fr);
  gap: 0 48px;
  align-items: start;
}

.log-intro {
  grid-column: 1 / -1;
  min-width: 0;
  padding: 48px 0 28px;
  border-bottom: 1px solid var(--line);
}

.log-intro-only {
  border-bottom: 0;
  max-width: var(--measure);
}

.log-intro h1 {
  font-size: 2.25rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.log-lead {
  max-width: var(--measure);
  margin-top: 14px;
  color: var(--muted);
}

.log-notice {
  max-width: var(--measure);
  margin-top: 14px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--card);
  font-size: 0.9375rem;
}

.log-links {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  font-size: 0.9375rem;
  font-weight: 500;
}

.log-nav {
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  padding: 28px 4px 28px 0;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.log-nav ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.log-nav a {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  padding: 4px 0;
  color: var(--muted);
  text-decoration: none;
}

.log-nav a:hover {
  color: var(--accent);
}

.log-nav .nav-v {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.log-nav a:hover .nav-v {
  color: inherit;
}

.log-body {
  min-width: 0;
  max-width: 46rem;
  padding-bottom: 24px;
}

.log-body h2 {
  margin: 48px 0 12px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  scroll-margin-top: 16px;
}

.log-body > h2:first-child {
  margin-top: 8px;
  border-top: 0;
}

.log-body h3 {
  margin: 24px 0 6px;
  font-size: 1.0625rem;
  scroll-margin-top: 16px;
}

.log-body h4,
.log-body h5,
.log-body h6 {
  margin: 20px 0 6px;
  font-size: 1rem;
}

.log-body p,
.log-body ul,
.log-body ol,
.log-body blockquote,
.log-body pre,
.log-body table {
  margin: 12px 0;
}

.log-body ul,
.log-body ol {
  padding-left: 1.4em;
}

.log-body li {
  margin: 6px 0;
  padding-left: 2px;
}

.log-body blockquote {
  margin-left: 0;
  margin-right: 0;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--line);
  color: var(--muted);
}

.log-body pre {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.log-body pre code {
  padding: 0;
  border: 0;
  background: none;
}

.log-body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.log-body th,
.log-body td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.log-body hr {
  margin: 28px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* ── 404 ───────────────────────────────────────────────────────────────────── */
.notfound {
  padding: 72px 0 24px;
}

.notfound h1 {
  font-size: 2rem;
}

.notfound h2 {
  font-size: 1.25rem;
}

.notfound section + section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.notfound p {
  margin-top: 12px;
}

.notfound .eyebrow {
  margin-bottom: 12px;
}

/* ── Single-column breakpoint + CJK / overflow guards (one query, one width) ─ */
@media (max-width: 760px) {
  html,
  body {
    overflow-x: hidden; /* older iOS Safari ignores clip — this line is what it obeys */
    overflow-x: clip;
  }

  .keep {
    word-break: normal;
  }

  .hero {
    padding: 48px 0 32px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .lead {
    font-size: 1.0625rem;
  }

  .shot.hero-shot {
    margin-top: 40px;
  }

  .feature {
    padding-top: 44px;
  }

  .feature + .feature {
    margin-top: 24px;
  }

  .feature h2 {
    font-size: 1.3125rem;
  }

  .closing {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 56px;
  }

  .changelog-panel {
    padding-top: 0;
  }

  .site-footer {
    margin-top: 72px;
  }

  .log-shell {
    display: block;
  }

  .log-intro {
    padding-top: 32px;
    padding-bottom: 20px;
  }

  .log-intro h1 {
    font-size: 1.75rem;
  }

  /* The version list becomes one scrolling row; the page itself never scrolls sideways. */
  .log-nav {
    position: static;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }

  .log-nav ol {
    display: flex;
    gap: 4px 18px;
    white-space: nowrap;
  }

  .log-nav .nav-d {
    display: none;
  }

  .log-body h2 {
    font-size: 1.3125rem;
    margin-top: 40px;
  }

  .log-body > h2:first-child {
    margin-top: 20px;
  }

  .notfound {
    padding-top: 48px;
  }
}

/* ── First-screen intro: plays once, only when site.js adds .intro to <html> ─
   Without JS there is no .intro class, so nothing starts hidden. Longest chain:
   200ms delay + 600ms = 800ms. */
@media (prefers-reduced-motion: no-preference) {
  .intro .reveal {
    animation: fmd-rise 560ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .intro .reveal-2 {
    animation-delay: 100ms;
  }

  .intro .reveal-3 {
    animation-delay: 180ms;
  }

  .intro .hero-shot {
    animation: fmd-fade 600ms cubic-bezier(0.2, 0.7, 0.2, 1) 200ms both;
  }
}

@keyframes fmd-rise {
  from {
    opacity: 0;
    transform: translateY(0.35em);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fmd-fade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

@media print {
  .site-header nav,
  .skip-link,
  .actions {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
}
