:root {
  --wall: #faf4f0;
  --surface: #ffffff;
  --muted: #f3e9e3;
  --line: #ecdcd5;
  --rosa: #d8456b;
  --rosa-dark: #b92e54;
  --marigold: #ec9420;
  --green: #2f7d5f;
  --cobalt: #2b54a8;
  --ink: #2a211f;
  --secondary: #705f59;
  --shadow: rgba(142, 34, 70, 0.12);
  --radius: 18px;
  --display: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--wall);
  font-family: var(--body);
}

button, input, a { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

a { color: inherit; }

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 54px);
  background: rgba(250, 244, 240, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 11px;
}

.journey-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.journey-switch a {
  padding: 8px 13px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--secondary);
}

.journey-switch a[aria-current="page"] {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 4px var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--rosa);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--display);
  letter-spacing: -0.035em;
}

h1 { font-size: clamp(38px, 5vw, 66px); line-height: 0.98; }
h2 { font-size: clamp(27px, 3vw, 38px); line-height: 1.08; }
h3 { font-size: 20px; line-height: 1.15; }

p { margin: 0; line-height: 1.55; }

.lede {
  max-width: 680px;
  color: var(--secondary);
  font-size: clamp(18px, 2vw, 22px);
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 800;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.button:hover { transform: translateY(-1px); }
.button:focus-visible, .copy-button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 3px solid rgba(43, 84, 168, 0.32);
  outline-offset: 3px;
}

.button.primary { color: white; background: var(--rosa); }
.button.primary:hover { background: var(--rosa-dark); }
.button.secondary { color: var(--rosa); background: var(--surface); border-color: var(--rosa); }
.button.quiet { color: var(--ink); background: var(--muted); border-color: var(--line); }
.button.full { width: 100%; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 3px 10px var(--shadow);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--green);
  background: #e9f4ef;
  font-size: 12px;
  font-weight: 800;
}

.tag::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.note {
  padding: 14px 16px;
  border-left: 4px solid var(--marigold);
  border-radius: 8px 14px 14px 8px;
  background: #fff4df;
  color: #573708;
  font-size: 14px;
  line-height: 1.5;
}

.fine-print { color: var(--secondary); font-size: 13px; line-height: 1.45; }

/* Entry page */
.entry {
  width: min(1120px, calc(100% - 36px));
  margin: auto;
  padding: 72px 0;
}

.entry-header { max-width: 830px; margin-bottom: 42px; }
.entry-header .lede { margin-top: 22px; }

.entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.entry-card {
  min-height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 36px;
  padding: clamp(24px, 4vw, 42px);
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.entry-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px var(--shadow); }
.entry-card h2 { margin: 12px 0; }
.entry-card p { color: var(--secondary); }
.entry-meta { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.entry-meta strong { color: var(--rosa); }

/* Web journey */
.web-layout {
  width: min(1240px, calc(100% - 38px));
  margin: 0 auto;
  padding: 34px 0 72px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: clamp(32px, 6vw, 86px);
  align-items: start;
}

.web-intro h1 { font-size: clamp(38px, 4vw, 54px); }
.web-intro .lede { margin: 16px 0 24px; }
.setup-choice { padding: 24px; margin: 0 0 28px; }
.setup-choice .step-head { align-items: start; }
.setup-choice h2 { font-size: clamp(24px, 3vw, 34px); }
.setup-choice > p { margin: 14px 0 20px; color: var(--secondary); }
.setup-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.setup-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-height: 160px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--wall);
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.setup-option:hover { border-color: var(--rosa); background: #fff; }
.setup-option:focus-visible { outline: 3px solid rgba(43, 84, 168, 0.32); outline-offset: 3px; }
.setup-option strong { font: 700 20px var(--display); }
.setup-option span { color: var(--secondary); font-size: 14px; line-height: 1.45; }
.setup-option b { margin-top: auto; color: var(--rosa); font-size: 14px; }
.setup-option--codex { cursor: default; background: #fff; }
.codex-steps { display: grid; gap: 14px; width: 100%; margin: 4px 0 0; padding-left: 22px; }
.codex-steps li { padding-left: 2px; color: var(--secondary); font-size: 14px; line-height: 1.45; }
.codex-steps li::marker { color: var(--rosa-dark); font-weight: 800; }
.codex-steps li span { display: block; margin-bottom: 8px; }
.codex-steps .codex-step-action { width: auto; min-height: 34px; padding: 6px 13px; border-radius: 999px; font-size: 12px; font-weight: 800; box-shadow: 0 2px 5px var(--shadow); }
.codex-step-action--primary { color: white; background: var(--rosa); }
.codex-step-action--primary:hover { background: var(--rosa-dark); }
.codex-step-action--secondary { color: var(--rosa-dark); background: #fff; border-color: #e9bbca; }
.codex-step-action--secondary:hover { background: #fff5f8; }
.setup-preview-link { margin-top: auto; color: #948783; font-size: 12px; font-weight: 500; text-decoration: none; }
.setup-preview-link:hover { color: var(--rosa-dark); text-decoration: underline; }
.setup-option small { color: var(--secondary); font-size: 12px; line-height: 1.4; }
.route-preview { display: grid; gap: 18px; padding: 18px; }
.route-preview h2 { max-width: 390px; }
.route-preview p { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--muted); color: var(--secondary); }
.route-preview strong { color: var(--ink); }
body[data-setup-mode="choose"] .requirements,
body[data-setup-mode="choose"] .web-steps,
body[data-setup-mode="choose"] .troubleshooting,
body[data-setup-mode="manual"] .setup-choice { display: none; }
.requirements { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.requirement {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--secondary);
  font-size: 13px;
  font-weight: 700;
}

.web-steps { display: grid; gap: 14px; }

.web-step {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.66);
}

.web-step[aria-current="step"] {
  background: var(--surface);
  border-color: rgba(216, 69, 107, 0.55);
  box-shadow: 0 4px 14px var(--shadow);
}

.step-head { display: flex; align-items: center; gap: 14px; }
.step-number {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--muted);
  color: var(--secondary);
  font-family: var(--display);
  font-weight: 800;
}

.web-step[aria-current="step"] .step-number { color: white; background: var(--rosa); }
.web-step[data-complete="true"] .step-number { color: white; background: var(--green); }
.web-step .step-body { display: none; padding: 18px 0 0 50px; }
.web-step[aria-current="step"] .step-body { display: grid; gap: 16px; }
.step-body p { color: var(--secondary); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

.web-preview {
  position: sticky;
  top: 96px;
  min-height: 590px;
  padding: 26px;
  overflow: hidden;
}

.preview-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 20px; align-items: start; }
.preview-screen { margin-top: 26px; min-height: 430px; display: grid; align-content: center; }
.preview-state { display: none; }
.preview-state.active { display: grid; gap: 16px; animation: appear 180ms ease both; }
.reference-shot { display: block; width: 100%; max-height: 590px; object-fit: contain; object-position: top center; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.reference-shot--form { max-height: 560px; }

@keyframes appear { from { opacity: 0; transform: translateY(6px); } }

.browser-card { padding: 18px; border-radius: 16px; background: var(--muted); border: 1px solid var(--line); }
.plugin-browser-head { display: grid; gap: 14px; padding-bottom: 14px; }
.plugin-browser-head small { display: block; margin-top: 5px; color: var(--secondary); }
.plugin-search { display: flex; align-items: center; gap: 8px; }
.plugin-search span { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--secondary); font-size: 12px; }
.plugin-search b { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--ink); font-size: 22px; font-weight: 400; }
.browser-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.browser-row:last-child { border-bottom: 0; }
.browser-label small { display: block; color: var(--secondary); margin-top: 4px; }
.toggle { width: 48px; height: 28px; padding: 3px; border-radius: 999px; background: var(--rosa); display: flex; justify-content: flex-end; }
.toggle::after { content: ""; width: 22px; height: 22px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.18); }

