@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  --bg: #f6f5f0;
  --ink: #121212;
  --muted: #5b5b5b;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --card: #ffffff;
  --border: rgba(18, 18, 18, 0.1);
  --shadow: 0 22px 50px rgba(9, 20, 21, 0.1);
  --radius: 22px;
  --mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

body[data-mode="simple"] .default-only {
  display: none !important;
}

body[data-mode="default"] .simple-only {
  display: none !important;
}

.background-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(0px);
  opacity: 0.18;
  z-index: -2;
  animation: float 16s ease-in-out infinite;
}

.orb-1 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle at 30% 30%, #f59e0b, #f97316);
  top: -180px;
  right: -120px;
}

.orb-2 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle at 40% 20%, #14b8a6, #0f766e);
  bottom: -200px;
  left: -140px;
  animation-delay: -4s;
}

.grid-pattern {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.25;
  z-index: -3;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 48px 8vw 24px;
  flex-wrap: wrap;
}

.hero-text {
  max-width: 760px;
  flex: 1 1 520px;
}

.hero-copy {
  display: grid;
  gap: 16px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 12px;
}

h1 {
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  margin: 0 0 12px;
}

.subhead {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.5;
}

.subhead-alt {
  border-left: 3px solid rgba(15, 118, 110, 0.3);
  padding-left: 14px;
}

@media (min-width: 900px) {
  .hero-copy {
    grid-template-columns: 1.3fr 1fr;
    align-items: start;
    column-gap: 24px;
  }

  .hero-secondary {
    margin-top: 28px;
  }
}

.hero-card {
  background: var(--card);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  min-width: 220px;
}

.hero-stat--mode {
  align-items: start;
}

.mode-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  background: rgba(18, 18, 18, 0.03);
}

.mode-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.mode-btn.is-active {
  background: var(--accent);
  color: #ffffff;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.stat-value {
  font-size: 1.2rem;
  font-weight: 600;
}

.layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
  padding: 0 8vw 48px;
}

.panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feature-grid {
  display: grid;
  gap: 14px;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.e2e-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 0;
  flex-wrap: wrap;
}

.e2e-row--tabs {
  padding-top: 4px;
}

.e2e-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.e2e-toggle input {
  accent-color: var(--accent);
}

.e2e-status {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.e2e-status[data-tone="ok"] {
  color: #0f766e;
}

.e2e-status[data-tone="warn"] {
  color: #b45309;
}

.e2e-status[data-tone="error"] {
  color: #b91c1c;
}

.e2e-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--muted);
}

.e2e-progress {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 6px;
}

.e2e-progress-track {
  height: 8px;
  background: rgba(15, 118, 110, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.e2e-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width 0.2s ease;
}

.scenario-switch {
  display: flex;
  gap: 10px;
  margin: 6px 0 14px;
  flex-wrap: wrap;
}

.scenario-btn {
  border: 1px solid var(--border);
  background: transparent;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.scenario-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.mini {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--muted);
}

.is-hidden {
  display: none !important;
}

.preset-pills {
  display: grid;
  gap: 8px;
}

.preset-pill {
  border: 1px solid var(--border);
  background: #f9fafb;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.preset-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.4);
}

.preset-pill:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.5);
  outline-offset: 2px;
}

.preset-btn {
  border: 1px solid var(--border);
  background: #f9fafb;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.preset-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.4);
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 0.9rem;
  color: var(--muted);
}

.field input {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 1rem;
  font-family: inherit;
}

.range-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}

.range-select:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.4);
  outline-offset: 2px;
}

.primary-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 16px;
  border-radius: 999px;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.primary-btn:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.primary-btn.is-loading {
  opacity: 0.7;
  cursor: progress;
}

.primary-btn.is-loading::after {
  content: "⏳";
  margin-left: 8px;
  font-size: 0.95rem;
}

.ghost-btn {
  background: transparent;
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
}

.badge {
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent-strong);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.badge[data-tone="warn"] {
  background: rgba(245, 158, 11, 0.2);
  color: #b45309;
}

.badge[data-tone="ok"] {
  background: rgba(16, 185, 129, 0.16);
  color: #047857;
}

