:root {
  --navy-950: #06131c;
  --navy-900: #0b2130;
  --navy-800: #102b3f;
  --navy-700: #173d56;
  --cyan: #22b7d6;
  --cyan-soft: rgba(34, 183, 214, 0.14);
  --gold: #d59a23;
  --gold-bright: #f2c861;
  --gold-soft: rgba(213, 154, 35, 0.14);
  --green: #5dd39e;
  --green-soft: rgba(93, 211, 158, 0.13);
  --red: #ff7c74;
  --red-soft: rgba(255, 124, 116, 0.13);
  --text: #f4f8fb;
  --muted: #a5b8c5;
  --line: rgba(255, 255, 255, 0.11);
  --panel: rgba(11, 33, 48, 0.84);
  --panel-solid: #0c2535;
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 10%, rgba(34, 183, 214, 0.11), transparent 30rem),
    radial-gradient(circle at 85% 2%, rgba(213, 154, 35, 0.10), transparent 28rem),
    linear-gradient(145deg, var(--navy-950), #071923 55%, #051117);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid rgba(34, 183, 214, 0.55);
  outline-offset: 3px;
}

.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;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 74px;
  padding: 0.75rem clamp(1rem, 4vw, 3.5rem);
  background: rgba(6, 19, 28, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  text-decoration: none;
}

.brand-mark, .synthia-orb, .handoff-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--navy-950);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  font-weight: 800;
}

.brand-mark { width: 42px; height: 42px; border-radius: 12px; letter-spacing: -0.07em; }
.brand strong { display: block; letter-spacing: 0.11em; font-size: 0.9rem; }
.brand small { display: block; color: var(--muted); font-size: 0.76rem; }

.topbar-meta { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; justify-content: flex-end; }
.demo-chip, .network-chip, .simulation-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 30px;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.05em;
}
.demo-chip { color: var(--gold-bright); background: var(--gold-soft); border: 1px solid rgba(213,154,35,.36); }
.network-chip { color: #c9d9e3; background: rgba(255,255,255,.045); border: 1px solid var(--line); letter-spacing: 0; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); }

.shell { width: min(1440px, 100%); margin: 0 auto; padding: 2.4rem clamp(1rem, 4vw, 3.5rem) 2rem; }
.intro { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-bottom: 1.5rem; }
.intro > div { max-width: 820px; }
.eyebrow, .overline { margin: 0 0 0.45rem; color: var(--cyan); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.14em; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 0.65rem; font-size: clamp(2rem, 5vw, 4.1rem); line-height: 0.98; letter-spacing: -0.045em; }
.intro p:last-child { margin-bottom: 0; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.17rem); max-width: 760px; }

