/* OpenCaller homepage. Direction: the quiet instrument, warm. Tokens first; everything else reads them. */

:root {
  color-scheme: light;
  --bg: #f3f2ef;
  --surface: #e8e6e1;
  --surface-2: #dedbd4;
  --ink: #1a1918;
  --muted: #5e5952;
  --accent: #f0a202;          /* marigold: live and ringing, one place per screen */
  --accent-deep: #8a5a00;
  --field: #1a1918;
  --field-ink: #f3f2ef;
  --field-muted: #b4ada3;
  --line-ui: #d6d0c6;
  --paper-raised: #ffffff;    /* interface fragments sit one step lighter than the page */
  --ink-hover: #33302c;
  --danger: #9f1f17;
  --accent-wash: #fdf1d8;
  --bar-quiet: #a8a197;         /* borders inside interface fragments and form fields only */

  --step-small: 0.875rem;                                  /* 14 */
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem); /* 17–19 */
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);   /* 20–26 */
  --step-head: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);     /* 28–40 */
  --step-display: clamp(2.25rem, 0.6rem + 4.4vw, 4.75rem);  /* 36–76 */

  --margin: clamp(20px, 2.4vw, 32px);
  --col: calc((100vw - 2 * var(--margin)) / 12);
  --axis: calc(var(--margin) + var(--col));                /* the page's one left edge: start of column 2 */
  --radius: 6px;
  --gap-section: clamp(112px, 11vw, 168px);

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --dur: 640ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: var(--step-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 400; letter-spacing: -0.02em; text-wrap: balance; }
p { text-wrap: pretty; }
button, input { font: inherit; color: inherit; }
input { caret-color: var(--ink); accent-color: var(--ink); }
::selection { background: var(--accent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px var(--margin) 0;
}
.wordmark img { width: 132px; height: auto; }
.wordmark { display: inline-block; transition: opacity 200ms; }
.wordmark:hover { opacity: .72; }
.top-links { display: flex; gap: 28px; font-size: var(--step-small); }
.top-links a { text-decoration: none; color: var(--muted); transition: color 160ms; }
.top-links a:hover { color: var(--ink); }
.top-links .signin { color: var(--ink); font-weight: 600; }

/* ---------- buttons, links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  background: var(--ink); color: var(--field-ink);
  border: 0; border-radius: var(--radius);
  font-weight: 600; font-size: 1rem; text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 160ms;
}
.btn:hover { background: var(--ink-hover); }
.btn:active { transform: scale(.97); }
.btn[aria-busy="true"] { cursor: progress; background: var(--ink-hover); }
[hidden] { display: none !important; }
.textlink { text-decoration: none; font-weight: 600; }
.textlink span { display: inline-block; transition: transform 200ms var(--ease-out); }
.textlink:hover span { transform: translateX(4px); }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 0;
  padding: clamp(96px, 16vh, 168px) var(--margin) 0;
  align-items: start;
}
.hero-copy { grid-column: 2 / span 6; padding-right: 40px; }
.hero h1 {
  font-size: var(--step-display);
  line-height: 1.0;
}
.hero h1 .l { display: block; }
@media (min-width: 480px) { .hero h1 .l { white-space: nowrap; } }
.lede { margin-top: 36px; max-width: 34em; }

.callme { margin-top: 44px; max-width: 560px; }
.scenario { border: 0; padding: 0; margin: 0; }
.scenario legend { padding: 0; font-weight: 600; margin-bottom: 12px; }

.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  background: var(--surface); border-radius: var(--radius);
  font-size: 1rem;
  transition: background-color 160ms, color 160ms, transform 160ms var(--ease-out);
}
.seg label:hover span { background: var(--surface-2); }
.seg label:active span { transform: scale(.97); }
.seg input:checked + span { background: var(--ink); color: var(--field-ink); }
.seg input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

.dial { display: flex; gap: 8px; margin-top: 20px; }
.phone-field {
  flex: 1; display: flex; align-items: center; min-height: 48px;
  background: var(--paper-raised); border: 1px solid var(--line-ui); border-radius: var(--radius);
  transition: border-color 160ms;
}
.phone-field:focus-within { border-color: var(--ink); }
.phone-field .cc { padding: 0 4px 0 16px; color: var(--muted); }
.phone-field input {
  flex: 1; min-width: 0; height: 46px; border: 0; background: transparent; padding: 0 16px 0 6px;
  font-size: 1.0625rem; letter-spacing: .01em; font-variant-numeric: tabular-nums;
}
.phone-field input:focus { outline: none; }
.phone-field.invalid { border-color: var(--danger); }
.note { margin-top: 12px; font-size: var(--step-small); color: var(--muted); }
.status { margin-top: 10px; font-weight: 600; min-height: 1.5em; }
.status.err { color: var(--danger); }

/* the call preview: interface fragment */
.hero-call {
  grid-column: 8 / span 4;
  margin: 8px 0 0;
  background: var(--surface);
  border-radius: 10px;
  padding: 22px 24px 20px;
  font-size: 1rem;
}
.call-head { display: flex; align-items: center; gap: 10px; }
.call-title { font-weight: 600; }
.call-meta { margin-left: auto; color: var(--muted); font-size: var(--step-small); font-variant-numeric: tabular-nums; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.turns { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; min-height: 19.5em; align-content: start; }
.turns li { display: grid; grid-template-columns: 5.2em 1fr; gap: 10px; line-height: 1.45; }
.turns .spk { color: var(--muted); font-size: var(--step-small); padding-top: 2px; }
.turns li.by-agent .spk { color: var(--ink); font-weight: 600; }
.call-foot {
  display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--line-ui); /* taste-skill-ignore: inside the data-ui call fragment */
  font-size: var(--step-small); color: var(--muted);
}
.tag {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 13px;
  background: var(--ink); color: var(--field-ink); font-size: var(--step-small); font-weight: 600; white-space: nowrap;
}
.swap { transition: opacity 700ms ease; }
.swap.out { opacity: .15; }

/* ---------- showcase ---------- */
.showcase { padding: var(--gap-section) var(--margin) 0; }
.showcase h2, .how h2, .faq h2 { font-size: var(--step-head); line-height: 1.1; }
.showcase h2 { margin-left: calc(3 * var(--col)); margin-bottom: 64px; }
.states { display: grid; gap: 56px; }
.state { display: grid; grid-template-columns: repeat(12, 1fr); align-items: center; }
.state-word {
  grid-column: 2 / span 2; text-align: right; padding-right: 32px;
  font-size: var(--step-lead); color: var(--muted);
}
.callrow {
  grid-column: 4 / span 8;
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 16px;
  background: var(--paper-raised); border: 1px solid var(--line-ui); border-radius: 10px;
  padding: 20px 22px; font-size: 1.0625rem; min-height: 96px;
}
.callrow-live { grid-template-columns: auto 1fr auto auto auto; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); font-weight: 600; font-size: var(--step-small);
}
.who { display: grid; min-width: 0; }
.who span { color: var(--muted); font-size: 0.9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .said { color: var(--ink); }
.time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: var(--step-small); }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: 14px; background: var(--accent-wash); color: var(--accent-deep); font-weight: 600; font-size: var(--step-small); }
.ring-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.wave { display: inline-flex; align-items: center; gap: 3px; height: 24px; }
.wave i { width: 3px; height: 100%; border-radius: 2px; background: var(--ink); transform: scaleY(.3); transform-origin: center; }
.mini {
  height: 34px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--line-ui);
  background: var(--bg); font-size: var(--step-small); font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background-color 160ms, transform 160ms var(--ease-out);
}
.mini:hover { background: var(--surface); }
.mini:active { transform: scale(.96); }
 @media (pointer: coarse) { .mini { height: 44px; } }
