/* HelloChat. Harbour-teal ink and a mint transcript bubble frame the scripted speech demo.
   An accepted phrase gets a dark highlight, and the five bars trace the rising Wake and falling End
   sound without playing either. Everything else is cool paper and quiet native-Mac detail.
   System fonts only: SF Rounded for spoken words, the system face for reading, SF Mono for labels
   and commands. Amber appears only for a mishearing match and the Opening… state. — GPT-6.1 Sol */

:root {
  --harbour: #122633;   /* ink, pills, code, footer — GPT-6.1 Sol */
  --mint: #42d4ab;      /* transcript bubble — GPT-6.1 Sol */
  --spray: #eef4f1;     /* page paper */
  --sheet: #fbfdfc;     /* native form groups */
  --tide: #4a606d;      /* secondary text */
  --amber: #f3b04b;     /* in-between: mishearing match, Opening… */
  --rule: #d0ddd7;
  --foam: #d9ebe4;      /* text on harbour */
  --display: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --gutter: clamp(18px, 4.5vw, 64px);
  --measure: 1200px;
  --focus: var(--harbour);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { background: var(--spray); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--harbour);
  background: var(--spray);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
}
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
code {
  font: 500 0.9em/1.4 var(--mono);
  padding: 0.12em 0.38em;
  border-radius: 6px;
  background: color-mix(in srgb, var(--harbour) 7%, transparent);
  overflow-wrap: anywhere;
}
kbd {
  font: 600 0.72em/1 var(--mono);
  padding: 0.28em 0.45em;
  border: 1px solid color-mix(in srgb, currentColor 40%, transparent);
  border-bottom-width: 2px;
  border-radius: 6px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.fine { color: var(--tide); font-size: 0.9375rem; }
.skip-link {
  position: absolute;
  left: 12px;
  top: -64px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--harbour);
  color: var(--spray);
}
.skip-link:focus { top: 12px; }

/* A phrase you say uses the transcript bubble's mint. — GPT-6.1 Sol */
.phrase {
  padding: 0 0.16em;
  border-radius: 0.3em;
  background: var(--mint);
  white-space: nowrap;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ---------------------------------------------------------------- header */
.topbar {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 800 1.2rem/1 var(--display);
  letter-spacing: -0.01em;
  text-decoration: none;
}
.topnav { display: flex; flex-wrap: wrap; gap: 4px clamp(12px, 2vw, 26px); font: 500 0.9375rem/1 var(--body); }
.topnav a { padding: 8px 2px; text-decoration: none; }
.topnav a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- hero */
.hero {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(16px, 3.5vw, 44px) var(--gutter) 0;
}
.hero-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "tagline tagline" "title title" "lead actions";
  gap: clamp(20px, 2.6vw, 32px) clamp(24px, 4vw, 64px);
  align-items: end;
}
.tagline {
  grid-area: tagline;
  margin: 0;
  font: 700 1.125rem/1.3 var(--display);
  color: var(--harbour);
}
.hero-head h1 {
  grid-area: title;
  max-width: 17em;
  margin: 0;
  font: 800 clamp(2.4rem, 5.4vw, 4.4rem)/1.04 var(--display);
  letter-spacing: -0.028em;
  text-wrap: balance;
}
.lead {
  grid-area: lead;
  max-width: 38ch;
  margin: 0;
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  line-height: 1.5;
}
.hero-actions { grid-area: actions; display: grid; gap: 14px; justify-items: start; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  min-height: 46px;
  padding: 0 1.2em;
  border-radius: 999px;
  background: var(--harbour);
  color: var(--spray);
  font: 700 1rem/1 var(--display);
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.button:hover { background: #1d3b4c; }
.button-quiet { background: transparent; color: var(--harbour); box-shadow: inset 0 0 0 2px var(--harbour); }
.button-quiet:hover { background: color-mix(in srgb, var(--mint) 40%, transparent); }
.needs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--tide);
  font: 500 0.8125rem/1 var(--mono);
}
.needs li { padding: 0.5em 0.75em; border: 1px solid var(--rule); border-radius: 999px; background: var(--sheet); }

