/* Yoke Calendar — landing site.
   Light by default (calm, editorial, product-y — not a terminal), with a
   warm coral accent that doubles as our calendar-red brand. Dark is opt-in
   via the nav toggle; every color routes through a variable so the same
   rules serve both themes. */
:root {
  color-scheme: light;
  --bg: #fbfaf7;
  --bg-2: #f3f1ea;
  --panel: #ffffff;
  --panel-2: #f6f4ee;
  --line: #e7e2d6;
  --line-soft: #efebe1;
  --ink: #201e1b;
  --ink-2: #5f5a51;
  --ink-3: #938d81;
  --accent: #cf5a39; /* coral / the calendar "23" red — buttons & highlights */
  --accent-2: #bb4c2e; /* deeper coral — links & accents on light surfaces */
  --warm: #e8623f;
  --glow: color-mix(in oklab, var(--accent) 10%, transparent);
  --shadow-card: 0 1px 2px rgba(40, 28, 14, 0.04), 0 6px 18px rgba(40, 28, 14, 0.05);
  --shadow-card-hover: 0 2px 5px rgba(40, 28, 14, 0.06), 0 16px 36px rgba(40, 28, 14, 0.1);
  --shadow-hero: 0 14px 36px rgba(40, 28, 14, 0.13);
  --shadow-btn: 0 8px 22px rgba(207, 90, 57, 0.28);
  --radius: 14px;
  --max: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1b1a18;
  --bg-2: #211f1c;
  --panel: #262420;
  --panel-2: #2e2b26;
  --line: #393630;
  --line-soft: #2c2a25;
  --ink: #f2efe8;
  --ink-2: #b8b2a6;
  --ink-3: #8a847a;
  --accent: #db6442;
  --accent-2: #ee835e;
  --glow: color-mix(in oklab, var(--accent) 18%, transparent);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-card-hover: 0 2px 6px rgba(0, 0, 0, 0.3), 0 18px 40px rgba(0, 0, 0, 0.45);
  --shadow-hero: 0 18px 44px rgba(0, 0, 0, 0.45);
  --shadow-btn: 0 8px 26px rgba(219, 100, 66, 0.3);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.3s ease, color 0.3s ease;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3 { letter-spacing: -0.02em; }

/* ── nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px max(20px, calc((100vw - var(--max)) / 2));
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.brand img { border-radius: 8px; }
.brand.small { font-size: 14px; color: var(--ink-2); }
.nav-right { display: flex; align-items: center; gap: 22px; }
.nav-links { display: flex; gap: 26px; font-size: 14px; color: var(--ink-2); }
.nav-links a { transition: color 0.15s ease; }
.nav-links a:hover { color: var(--ink); }

/* theme toggle — shows the icon for the mode you'd switch TO */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.theme-toggle:hover { color: var(--ink); border-color: color-mix(in oklab, var(--accent) 45%, var(--line)); }
.theme-toggle .ic-sun { display: none; }
.theme-toggle .ic-moon { display: block; }
[data-theme="dark"] .theme-toggle .ic-sun { display: block; }
[data-theme="dark"] .theme-toggle .ic-moon { display: none; }

.nav-tools { display: flex; align-items: center; gap: 8px; }

/* language toggle — shows the label of the language you'd switch TO */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 36px;
  padding: 0 9px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-2);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.lang-toggle:hover { color: var(--ink); border-color: color-mix(in oklab, var(--accent) 45%, var(--line)); }
.lang-toggle .to-zh { display: none; }
:root[data-lang="en"] .lang-toggle .to-en { display: none; }
:root[data-lang="en"] .lang-toggle .to-zh { display: inline; }

/* parallel-language prose blocks (docs): the wrapper dissolves into its parent
   grid via display:contents, and only the active language is shown */
.lang-block { display: contents; }
:root[data-lang="zh"] .lang-block[data-lang="en"] { display: none; }
:root[data-lang="en"] .lang-block[data-lang="zh"] { display: none; }

main { display: block; }
section { padding: 0 max(20px, calc((100vw - var(--max)) / 2)); }

/* ── hero ── */
.hero { position: relative; text-align: center; padding-top: 100px; padding-bottom: 76px; overflow: hidden; }
.hero-glow {
  position: absolute;
  top: -380px;
  right: -340px;
  width: 1700px;
  height: 980px;
  background: radial-gradient(closest-side, var(--glow), transparent 80%);
  filter: blur(64px);
  pointer-events: none;
  z-index: 0;
}
.hero > *:not(.hero-glow) { position: relative; z-index: 1; }
.eyebrow {
  display: inline-block;
  margin: 0 0 18px;
  padding: 5px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-2);
  background: color-mix(in oklab, var(--accent) 9%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 26%, transparent);
  border-radius: 999px;
}
.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(40px, 7vw, 74px);
  font-weight: 800;
  line-height: 1.05;
  color: var(--ink);
}
.lede { margin: 0 auto 32px; max-width: 660px; font-size: clamp(15px, 2.2vw, 19px); color: var(--ink-2); }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-meta { margin-top: 18px; font-size: 13px; color: var(--ink-3); }
.hero-meta a { color: var(--accent-2); }
.hero-meta a:hover { text-decoration: underline; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.08s ease, background-color 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-btn); }
.btn.primary:hover { background: color-mix(in oklab, var(--accent) 88%, #000); }
.btn.ghost { background: var(--panel); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-card); }
.btn.ghost:hover { background: var(--panel-2); border-color: color-mix(in oklab, var(--accent) 35%, var(--line)); }

/* hero screenshot frame */
.shot { position: relative; margin: 56px auto 0; max-width: 920px; }
.shot img {
  display: none; /* revealed by app.js once it actually loads */
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-hero);
}
.shot-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  border: 1px dashed var(--line);
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  color: var(--ink-3);
  font-size: 14px;
}