.callrow-live.finished .wave, .callrow-live.finished .mini { display: none; }

/* ---------- how it works ---------- */
.how { padding: var(--gap-section) var(--margin) 0; }
.how > h2, .exchange { margin-left: var(--col); }
.how > h2 { margin-bottom: 56px; }
.exchange { max-width: 600px; margin-bottom: 88px; }
.ask { font-size: var(--step-lead); font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.give { margin-top: 18px; background: var(--surface); border-radius: var(--radius); padding: 20px; }
.give-label, .back-label { font-size: var(--step-small); color: var(--muted); margin-bottom: 8px; text-align: left; }
.brief { font-size: 1rem; }
.back { margin: 14px 0 0 56px; background: var(--paper-raised); border: 1px solid var(--line-ui); border-radius: 10px; padding: 18px 20px; }
.spoken { font-size: 1.0625rem; }
.sched { font-size: 1.0625rem; }
.orders { width: 100%; border-collapse: collapse; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.orders caption { caption-side: top; }
.orders th { text-align: left; font-weight: 600; padding: 6px 8px 8px 0; border-bottom: 1px solid var(--line-ui); }
.orders td { padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line-ui); white-space: nowrap; }
.orders .num { text-align: right; padding-right: 0; }
.orders .more { color: var(--muted); border-bottom: 0; padding-bottom: 0; }

.exchange-last { max-width: none; margin-right: var(--col); margin-bottom: 0; }
.report {
  margin-top: 18px;
  background: var(--paper-raised); border: 1px solid var(--line-ui); border-radius: 10px; padding: 24px 26px;
}
.report-head { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between; align-items: baseline; }
.report-head span { color: var(--muted); font-size: var(--step-small); font-variant-numeric: tabular-nums; }
.bars { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 12px; }
.bars li { display: grid; grid-template-columns: 9.5em 1fr 2.5em; align-items: center; gap: 14px; font-size: 1rem; }
.b-track { height: 10px; background: var(--surface); border-radius: 5px; overflow: hidden; }
.b-fill { display: block; height: 100%; width: var(--w); background: var(--ink); border-radius: 5px; transform-origin: left; }
.b-quiet { background: var(--bar-quiet); }
.b-n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.report-note { margin-top: 20px; font-size: 1rem; color: var(--muted); max-width: 60ch; }

/* ---------- set-up: fixed output, live controls ---------- */
.setup {
  margin-top: var(--gap-section);
  display: grid; grid-template-columns: repeat(12, 1fr);
  background: var(--bg);
}
.setup-field {
  grid-column: 1 / span 6;
  position: sticky; top: 0; height: 100svh;
  background: var(--field); color: var(--field-ink);
  display: grid; place-items: center; padding: 40px var(--margin);
}
.agent {
  width: min(440px, 100%);
  background: var(--bg); color: var(--ink);
  border-radius: 12px; padding: 28px 28px 22px;
}
.agent-kind { font-size: var(--step-small); color: var(--muted); }
.agent-name { font-size: var(--step-lead); font-weight: 600; letter-spacing: -0.01em; margin-top: 2px; }
.agent-line { margin-top: 18px; padding: 16px 18px; background: var(--surface); border-radius: 8px; font-size: 1.0625rem; min-height: 7.6em; }
.agent-specs { margin: 18px 0 0; display: grid; }
.agent-specs div { display: grid; grid-template-columns: 9em 1fr; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line-ui); font-size: 0.9375rem; } /* taste-skill-ignore: inside the data-ui agent card */
.agent-specs dt { color: var(--muted); }
.agent-specs dd { margin: 0; font-weight: 600; }
.agent-specs dd.flash { animation: flash 900ms var(--ease-out); }
@keyframes flash { from { color: var(--accent-deep); } to { color: var(--ink); } }