/* ---------------------------------------------------------------- the bubble (signature) */
.speech {
  --r: clamp(30px, 4.2vw, 54px);
  position: relative;
  border-radius: var(--r);
  background: var(--mint);
  color: var(--harbour);
}
/* The transcript bubble's tail leans left. — GPT-6.1 Sol */
.speech::after {
  content: "";
  position: absolute;
  left: calc(var(--r) * 0.58);
  bottom: calc(var(--r) * -0.71);
  width: calc(var(--r) * 1.39);
  height: calc(var(--r) * 0.9);
  background: var(--mint);
  clip-path: polygon(28% 0, 100% 0, 0 100%);
}

.demo {
  --r: clamp(30px, 4.2vw, 54px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 300px);
  grid-template-areas: "bubble panel" "say boundary";
  column-gap: clamp(20px, 3vw, 44px);
  margin-top: clamp(32px, 4.6vw, 56px);
}
.bubble {
  grid-area: bubble;
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.4vw, 16px);
  padding: clamp(20px, 2.6vw, 32px) clamp(22px, 3.2vw, 44px);
}
.bubble-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bubble-label, .demo-tag, .cue, .listening { margin: 0; font: 600 0.8125rem/1.2 var(--mono); }
.demo-tag { padding: 0.4em 0.75em; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--harbour); }

/* Fixed height, newest line at the bottom: the transcript scrolls like a feed and never moves the page. */
.heard {
  height: calc(2 * 1.14em);
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  font: 800 clamp(1.6rem, 4vw, 3.3rem)/1.14 var(--display);
  letter-spacing: -0.02em;
}
/* 0.6 keeps faded large text at 3:1 or better on mint. */
.heard-empty { opacity: 0.6; }
.utt { display: block; transition: opacity 0.3s ease; }
.utt.old { opacity: 0.6; }
.word { transition: opacity 0.18s ease; }
.word.pending { opacity: 0; }
.word.tentative { opacity: 0.5; }
.match {
  margin: 0 -0.12em;
  padding: 0 0.12em;
  border-radius: 0.24em;
  background: transparent;
  color: inherit;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-color 0.28s ease, color 0.28s ease;
}
/* Accepted commands get a dark highlight. — GPT-6.1 Sol */
.match.is-set.match-wake,
.match.is-set.match-end { background: var(--harbour); color: var(--mint); }
.match.is-set.match-alias { background: var(--amber); }
/* Heard, but not acted on. */
.match.is-set.match-mention { outline: 0.06em dashed var(--harbour); outline-offset: -0.06em; }
.heard-note { min-height: 1.45em; margin: 0; font: 600 0.9375rem/1.45 var(--body); }

.bubble-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.meter { display: flex; align-items: center; gap: 5px; height: 38px; }
.meter span {
  width: 9px;
  height: 100%;
  border-radius: 99px;
  background: var(--harbour);
  transform: scaleY(var(--rest));
  transition: transform 0.09s linear;
}
/* Rest heights keep the five waveform bars visually distinct. — GPT-6.1 Sol */
.meter span:nth-child(1) { --rest: 0.3; --i: 0; }
.meter span:nth-child(2) { --rest: 0.67; --i: 1; }
.meter span:nth-child(3) { --rest: 1; --i: 2; }
.meter span:nth-child(4) { --rest: 0.55; --i: 3; }
.meter span:nth-child(5) { --rest: 0.33; --i: 4; }
.meter.cue-wake span { --peak: calc(0.42 + var(--i) * 0.145); animation: cue 0.56s cubic-bezier(0.2, 0.7, 0.3, 1) calc(var(--i) * 70ms) both; }
.meter.cue-end span { --peak: calc(1 - var(--i) * 0.145); animation: cue 0.56s cubic-bezier(0.2, 0.7, 0.3, 1) calc(var(--i) * 70ms) both; }
@keyframes cue {
  0%, 100% { transform: scaleY(var(--rest)); }
  40% { transform: scaleY(var(--peak)); }
}
.cue { opacity: 0; transition: opacity 0.2s ease; }
.cue::before { content: "♪ "; }
.cue.show { opacity: 1; }
.listening { margin-left: auto; display: inline-flex; align-items: center; gap: 0.5em; }
.listen-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--harbour); animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.3; } }