.workspace { display: grid; grid-template-columns: minmax(310px, 0.82fr) minmax(540px, 1.6fr); gap: 1rem; align-items: stretch; }
.product-panel, .passport-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.product-panel { display: flex; flex-direction: column; border-radius: 26px; overflow: hidden; }
.image-frame { position: relative; flex: 1; min-height: 510px; background: #040709; overflow: hidden; }
.image-frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 70%, rgba(6,19,28,.84)); pointer-events: none; }
.image-frame img { width: 100%; height: 100%; object-fit: cover; object-position: left center; display: block; }
.image-label { position: absolute; z-index: 1; top: 1rem; left: 1rem; padding: 0.35rem 0.55rem; color: var(--gold-bright); background: rgba(3,8,11,.8); border: 1px solid rgba(213,154,35,.35); border-radius: 6px; font-size: .72rem; letter-spacing: .1em; }
.product-caption { display: grid; grid-template-columns: 1.2fr .7fr 1fr; gap: .5rem; padding: 1rem 1.2rem 1.2rem; background: linear-gradient(180deg, #0c2535, #091b27); }
.product-caption > div { min-width: 0; }
.caption-label { display: block; color: var(--muted); font-size: .74rem; }
.product-caption strong { display: block; margin-top: .2rem; overflow-wrap: anywhere; font-size: .93rem; }

.passport-panel { border-radius: 26px; padding: clamp(1.05rem, 2.4vw, 2rem); }
.passport-heading { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.passport-heading h2 { margin-bottom: 0; font-size: clamp(1.4rem, 3vw, 2.15rem); line-height: 1.1; }
.verification-badge { display: inline-flex; align-items: center; gap: .45rem; flex: 0 0 auto; min-height: 36px; padding: .35rem .75rem; border-radius: 999px; border: 1px solid var(--line); font-size: .82rem; font-weight: 750; }
.verification-badge.is-neutral { color: var(--muted); background: rgba(255,255,255,.04); }
.verification-badge.is-valid { color: var(--green); background: var(--green-soft); border-color: rgba(93,211,158,.32); }
.verification-badge.is-invalid { color: var(--red); background: var(--red-soft); border-color: rgba(255,124,116,.35); }

.tabs { display: flex; gap: .25rem; margin: 1.45rem 0 1.35rem; padding: .25rem; border: 1px solid var(--line); border-radius: 12px; background: rgba(0,0,0,.15); }
.tab { flex: 1; min-height: 44px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-weight: 700; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--navy-950); background: var(--gold-bright); }
.tab-view { animation: reveal .24s ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.fact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; margin: 0; }
.fact-grid > div { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.fact-grid dt { color: var(--muted); font-size: .78rem; }
.fact-grid dd { margin: .2rem 0 0; font-weight: 700; overflow-wrap: anywhere; }
.composition { margin-top: 1.2rem; padding: 1.1rem; background: linear-gradient(135deg, var(--gold-soft), rgba(34,183,214,.06)); border-left: 3px solid var(--gold); }
.composition h3 { margin-bottom: .7rem; font-size: 1.15rem; }
.composition ul { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 .75rem; padding: 0; list-style: none; }
.composition li { padding: .32rem .55rem; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; color: #dce8ee; background: rgba(3,14,20,.38); font-size: .78rem; }
.source-note, .field-help { margin: 0; color: var(--muted); font-size: .78rem; }
.primary-actions, .lab-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.2rem 0; }
.primary-button, .secondary-button, .warning-button, .text-button {
  min-height: 46px;
  padding: .7rem 1rem;
  border-radius: 11px;
  font-weight: 800;
  border: 1px solid transparent;
}
.primary-button { color: var(--navy-950); background: linear-gradient(135deg, var(--gold-bright), var(--gold)); }
.primary-button:hover { filter: brightness(1.06); }
.secondary-button { color: var(--text); background: rgba(34,183,214,.09); border-color: rgba(34,183,214,.38); }
.warning-button { color: #ffe0dd; background: var(--red-soft); border-color: rgba(255,124,116,.42); }
.text-button { color: var(--muted); background: transparent; border-color: var(--line); }
.compact { min-height: 38px; padding: .45rem .75rem; font-size: .84rem; }

.event-line { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin: 1.4rem 0 0; padding: 1.1rem 0 0; border-top: 1px solid var(--line); list-style: none; }
.event-line li { display: grid; grid-template-columns: 30px 1fr; gap: .5rem; align-items: start; color: var(--muted); }
.event-line li > span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); font-size: .68rem; }
.event-line .is-complete > span { color: var(--navy-950); background: var(--green); border-color: var(--green); }
.event-line strong, .event-line small { display: block; }
.event-line strong { color: var(--text); font-size: .82rem; }
.event-line small { margin-top: .15rem; font-size: .7rem; line-height: 1.35; }

.proof-intro, .operations-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.proof-intro h3, .operations-heading h3 { margin-bottom: 0; font-size: 1.2rem; }
.simulation-tag { color: var(--cyan); background: var(--cyan-soft); border: 1px solid rgba(34,183,214,.32); white-space: nowrap; }
.field-label { display: block; margin: 1.1rem 0 .45rem; font-weight: 750; }
#certificate-record, .issue-form textarea, .issue-form select, .chat-form input {
  width: 100%;
  color: var(--text);
  background: rgba(2, 11, 16, .62);
  border: 1px solid var(--line);
  border-radius: 11px;
}
#certificate-record { padding: .85rem; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .84rem; line-height: 1.55; }
.field-help { margin-top: .4rem; }
.proof-result { display: grid; grid-template-columns: 42px 1fr; gap: .8rem; align-items: center; margin: .8rem 0; padding: .9rem; border-radius: 14px; border: 1px solid var(--line); }
.proof-result.is-neutral { background: rgba(255,255,255,.035); }
.proof-result.is-valid { background: var(--green-soft); border-color: rgba(93,211,158,.35); }
.proof-result.is-invalid { background: var(--red-soft); border-color: rgba(255,124,116,.4); }
.result-symbol { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.07); font-size: 1.35rem; }
.proof-result strong { font-size: 1.02rem; }
.proof-result p { margin: .18rem 0 0; color: var(--muted); font-size: .85rem; }
.hash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.hash-grid > div { min-width: 0; padding: .8rem; background: rgba(0,0,0,.16); border-bottom: 2px solid var(--navy-700); }
.hash-grid span { display: block; color: var(--muted); font-size: .76rem; }
.hash-grid code { display: block; margin-top: .35rem; color: #d9e9f0; font-size: .72rem; overflow-wrap: anywhere; }
.storage-map { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.storage-map h4 { margin: .28rem 0; }
.storage-map p { margin: 0; color: var(--muted); font-size: .82rem; }
.storage-kicker { font-size: .69rem; font-weight: 800; letter-spacing: .1em; }
.storage-kicker.offchain { color: var(--gold-bright); }
.storage-kicker.onchain { color: var(--cyan); }
.storage-arrow { color: var(--cyan); font-size: 1.6rem; }

.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; margin-bottom: 1.15rem; }
.metric-row > div { padding: .9rem; background: rgba(255,255,255,.045); border-top: 2px solid var(--cyan); }
.metric-row span { display: block; color: var(--muted); font-size: .78rem; }
.metric-row strong { display: block; margin-top: .1rem; font-size: 1.75rem; }
.operations-heading { align-items: end; margin-bottom: .75rem; }
.operations-heading > span { color: var(--muted); font-size: .76rem; }
.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; min-width: 550px; }
th, td { padding: .82rem .55rem; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .75rem; letter-spacing: .04em; }
td { font-size: .86rem; }
.table-status { display: inline-flex; padding: .23rem .48rem; border-radius: 999px; font-size: .72rem; font-weight: 800; }
.table-status.good { color: var(--green); background: var(--green-soft); }
.table-status.attention { color: var(--gold-bright); background: var(--gold-soft); }
.handoff-card { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: .85rem; margin-top: 1rem; padding: .9rem; border-left: 3px solid var(--cyan); background: var(--cyan-soft); }
.handoff-icon { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, var(--cyan), #98edff); }
.handoff-card p { margin: .15rem 0 0; color: var(--muted); font-size: .82rem; }

.concept-boundary { display: grid; grid-template-columns: auto repeat(4, 1fr); gap: .55rem; align-items: center; margin-top: 1rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 18px; background: rgba(11,33,48,.55); }
.concept-boundary strong { color: var(--gold-bright); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.concept-boundary span { color: var(--muted); font-size: .78rem; }
.concept-boundary strong:nth-of-type(2) { grid-column: 1; }

.synthia-fab { position: fixed; z-index: 31; right: 1.3rem; bottom: 1.3rem; display: flex; align-items: center; gap: .55rem; min-height: 50px; padding: .45rem .85rem .45rem .45rem; color: var(--navy-950); background: linear-gradient(135deg, #9deeff, var(--cyan)); border: 0; border-radius: 999px; box-shadow: 0 16px 40px rgba(0,0,0,.38); font-weight: 850; }
.synthia-fab > span:first-child { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--cyan); background: var(--navy-950); }
.synthia-panel { position: fixed; z-index: 40; top: 0; right: 0; display: grid; grid-template-rows: auto 1fr auto auto; width: min(420px, 100%); height: 100dvh; color: var(--text); background: var(--panel-solid); border-left: 1px solid var(--line); box-shadow: -28px 0 80px rgba(0,0,0,.48); transform: translateX(105%); transition: transform .24s ease; }
.synthia-panel.is-open { transform: translateX(0); }
.synthia-panel > header { display: flex; justify-content: space-between; align-items: center; padding: 1rem; border-bottom: 1px solid var(--line); }
.synthia-identity { display: flex; align-items: center; gap: .65rem; }
.synthia-orb { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #9deeff, var(--cyan)); }
.synthia-identity strong, .synthia-identity small { display: block; }
.synthia-identity small { color: var(--muted); font-size: .72rem; }
.icon-button { width: 42px; height: 42px; border: 0; border-radius: 50%; color: var(--text); background: rgba(255,255,255,.06); font-size: 1.65rem; }
.chat-log { overflow-y: auto; padding: 1rem; }
.message { max-width: 88%; margin-bottom: .7rem; padding: .72rem .82rem; border-radius: 13px; font-size: .9rem; }
.message.assistant { background: rgba(34,183,214,.1); border: 1px solid rgba(34,183,214,.2); }
.message.user { margin-left: auto; color: var(--navy-950); background: #dcecf3; }
.quick-prompts { display: flex; flex-wrap: wrap; gap: .4rem; padding: .6rem 1rem; border-top: 1px solid var(--line); }
.quick-prompts button { min-height: 36px; padding: .35rem .55rem; color: #d8e8ef; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 999px; font-size: .74rem; }
.issue-form { display: grid; gap: .42rem; padding: .8rem 1rem; border-top: 1px solid var(--line); }
.issue-form label { color: var(--muted); font-size: .75rem; }
.issue-form textarea, .issue-form select { padding: .65rem; }
.issue-form small { color: var(--muted); }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: .55rem; padding: .85rem 1rem 1rem; border-top: 1px solid var(--line); }
.chat-form input { min-height: 46px; padding: .65rem .75rem; }
.chat-form button { min-width: 68px; border: 0; border-radius: 10px; color: var(--navy-950); background: var(--gold-bright); font-weight: 850; }
.panel-scrim { position: fixed; z-index: 35; inset: 0; background: rgba(0,0,0,.55); }

footer { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1.2rem clamp(1rem,4vw,3.5rem) 5.2rem; color: var(--muted); background: rgba(0,0,0,.18); border-top: 1px solid var(--line); font-size: .76rem; }
footer p { margin: 0; }

body.presentation .intro { justify-content: flex-end; margin-bottom: .5rem; }
body.presentation .intro > div { display: none; }
body.presentation .shell { padding-top: 1rem; }
body.presentation .concept-boundary, body.presentation footer { display: none; }
body.presentation .workspace { min-height: calc(100dvh - 104px); }

@media (max-width: 1020px) {
  .workspace { grid-template-columns: 1fr; }
  .product-panel { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(220px, .65fr); }
  .image-frame { min-height: 390px; }
  .product-caption { grid-template-columns: 1fr; align-content: center; }
  .concept-boundary { grid-template-columns: repeat(2, 1fr); }
  .concept-boundary strong, .concept-boundary strong:nth-of-type(2) { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .topbar { align-items: flex-start; }
  .network-chip { display: none; }
  .shell { padding-top: 1.4rem; }
  .intro { align-items: start; flex-direction: column; gap: 1rem; }
  .product-panel { display: flex; }
  .image-frame { min-height: 360px; }
  .fact-grid { grid-template-columns: 1fr 1fr; }
  .event-line { grid-template-columns: 1fr 1fr; }
  .hash-grid, .storage-map { grid-template-columns: 1fr; }
  .storage-arrow { transform: rotate(90deg); justify-self: center; }
  .metric-row { grid-template-columns: 1fr 1fr 1fr; }
  .proof-intro, .operations-heading { flex-direction: column; align-items: flex-start; }
  .handoff-card { grid-template-columns: 42px 1fr; }
  .handoff-card button { grid-column: 1 / -1; width: 100%; }
  footer { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .brand small { display: none; }
  .brand strong { font-size: .82rem; }
  .passport-heading { flex-direction: column; }
  .tabs { overflow-x: auto; }
  .tab { min-width: 112px; }
  .fact-grid { grid-template-columns: 1fr; }
  .product-caption { grid-template-columns: 1fr 1fr; }
  .product-caption > div:first-child { grid-column: 1 / -1; }
  .event-line { grid-template-columns: 1fr; }
  .metric-row { grid-template-columns: 1fr; }
  .concept-boundary { grid-template-columns: 1fr; }
  .primary-actions > button, .lab-actions > button { width: 100%; }
  .synthia-fab > span:last-child { display: none; }
  .synthia-fab { width: 54px; height: 54px; padding: 0; justify-content: center; }
}

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