.setup-read { grid-column: 8 / span 4; padding: 72px 0 12vh; }
.setup-read h2 { font-size: var(--step-head); line-height: 1.1; }
.cap { min-height: 50vh; padding-top: 18vh; max-width: 44ch; }
.cap:first-of-type { padding-top: 12vh; }
.cap-title { font-size: var(--step-lead); line-height: 1.25; letter-spacing: -0.01em; font-weight: 600; margin-bottom: 12px; }
.cap .seg, .cap .stepper, .cap .toggle { margin-top: 22px; }

.stepper { display: inline-flex; align-items: center; gap: 12px; }
.step-btn {
  width: 44px; height: 44px; border-radius: var(--radius); border: 0; background: var(--surface);
  font-size: 1.25rem; cursor: pointer; transition: background-color 160ms, transform 160ms var(--ease-out);
}
.step-btn:hover { background: var(--surface-2); }
.step-btn:active { transform: scale(.94); }
.step-btn:disabled { opacity: .4; cursor: default; }
.stepper output { min-width: 1.2em; text-align: center; font-size: var(--step-lead); font-weight: 600; font-variant-numeric: tabular-nums; }
.step-unit { color: var(--muted); margin-right: 4px; }

.toggle { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; position: relative; min-height: 44px; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track { width: 46px; height: 28px; border-radius: 14px; background: var(--surface-2); position: relative; transition: background-color 200ms; flex: none; }
.toggle-knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--paper-raised); transition: transform 240ms var(--ease-out); }
.toggle input:checked + .toggle-track { background: var(--ink); }
.toggle input:checked + .toggle-track .toggle-knob { transform: translateX(18px); }
.toggle input:focus-visible + .toggle-track { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---------- questions ---------- */
.faq {
  padding: var(--gap-section) var(--margin) 0;
  display: grid; grid-template-columns: repeat(12, 1fr);
}
.faq h2 { grid-column: 2 / span 3; padding-right: 24px; }
.faq-text { grid-column: 5 / span 7; columns: 2; column-gap: 56px; }
.faq-text p { break-inside: avoid; margin-bottom: 22px; font-size: 1.0625rem; line-height: 1.55; max-width: 40ch; }
.faq-text strong { font-weight: 600; }

/* ---------- close ---------- */
.close { padding: 22svh var(--margin) 18svh calc(var(--axis)); }
.close-line { font-size: var(--step-lead); line-height: 1.3; letter-spacing: -0.01em; max-width: 26ch; }
.close-actions { display: flex; align-items: center; gap: 28px; margin-top: 28px; flex-wrap: wrap; }

/* ---------- footer ---------- */
.foot {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline;
  padding: 0 var(--margin) 30px; font-size: var(--step-small); color: var(--muted);
}
.foot-links { display: flex; gap: 24px; }
.foot-links a { color: var(--ink); text-decoration: none; }
.foot-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.foot-year { justify-self: end; }

/* ---------- motion ---------- */
.js [data-in] > * {
  opacity: 0; transform: translateY(22px);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.js [data-in].in > * { opacity: 1; transform: none; }
.js .b-fill { transform: scaleX(0); transition: transform 1100ms var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms + 200ms); }
.js .in .b-fill { transform: scaleX(1); }
.wave i { animation: wave 1.1s ease-in-out 4; }
.wave i:nth-child(2) { animation-delay: -.9s; } .wave i:nth-child(3) { animation-delay: -.4s; }
.wave i:nth-child(4) { animation-delay: -.7s; } .wave i:nth-child(5) { animation-delay: -.2s; }
.wave i:nth-child(6) { animation-delay: -.55s; } .wave i:nth-child(7) { animation-delay: -.15s; }
@keyframes wave { 50% { transform: scaleY(1); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-in] > * { transform: none; transition: opacity 200ms linear; }
  .js .b-fill { transform: none; transition: none; }
  .wave i { animation: none; }
  .wave i { transform: scaleY(.6); }
  .swap { transition: none; }
}

/* ---------- tablet ---------- */
@media (max-width: 1100px) {
  .hero-copy { grid-column: 1 / span 7; }
  .hero-call { grid-column: 8 / span 5; }
  .showcase h2, .how > h2, .exchange { margin-left: 0; }
  .state-word { grid-column: 1 / span 2; padding-right: 20px; }
  .callrow { grid-column: 3 / span 10; }
  .setup-read { grid-column: 7 / span 6; padding-left: 32px; padding-right: var(--margin); }
  .setup-field { grid-column: 1 / span 6; }
  .faq h2 { grid-column: 1 / -1; margin-bottom: 40px; }
  .faq-text { grid-column: 1 / -1; }
  .close { padding-left: var(--margin); }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 72px; }
  .hero-copy, .hero-call { grid-column: 1; padding-right: 0; }
  .hero-call { margin-top: 56px; }
  .state { grid-template-columns: 1fr; }
  .state-word { grid-row: 2; grid-column: 1; text-align: left; padding: 10px 0 0; font-size: var(--step-body); }
  .callrow { grid-column: 1; }
  .setup { grid-template-columns: 1fr; }
  .setup-field { grid-column: 1; order: 2; position: static; height: auto; padding: 40px var(--margin); }
  .setup-read { order: 1; }
  .agent { padding: 18px 20px 12px; }
  .agent-line { min-height: 0; margin-top: 10px; padding: 12px 14px; font-size: 1rem; }
  .agent-specs { margin-top: 8px; }
  .agent-specs div { padding: 7px 0; grid-template-columns: 8em 1fr; font-size: 0.875rem; }
  .agent-name { font-size: 1.125rem; }
  .setup-read { grid-column: 1; padding: 0 var(--margin) 64px; }
  .cap { min-height: 0; padding-top: 64px; }
  .cap:first-of-type { padding-top: 40px; }
  .faq-text { columns: 1; }
  .faq-text p { max-width: none; }
}

