/* ConfirmLight
 *
 * Direction A, 暗室: the page is a dark room and the lamp is its only light.
 * The fixed lamp takes the colour of whichever section is in view (site.js),
 * and the ambient glow follows it - red at the top, green by the footer.
 *
 * Chinese text uses system fonts on purpose: fonts.googleapis.com is blocked
 * in mainland China, and a stalled stylesheet would hold up the whole page.
 * Only the small Latin faces are self-hosted, restricted by unicode-range so
 * CJK falls straight through to PingFang / YaHei.
 */

@font-face { font-family: "Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/ibm-plex-sans-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  --bg: #0D0E11;
  --panel: #121419;
  --line: #23262D;
  --ink: #F4F5F8;
  --dim: #9AA1AD;
  --faint: #7B828E;        /* 4.7:1 on --bg: still AA for the small labels */
  /* Same hues as the app's lamp (confimlight/src/confirmlight/ui/theme.py):
     Tailwind rose-500 / amber-500 / emerald-500. */
  --red: #F43F5E;
  --amber: #F59E0B;
  --green: #10B981;

  --sans: "Plex Sans", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Hiragino Sans GB", system-ui, sans-serif;
  --mono: "Plex Mono", "Cascadia Mono", Consolas, "SFMono-Regular", monospace;
  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 64px);

  /* Colour of the section in view (site.js); the logo dot and the ambient
     glow follow it, the fixed capsule restyles itself below. */
  --lamp: var(--red);
}
:root[data-lamp-state="amber"] { --lamp: var(--amber); }
:root[data-lamp-state="green"] { --lamp: var(--green); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
.mono { font-family: var(--mono); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }
.narrow { max-width: 840px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---- the light ------------------------------------------------------- */

.ambient { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.ambient i {
  position: absolute; right: -18vmax; top: -24vmax; width: 74vmax; height: 74vmax; border-radius: 50%;
  opacity: 0; transition: opacity 1.1s ease;
}
.ambient .red   { background: radial-gradient(circle, rgba(244, 63, 94, .34) 0%, rgba(244, 63, 94, .09) 40%, transparent 68%); }
.ambient .amber { background: radial-gradient(circle, rgba(245, 158, 11, .2) 0%, rgba(245, 158, 11, .05) 42%, transparent 66%); }
.ambient .green { background: radial-gradient(circle, rgba(16, 185, 129, .09) 0%, transparent 60%); }
:root[data-lamp-state="red"]   .ambient .red,
:root[data-lamp-state="amber"] .ambient .amber,
:root[data-lamp-state="green"] .ambient .green { opacity: 1; }

.lamp { position: fixed; top: 86px; right: 28px; z-index: 40; pointer-events: none; }

/* The capsule, as the app draws it (confimlight/ui/code.html, ui/theme.py):
   a fixed 52x24 shell whose colour, dot and four-letter label carry the
   state. Red and amber breathe a halo around it; the shell never resizes.
   .pill-* fixes a state (the legend rows); the fixed .lamp follows the
   section in view through :root[data-lamp-state]. Default is red. */
.pill {
  --edge: rgba(244, 63, 94, .7);
  --dot: #F43F5E;
  --dot-glow: 0 0 8px #F43F5E;
  --label: #FECDD3;
  --text: "WAIT";
  --halo: pulse-red 2.2s cubic-bezier(.45, .05, .55, .95) infinite;
  --halo-still: 0 0 0 4px rgba(244, 63, 94, .3), 0 0 16px rgba(244, 63, 94, .6);

  position: relative; flex: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 52px; height: 24px; padding: 0 6px; border-radius: 9999px;
  background: rgba(10, 13, 20, .95); border: 1px solid var(--edge);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1);
  transition: border-color .6s ease;
}
.pill::before {
  content: ""; position: absolute; inset: -4px; border-radius: 9999px; pointer-events: none;
  animation: var(--halo);
}
.pill i {
  flex: none; width: 8px; height: 8px; border-radius: 50%;
  background: var(--dot); box-shadow: var(--dot-glow);
  transition: background-color .6s ease, box-shadow .6s ease;
}
.pill::after { content: var(--text); font: 700 9px/1 var(--mono); letter-spacing: .05em; color: var(--label); }

.pill-amber, :root[data-lamp-state="amber"] .lamp .pill {
  --edge: rgba(245, 158, 11, .7);
  --dot: #FBBF24;
  --dot-glow: 0 0 6px #F59E0B;
  --label: #FDE68A;
  --text: "IDLE";
  --halo: pulse-amber 2.6s ease-in-out infinite;
  --halo-still: 0 0 0 3px rgba(245, 158, 11, .25), 0 0 12px rgba(245, 158, 11, .5);
}
.pill-green, :root[data-lamp-state="green"] .lamp .pill {
  --edge: rgba(16, 185, 129, .7);
  --dot: #34D399;
  --dot-glow: 0 0 8px #10B981;
  --label: #A7F3D0;
  --text: "RUN";
  --halo: none;
  --halo-still: none;
}

@keyframes pulse-red {
  0%, 100% { opacity: .45; box-shadow: 0 0 0 0 rgba(244, 63, 94, .65), 0 0 10px rgba(244, 63, 94, .5); }
  50%      { opacity: .95; box-shadow: 0 0 0 7px rgba(244, 63, 94, .18), 0 0 22px rgba(244, 63, 94, .85); }
}
@keyframes pulse-amber {
  0%, 100% { opacity: .4;  box-shadow: 0 0 0 0 rgba(245, 158, 11, .5), 0 0 8px rgba(245, 158, 11, .4); }
  50%      { opacity: .85; box-shadow: 0 0 0 5px rgba(245, 158, 11, .15), 0 0 16px rgba(245, 158, 11, .7); }
}

main, .nav, .foot { position: relative; z-index: 1; }

/* ---- navigation ------------------------------------------------------ */

.nav {
  position: sticky; top: 0; z-index: 30;
  background: rgba(13, 14, 17, .72);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid rgba(35, 38, 45, .7);
}
.nav-inner { display: flex; align-items: center; gap: 26px; height: 64px; }
.logo {
  display: flex; align-items: center; gap: 10px; margin-right: auto;
  font-weight: 700; font-size: 15px; letter-spacing: .01em; text-decoration: none;
}
.logo i {
  width: 9px; height: 9px; border-radius: 50%; background: var(--lamp);
  box-shadow: 0 0 10px 2px color-mix(in srgb, var(--lamp) 55%, transparent);
  transition: background-color .6s ease, box-shadow .6s ease;
}
.nav-links { display: flex; gap: 26px; }
.nav-links a, .foot-links a { color: var(--dim); text-decoration: none; font-size: 14px; }
.nav-links a:hover, .foot-links a:hover { color: var(--ink); }
.nav-cta {
  font-size: 13px; font-weight: 600; text-decoration: none;
  padding: 7px 14px; border-radius: 8px; background: var(--ink); color: var(--bg);
}
.lang-switch {
  font: 500 12px var(--mono); color: var(--dim); text-decoration: none;
  border: 1px solid var(--line); padding: 4px 9px; border-radius: 6px;
}
.lang-switch:hover { color: var(--ink); border-color: #3A3F48; }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px var(--sans); padding: 13px 22px; border-radius: 10px; text-decoration: none;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: #fff; transform: translateY(-1px); }
.btn-quiet { border: 1px solid #2E323A; color: #CDD1D8; }
.btn-quiet:hover { border-color: #4A4F59; color: var(--ink); }
.btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn[aria-disabled="true"]:hover { border-color: #2E323A; color: #CDD1D8; }

/* ---- buy / license --------------------------------------------------- */

button.btn { cursor: pointer; }
button.btn-primary { border: 0; }
button.btn-quiet { background: transparent; }
.buy-form { margin-top: 32px; max-width: 520px; }
.buy-form label { display: block; margin-bottom: 8px; font-size: 14px; color: var(--dim); }
.buy-form input[type="email"] {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  font: 400 16px var(--sans); color: var(--ink); background: var(--panel); border: 1px solid var(--line);
}
.buy-form input[type="email"]:focus { outline: none; border-color: #4A4F59; }
.hint { margin: 8px 0 0; font-size: 13px; color: var(--faint); }
.form-error { margin: 10px 0 0; font-size: 14px; color: #FDA4AF; }
.buy-foot { margin-top: 28px; font-size: 14px; color: var(--dim); }
.qr { margin-top: 28px; width: 232px; padding: 16px; border-radius: 12px; background: #fff; }
.qr svg { display: block; width: 100%; height: auto; }
.license-box { display: flex; align-items: flex-start; gap: 12px; margin-top: 28px; }
.license-box code {
  flex: 1; min-width: 0; padding: 14px 16px; border-radius: 10px;
  font: 400 13px/1.6 var(--mono); word-break: break-all; user-select: all;
  background: var(--panel); border: 1px solid var(--line);
}

/* ---- sections -------------------------------------------------------- */

section { padding: clamp(64px, 8vw, 104px) 0; }
h2 { margin: 0; font-weight: 700; font-size: clamp(28px, 3.4vw, 38px); line-height: 1.2; letter-spacing: -.01em; }
.section-lede { margin: 12px 0 0; max-width: 36em; color: var(--dim); }

.hero { padding: clamp(56px, 9vw, 112px) 0 72px; }
.eyebrow { margin: 0; font-size: 12px; letter-spacing: .12em; color: #FDA4AF; }
.hero-title {
  margin: 18px 0 0; max-width: 980px;
  font-weight: 700; font-size: clamp(40px, 7vw, 76px); line-height: 1.08; letter-spacing: -.02em;
  background: linear-gradient(96deg, var(--ink) 52%, #FECDD3 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { margin: 22px 0 0; max-width: 36em; font-size: clamp(16px, 1.6vw, 18px); color: var(--dim); }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 34px; }
.platforms { margin-left: 6px; font-size: 13px; color: var(--faint); }

.wins { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-top: 64px; }
.win { position: relative; height: 84px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.win::before, .win::after { content: ""; position: absolute; left: 12px; height: 6px; border-radius: 3px; }
.win::before { top: 12px; width: 44%; background: #23262D; }
.win::after  { top: 26px; width: 62%; background: #1B1E24; }
.win-name, .win-alert {
  position: absolute; left: 12px; right: 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.win-name { bottom: 10px; font: 400 11px var(--mono); color: var(--faint); }
.win.is-hot { border-color: rgba(244, 63, 94, .7); box-shadow: 0 0 0 1px rgba(244, 63, 94, .22), 0 0 34px rgba(244, 63, 94, .28); }
.win.is-hot::after { display: none; }
.win.is-hot .win-name { bottom: 28px; color: #FDA4AF; }
.win-alert { bottom: 10px; font: 600 12px var(--sans); color: #FECDD3; }

.rows { margin-top: 40px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.row {
  display: grid; grid-template-columns: 64px 150px 1fr; align-items: center; gap: 20px;
  padding: 24px 28px; background: rgba(13, 14, 17, .85);
}
.row + .row { border-top: 1px solid var(--line); }
.row .pill { justify-self: center; }
.row h3 { margin: 0; font-size: 18px; font-weight: 700; }
.row p { margin: 0; color: var(--dim); font-size: 15px; }

.grid4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 40px; }
.feat { border: 1px solid var(--line); border-radius: 14px; padding: 28px; background: rgba(18, 20, 25, .65); }
.feat .k { margin: 0; font: 500 11px var(--mono); letter-spacing: .1em; color: var(--faint); }
.feat h3 { margin: 10px 0 0; font-size: 20px; font-weight: 700; }
.feat p { margin: 8px 0 0; color: var(--dim); font-size: 15px; }

.proof-section { padding-top: 24px; }
.proof { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.proof h2 { font-size: clamp(24px, 2.8vw, 30px); }
.proof p { margin: 12px 0 0; color: var(--dim); }
.term {
  margin: 0; overflow-x: auto; padding: 20px 22px;
  border: 1px solid var(--line); border-radius: 12px; background: #0A0B0D;
  font: 400 14px/1.9 var(--mono); color: #B4BAC4;
}
.term code { font: inherit; background: none; border: 0; padding: 0; color: inherit; }
.term .c { color: var(--faint); }
.term .y { color: var(--amber); }

.pricing { text-align: center; }
.pricing .section-lede { margin-inline: auto; }
.price-card {
  max-width: 540px; margin: 40px auto 0; padding: 36px; text-align: left;
  border: 1px solid #2A2E36; border-radius: 18px; background: linear-gradient(180deg, #14161B, #0F1014);
}
.price-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; }
.amt { font-size: 56px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.alt { font-size: 18px; color: var(--dim); }
.once { margin-left: auto; font-size: 13px; color: var(--faint); }
.points { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; font-size: 15px; color: #C8CDD5; }
.points li { display: flex; align-items: baseline; gap: 12px; }
.points li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--green); transform: translateY(-2px); }
.pay { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 28px; }
.pay .btn { padding: 14px; }
.trial { margin: 16px 0 0; text-align: center; font-size: 14px; color: var(--faint); }
.trial a { color: var(--dim); }

.qa { margin: 32px 0 0; border-top: 1px solid var(--line); }
.qa div { display: grid; grid-template-columns: 280px 1fr; gap: 28px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.qa dt { font-weight: 700; }
.qa dd { margin: 0; color: var(--dim); font-size: 15px; }

/* ---- inner pages ----------------------------------------------------- */

.page-hero { padding: clamp(56px, 8vw, 96px) 0 24px; }
.page-hero h1, .doc h1 { margin: 0; font-weight: 700; font-size: clamp(34px, 5vw, 52px); line-height: 1.15; letter-spacing: -.015em; }
.page-hero .eyebrow { margin-bottom: 14px; color: var(--amber); }

.platforms-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 40px; }
.platform { padding: 28px; border: 1px solid var(--line); border-radius: 14px; background: rgba(18, 20, 25, .65); }
.platform h2 { font-size: 22px; }
.platform p { margin: 6px 0 20px; color: var(--dim); font-size: 14px; }

.steps { list-style: none; counter-reset: step; margin: 36px 0 0; padding: 0; display: grid; gap: 14px; }
.steps li {
  counter-increment: step; display: grid; grid-template-columns: 40px 1fr; gap: 18px;
  padding: 22px 24px; border: 1px solid var(--line); border-radius: 14px; background: rgba(13, 14, 17, .8);
}
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 32px; height: 32px;
  border: 1px solid #2E323A; border-radius: 50%; font: 500 13px var(--mono); color: var(--dim);
}
.steps h3 { margin: 4px 0 0; font-size: 17px; }
.steps p { margin: 6px 0 0; color: var(--dim); font-size: 15px; }
/* overflow-wrap rather than word-break: break-all. A long path first moves to
   its own line and only breaks mid-token if it still cannot fit, instead of
   splitting "/Applications/ConfirmLight.app/Con|tents" for no reason. */
code {
  font: 400 .88em var(--mono); color: #D2D6DC; overflow-wrap: anywhere;
  background: #0A0B0D; border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.note { margin-top: 28px; padding: 22px 24px; border: 1px dashed #2E323A; border-radius: 14px; }
.note h3 { margin: 0; font-size: 16px; }
.note p { margin: 6px 0 0; color: var(--dim); font-size: 15px; }

.doc { padding-block: clamp(56px, 8vw, 96px) 24px; }
.updated { margin: 10px 0 0; font-size: 14px; color: var(--faint); }
.doc section { padding: 0; margin-top: 36px; }
.doc h2 { font-size: 20px; }
.doc p { margin: 10px 0 0; color: #C3C8D0; font-size: 15.5px; }

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

.foot { padding: 96px 0 48px; text-align: center; }
.calm { display: inline-flex; align-items: center; gap: 12px; margin: 0; font-size: 14px; color: var(--faint); }
.calm i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); opacity: .6; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 24px; margin-top: 28px; }
.foot-links a { font-size: 13px; }
.fine { margin: 20px 0 0; font-size: 12px; color: var(--faint); }

/* ---- smaller screens ------------------------------------------------- */

@media (max-width: 900px) {
  .nav-links { display: none; }
  .grid4, .proof, .platforms-grid { grid-template-columns: 1fr; }
  .proof { gap: 24px; }
  .qa div { grid-template-columns: 1fr; gap: 6px; }
  .row { grid-template-columns: 56px 1fr; gap: 4px 14px; padding: 20px; }
  .row .pill { grid-row: span 2; }
  .row p { grid-column: 2; }
}

@media (max-width: 640px) {
  .nav-inner { gap: 14px; }
  .nav-cta { display: none; }
  .lamp { top: 72px; right: 12px; }
  /* Two columns, not three: at three the waiting window is too narrow for
     its own prompt, which is the one thing it exists to show. */
  .wins { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 48px; }
  .win { height: 76px; }
  /* Small enough that the 127.0.0.1 line fits a 360px phone without the
     block growing its own sideways scrollbar. */
  .term { font-size: 12px; padding: 16px 18px; }
  .pay { grid-template-columns: 1fr; }
  .price-card { padding: 26px; }
  .amt { font-size: 46px; }
  .once { margin-left: 0; width: 100%; }
  .steps li { grid-template-columns: 1fr; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  /* No breathing, but red and amber still need their halo to read as urgent. */
  .pill::before { box-shadow: var(--halo-still); }
}
