/* Kuida — static site styles. No external requests. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --night: #1f1a3d;
  --night-2: #2c2656;
  --porch: #f6f3fb;
  --paper: #ffffff;
  --ink: #231e3f;
  --muted: #57527a;
  --line: #ddd7ec;
  --lamp: #f4b942;
  --lamp-soft: #ffe7a8;
  --sage: #7fcfae;
  --bubble-them: #3a3370;
  --bubble-you: #f6f3fb;

  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: 1.65rem;
  --step-3: clamp(2.3rem, 6vw + 0.5rem, 4.1rem);

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --measure: 36rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--porch);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.55;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--lamp); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 68rem; margin: 0 auto; padding: 0 var(--gutter); }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--lamp); color: var(--night); padding: 0.5rem 1rem; z-index: 10;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- Header ---------- */
.site-head { padding: 1.25rem 0; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.wordmark {
  font-family: var(--display); font-weight: 800; font-size: 1.6rem;
  letter-spacing: -0.02em; text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem;
}
.wordmark .dot {
  width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--lamp);
  box-shadow: 0 0 0 4px rgba(244, 185, 66, 0.25);
}
.beta-tag { font-size: var(--step--1); color: var(--muted); }
.head-right { display: flex; align-items: center; gap: 1rem 1.5rem; flex-wrap: wrap; justify-content: flex-end; }
.lang { display: flex; gap: 0.25rem; font-size: var(--step--1); }
.lang a { text-decoration: none; padding: 0.3rem 0.6rem; border-radius: 999px; border: 1px solid transparent; }
.lang a:hover { border-color: currentColor; }
.lang a[aria-current] { background: var(--ink); color: var(--porch); font-weight: 700; }
.night .lang a[aria-current] { background: var(--lamp); color: var(--night); }
@media (max-width: 520px) { .beta-tag { display: none; } }

.night .site-head, .night .wordmark { color: var(--porch); }
.night .beta-tag { color: #c9c2e6; }

/* ---------- Hero ---------- */
.hero {
  background: var(--night);
  color: var(--porch);
  overflow: hidden;
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding: 2rem var(--gutter) 4rem;
  max-width: 68rem; margin: 0 auto;
  align-items: center;
}
@media (min-width: 860px) {
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; padding-top: 3rem; padding-bottom: 5.5rem; }
}
.hero h1 {
  font-family: var(--display); font-weight: 800;
  font-size: var(--step-3); line-height: 1.02; letter-spacing: -0.035em;
  margin: 0 0 1.25rem; max-width: 12ch;
}
.hero .lede { font-size: var(--step-1); line-height: 1.45; color: #ded8f3; max-width: 30rem; margin: 0 0 1.75rem; }
.hero .fine { font-size: var(--step--1); color: #c9c2e6; max-width: 30rem; margin: 0; }

/* The chat: the one memorable thing. */
.thread {
  position: relative;
  max-width: 24rem; width: 100%; justify-self: center;
  padding: 1.25rem 1rem 1.5rem;
  border-radius: 28px;
  background: var(--night-2);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6);
}
.thread::before { /* the porch light left on */
  content: ""; position: absolute; z-index: 0;
  width: 26rem; height: 26rem; right: -9rem; top: -9rem;
  background: radial-gradient(circle, rgba(244, 185, 66, 0.42) 0%, rgba(244, 185, 66, 0.12) 40%, rgba(244, 185, 66, 0) 70%);
  pointer-events: none;
}
.thread-head {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0 0.25rem 0.9rem; margin-bottom: 0.9rem;
  border-bottom: 1px solid rgba(246, 243, 251, 0.12);
  font-weight: 700;
}
.thread-head .avatar {
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--lamp); color: var(--night);
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 1rem;
}
.thread-head small { display: block; font-weight: 400; color: #c9c2e6; font-size: 0.8rem; }
.thread ol { list-style: none; margin: 0; padding: 0; position: relative; z-index: 1; display: grid; gap: 0.6rem; }
.msg {
  max-width: 85%; padding: 0.6rem 0.8rem 0.45rem;
  border-radius: 16px; font-size: 0.95rem; line-height: 1.4;
}
.msg time { display: block; font-size: 0.72rem; opacity: 0.7; margin-top: 0.2rem; text-align: right; }
.msg.them { background: var(--bubble-them); color: var(--porch); border-bottom-left-radius: 4px; }
.msg.you { background: var(--bubble-you); color: var(--ink); margin-left: auto; border-bottom-right-radius: 4px; }
.msg.you .secret { letter-spacing: 0.2em; }
.msg.safe { background: var(--sage); color: var(--night); }
.msg strong { font-weight: 700; }

.gap-note {
  text-align: center; font-size: 0.75rem; color: #c9c2e6; margin: 0.15rem 0;
}

@media (prefers-reduced-motion: no-preference) {
  .thread::before { animation: lamp 5s ease-in-out infinite alternate; }
  @keyframes lamp { from { opacity: 0.75; } to { opacity: 1; } }
}

/* ---------- Sections ---------- */
main section { padding: 3.5rem 0; }
main section + section { border-top: 1px solid var(--line); }
h2 {
  font-family: var(--display); font-weight: 800; font-size: var(--step-2);
  letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 1.25rem;
}
h3 { font-family: var(--display); font-weight: 600; font-size: var(--step-1); line-height: 1.25; margin: 0 0 0.35rem; }
p { margin: 0 0 1rem; max-width: var(--measure); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.75rem; counter-reset: step; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; } }
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: grid; place-items: center;
  width: 2.25rem; height: 2.25rem; margin-bottom: 0.75rem;
  border-radius: 50%; border: 2px solid var(--ink);
  font-family: var(--display); font-weight: 800;
}
.steps li:last-child::before { background: var(--lamp); border-color: var(--lamp); color: var(--night); }
.steps p { color: var(--muted); margin: 0; }