.results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.simple-summary {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.summary-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 6px);
  padding: 16px;
  box-shadow: 0 14px 28px rgba(9, 20, 21, 0.08);
}

.summary-card p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.summary-card h3 {
  margin: 0;
  font-size: 1.2rem;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.role-tabs {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.tab-btn {
  border: 1px solid var(--border);
  background: transparent;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.tab-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.role-view {
  display: none;
}

.role-view.active {
  display: block;
}

.flow-diagram {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  align-items: center;
}

.flow-node {
  background: #f8fafc;
  border-radius: 16px;
  padding: 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.flow-node h4 {
  margin: 0 0 6px;
}

.flow-node .tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.flow-node.client {
  border-left: 4px solid #0f766e;
}

.flow-node.server {
  border-left: 4px solid #f97316;
}

.flow-arrow {
  font-size: 1.8rem;
  text-align: center;
  color: var(--muted);
}

.trace ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.trace li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f9fafb;
  border: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--muted);
}

.trace .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.2);
}

.trace li.active {
  color: var(--ink);
  border-color: rgba(15, 118, 110, 0.35);
  background: rgba(15, 118, 110, 0.08);
}

.trace li.active .dot {
  background: var(--accent);
}

.contrib-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.contrib-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: #f9fafb;
}

.contrib-list li span {
  font-family: var(--mono);
  color: var(--muted);
}

.result-card {
  background: #f9fafb;
  border-radius: 16px;
  padding: 14px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.result-card h3 {
  margin: 6px 0 0;
  font-size: 1.4rem;
}

.result-card.highlight {
  background: rgba(15, 118, 110, 0.08);
  border-color: rgba(15, 118, 110, 0.2);
}

.steps ol {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.ciphertext {
  border-top: 1px dashed var(--border);
  padding-top: 16px;
}

.ciphertext-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.value-warn {
  color: #b45309;
  font-weight: 600;
}

.hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  border-radius: 50%;
  border: 1px solid var(--border);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  cursor: help;
  background: #f9fafb;
}

.hint-text {
  margin: 6px 0 12px;
  font-size: 0.78rem;
  color: var(--muted);
}

.mono {
  font-family: var(--mono);
  font-size: 0.82rem;
  display: block;
  word-break: break-all;
  background: #f3f4f6;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.footer {
  padding: 16px 8vw 40px;
  color: var(--muted);
  font-size: 0.85rem;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(18px);
  }
}

@media (max-width: 720px) {
  .hero {
    padding: 32px 6vw 16px;
  }

  .layout {
    padding: 0 6vw 32px;
  }
}

/* FHELAB unified product shell */
:root {
  --bg: #f3f5f2;
  --ink: #10232d;
  --muted: #5d6d75;
  --accent: #0f6e89;
  --accent-strong: #0a5870;
  --card: #fffefa;
  --border: #d6dfde;
  --shadow: 0 14px 38px rgba(26, 49, 58, 0.075);
  --radius: 18px;
  --mono: "IBM Plex Mono", monospace;
}

