/* USSD-AI website. Rules and tokens: .kiro/skills/ussd-ai-ui/SKILL.md */
:root {
  --paper: #ffffff;
  --ink: #14213d;
  --muted: #3d4555;
  --label: #525b6e;
  --line: #e3e6ec;
  --line-strong: #c9ced8;
  --leaf: #0a7d4b;
  --leaf-dark: #086a3f;
  --leaf-tint: #e9f5ef;
  --signal: #ffd23f;
  --alarm: #b42318;
  --soft: #f5f7fa;
  --screen: #dcebc4;
  --display: "Archivo", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 17px/1.55 var(--body); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
main { overflow-x: clip; }
img, video, svg { display: block; max-width: 100%; }
a { color: var(--leaf); text-underline-offset: 3px; }
a:hover { color: var(--leaf-dark); }
h1, h2, h3 { font-family: var(--display); font-stretch: 112%; color: var(--ink); text-wrap: balance; margin: 0; }
p { text-wrap: pretty; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 36px); }
.nowrap { white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
.skip:hover { color: #fff; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 20px; border-radius: 8px; border: 1px solid transparent;
  font: 700 17px/1.2 var(--display); font-stretch: 105%; cursor: pointer; text-decoration: none;
  transition: background-color .15s ease-out, border-color .15s ease-out, transform .15s ease-out;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.primary { background: var(--leaf); color: #fff; }
.btn.primary:hover { background: var(--leaf-dark); color: #fff; }
.btn.plain { background: var(--paper); color: var(--ink); border-color: var(--line-strong); }
.btn.plain:hover { background: var(--soft); border-color: var(--ink); }

/* Header */
.top { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 800 21px var(--display); font-stretch: 112%; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 30px; height: 30px; }
.links { display: flex; gap: 28px; }
.links a, .code-link { color: var(--muted); text-decoration: none; font-weight: 600; }
.links a:hover, .code-link:hover { color: var(--ink); }
.code-link { display: inline-flex; align-items: center; gap: 8px; }
.code-link svg { width: 18px; height: 18px; }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 4vw, 56px); align-items: center; padding-top: clamp(28px, 5vw, 56px); padding-bottom: 40px; }
h1 { font-size: clamp(40px, 5.2vw, 68px); line-height: 1.02; font-weight: 800; letter-spacing: -0.02em; }
.lead { font-size: clamp(18px, 1.5vw, 20px); color: var(--muted); max-width: 34em; margin: 20px 0 28px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.watch { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.watch p { margin: 0 0 10px; color: var(--muted); font-size: 16px; }
.watch ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.watch button { background: none; border: 0; padding: 6px 0; min-height: 44px; font: 600 17px var(--body); color: var(--leaf); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.watch button:hover { color: var(--leaf-dark); }
.watch button[aria-current="true"] { color: var(--ink); text-decoration-thickness: 2px; }

/* Try panel: phone + guide */
.try { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: start; background: var(--leaf-tint); border-radius: 14px; padding: clamp(18px, 2.4vw, 30px); }
.try-phone { display: flex; justify-content: center; }
.guide { padding-top: 6px; min-height: 420px; }
.guide-step { margin: 0 0 6px; font-size: 15px; font-weight: 700; color: var(--leaf-dark); }
.guide-title { font-size: clamp(24px, 2.2vw, 30px); line-height: 1.12; font-weight: 800; }
.guide-text { margin: 10px 0 18px; color: var(--muted); max-width: 32em; }
.guide-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; max-width: 360px; }
.guide-actions:empty { display: none; }
.opt {
  display: flex; align-items: center; gap: 12px; text-align: left;
  min-height: 46px; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--paper); color: var(--ink); font: 600 17px/1.25 var(--body); cursor: pointer;
  transition: background-color .15s ease-out, border-color .15s ease-out;
}
.opt:hover { border-color: var(--ink); background: var(--soft); }
.opt:disabled { opacity: .55; cursor: default; }
.opt .k { flex: none; min-width: 28px; height: 28px; padding: 0 6px; display: grid; place-items: center; border-radius: 6px; background: var(--ink); color: #fff; font: 700 15px var(--display); }
.opt.primary-opt { background: var(--leaf); border-color: transparent; color: #fff; }
.opt.primary-opt:hover { background: var(--leaf-dark); }
.opt.primary-opt .k { background: #fff; color: var(--leaf-dark); }
.ask { max-width: 420px; }
.ask label { display: block; font-weight: 700; margin-bottom: 6px; }
.ask-row { display: flex; gap: 8px; }
.ask-row input {
  flex: 1; min-width: 0; min-height: 48px; padding: 10px 14px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); font: 17px var(--body);
}
.ask-row input:focus { border-color: var(--ink); outline: 3px solid var(--ink); outline-offset: 2px; }
.ask-samples-label { margin: 16px 0 8px; font-size: 15px; color: var(--muted); }
.ask-samples { display: flex; flex-direction: column; gap: 6px; }
.ask-samples button { text-align: left; background: none; border: 0; padding: 6px 0; min-height: 40px; font: 600 16px var(--body); color: var(--leaf); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.guide-tip { margin: 22px 0 0; font-size: 15px; color: var(--muted); max-width: 32em; }
.guide.is-alarm .guide-title { color: var(--alarm); }

/* Sections */
section h2 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.08; font-weight: 800; letter-spacing: -0.015em; }
.sub { color: var(--muted); max-width: 40em; margin: 12px 0 0; font-size: 18px; }
.how, .topics, .languages, .inside { padding-top: clamp(56px, 7vw, 96px); }

.steps { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 28px; }
.steps li { border-top: 2px solid var(--ink); padding-top: 16px; }
.steps .n { font: 800 34px var(--display); color: var(--leaf); }
.steps h3 { font-size: 22px; margin: 6px 0 6px; }
.steps p { margin: 0; color: var(--muted); }

.path { margin: 44px 0 0; }
.path figcaption { font-weight: 700; margin-bottom: 14px; }
.path-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.path-list li { position: relative; padding: 14px 18px 14px 0; border-top: 1px solid var(--line-strong); }
.path-list li::before { content: ""; position: absolute; top: -6px; left: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); }
.path-list li.us::before { background: var(--leaf); border-color: var(--leaf); }
.path-list b { display: block; font: 700 17px var(--display); margin-top: 6px; }
.path-list span { color: var(--muted); font-size: 15px; }

.band { position: relative; margin-top: clamp(56px, 7vw, 96px); min-height: 440px; display: flex; align-items: center; overflow: hidden; background: var(--ink) url(/static/media/market-okra.webp) center/cover; }
.band video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.band::after { content: ""; position: absolute; inset: 0; background: rgba(20, 33, 61, .66); }
.band-in { width: 100%; position: relative; z-index: 2; padding-top: 56px; padding-bottom: 56px; color: #fff; }
.band h2 { color: #fff; max-width: 15em; }
.band p { max-width: 36em; margin: 16px 0 24px; font-size: 19px; color: #f1f3f7; }
.video-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .7); background: transparent; color: #fff; font: 600 16px var(--body); cursor: pointer; }
.video-toggle:hover { background: rgba(255, 255, 255, .12); }
.video-toggle svg { width: 16px; height: 16px; }
.band-credit-unused { position: absolute; z-index: 2; right: 0; bottom: 0; margin: 0; padding: 6px 12px; font-size: 14px; color: #ffffff; background: var(--ink); border-top-left-radius: 8px; }

.topics-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 56px); margin-top: 32px; align-items: start; }
.topic-photo { margin: 0; position: sticky; top: 92px; }
.topic-photo { overflow: hidden; border-radius: 14px; }
.topic-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--soft); transition: transform .4s ease-out; }
.topics-grid:hover .topic-photo img { transform: scale(1.025); }

.topic-list { list-style: none; margin: 0; padding: 0; }
.topic-list li { padding: 22px 0; border-top: 1px solid var(--line); }
.topic-list li:last-child { border-bottom: 1px solid var(--line); }
.topic-list h3 { display: flex; align-items: center; gap: 12px; font-size: 22px; }
.topic-list h3 svg { width: 24px; height: 24px; color: var(--leaf); }
.topic-list .key { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; background: var(--ink); color: #fff; font: 800 17px var(--display); }
.topic-list p { margin: 8px 0 12px; color: var(--muted); max-width: 36em; }

.topic-list .lead-topic p { font-size: 19px; color: var(--ink); }
.ask-this { background: none; border: 0; padding: 4px 0; min-height: 44px; font: 700 17px var(--body); color: var(--leaf); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; text-align: left; }
.ask-this:hover { color: var(--leaf-dark); }

.languages { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--line-strong); }
.tabs button { min-height: 44px; padding: 8px 14px; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; background: none; font: 600 17px var(--body); color: var(--muted); cursor: pointer; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--leaf); font-weight: 700; }
.lang-panel { padding-top: 20px; display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; }
.menu-screen { margin: 0; width: 320px; max-width: 100%; min-height: 168px; padding: 12px 14px; border-radius: 10px; border: 8px solid var(--ink); background: var(--screen); color: #17300f; font: 22px/1.3 "VT323", monospace; white-space: pre-wrap; }

.inspector { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; margin-top: 28px; }
.panel { border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; background: var(--soft); min-width: 0; }
.panel h3 { font-size: 17px; margin: 0 0 10px; }
.panel pre { margin: 0; font: 14px/1.5 var(--mono); white-space: pre-wrap; word-break: break-word; min-height: 150px; color: var(--ink); }
.meter { height: 8px; border-radius: 4px; background: var(--line); margin-top: 12px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--leaf); transition: width .3s ease-out; }
.meter i.full { background: var(--alarm); }
.meta { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.sms-panel .empty { margin: 0; color: var(--muted); }
.sms-part { padding: 10px 0; border-top: 1px solid var(--line-strong); }
.sms-part:first-child { border-top: 0; padding-top: 0; }
.sms-part small { display: block; font-size: 14px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.sms-part p { margin: 0; font: 19px/1.15 "VT323", monospace; }
.rules { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 36px; }
.rules li { display: flex; gap: 12px; align-items: flex-start; }
.rules svg { width: 22px; height: 22px; flex: none; color: var(--leaf); margin-top: 2px; }
.rules p { margin: 0; color: var(--muted); }
.rules b { color: var(--ink); }

.judges { margin-top: clamp(56px, 7vw, 96px); padding: clamp(48px, 6vw, 80px) 0; background: var(--soft); border-top: 1px solid var(--line); }
.kiro-list { margin: 28px 0 0; }
.kiro-list > div { display: grid; grid-template-columns: minmax(160px, 2fr) minmax(0, 6fr) minmax(140px, 2fr); gap: 8px 28px; padding: 18px 0; border-top: 1px solid var(--line-strong); align-items: baseline; }
.kiro-list dt { font: 700 19px var(--display); }
.kiro-list dd { margin: 0; color: var(--muted); }
.kiro-list dd.link { text-align: right; font-weight: 600; }
.kiro-list a { word-break: break-word; }

.foot { padding: 32px 0 44px; border-top: 1px solid var(--line); }
.foot-main { margin: 0; }
.foot .small { margin: 10px 0 0; font-size: 14px; color: var(--muted); max-width: 54ch; }

/* Responsive */
@media (max-width: 1120px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-text { max-width: 760px; }
  .inspector { grid-template-columns: 1fr 1fr; }
  .sms-panel { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .links { display: none; }
  .steps { grid-template-columns: 1fr 1fr; gap: 24px 24px; }
  .path-list { grid-template-columns: 1fr; }
  .path-list li { border-top: 0; border-left: 1px solid var(--line-strong); padding: 0 0 18px 22px; }
  .path-list li::before { top: 4px; left: -6px; }
  .path-list b { margin-top: 0; }
  .topics-grid, .languages { grid-template-columns: minmax(0, 1fr); }
  .topic-photo { position: static; }
  .topic-photo img { aspect-ratio: 3 / 2; }
  .kiro-list > div { grid-template-columns: 1fr; }
  .kiro-list dd.link { text-align: left; }
}
@media (max-width: 720px) {
  .try { grid-template-columns: 1fr; justify-items: center; }
  .guide { min-height: 0; width: 100%; }
  .guide-actions, .ask { max-width: none; }
  .inspector, .rules { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .code-link { font-size: 0; gap: 0; }
  .code-link svg { width: 22px; height: 22px; }
  .steps { grid-template-columns: 1fr; }
  .actions .btn { width: 100%; }
  .band { min-height: 0; }
}
@media (max-width: 360px) {
  .try { padding: 10px; }
  .vphone { --ph-width: min(270px, calc(100vw - 56px)); }
  .vphone-screen { font-size: 19px; }
  .vphone-body { padding: 18px 12px 16px; }
  .vphone-key { height: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Hero entrance, once on load (Taste skill rule 5) */
@media (prefers-reduced-motion: no-preference) {
  [data-enter] > * { animation: enter .6s ease-out both; }
  [data-enter] > *:nth-child(2) { animation-delay: .12s; }
  @keyframes enter { from { opacity: 0; transform: translateY(12px); } }
}
.watch button, .ask-samples button, .ask-this { text-decoration-thickness: 1px; transition: text-decoration-thickness .15s ease-out, color .15s ease-out; }
.watch button:hover, .ask-samples button:hover, .ask-this:hover { text-decoration-thickness: 2px; }
.foot .small, .meta, .sms-part small, .guide-step { color: var(--label); }