/* The app's own Codex Voice section, as a native grouped form. */
.voice-panel { grid-area: panel; align-self: start; }
.form-title { margin: 4px 0 8px 2px; font: 700 0.9375rem/1.2 var(--body); }
.form-group { padding: 2px 16px; border: 1px solid var(--rule); border-radius: 14px; background: var(--sheet); }
.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.28em 0.75em;
  border-radius: 999px;
  font-weight: 600;
  transition: background-color 0.25s ease;
}
.status-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; box-shadow: inset 0 0 0 1.5px currentColor; }
[data-voice="opening"] .status { background: var(--amber); }
[data-voice="opening"] .status-dot { background: var(--harbour); animation: breathe 0.9s ease-in-out infinite; }
[data-voice="on"] .status { background: var(--mint); }
[data-voice="on"] .status-dot { background: var(--harbour); }
.form-note { min-height: 2.9em; margin: 10px 0; color: var(--tide); font-size: 0.9375rem; line-height: 1.45; }
.form-event { min-height: 1.45em; margin-top: 0; padding-top: 10px; border-top: 1px solid var(--rule); color: var(--harbour); }
.form-event:empty { border-top-color: transparent; }

.say {
  grid-area: say;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: calc(var(--r) * 0.71 + 16px);
}
.say-label { margin-right: 2px; color: var(--tide); font: 600 0.8125rem/1 var(--mono); }
.say-button {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  min-height: 44px;
  padding: 0.5em 1em;
  border: 2px solid var(--harbour);
  border-radius: 999px;
  background: transparent;
  color: var(--harbour);
  font: 700 0.9375rem/1 var(--display);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.say-button:hover { background: color-mix(in srgb, var(--mint) 45%, transparent); }
.say-button.primary { font-size: 1.0625rem; background: var(--harbour); color: var(--spray); }
.say-button.primary:hover { background: #1d3b4c; }
.say-button:active, .say-button.pressed { transform: translateY(1px) scale(0.98); }
.reset {
  margin-left: auto;
  padding: 10px 6px;
  border: 0;
  background: none;
  color: var(--tide);
  font: 500 0.9375rem/1 var(--body);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}
.reset:hover { color: var(--harbour); }
.boundary { grid-area: boundary; margin-top: calc(var(--r) * 0.71 + 16px); color: var(--tide); font-size: 0.875rem; line-height: 1.5; }
.boundary p { margin: 0 0 6px; }

/* ---------------------------------------------------------------- sections */
.section {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(64px, 9vw, 120px) var(--gutter) 0;
}
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 16px clamp(24px, 4vw, 64px);
  align-items: end;
  margin-bottom: clamp(28px, 4vw, 48px);
}
.section-head h2 { margin: 0; font: 800 clamp(2rem, 4vw, 3rem)/1.04 var(--display); letter-spacing: -0.022em; }
.section-lead { max-width: 46ch; margin: 0; color: var(--tide); font-size: 1.125rem; line-height: 1.5; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(26px, 3.5vw, 44px) clamp(22px, 3vw, 40px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.steps li { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); column-gap: 14px; align-content: start; }
.step-num {
  grid-row: span 2;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--harbour);
  color: var(--mint);
  font: 800 1.05rem/1 var(--display);
}
.step-title { grid-column: 2; margin: 0.3rem 0; font: 700 1.125rem/1.3 var(--body); }
.step-text { grid-column: 2; margin: 0; color: var(--tide); }

/* Two sides of one thing, with an equal gap either side of the rule. */
.pair { display: grid; grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr); column-gap: clamp(28px, 4.5vw, 64px); }
.pair-rule { background: var(--rule); }
.pair h3 { margin: 0 0 18px; font: 800 clamp(1.5rem, 2.6vw, 2rem)/1.15 var(--display); letter-spacing: -0.015em; }
.pair ul { margin: 0; padding-left: 1.15em; }
.pair li { padding-left: 0.2em; }
.pair li + li { margin-top: 0.6em; }
.pair li::marker { color: var(--tide); }

/* README owns both reference tables; these cells wrap at phone widths too. */
.reference-scroll { overflow-x: auto; }
.reference-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.reference-table th, .reference-table td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.reference-table th:first-child, .reference-table td:first-child { width: 32%; padding-left: 0; }
.reference-table th:last-child, .reference-table td:last-child { padding-right: 0; }
.reference-table th { color: var(--tide); font-size: 0.9rem; }
.after-note { max-width: 70ch; margin: clamp(28px, 4vw, 40px) 0 0; color: var(--tide); }