/* ── section titles ── */
.section-title {
  text-align: center;
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  margin: 0 0 42px;
}
.features, .download, .changelog { padding-top: 96px; padding-bottom: 30px; }

/* ── feature grid ── */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  padding: 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover {
  border-color: color-mix(in oklab, var(--accent) 40%, var(--line));
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}
.card-ic { font-size: 26px; margin-bottom: 12px; line-height: 1; }
.card h3 { margin: 0 0 8px; font-size: 17px; }
.card p { margin: 0; color: var(--ink-2); font-size: 14px; }

/* ── craft (feature close-ups) ── */
.craft { padding: 30px 24px 86px; max-width: var(--max); margin: 0 auto; scroll-margin-top: 70px; }
.craft-lede { text-align: center; color: var(--ink-2); margin: -22px 0 54px; font-size: 16px; }
.craft-rows { display: flex; flex-direction: column; gap: 72px; }
.craft-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 48px; align-items: center; }
.craft-row:nth-child(even) .craft-text { order: 2; }
.craft-text h3 { font-size: 22px; letter-spacing: -0.01em; margin: 0 0 10px; }
.craft-text p { color: var(--ink-2); line-height: 1.75; font-size: 15px; margin: 0; }
.craft-shot { margin: 0; }
.craft-shot img {
  display: block;
  max-width: 100%;
  max-height: 480px;
  width: auto;
  height: auto;
  margin-inline: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.10);
}
[data-theme='dark'] .craft-shot img { box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45); }
@media (max-width: 860px) {
  .craft-row, .craft-row:nth-child(even) { grid-template-columns: 1fr; gap: 18px; }
  .craft-row:nth-child(even) .craft-text { order: 0; }
  .craft-rows { gap: 52px; }
}

/* ── download ── */
.dl-version { text-align: center; margin: -22px 0 30px; color: var(--ink-3); font-size: 14px; }
.dl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 880px; margin: 0 auto; }
.dl-os {
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.dl-os.match { border-color: color-mix(in oklab, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 1px color-mix(in oklab, var(--accent) 38%, transparent), var(--shadow-card); }
.dl-os-head { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; margin-bottom: 14px; }
.dl-os-badge { font-size: 10.5px; font-weight: 600; color: var(--accent-2); background: color-mix(in oklab, var(--accent) 12%, transparent); padding: 1px 8px; border-radius: 999px; }
.dl-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 13px;
  margin-bottom: 8px;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.dl-link:last-child { margin-bottom: 0; }
.dl-link:hover { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 9%, var(--panel-2)); }
.dl-link > span:first-child { white-space: nowrap; }
.dl-link .arch { color: var(--ink-3); font-family: var(--mono); font-size: 12px; font-weight: 500; text-align: right; }
.dl-foot { text-align: center; margin-top: 28px; color: var(--ink-3); font-size: 13px; }
.dl-foot a, .changelog a, .lede a { color: var(--accent-2); }
.dl-foot a:hover { text-decoration: underline; }
.dl-empty { grid-column: 1 / -1; text-align: center; padding: 44px; color: var(--ink-3); border: 1px dashed var(--line); border-radius: var(--radius); }

/* ── changelog ── */
.cl-card { max-width: 760px; margin: 0 auto; padding: 26px 30px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.cl-card h3 { margin: 0 0 4px; font-size: 18px; }
.cl-date { color: var(--ink-3); font-size: 13px; margin: 0 0 16px; }
.cl-notes { color: var(--ink-2); font-size: 14px; }
.cl-notes ul { margin: 0; padding-left: 20px; }
.cl-notes li { margin: 5px 0; }
.cl-more { display: inline-block; margin-top: 16px; font-size: 13px; color: var(--accent-2); }
.muted { color: var(--ink-3); }

/* ── footer ── */
.footer { margin-top: 80px; padding: 36px max(20px, calc((100vw - var(--max)) / 2)); border-top: 1px solid var(--line-soft); }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 22px; font-size: 14px; color: var(--ink-2); }
.footer-links a:hover { color: var(--ink); }
.copyright { margin: 18px 0 0; color: var(--ink-3); font-size: 13px; }

/* ── responsive ── */
@media (max-width: 860px) {
  .grid, .dl-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .hero { padding-top: 68px; }
}
