/* Try Ripple. Colours, type and radii from the Pebble design system
   (design-system/tokens/*.css in Ripple). */
:root {
  --cyan-950: #083344; --cyan-900: #0d3f4f; --cyan-800: #155e75;
  --emerald-700: #047857; --emerald-600: #059669; --emerald-500: #10b981; --emerald-50: #ecfdf5;
  --teal-700: #0f766e; --teal-600: #0d9488; --teal-300: #5eead4;
  --stone-50: #fafaf9; --stone-100: #f5f5f4; --stone-200: #e7e5e4; --stone-400: #a8a29e;
  --stone-500: #78716c; --stone-600: #57534e;
  --white: #ffffff;
  --text-on-dark-body: #c3d0d6;
  --surface-deep-card: #11455a;
  --border-card: #edeae6;
  --border-on-dark: rgba(255, 255, 255, 0.12);
  --tag-bg: #e6f5ef;
  --gradient-deep: linear-gradient(180deg, #14586c 0%, #0d3f4f 42%, #083344 100%);
  --gradient-button: linear-gradient(180deg, #0aa06d 0%, #059669 100%);
  --focus-ring: 0 0 0 3px rgba(45, 212, 191, 0.45);
  --sans: "Plus Jakarta Sans", system-ui, sans-serif;
  --serif: "Lora", Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--stone-50); color: var(--stone-600); font: 17px/1.6 var(--serif); }
a { color: var(--emerald-600); }
a:hover { color: var(--emerald-700); }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 6px; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

h1, h2, h3, .eyebrow, button, label, .count, .chat-bar, .site-header { font-family: var(--sans); }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--teal-600); display: flex; align-items: center; gap: .75rem; }
.eyebrow::before { content: ""; width: 2rem; height: 1px; background: currentColor; opacity: .9; }

.site-header {
  background: var(--cyan-800); display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px;
}
.logo { height: 26px; display: block; }
.header-link { color: var(--white); text-decoration: none; font: 500 15px var(--sans); background: none; border: 0; cursor: pointer; }
.header-link:hover { color: var(--teal-300); }

/* Hero: the demo sits at the top */
.hero { background: var(--gradient-deep); color: var(--text-on-dark-body); position: relative; overflow: hidden; padding: clamp(32px, 5vw, 56px) 0 clamp(40px, 6vw, 72px); }
.hero .eyebrow { color: var(--teal-300); }
.hero h1 { color: var(--white); font-size: clamp(28px, 4vw, 44px); line-height: 1.15; letter-spacing: -.02em; margin: 10px 0 12px; max-width: 24ch; }
.hero h1 em { font-family: var(--serif); font-weight: 400; color: var(--teal-300); }
.hero .lede { margin-bottom: 24px; }
.hero .app { position: relative; color: var(--stone-600); box-shadow: 0 24px 60px rgba(8, 51, 68, .35); }
.lede { max-width: 58ch; font-size: 19px; }

/* How it works */
.how { padding: clamp(48px, 7vw, 88px) 16px; }
.how h2 { color: var(--cyan-900); font-size: clamp(26px, 3.4vw, 38px); line-height: 1.15; letter-spacing: -.02em; margin: 10px 0 12px; max-width: 22ch; }
.how h2 em { font-family: var(--serif); font-weight: 400; color: var(--teal-700); }
.rings { position: absolute; right: -140px; top: -140px; width: 440px; height: 440px; fill: none; stroke: var(--teal-300); stroke-width: 1; pointer-events: none; }
.rings circle:nth-child(1) { stroke-opacity: .32; } .rings circle:nth-child(2) { stroke-opacity: .22; }
.rings circle:nth-child(3) { stroke-opacity: .14; } .rings circle:nth-child(4) { stroke-opacity: .07; }

.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 32px 0 28px; }
.step { background: var(--surface-deep-card); color: var(--text-on-dark-body); border: 1px solid var(--border-on-dark); border-radius: 16px; padding: 18px; opacity: .4; animation: light 10s infinite; }
.step:nth-child(2) { animation-delay: 2.5s; } .step:nth-child(3) { animation-delay: 5s; } .step:nth-child(4) { animation-delay: 7.5s; }
@keyframes light { 0%, 3% { opacity: .4; } 8%, 25% { opacity: 1; border-color: var(--teal-300); } 30%, 100% { opacity: .4; } }
.step .n { font: 700 12px var(--sans); color: var(--teal-300); }
.step h3 { color: var(--white); font-size: 17px; margin: 6px 0; }
.step p { font-size: 15px; line-height: 1.5; }