.connection-form { display: grid; gap: 14px; }
.field { display: grid; gap: 7px; }
.field label { color: var(--secondary); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.field-value { padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: white; overflow-wrap: anywhere; font-size: 14px; }
.muted-value { color: #9b8c86; }

.safe-value { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: stretch; }
.safe-value code { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--muted); color: var(--ink); overflow-wrap: anywhere; font-size: 13px; }
.copy-button { padding: 0 16px; border: 1px solid var(--rosa); border-radius: 12px; background: white; color: var(--rosa); cursor: pointer; font-weight: 800; }

.consent { text-align: center; padding: 30px 22px; }
.consent img { width: 64px; height: 64px; border-radius: 18px; margin-bottom: 16px; }
.consent p { color: var(--secondary); margin: 10px auto 22px; max-width: 330px; }
.consent-links { margin-top: 14px; display: flex; justify-content: center; gap: 18px; color: var(--rosa); font-size: 13px; font-weight: 700; }

.success-panel { text-align: center; padding: 30px 20px; }
.success-mark { width: 70px; height: 70px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 50%; background: #e9f4ef; color: var(--green); font: 800 34px var(--display); }
.prompt-box { margin-top: 20px; padding: 16px; text-align: left; border: 1px solid var(--line); border-radius: 14px; background: var(--muted); }
.prompt-box small { display: block; color: var(--secondary); margin-bottom: 8px; }

details.troubleshooting { margin-top: 24px; border-top: 1px solid var(--line); }
details.troubleshooting summary { padding: 18px 0 4px; cursor: pointer; color: var(--rosa); font-weight: 800; }
details.troubleshooting > div { padding: 12px 0 0; color: var(--secondary); font-size: 14px; }

/* Agent-readable handoff: intentionally plain, semantic, and easy to scan. */
.agent-page { background: #fff; }
.agent-brief { max-width: 840px; margin: 0 auto; padding: 48px 22px 80px; line-height: 1.6; }
.agent-brief h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.05; margin: 0 0 18px; }
.agent-brief h2 { font-size: 24px; margin: 0 0 14px; }
.agent-brief > p { margin-bottom: 20px; }
.agent-brief section { border-top: 1px solid var(--line); padding: 28px 0; }
.agent-brief section > p + p { margin-top: 12px; }
.agent-brief ol { padding-left: 24px; }
.agent-brief li { margin: 0 0 14px; }
.agent-brief dl { display: grid; grid-template-columns: minmax(160px, 220px) 1fr; gap: 10px 18px; margin: 16px 0; }
.agent-brief dt { font-weight: 800; }
.agent-brief dd { margin: 0; overflow-wrap: anywhere; }
.agent-brief code { overflow-wrap: anywhere; }
.agent-brief blockquote { margin: 18px 0; padding: 20px; border-left: 4px solid var(--rosa); background: var(--wall); }
.agent-brief a { color: var(--rosa-dark); }
.agent-status { color: #805100; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.agent-caution { margin-top: 12px; color: #805100; font-size: 14px; }

/* App companion */
.app-stage {
  min-height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: minmax(290px, 410px) minmax(300px, 480px);
  justify-content: center;
  align-items: center;
  gap: clamp(36px, 7vw, 100px);
  padding: 42px 22px 64px;
}

.app-explainer h1 { font-size: clamp(38px, 5vw, 60px); }
.app-explainer .lede { margin: 20px 0 28px; }
.principles { display: grid; gap: 12px; }
.principle { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; }
.principle strong { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--rosa); font-size: 13px; }
.principle p { color: var(--secondary); font-size: 14px; }

.phone {
  width: min(100%, 390px);
  height: min(780px, calc(100vh - 110px));
  min-height: 650px;
  margin: auto;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  border: 9px solid var(--ink);
  border-radius: 44px;
  background: var(--wall);
  box-shadow: 0 24px 70px rgba(42, 33, 31, 0.23);
}

.phone-status { display: flex; justify-content: space-between; padding: 12px 22px 7px; font-size: 12px; font-weight: 800; }
.phone-nav { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding: 8px 14px 13px; border-bottom: 1px solid var(--line); }
.phone-nav button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--surface); color: var(--ink); font-size: 22px; cursor: pointer; }
.phone-nav h2 { text-align: center; font-size: 18px; }
.phone-content { overflow: auto; padding: 18px 16px 30px; }
.phone-content::-webkit-scrollbar { width: 0; }
.phone-footer { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 10px 12px 16px; border-top: 1px solid var(--line); background: rgba(255,255,255,.92); }
.phone-footer span { text-align: center; color: var(--secondary); font-size: 10px; font-weight: 700; }
.phone-footer span:last-child { color: var(--rosa); }