.more { margin-top: clamp(32px, 4.5vw, 48px); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.more + .more { margin-top: 0; border-top: 0; }
.more > summary {
  display: flex;
  align-items: center;
  gap: 0.55em;
  padding: 16px 0;
  cursor: pointer;
  list-style: none;
  font: 700 1.0625rem/1.3 var(--body);
}
.more > summary::-webkit-details-marker { display: none; }
.more > summary::after {
  content: "";
  width: 0.45em;
  height: 0.45em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-0.15em) rotate(45deg);
  transition: transform 0.2s ease;
}
.more[open] > summary::after { transform: translateY(0.12em) rotate(-135deg); }
.more-body { max-width: 74ch; padding: 0 0 22px; }
.more-body > :first-child { margin-top: 0; }
.more-body > :last-child { margin-bottom: 0; }
.models { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 24px; margin: 18px 0; }
.models dt { font: 600 0.875rem/1.6 var(--mono); }
.models dd { margin: 0; color: var(--tide); }

.build-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.build-grid h3 { margin: 0 0 12px; font: 700 1.125rem/1.3 var(--body); }
.need-list { margin: 0; padding-left: 1.15em; }
.need-list li + li { margin-top: 0.5em; }
.code-block { overflow: hidden; border-radius: 20px; background: var(--harbour); color: var(--foam); --focus: var(--mint); }
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 6px 12px 6px 22px;
  border-bottom: 1px solid color-mix(in srgb, var(--foam) 16%, transparent);
  font: 600 0.8125rem/1 var(--mono);
}
.copy {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--foam) 40%, transparent);
  border-radius: 999px;
  background: transparent;
  color: var(--foam);
  font: 600 0.8125rem/1 var(--body);
  cursor: pointer;
}
.copy:hover { background: color-mix(in srgb, var(--foam) 12%, transparent); }
.copy[hidden] { display: none; }
.code {
  margin: 0;
  padding: 20px 22px;
  overflow-x: auto;
  border-radius: 20px;
  background: var(--harbour);
  color: var(--foam);
  font: 500 0.875rem/1.75 var(--mono);
}
.code-block .code { border-radius: 0; }
.code code { padding: 0; background: none; color: inherit; font: inherit; overflow-wrap: normal; }
.more-body .code { margin: 14px 0; }

.limit-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(28px, 4.5vw, 64px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.limit-list li { padding: 16px 0; border-top: 1px solid var(--rule); }

/* ---------------------------------------------------------------- footer */
.footer { margin-top: clamp(88px, 11vw, 150px); background: var(--harbour); color: var(--foam); --focus: var(--mint); }
.footer-inner { max-width: var(--measure); margin: 0 auto; padding: 40px var(--gutter) 48px; display: grid; gap: 10px; }
.footer p { margin: 0; font-size: 0.9375rem; }
.footer .footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 8px; font-weight: 600; }
.disclaimer { color: color-mix(in srgb, var(--foam) 72%, transparent); }

/* ---------------------------------------------------------------- 404 */
.missing {
  min-height: 100vh;
  max-width: 640px;
  margin: 0 auto;
  padding: 48px var(--gutter);
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 8px;
}
.missing .speech { --r: 34px; margin-bottom: calc(34px * 0.71 + 18px); padding: 22px 28px; }
.missing h1 { margin: 0; font: 800 clamp(2rem, 7vw, 3.2rem)/1.05 var(--display); letter-spacing: -0.02em; }
.missing p { margin: 0 0 12px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .hero-head { grid-template-columns: minmax(0, 1fr); grid-template-areas: "tagline" "title" "lead" "actions"; }
  .section-head { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .build-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .demo { grid-template-columns: minmax(0, 1fr); grid-template-areas: "bubble" "say" "panel" "boundary"; }
  .voice-panel { margin-top: 28px; }
  .boundary { margin-top: 18px; }
}
@media (max-width: 640px) {
  .topnav a:not(.external) { display: none; }
  .heard { height: calc(3 * 1.14em); }
  .steps, .limit-list { grid-template-columns: minmax(0, 1fr); }
  .pair { grid-template-columns: minmax(0, 1fr); row-gap: 28px; }
  .pair-rule { height: 1px; }
  .models { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .models dd { margin-bottom: 10px; }
  .reset { margin-left: 0; }
  .listening { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