.pill { display: inline-flex; gap: 8px; align-items: center; background: var(--gradient-button); color: var(--white); border: 0; border-radius: 999px; padding: 13px 24px; font: 700 16px var(--sans); cursor: pointer; text-decoration: none; transition: background .15s ease; }
.pill:hover { background: var(--emerald-500); color: var(--white); }
.pill:active { transform: translateY(1px); }
.pill:disabled { opacity: .6; cursor: progress; }
.pill.small { padding: 10px 18px; font-size: 14px; }
.note { font-size: 14px; margin-top: 10px; }
.error { color: #b91c1c; font: 500 14px var(--sans); margin-top: 10px; }
.turnstile:empty { display: none; }

/* Chat */
.app { display: grid; grid-template-columns: 250px 1fr; background: var(--white); border: 1px solid var(--border-card); border-radius: 24px; overflow: hidden; }
.side { background: var(--stone-100); padding: 22px; font-size: 15px; }
.hero .side .eyebrow { color: var(--teal-700); }
.side h3 { color: var(--cyan-900); font-size: 14px; margin: 16px 0 6px; }
.dots { list-style: none; }
.dots li { padding: 3px 0; }
.dots li::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--emerald-600); margin-right: 9px; vertical-align: middle; }

.chat { display: flex; flex-direction: column; gap: 14px; padding: 20px; background: var(--stone-50); min-height: 440px; }
.chat-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--cyan-900); font-size: 15px; flex-wrap: wrap; }
.disclosure { display: block; color: var(--stone-500); font-size: 13px; font-weight: 500; }
.count { background: var(--tag-bg); color: var(--teal-700); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.log { display: flex; flex-direction: column; gap: 12px; flex: 1; overflow-y: auto; max-height: 60vh; }
.msg { max-width: 88%; padding: 12px 15px; border-radius: 16px; font-size: 16px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.welcome { white-space: normal; }
.msg p + p { margin-top: 8px; }
.msg.me { align-self: flex-end; background: var(--cyan-800); color: var(--white); font-family: var(--sans); font-size: 15px; }
.msg.bot { background: var(--white); border: 1px solid var(--border-card); }
.msg.pending { color: var(--stone-500); font-style: italic; }
.sources { margin-top: 10px; font: 13px var(--sans); }
.sources summary { cursor: pointer; color: var(--teal-700); font-weight: 500; }
.sources ul { margin: 6px 0 0 18px; color: var(--stone-600); }

.starters { display: flex; flex-wrap: wrap; gap: 8px; }
.ghost { border: 1px solid var(--stone-200); background: var(--white); color: var(--cyan-900); border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 500; cursor: pointer; }
.ghost:hover { border-color: var(--teal-600); }
.composer { display: flex; gap: 8px; align-items: flex-end; background: var(--white); border: 1px solid var(--stone-200); border-radius: 20px; padding: 8px 8px 8px 16px; }
.composer textarea { flex: 1; border: 0; resize: none; font: 16px var(--serif); background: transparent; color: var(--stone-600); padding: 6px 0; }
.composer textarea:focus { outline: none; }

/* Gate: a pop-up */
.gate { border: 0; padding: 0; background: transparent; width: min(920px, calc(100% - 32px)); max-height: calc(100% - 32px); margin: auto; overflow: auto; }
.gate::backdrop { background: rgba(8, 51, 68, .55); }
.gate .close { position: absolute; top: 12px; right: 16px; background: none; border: 0; font: 400 28px/1 var(--sans); color: var(--stone-500); cursor: pointer; padding: 4px 8px; }
.gate .close:hover { color: var(--cyan-900); }
.gate-card { background: var(--white); border-radius: 24px; padding: clamp(28px, 4vw, 44px); display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.gate-card p + p { margin-top: 10px; }
.gate h2 { color: var(--cyan-900); font-size: clamp(24px, 3vw, 30px); line-height: 1.2; margin: 8px 0 12px; letter-spacing: -.01em; }
.gate form { display: flex; flex-direction: column; gap: 8px; }
.gate label { font-size: 14px; font-weight: 500; color: var(--cyan-900); }
.gate input[type=email], .gate input[type=text] { border: 1px solid var(--stone-200); border-radius: 12px; padding: 11px 14px; font: 16px var(--serif); background: var(--stone-50); margin-bottom: 6px; }
.optional { color: var(--stone-400); font-weight: 400; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400 !important; line-height: 1.4; }
.check input { margin-top: 3px; accent-color: var(--emerald-600); }
.gate .pill { align-self: flex-start; margin-top: 8px; }
.done h3 { color: var(--cyan-900); font-size: 22px; margin-bottom: 6px; }
.done .pill { margin-top: 14px; }

.site-footer { padding: 24px 16px 40px; font: 14px var(--sans); color: var(--stone-500); }

@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr 1fr; }
  .app { grid-template-columns: 1fr; }
  .side { order: 2; }
  .gate-card { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .steps { grid-template-columns: 1fr; }
  .msg { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .step { animation: none; opacity: 1; }
  * { transition: none !important; }
}
