/* toki official site. Palette follows apps/mobile/lib/companion_ui/theme.dart (warm paper, low-saturation green). */
:root {
  --paper: #f8f7f2;
  --card: #fffefa;
  --ink: #22332a;
  --text: #29372f;
  --muted: #697168;
  --soft: #8a918b;
  --accent: #4b6b58;
  --accent-2: #6a8a74;
  --sage: #e8ede3;
  --line: #e2e6dd;
  --live: #3fb46b;
  --wrap: 1080px;
  --pad: clamp(20px, 5vw, 40px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

/* Language switching: both languages live in the markup, the inactive one is hidden. */
html[lang="en"] .zh { display: none !important; }
html:not([lang="en"]) .en { display: none !important; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font-family: var(--font); line-height: 1.6; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, dl, dd { margin: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }

/* Nav */
.nav-in { display: flex; align-items: center; gap: 24px; height: 72px; }
.brand { display: flex; align-items: center; gap: 14px; margin-right: auto; }
.brand img { height: 30px; width: auto; }
.tag {
  position: relative; padding-left: 15px; transform: translateY(-2px);
  font-size: 15px; font-weight: 500; letter-spacing: .04em; color: var(--accent); white-space: nowrap;
}
.tag::before { content: ""; position: absolute; left: 0; top: 50%; width: 1px; height: 14px; margin-top: -7px; background: #cfd5cc; }
.nav-link { font-size: 15px; color: var(--muted); }
.nav-link:hover { color: var(--ink); }
.lang {
  font: inherit; font-size: 13px; font-weight: 600; color: var(--accent);
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 14px; cursor: pointer;
}
.lang:hover { border-color: var(--accent-2); }

/* Hero */
.hero { padding: clamp(24px, 5vw, 64px) 0 clamp(56px, 9vw, 104px); }
.hero-in { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
h1 {
  font-size: clamp(38px, 5.6vw, 60px); line-height: 1.15;
  font-weight: 700; letter-spacing: -.03em; color: var(--ink);
}
html:not([lang="en"]) h1 { letter-spacing: -.01em; line-height: 1.2; }
.lead { margin-top: 20px; max-width: 26em; font-size: clamp(17px, 1.5vw, 19px); line-height: 1.7; color: var(--muted); }
.badge {
  margin-top: 32px; display: inline-flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--accent); background: var(--sage);
  border-radius: 999px; padding: 9px 18px;
}
.badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--live); }

/* Phone showcase. Inner sizes are designed for a 290×600 screen; small viewports scale the whole phone. */
.showcase { --sc: 1; display: flex; flex-direction: column; align-items: center; }
.stage { width: calc(290px * var(--sc)); height: calc(600px * var(--sc)); }
.phone {
  width: 290px; height: 600px; transform: scale(var(--sc)); transform-origin: top left;
  background: var(--paper); border-radius: 44px; overflow: hidden; position: relative;
  box-shadow: 0 0 0 9px #1f2a24, 0 40px 80px -30px rgba(24, 40, 30, .45);
  touch-action: pan-y; user-select: none; -webkit-user-select: none; text-align: left;
}
/* Screens are stacked; only the current one shows, changing by a short fade. */
.track { position: relative; height: 100%; }
.screen {
  position: absolute; inset: 0; display: flex; flex-direction: column; padding: 24px 16px 18px;
  opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility 0s .35s;
}
.screen.on { opacity: 1; visibility: visible; transition: opacity .35s ease; }
/* Tap mark: a soft fingertip on the control about to be pressed. */
[data-tap] { position: relative; }
[data-tap]::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border-radius: 50%; background: rgba(140, 150, 142, .38); box-shadow: 0 0 0 2px rgba(255, 255, 255, .85);
  opacity: 0; transform: scale(.5); pointer-events: none; z-index: 2;
}
[data-tap].press::before { animation: tap .8s ease-out forwards; }
[data-tap].press { animation: dip .8s ease-out; }
@keyframes tap { 0% { opacity: 0; transform: scale(.5); } 30% { opacity: 1; transform: scale(1); } 75% { opacity: 1; transform: scale(.88); } 100% { opacity: 0; transform: scale(1.15); } }
@keyframes dip { 40% { transform: scale(.94); } }
.bar { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 0 4px 14px; }
.bar img { height: 19px; width: auto; }
.gear { width: 17px; height: 17px; display: block; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
/* Channel tabs, as the app's top bar: current one bold with a short underline */
.chs { position: absolute; left: 50%; top: -3px; transform: translateX(-50%); display: flex; gap: 2px; }
.chs span { position: relative; padding: 0 8px 6px; font-size: 13.5px; font-weight: 500; color: var(--soft); white-space: nowrap; }
.chs span.on { font-size: 14px; font-weight: 700; color: var(--ink); }
.chs span.on::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 12px; height: 2.5px; margin-left: -6px; border-radius: 2px; background: var(--ink); }
.chs span.dot::before { content: ""; position: absolute; top: 1px; right: 3px; width: 4.5px; height: 4.5px; border-radius: 50%; background: #b74c48; }
.clock {
  position: absolute; left: 50%; transform: translateX(-50%); top: 1px;
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.clock i { width: 5px; height: 5px; border-radius: 50%; background: var(--live); }

/* Call screen: sizes are the call page v2 design scaled to this 290px phone */
.thread {
  /* Like the app: the conversation list starts at the top (12pt inset). */
  flex: 1; display: flex; flex-direction: column; gap: 12px; overflow: hidden; padding: 6px 2px 8px;
}
.who { display: inline-block; font-size: 9px; font-weight: 600; letter-spacing: .02em; line-height: 1; color: #6b726c; background: #f1f3ee; border-radius: 999px; padding: 4px 7px; }
.who.t { color: var(--accent); background: #e5efe8; }
.say p { margin-top: 5px; font-size: 13px; line-height: 1.5; color: var(--ink); }
.say small { display: block; margin-top: 3px; font-size: 9.5px; line-height: 1.5; color: var(--soft); }
.state {
  align-self: center; display: inline-flex; align-items: center; gap: 6px; margin-top: 4px;
  font-size: 10px; color: var(--muted); background: #eef1ea; border-radius: 999px; padding: 4px 11px;
}
.wave { display: inline-flex; align-items: center; gap: 1.5px; height: 10px; }
.wave b { width: 1.5px; border-radius: 1px; background: var(--accent); animation: wave 1.2s ease-in-out infinite; }
.wave b:nth-child(1) { height: 5px; }
.wave b:nth-child(2) { height: 10px; animation-delay: .15s; }
.wave b:nth-child(3) { height: 7px; animation-delay: .3s; }
.wave b:nth-child(4) { height: 9px; animation-delay: .45s; }
@keyframes wave { 50% { transform: scaleY(.45); } }
.controls { display: flex; justify-content: center; gap: 44px; margin-top: 10px; }
.ctl { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 10px; color: var(--muted); }
.ctl.end { color: #b74c48; }
.mute, .hang { display: grid; place-items: center; border-radius: 50%; }
.mute { width: 48px; height: 48px; background: #fff; border: 1px solid var(--line); }
.mute svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; }
.hang { width: 54px; height: 54px; background: #b74c48; }
.hang svg { width: 22px; height: 22px; fill: #fff; }

/* Speak hint: bulb, "You:" line and its Chinese, under toki's latest words */
.hint {
  display: flex; align-items: flex-start; gap: 6px; margin-top: -2px;
  background: var(--sage); border-radius: 9px; padding: 7px 7px 7px 9px;
}
.hint .bulb { flex: none; width: 12px; height: 12px; margin-top: 2px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hint div { flex: 1; }
.hint p { font-size: 11.5px; line-height: 1.45; color: var(--text); }
.hint b { font-weight: 600; color: var(--ink); }
.hint small { display: block; margin-top: 2px; font-size: 9.5px; line-height: 1.45; color: var(--soft); }
.hint .x { flex: none; width: 11px; height: 11px; margin-top: 2px; fill: none; stroke: var(--soft); stroke-width: 2; stroke-linecap: round; }
.screen.on .hint { animation: hint .45s 1.4s both; }
@keyframes hint { from { opacity: 0; transform: translateY(6px); } }

/* Screen 4: recap */
.s-title { margin-top: 14px; text-align: center; font-size: 21px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.panel { margin-top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 14px 2px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.kpis span { display: block; font-size: 10px; color: var(--soft); }
.kpis b { font-size: 19px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.kpis small { font-size: 10px; font-weight: 500; color: var(--muted); margin-left: 1px; }
.kpis em { margin-left: 3px; font-style: normal; font-size: 9.5px; color: var(--accent); background: #e5efe8; border-radius: 4px; padding: 1px 4px; vertical-align: 3px; }
.cheer { padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 11.5px; line-height: 1.6; color: var(--text); }
.cheer b { display: block; font-size: 13.5px; color: var(--accent); margin-bottom: 2px; }
.sec { display: flex; padding: 10px 0 2px; font-size: 10px; color: var(--muted); }
.sec span { margin-left: auto; color: #9aa19b; }
.note { display: flex; padding: 9px 0 10px; border-bottom: 1px solid var(--line); }
.note:last-child { border-bottom: 0; }
.note .n { font-size: 9.5px; color: var(--muted); padding: 2px 8px 0 0; }
.note .t { font-size: 11.5px; font-weight: 500; color: var(--ink); }
.note .f { margin-top: 3px; font-size: 13px; font-weight: 600; color: var(--ink); }
.cp { display: flex; margin-top: 4px; font-size: 11px; line-height: 1.55; color: var(--ink); }
.cp span { flex: none; width: 38px; font-size: 9.5px; color: var(--muted); padding-top: 1px; }
.cp s { text-decoration: none; color: var(--muted); }
.cp u { text-decoration: none; }
.cp em { font-style: normal; font-weight: 600; color: var(--accent); }

/* Screen 1: home topic card */
.s-title.home { margin-top: 40px; font-size: 22px; }
.s-sub { margin-top: 4px; text-align: center; font-size: 11px; color: var(--muted); }
.topic { position: relative; margin-top: 22px; background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 14px 14px 12px; }
.topic .x { position: absolute; top: 10px; right: 10px; width: 11px; height: 11px; fill: none; stroke: #a9afa7; stroke-width: 2; stroke-linecap: round; }
.q { padding-right: 14px; }
.q { font-size: 14px; font-weight: 600; line-height: 1.45; color: var(--ink); }
.line { margin-top: 9px; padding-left: 10px; border-left: 2px solid var(--sage); }
.l-en { font-size: 12.5px; line-height: 1.5; color: var(--ink); }
.l-zh { font-size: 10.5px; line-height: 1.5; color: var(--soft); }
.topic-bar { display: flex; align-items: center; margin-top: 12px; }
.pips { display: flex; gap: 4px; }
.pips i { width: 5px; height: 5px; border-radius: 50%; background: #d3d8cf; }
.pips i.on { width: 13px; border-radius: 3px; background: var(--accent); }
.go { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--ink); background: var(--sage); border-radius: 14px; padding: 5px 13px 5px 10px; }
.go svg { width: 11px; height: 11px; fill: var(--ink); }
.all { margin-top: 16px; text-align: center; font-size: 10.5px; color: var(--soft); }
.all i { font-style: normal; color: #c8cdc5; margin: 0 2px; }
.all b { font-weight: 500; color: var(--accent); }
.dock { margin-top: auto; display: flex; flex-direction: column; align-items: center; padding-bottom: 8px; }
.halo { padding: 8px; border-radius: 50%; background: rgba(34, 51, 42, .07); }
.callk { width: 64px; height: 64px; border-radius: 50%; background: var(--ink); display: grid; place-items: center; }
.callk svg { width: 24px; height: 24px; fill: #fff; }
.lab { margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--ink); }
.slogan { margin-top: 10px; font-size: 9px; letter-spacing: .15em; color: var(--soft); }

/* Screen 2: scenes — topic chips, grouped two-column cards, then the drawer */
.chips { display: flex; gap: 6px; padding: 0 2px; }
.chips span { font-size: 10.5px; color: var(--muted); background: #eef1ea; border-radius: 13px; padding: 4px 12px; }
.chips span.on { color: #fff; font-weight: 500; background: var(--ink); }
.grp { display: flex; align-items: baseline; gap: 6px; margin: 13px 2px 7px; font-size: 11.5px; font-weight: 700; color: var(--text); }
.grp small { font-size: 9px; font-weight: 400; color: var(--soft); }
.grp em { margin-left: auto; font-style: normal; font-size: 9px; font-weight: 400; color: var(--accent); }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.sc { min-height: 60px; display: flex; flex-direction: column; justify-content: space-between; background: #e6ece1; border-radius: 13px; padding: 10px 10px 9px; }
.sc.stu { background: #e3e9ee; }
.sc.life { background: #f1eadf; }
.st { display: flex; align-items: flex-start; font-size: 12px; font-weight: 700; line-height: 1.3; color: var(--ink); }
.st em { margin-left: auto; padding-left: 4px; font-style: normal; font-size: 8.5px; font-weight: 600; color: var(--accent); white-space: nowrap; line-height: 1.8; }
.st em.new { color: #b0703a; }
.ss { margin-top: 6px; font-size: 9.5px; color: #56635a; }
.scrim { position: absolute; inset: 0; background: rgba(34, 51, 42, .3); opacity: 0; }
.drawer {
  position: absolute; left: 0; right: 0; bottom: 0; background: #fff;
  border-radius: 21px 21px 0 0; padding: 8px 16px 22px; transform: translateY(105%);
}
.screen.on .scrim { opacity: 1; transition: opacity .4s 1.8s; }
.screen.on .drawer { transform: none; transition: transform .5s 1.8s cubic-bezier(.22, .61, .36, 1); }
.grab { display: block; width: 30px; height: 3.5px; margin: 0 auto 12px; border-radius: 2px; background: #d9ddd5; }
.d-title { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.row { display: flex; padding: 7px 0; border-bottom: 1px solid #e4e7de; font-size: 10.5px; line-height: 1.5; color: var(--text); }
.row span { flex: none; width: 40px; color: var(--soft); }
.d-btns { display: flex; gap: 7px; margin-top: 14px; }
.d-btns span { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px; height: 36px; border-radius: 18px; font-size: 11.5px; font-weight: 600; }
.d-btns .b1 { color: #fff; background: var(--ink); }
.d-btns .b1 svg { width: 12px; height: 12px; fill: #fff; }
.d-btns .b2 { color: var(--ink); background: #e5efe8; }

/* Tabs under the phone, with a progress bar on the active one */
.tabs { margin-top: 28px; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.tabs button {
  position: relative; overflow: hidden; font: inherit; font-size: 13px; color: var(--muted);
  background: none; border: 1px solid transparent; border-radius: 999px; padding: 6px 14px; cursor: pointer;
}
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); background: var(--card); border-color: var(--line); }
.tabs i { position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px; border-radius: 1px; background: var(--accent-2); transform: scaleX(0); transform-origin: left; }
.tabs button.on i { animation: progress 5.5s linear forwards; }
.no-auto .tabs button.on i { animation: none; }
@keyframes progress { to { transform: scaleX(1); } }

/* Features */
.features { padding-bottom: clamp(56px, 9vw, 112px); }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.feature { border-top: 1px solid var(--line); padding-top: 24px; }
h3 { font-size: 18px; font-weight: 650; color: var(--ink); }
.feature p { margin-top: 8px; font-size: 15px; color: var(--muted); }
.nb { display: inline-block; }

/* Company */
.company { background: var(--ink); color: #c9d3cb; padding: clamp(48px, 7vw, 80px) 0; }
.company-in { display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; }
h2 { font-size: 22px; font-weight: 650; color: #fff; margin-bottom: 12px; }
.company p { max-width: 30em; font-size: 15px; line-height: 1.8; }
.company dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 24px; font-size: 15px; align-content: start; }
.company dt { color: #8fa094; }
.company dd { color: #fff; overflow-wrap: anywhere; }
.company a:hover { text-decoration: underline; }

/* Footer */
.foot { padding: 24px 0 calc(24px + env(safe-area-inset-bottom)); font-size: 13px; color: var(--soft); }
.foot-in { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.foot a:hover { color: var(--ink); }

/* Tablet & phone */
@media (max-width: 900px) {
  .hero-in { grid-template-columns: 1fr; gap: 48px; }
  .hero-copy { display: flex; flex-direction: column; align-items: center; text-align: center; }
  .company-in { grid-template-columns: 1fr; gap: 28px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 0 40px; }
  .feature { padding-bottom: 28px; }
}
@media (max-width: 640px) {
  .nav-in { height: 60px; gap: 18px; }
  .brand { gap: 10px; }
  .brand img { height: 26px; }
  .tag { padding-left: 11px; font-size: 13px; transform: translateY(-1px); }
  .tag::before { height: 12px; margin-top: -6px; }
  .showcase { --sc: .9; }
  .tabs { margin-top: 22px; gap: 2px; }
  .tabs button { font-size: 12.5px; padding: 6px 11px; }
  .grid { grid-template-columns: 1fr; gap: 0; }
  .feature { padding: 20px 0; }
  .company dl { grid-template-columns: 1fr; gap: 2px; }
  .company dd { margin-bottom: 10px; }
}
@media (max-width: 480px) {
  .nav-link { display: none; }
  html[lang="en"] .tag { display: none; }
}
@media (max-width: 360px) {
  .showcase { --sc: .82; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wave b { animation: none; }
  .screen, .screen.on { transition: none; }
}
.no-auto .drawer, .no-auto .scrim { transition: none !important; }
.no-auto .screen.on .hint { animation: none; }

/* Tapping 首页 above the open scene drawer first closes it, as in the app. */
.screen.on.scenes:has(.press) .drawer { transform: translateY(105%); transition: transform .35s ease-in; }
.screen.on.scenes:has(.press) .scrim { opacity: 0; transition: opacity .35s; }
