/* Michroma (SIL OFL 1.1, see /fonts/Michroma-OFL.txt) is the same display face
   the app bundles (Packages/CamduoletKit/Sources/DesignSystem/Resources/Fonts).
   Like the app, it is used only for the wordmark and uppercase eyebrows; it
   has no CJK glyphs, so Chinese falls back to PingFang SC. */
@font-face {
  font-family: "Michroma";
  src: url("/fonts/Michroma-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  /* "Instrument" palette, transcribed from
     Packages/CamduoletKit/Sources/DesignSystem/Tokens.swift (DS.Palette) and
     docs/DESIGN.md §3.2. The app is dark-only, so the site is too. */
  --void: #050607;
  --panel: #111317;
  --graphite: rgba(17, 19, 23, 0.86);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --bone: #eceae5;
  --body: #c9c7c2;
  --ash: #8c929b;
  --lumen: #a6d8ff;
  --signal: #ff4b3e;
  --radius-s: 10px;
  --radius-m: 18px;
  --radius-l: 28px;
  --display: "Michroma", -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { background: var(--void); }
body {
  margin: 0;
  overflow-x: hidden;
  color: var(--body);
  background: var(--void);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--lumen); }
[hidden] { display: none !important; }
::selection { background: rgba(166, 216, 255, 0.3); color: var(--bone); }

.wrap { width: min(920px, calc(100% - 32px)); margin: 0 auto; }

/* Header ------------------------------------------------------------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 0 18px;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--display);
  font-size: 0.8rem;
  letter-spacing: 0.24em;
  color: var(--bone);
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}
.site-nav { display: flex; align-items: center; gap: 16px; }
.site-nav a { color: var(--ash); text-decoration: none; font-size: 0.9rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--bone); }
.lang-toggle {
  min-height: 32px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--bone);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.lang-toggle:hover { border-color: var(--lumen); }
.lang-toggle:focus-visible, a:focus-visible { outline: 2px solid var(--lumen); outline-offset: 2px; }

/* Type --------------------------------------------------------------- */
.eyebrow {
  font-family: var(--display);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ash);
}
h1, h2, h3 { color: var(--bone); line-height: 1.18; letter-spacing: -0.015em; font-weight: 600; }
h1 { max-width: 660px; margin: 14px 0 16px; font-size: clamp(2.1rem, 6.5vw, 3.3rem); }
h2 { margin: 10px 0 12px; font-size: clamp(1.45rem, 4vw, 2rem); }
h3 { margin: 0 0 6px; font-size: 1.05rem; }
.lede { max-width: 620px; margin: 0; color: var(--ash); font-size: clamp(1.02rem, 2.2vw, 1.18rem); }
.readout { font-family: var(--mono); font-size: 0.78rem; color: var(--ash); letter-spacing: 0.02em; }

/* Hero --------------------------------------------------------------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 36px; align-items: center; padding: 48px 0 56px; }
.viewfinder {
  position: relative;
  aspect-ratio: 3 / 4;
  max-width: 340px;
  width: 100%;
  justify-self: center;
  border-radius: var(--radius-m);
  background:
    radial-gradient(120% 90% at 30% 70%, rgba(166, 216, 255, 0.06), transparent 60%),
    var(--panel);
  border: 1px solid var(--line);
  overflow: hidden;
}
/* 2 px corner ticks, as on the app's frames (DESIGN.md §3.1 rule 5). */
.viewfinder::before, .viewfinder::after {
  content: "";
  position: absolute;
  inset: 14px;
  pointer-events: none;
  background:
    linear-gradient(var(--bone), var(--bone)) top left / 16px 2px,
    linear-gradient(var(--bone), var(--bone)) top left / 2px 16px,
    linear-gradient(var(--bone), var(--bone)) top right / 16px 2px,
    linear-gradient(var(--bone), var(--bone)) top right / 2px 16px,
    linear-gradient(var(--bone), var(--bone)) bottom left / 16px 2px,
    linear-gradient(var(--bone), var(--bone)) bottom left / 2px 16px,
    linear-gradient(var(--bone), var(--bone)) bottom right / 16px 2px,
    linear-gradient(var(--bone), var(--bone)) bottom right / 2px 16px;
  background-repeat: no-repeat;
  opacity: 0.75;
}
.viewfinder::after { display: none; }
.viewfinder svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.viewfinder .vf-readout {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 20px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--ash);
  letter-spacing: 0.04em;
}
.viewfinder .vf-top {
  position: absolute;
  top: 22px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--display);
  font-size: 0.56rem;
  letter-spacing: 0.2em;
  color: var(--bone);
  opacity: 0.8;
}