.app-screen { display: none; }
.app-screen.active { display: block; animation: appear 180ms ease both; }
.app-screen h1 { font-size: 30px; line-height: 1.05; }
.app-screen .intro { margin: 10px 0 18px; color: var(--secondary); }
.computer-callout { padding: 18px; margin: 20px 0; border-radius: var(--radius); color: white; background: var(--cobalt); }
.computer-callout strong { display: block; font: 700 20px var(--display); margin-bottom: 5px; }
.computer-callout p { color: rgba(255,255,255,.86); font-size: 14px; }
.app-checklist { margin: 18px 0; display: grid; gap: 10px; }
.app-check { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.app-check span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--muted); color: var(--secondary); font-size: 12px; font-weight: 800; }
.app-check p { font-size: 14px; }
.app-check p small { display: block; color: var(--secondary); margin-top: 2px; }
.app-card { padding: 18px; margin: 14px 0; }
.app-card h3 { margin-bottom: 8px; }
.app-card p { color: var(--secondary); font-size: 14px; }
.app-card .button { margin-top: 14px; }
.app-progress { display: flex; gap: 6px; margin: 4px 0 18px; }
.app-progress span { height: 5px; flex: 1; border-radius: 999px; background: var(--line); }
.app-progress span.done { background: var(--rosa); }
.safe-label { margin: 12px 0 8px; color: var(--green); font-size: 12px; font-weight: 800; }
.app-value { padding: 13px; border-radius: 12px; background: var(--muted); border: 1px solid var(--line); overflow-wrap: anywhere; font-size: 12px; line-height: 1.45; }
.modal-backdrop { position: absolute; inset: 0; display: none; place-items: end center; padding: 18px; background: rgba(42,33,31,.3); }
.modal-backdrop.open { display: grid; }
.share-sheet { width: 100%; padding: 22px; border-radius: 24px; background: var(--surface); box-shadow: 0 14px 40px rgba(0,0,0,.18); }
.share-sheet h3 { margin-bottom: 8px; }
.share-sheet p { color: var(--secondary); font-size: 14px; margin-bottom: 18px; }
.share-actions { display: grid; gap: 9px; }
.phone-wrap { position: relative; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  transform: translate(-50%, 20px);
  padding: 11px 15px;
  border-radius: 999px;
  color: white;
  background: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
  font-size: 13px;
  font-weight: 700;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1120px) {
  .web-layout { width: min(900px, calc(100% - 38px)); grid-template-columns: 1fr; }
  .web-preview { position: relative; top: 0; min-height: auto; }
}

@media (max-width: 900px) {
  .app-stage { grid-template-columns: 1fr; }
  .app-explainer { text-align: center; max-width: 620px; margin: auto; }
  .principles { text-align: left; }
}

@media (max-width: 680px) {
  .topbar { padding: 11px 14px; }
  .brand span { display: none; }
  .journey-switch a { padding: 7px 10px; }
  .entry { padding: 44px 0; }
  .entry-grid { grid-template-columns: 1fr; }
  .entry-card { min-height: 280px; }
  .web-layout { width: min(100% - 24px, 1240px); padding-top: 30px; }
  .web-step .step-body { padding-left: 0; }
  .setup-choice > p { margin-left: 0; }
  .setup-options { grid-template-columns: 1fr; }
  .setup-option { min-height: 0; }
  .web-preview { padding: 18px; }
  .safe-value { grid-template-columns: 1fr; }
  .copy-button { min-height: 44px; }
  .agent-brief dl { grid-template-columns: 1fr; gap: 4px; }
  .agent-brief dd { margin-bottom: 12px; }
  .app-stage { padding-inline: 10px; }
  .app-explainer { padding-inline: 12px; }
  .phone { border-width: 0; border-radius: 0; width: 100%; height: calc(100vh - 64px); min-height: 620px; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