.split { display: grid; gap: 2.5rem; }
@media (min-width: 760px) { .split { grid-template-columns: 1fr 1fr; gap: 4rem; } }

.not-box {
  background: var(--paper);
  border-left: 6px solid var(--lamp);
  padding: 1.5rem 1.5rem 0.5rem;
  border-radius: 0 12px 12px 0;
}

.plain { margin: 0; padding-left: 1.2rem; max-width: var(--measure); }
.plain li { margin-bottom: 0.55rem; }
.plain li::marker { color: var(--muted); }

.beta {
  background: var(--night); color: var(--porch);
  border-radius: 20px; padding: 2rem var(--gutter);
}
.beta p { color: #ded8f3; }
.beta a { color: var(--lamp-soft); }

/* ---------- Text pages (terms, privacy, 404) ---------- */
.doc { padding: 1.5rem 0 4rem; }
.doc h1 {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2rem, 4vw + 1rem, 3rem); letter-spacing: -0.03em; line-height: 1.05;
  margin: 1rem 0 0.75rem;
}
.doc .meta { color: var(--muted); font-size: var(--step--1); margin-bottom: 2rem; }
.doc h2 { font-size: var(--step-1); margin: 2.25rem 0 0.75rem; }
.doc ol, .doc ul { max-width: var(--measure); padding-left: 1.3rem; }
.doc li { margin-bottom: 0.7rem; }
.doc .callout {
  background: var(--paper); border-left: 6px solid var(--lamp);
  padding: 1rem 1.25rem; border-radius: 0 12px 12px 0; max-width: var(--measure); margin: 1.5rem 0;
}
.doc .callout p { margin: 0; }

/* ---------- Footer ---------- */
.site-foot { padding: 2.5rem 0 3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--step--1); }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; }
.site-foot nav { display: flex; gap: 1.5rem; }
.site-foot p { margin: 0; }

/* Chinese: no negative tracking, a little more line height */
:lang(zh) .hero h1, :lang(zh) h2, :lang(zh) .doc h1 { letter-spacing: 0; line-height: 1.2; }
:lang(zh) body, :lang(zh) p { line-height: 1.7; }