body { min-width: 320px; font-family: "Manrope", sans-serif; -webkit-font-smoothing: antialiased; }
.background-orb { opacity: .1; animation: none; }
.orb-1 { background: radial-gradient(circle at 30% 30%, #e78235, transparent 68%); }
.orb-2 { background: radial-gradient(circle at 40% 20%, #0f6e89, transparent 68%); }
.grid-pattern { background-size: 32px 32px; opacity: .35; }
.site-nav {
  width: min(1232px, calc(100% - 48px));
  min-height: 72px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid rgba(16, 35, 45, .12);
}
.brand { display: inline-flex; width: max-content; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 800; letter-spacing: .14em; }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: #fff; background: var(--ink); font: 700 15px/1 var(--mono); letter-spacing: 0; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { position: relative; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 650; }
.nav-links a:hover, .nav-links a.is-current { color: var(--ink); }
.nav-links a.is-current::after { content: ""; position: absolute; left: 0; right: 0; bottom: -27px; height: 2px; background: var(--accent); }
.site-nav .mode-toggle { justify-self: end; min-width: 0; padding: 4px; gap: 2px; border-radius: 11px; background: rgba(255, 254, 250, .75); }
.site-nav .mode-btn { min-height: 36px; padding: 0 13px; border-radius: 8px; }

.hero { width: min(1232px, calc(100% - 48px)); margin: 0 auto; padding: 48px 0 34px; align-items: center; flex-wrap: nowrap; }
.hero-text { max-width: none; }
.hero-copy { gap: 22px; }
.eyebrow { margin: 0 0 13px; color: var(--accent); font: 600 10px/1.4 var(--mono); letter-spacing: .13em; }
h1 { margin-bottom: 18px; font-size: clamp(38px, 5vw, 64px); line-height: 1.02; letter-spacing: -.055em; }
.subhead { max-width: 680px; margin: 0; font-size: 15px; line-height: 1.75; }
.subhead-alt { padding: 16px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 0 11px 11px 0; background: rgba(255, 254, 250, .66); font-size: 12px; }
.hero-card { min-width: 290px; padding: 22px; gap: 13px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.hero-stat { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.hero-stat:last-child { padding-bottom: 0; border-bottom: 0; }
.stat-label { font: 500 9px/1.4 var(--mono); letter-spacing: .08em; }
.stat-value { color: var(--accent); font: 500 13px/1.2 var(--mono); }

.layout { width: min(1280px, 100%); margin: 0 auto; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding: 0 24px 56px; align-items: start; }
.panel { padding: 24px; gap: 16px; box-shadow: var(--shadow); }
.panel-header h2 { margin: 0; font-size: 19px; letter-spacing: -.025em; }
.scenario-switch { padding: 4px; border: 1px solid var(--border); border-radius: 11px; background: #f3f6f4; }
.scenario-btn { min-height: 38px; border-radius: 8px; }
.scenario-btn.active { color: #fff; background: var(--accent); }
.feature-grid { gap: 12px; }
.feature-grid label { color: var(--ink); font-size: 12px; font-weight: 700; }
.feature-grid input, .feature-grid select { min-height: 45px; border-color: var(--border); border-radius: 10px; background: #fff; }
.preset-btn, .ghost-btn { min-height: 40px; border-radius: 10px; border-color: var(--border); background: #fff; }
.primary-btn { min-height: 48px; border-radius: 11px; background: var(--accent); box-shadow: 0 8px 18px rgba(15, 110, 137, .16); }
.primary-btn:hover { background: var(--accent-strong); }
.results, .simple-summary { gap: 10px; }
.result-card, .summary-card { border: 1px solid var(--border); border-radius: 12px; background: #f7f9f7; }
.result-card.highlight { border-color: #c5dcdd; background: #edf5f4; }
.result-card.highlight h3 { color: var(--accent); }
.badge { border-radius: 999px; }
.role-tabs { padding: 4px; border: 1px solid var(--border); border-radius: 11px; background: #f3f6f4; }
.tab-btn { min-height: 38px; border-radius: 8px; }
.tab-btn.active { color: #fff; background: var(--accent); }
.role-view, .accuracy-card { border-color: var(--border); border-radius: 12px; background: #f8faf8; }
.mono { border-color: var(--border); border-radius: 10px; background: #f3f6f4; }
.footer { width: min(1232px, calc(100% - 48px)); margin: 0 auto; padding: 0 0 40px; border-top: 1px solid var(--border); padding-top: 18px; font-size: 11px; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(15, 110, 137, .35); outline-offset: 3px; }
@media (max-width: 1000px) {
  .site-nav { grid-template-columns: 1fr auto; }
  .nav-links { display: none; }
  .hero { flex-wrap: wrap; }
  .hero-card { width: 100%; }
}
@media (max-width: 760px) {
  .site-nav, .hero, .footer { width: calc(100% - 28px); }
  .site-nav { min-height: 66px; }
  .brand { font-size: 11px; }
  .site-nav .mode-btn { min-height: 34px; padding-inline: 10px; }
  .hero { padding: 40px 0 26px; }
  h1 { font-size: 40px; }
  .layout { grid-template-columns: 1fr; padding-inline: 14px; gap: 14px; }
  .panel { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
