@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f5f8f5;
  --panel: #ffffff;
  --line: #d5dedb;
  --text: #131f2b;
  --muted: #526a60;
  --cyan: #087f4f;
  --green: #075f45;
  --amber: #e1932c;
  --red: #c23838;
  --grey: #82998d;
  --mint: #e8f3ed;
  --shadow: 0 18px 55px rgba(12, 39, 31, .08);
}

html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: "Cairo", Tahoma, sans-serif; text-align: right; }
.topbar { position: sticky; top: 0; z-index: 50; display: flex; direction: rtl; justify-content: space-between; align-items: center; gap: 28px; padding: 14px clamp(20px, 5vw, 72px); min-height: 88px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.mark { width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--green); color: #fff; }
.brand strong { color: var(--green); font-size: 17px; }
.brand small { color: var(--muted); font-size: 9px; letter-spacing: .04em; }
.main-nav { display: flex; gap: 28px; align-items: center; }
.main-nav a { color: var(--muted); font-size: 13px; text-decoration: none; }
.main-nav a:hover, .main-nav a:focus-visible { color: var(--green); }
.head-state { display: flex; align-items: center; gap: 10px; }
.status-live { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 10px; color: var(--green); font-size: 12px; background: #f7fbf9; }
.status-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
main { width: 100%; margin: 0; display: block; }
.hero { direction: ltr; min-height: 620px; padding: 64px clamp(24px, 5vw, 72px); display: grid; grid-template-columns: minmax(360px, 460px) minmax(0, 700px); justify-content: space-between; align-items: center; gap: 56px; background: var(--mint); }
.hero-copy { direction: rtl; text-align: right; }
.hero h1 { font-size: clamp(48px, 5vw, 72px); line-height: 1.08; margin: 10px 0 18px; color: var(--text); letter-spacing: -.035em; }
.hero .lead { max-width: 680px; color: var(--muted); font-size: 18px; line-height: 1.9; }
.hero-badges { display: flex; gap: 10px; justify-content: flex-start; margin: 24px 0; }
.hero-action { display: inline-flex; width: auto; text-decoration: none; padding: 14px 22px; border-radius: 12px; }
.governing-card { direction: rtl; background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 24px 28px; box-shadow: var(--shadow); }
.governing-head { display: flex; align-items: center; justify-content: space-between; }
.governing-card h2 { font-size: 25px; margin: 18px 0; }
.governing-card .hero-metrics { display: block; }
.governing-card .metric { display: flex; align-items: center; justify-content: space-between; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; padding: 12px 0; }
.governing-card .metric b { font-size: 16px; color: var(--green); }
.governing-card .metric:last-child b { color: var(--amber); }
.governing-card .metric span { font-size: 13px; color: var(--muted); }
.merkle-note { display: grid; gap: 4px; background: #f7fbf9; border-radius: 12px; padding: 12px 14px; margin-top: 8px; text-align: left; }
.merkle-note span { font-size: 10px; font-weight: 700; color: var(--green); }
.merkle-note code { font-size: 13px; color: var(--text); }
.panel { background: #fff; border-color: var(--line); color: var(--text); box-shadow: var(--shadow); }

@media (max-width: 1050px) {
  .main-nav { display: none; }
  .hero { grid-template-columns: 1fr; direction: rtl; }
  .governing-card { max-width: 680px; width: 100%; }
}

@media (max-width: 650px) {
  .topbar { min-height: 72px; padding: 12px 18px; }
  .brand strong { font-size: 14px; }
  .brand small, .head-state .pill { display: none; }
  .hero { padding: 48px 18px; min-height: auto; }
  .hero h1 { font-size: 46px; }
  .hero .lead { font-size: 16px; }
  .governing-card { padding: 20px; }
  .status-live { font-size: 11px; }
}

.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 12px; font-weight: 700; letter-spacing: 0; }
.pill { border-color: var(--line); background: #fff; }
.pill.cert { color: var(--green); border-color: #c9ded4; background: var(--mint); }
.pill.open { color: var(--amber); border-color: #efd7aa; background: #fef6e5; }
.pill.active { color: var(--green); border-color: #c9ded4; background: var(--mint); }
.pill.neutral { color: var(--muted); border-color: var(--line); background: #f7fbf9; }
.section-intro { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 28px; }
.section-intro h2 { margin: 0; color: var(--text); font-size: clamp(30px, 3vw, 42px); line-height: 1.25; }
.section-intro > p { max-width: 480px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; }

.journey-section, .verification-section, .evidence-section, .ledger-section, .explorer-section { padding: 64px clamp(24px, 5vw, 72px); }
.journey-section { background: #fff; }
.proof-rail { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; direction: ltr; }
.proof-rail article { min-height: 238px; padding: 18px 16px; display: flex; direction: rtl; flex-direction: column; align-items: flex-end; justify-content: space-between; border: 1px solid var(--line); border-radius: 16px; background: #f7fbf9; }
.proof-rail article > span { color: var(--muted); font: 600 11px/1.2 Inter, sans-serif; }
.proof-rail h3 { margin: 0; font-size: 18px; direction: ltr; }
.proof-rail p { margin: 0; color: var(--muted); font-size: 12px; }
.proof-rail b { display: inline-flex; align-items: center; gap: 6px; padding: 7px 9px; border-radius: 999px; font-size: 9px; }
.proof-rail b::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.proof-rail b.cert { color: var(--green); background: var(--mint); }
.proof-rail b.open { color: var(--amber); background: #fef6e5; }
.proof-rail b.neutral { color: var(--muted); background: #edf2ef; }
.nonpromotion { display: flex; justify-content: space-between; gap: 24px; margin-top: 18px; padding: 15px 18px; border-radius: 12px; color: var(--text); background: #fef6e5; font-size: 13px; }
.nonpromotion strong { color: var(--amber); white-space: nowrap; }

.verification-section { background: var(--bg); }
.verification-section .p2p-panel { padding: 28px; border: 0; border-radius: 24px; background: #0c271f; color: #fff; box-shadow: none; }
.verification-section .p2p-panel .eyebrow { color: #75d6a3; }
.verification-section .p2p-panel .section-head h2 { color: #fff; }
.verification-section .p2p-summary { color: #9ec4b2; font-size: 14px; }
.verification-section .metric { border-color: #1c4738; background: #103b2d; }
.verification-section .metric b { color: #fff; }
.verification-section .p2p-actions button { min-height: 42px; border-color: #286348; background: #103b2d; color: #e9f7f0; font-family: "Cairo", sans-serif; }
.verification-section .p2p-actions button:hover:not(:disabled), .verification-section .p2p-actions button:focus-visible { border-color: #75d6a3; }
.verification-section .p2p-actions .primary-action { background: #087f4f; border-color: #0c9b62; color: #fff; }
.verification-section .p2p-region { border-color: #1c4738; background: #091c17; }
.verification-section .protocol-row { border-color: #1c4738; background: #0d2d23; }
.verification-section .event-log { border-color: #1c4738; background: #071611; color: #9ec4b2; }
.verification-section .region-head span, .verification-section .region-head code { color: #9ec4b2; }
.verification-section .diagnostics-panel { margin-top: 18px; padding: 24px; border-radius: 20px; background: #fff; color: var(--text); box-shadow: none; }
.verification-section .diagnostics-panel .section-head h2 { color: var(--text); }
.verification-section .diagnostics-panel .p2p-summary { color: var(--muted); }
.verification-section .diagnostics-panel .p2p-actions button { color: var(--text); border-color: var(--line); background: #f7fbf9; }
.verification-section .diagnostics-panel .p2p-actions .primary-action { color: #fff; border-color: var(--green); background: var(--green); }

.evidence-section { background: #fff; }
.evidence-layout { display: grid; grid-template-columns: minmax(360px, .75fr) minmax(0, 1.25fr); gap: 18px; direction: ltr; }
.evidence-layout > * { direction: rtl; }
.evidence-layout .gate { padding: 26px; border-color: #edd19c; background: #fef6e5; box-shadow: none; }
.gate-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--amber); font-size: 12px; font-weight: 700; }
.evidence-layout .gate h2 { margin: 28px 0 14px; overflow-wrap: anywhere; color: var(--text); font-size: 24px; line-height: 1.35; }
.evidence-layout .gate > p { color: var(--muted); font-size: 14px; line-height: 1.9; }
.gate-rule { margin-top: 22px; padding: 14px; border: 0; border-radius: 12px; background: #fff; color: var(--text); }
.gate-rule code { white-space: normal; overflow-wrap: anywhere; }
.boundary-card { padding: 20px 24px; box-shadow: none; background: #f7fbf9; }
.boundary-card .state-grid { display: block; }
.boundary-card .state-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.boundary-card .state-card:first-child { border-top: 0; }
.boundary-card .state-card b { color: var(--text); font-size: 13px; }
.boundary-card .state-card span { display: inline-flex; padding: 6px 10px; border-radius: 999px; color: var(--amber); background: #fef6e5; font-size: 10px; font-weight: 700; text-align: left; }
.boundary-card .state-card:nth-child(-n+3) span { color: var(--green); background: var(--mint); }

.ledger-section { background: var(--bg); }
.ledger-panel, .protocol-panel, .findings-panel { padding: 24px; }
.ledger-meta .metric, .state-card, .step, .block { border-color: var(--line); background: #f7fbf9; }
.ledger-meta .metric b { color: var(--green); }
.integrity-panel { background: #f7fbf9; }
.integrity-panel.ok { border-color: #9ecab0; color: var(--green); }
.integrity-panel.bad { border-color: #e8b1b1; color: var(--red); }
.integrity-panel.warn { border-color: #edd19c; color: #7b571f; }
.block .height { color: var(--green); }
.hash { color: var(--muted); }

.explorer-section { display: grid; gap: 18px; background: #fff; }
.network-layout, .grid-layout { direction: ltr; }
.network-layout > *, .grid-layout > * { direction: rtl; }
.network { min-height: 600px; }
.network-canvas { direction: ltr; }
.node { border-color: var(--line); background: #f7fbf9; color: var(--text); text-align: left; box-shadow: 0 8px 24px rgba(12,39,31,.04); }
.node:hover, .node.selected { border-color: var(--green); box-shadow: 0 12px 30px rgba(12,39,31,.12); }
.edge { background: #9ecab0; }.edge::after { border-left-color: #9ecab0; }
.grid-tools button { border-color: var(--line); background: #f7fbf9; color: var(--text); }
.grid-wrap { border-color: var(--line); background: #f7fbf9; }
.formula { border-color: var(--line); background: #f7fbf9; }
.kv { border-color: var(--line); }.kv div { font-size: 14px; }
.pipeline { direction: ltr; }.step { direction: rtl; }.step:not(:last-child)::after { color: var(--green); }
.finding { border-color: var(--line); }.finding b { font-size: 14px; }.finding p { font-size: 13px; line-height: 1.8; }
.legend { padding: 20px 24px; }
.legend > div { font-size: 12px; }
footer { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 48px clamp(24px, 5vw, 72px); background: #0c271f; color: #9ec4b2; text-align: right; }
footer div { display: grid; gap: 4px; }footer strong { color: #fff; font-size: 20px; }footer small { font-size: 11px; }footer p { margin: 0; color: #fff; font-size: 12px; }

@media (max-width: 1180px) {
  .proof-rail { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .evidence-layout { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  .journey-section, .verification-section, .evidence-section, .ledger-section, .explorer-section { padding: 48px 18px; }
  .section-intro { align-items: start; flex-direction: column; }
  .proof-rail { display: flex; overflow-x: auto; padding-bottom: 8px; }
  .proof-rail article { min-width: 168px; }
  .nonpromotion { align-items: flex-start; flex-direction: column; }
  .p2p-grid, .diagnostic-grid, .network-layout, .grid-layout { grid-template-columns: 1fr; }
  footer { align-items: flex-start; flex-direction: column; }
}