.notice {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 26px 0 0;
  padding: 8px 16px 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--bone);
  font-size: 0.9rem;
}
.notice .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lumen); flex: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  color: var(--bone);
  font-weight: 600;
  text-decoration: none;
}
.button:hover { border-color: var(--lumen); }

/* Sections ----------------------------------------------------------- */
.section { padding: 48px 0; border-top: 1px solid var(--line); }
.section-intro { max-width: 620px; margin: 0; color: var(--ash); }

.layouts { list-style: none; padding: 0; margin-bottom: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 26px; }
.layout {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--graphite);
  min-width: 0;
}
.layout svg { width: 36px; height: 48px; flex: none; }
.layout-name { color: var(--bone); font-size: 0.95rem; font-weight: 600; line-height: 1.25; }
.layout-sub { display: block; color: var(--ash); font-size: 0.8rem; line-height: 1.35; margin-top: 2px; }
.layout-names { min-width: 0; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 26px; }
.card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--graphite);
  min-width: 0;
}
.card p { margin: 0; color: var(--ash); font-size: 0.94rem; }
.card .readout { display: block; margin-bottom: 10px; color: var(--lumen); }

.specs { margin: 22px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); max-width: 680px; }
.specs li {
  display: grid;
  grid-template-columns: minmax(0, 170px) minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.specs .k { font-family: var(--display); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ash); padding-top: 4px; }
.specs .v { color: var(--bone); }

/* Prose pages -------------------------------------------------------- */
.prose { max-width: 720px; padding: 44px 0 80px; }
.prose h1 { font-size: clamp(2rem, 6vw, 2.7rem); }
.prose h2 {
  margin-top: 40px;
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ash);
}
.prose :lang(zh-Hans) h2, .prose [data-lang="zh"] h2 { font-family: inherit; font-size: 0.95rem; letter-spacing: 0.06em; font-weight: 600; }
.prose h3 { margin-top: 26px; font-size: 1.05rem; }
.prose ul { padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose strong { color: var(--bone); }
.prose .meta { color: var(--ash); font-size: 0.88rem; }
.prose .path {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: rgba(0, 0, 0, 0.35);
  color: var(--bone);
  font-weight: 600;
  font-size: 0.92rem;
}
.faq-item { padding: 18px 0; border-top: 1px solid var(--line); }
.faq-item:first-of-type { border-top: 0; }
.faq-item p { margin: 0; }

/* Without JS both languages show; separate them with a hairline. */
.lang-block + .lang-block { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); }
.lang-ready .lang-block + .lang-block { margin-top: 0; padding-top: 0; border-top: 0; }

/* Footer ------------------------------------------------------------- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--ash);
  font-size: 0.85rem;
}
.site-footer a { color: var(--ash); text-decoration: none; }
.site-footer a:hover { color: var(--bone); }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 36px; }
  .viewfinder { max-width: 260px; }
  .grid { grid-template-columns: 1fr; }
  .layouts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .site-nav { gap: 12px; }
  .site-nav a { font-size: 0.85rem; }
  .layouts { grid-template-columns: 1fr; }
  .specs li { grid-template-columns: 1fr; gap: 2px; }
}