/* ---------- phone ---------- */
@media (max-width: 560px) {
  .top { padding-top: 22px; }
  .wordmark img { width: 116px; }
  .top-links a:not(.signin) { display: none; }
  .hero { padding-top: 64px; }
  .lede { margin-top: 24px; }
  .callme { margin-top: 32px; }
  .seg span { padding: 0 14px; font-size: 0.9375rem; }
  .dial { flex-direction: column; }
  .dial .btn { width: 100%; }
  .turns { min-height: 24em; }
  .callrow { grid-template-columns: auto 1fr auto; padding: 14px; gap: 12px; }
  .callrow .time { display: none; }
  .callrow-live { grid-template-columns: auto 1fr auto; }
  .callrow-live .mini { grid-column: 1 / -1; justify-self: start; }
  .who span { white-space: normal; }
  .back { margin-left: 0; }
  .give { padding: 16px; }
  .orders th:nth-child(3), .orders td:nth-child(3) { display: none; }
  .bars li { grid-template-columns: 7.5em 1fr 2em; gap: 10px; font-size: 0.9375rem; }
  .report { padding: 18px; }
  .exchange { margin-bottom: 64px; }
  .foot { grid-template-columns: 1fr; gap: 8px; padding-bottom: 24px; }
  .foot-year { justify-self: start; }
  .close { padding-top: 16svh; padding-bottom: 14svh; }
}
