:root {
  --bg: #f5f7fb;
  --bg-soft: #eef3ff;
  --surface: #ffffff;
  --surface-2: #f8fbff;
  --surface-3: #edf4ff;
  --line: #d8e2f1;
  --line-strong: #bfd0ea;
  --text: #183153;
  --muted: #5f7594;
  --accent: #2d6df6;
  --accent-strong: #1859ea;
  --accent-soft: #eaf1ff;
  --gold: #ffbd3d;
  --gold-soft: #fff2cf;
  --green: #0ca678;
  --shadow: 0 20px 45px rgba(29, 65, 122, 0.08);
  --shadow-soft: 0 12px 28px rgba(29, 65, 122, 0.06);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(45, 109, 246, 0.12), transparent 22%),
    radial-gradient(circle at top right, rgba(255, 189, 61, 0.14), transparent 18%),
    linear-gradient(180deg, #f7f9fd 0%, #f4f8ff 42%, #f7fbff 100%);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease; }

.wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}
.narrow { width: min(920px, calc(100% - 32px)); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(248, 251, 255, 0.88);
  border-bottom: 1px solid rgba(191, 208, 234, 0.75);
}

.header-inner,
.footer-inner,
.hero-inner,
.status-row,
.counter-row,
.panel-head,
.signal-meta,
.mini-toolbar,
.input-meta {
  display: flex;
  align-items: center;
}

.header-inner,
.footer-inner {
  justify-content: space-between;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: 1.45rem;
}
.brand::before {
  content: "• — •";
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--accent);
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid #cfe0ff;
}
.brand span { color: var(--accent); }

.top-nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-weight: 600;
}
.top-nav a:hover,
.footer-links a:hover {
  color: var(--accent);
}

.hero {
  padding: 42px 0 22px;
}
.hero-inner {
  gap: 24px;
  align-items: stretch;
}
.hero-copy,
.hero-card,
.tool-shell,
.settings-panel,
.signal-stage,
.info-card,
.steps article,
.faq-list details {
  border: 1px solid rgba(191, 208, 234, 0.92);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius);
}
.hero-copy {
  flex: 1.45;
  padding: 34px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.96), rgba(245,249,255,0.98)),
    linear-gradient(135deg, rgba(45,109,246,0.08), rgba(255,189,61,0.08));
}
.hero-card {
  flex: 0.9;
  padding: 28px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.hero-card-title,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #916300;
  font-size: 0.88rem;
  font-weight: 700;
  border: 1px solid #ffe09a;
}
.hero h1,
.content-section h2 {
  margin: 16px 0 12px;
  letter-spacing: -0.045em;
  line-height: 1.02;
}
.hero h1 { font-size: clamp(2.25rem, 5vw, 4.15rem); }
.hero p,
.section-lead,
.steps p,
.faq-list p,
.site-footer p,
.hero-card li {
  color: var(--muted);
  line-height: 1.72;
}
.hero-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(29, 65, 122, 0.06);
}
.btn-primary {
  background: linear-gradient(180deg, #3f7bfd, #2b68f3);
  color: white;
  border-color: transparent;
}
.btn-primary:hover { box-shadow: 0 12px 24px rgba(45, 109, 246, 0.24); }
.btn-secondary {
  background: #fff;
  color: var(--text);
}
.btn:hover,
.chip:hover,
.swap-btn:hover { transform: translateY(-1px); }

.hero-card ul {
  margin: 16px 0 0;
  padding-left: 18px;
}

.tool-section { padding: 10px 0 38px; }
.tool-shell {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  padding: 22px;
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
}
.panel { min-width: 0; }
.panel h2 {
  margin: 0;
  font-size: 1.12rem;
}
.panel-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.panel-title-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.panel-subtitle,
.panel-mini,
#modeLabel,
.counter-row,
.small,
.muted,
.status-text-muted {
  color: var(--muted);
}
.panel-mini {
  font-size: 0.9rem;
}
.panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.compact .chip { min-height: 36px; }
.multi .chip { font-size: 0.84rem; }
.chip,
.swap-btn {
  border: 1px solid #d7e4f7;
  background: linear-gradient(180deg, #ffffff, #f3f8ff);
  color: var(--text);
  border-radius: 12px;
  padding: 0 12px;
  box-shadow: 0 4px 12px rgba(29, 65, 122, 0.05);
}
.chip.active-chip {
  background: linear-gradient(180deg, #3f7bfd, #2b68f3);
  color: white;
  border-color: transparent;
}
textarea {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  border-radius: 18px;
  border: 1px solid #d7e4f7;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  color: var(--text);
  padding: 18px 20px;
  line-height: 1.75;
  font-size: 1rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}
textarea::placeholder { color: #95a6bf; }
textarea:focus,
select:focus,
input:focus {
  outline: 2px solid rgba(45, 109, 246, 0.22);
  outline-offset: 2px;
  border-color: #a7c4ff;
}

.middle-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 92px;
}
.swap-btn {
  width: 66px;
  height: 66px;
  font-size: 1.7rem;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff8df, #ffe9a7);
  border-color: #ffd96c;
}
#modeLabel {
  font-size: 0.95rem;
  text-align: center;
  max-width: 110px;
}

.counter-row {
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
  font-size: 0.95rem;
}
.counter-row.between,
.status-row,
.signal-meta,
.input-meta { justify-content: space-between; }
.small { font-size: 0.9rem; }

.settings-panel {
  margin-top: 18px;
  padding: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
}
select {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid #d7e4f7;
  background: white;
  padding: 0 12px;
  color: var(--text);
}
input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}
.check-label {
  justify-content: flex-end;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding-top: 28px;
}
.hidden { display: none; }

.status-row { margin: 18px 0; gap: 16px; }
.status-text {
  color: var(--green);
  font-weight: 700;
}

.signal-stage {
  padding: 20px;
  background: linear-gradient(180deg, #fff 0%, #f7fbff 100%);
}
.signal-lamp {
  width: 100%;
  min-height: 96px;
  border-radius: 18px;
  background: radial-gradient(circle at center, rgba(45, 109, 246, 0.08), rgba(45, 109, 246, 0.02));
  border: 1px solid #d7e4f7;
  transition: all 100ms linear;
  margin-top: 12px;
}
.signal-lamp.active {
  background: radial-gradient(circle at center, rgba(255, 247, 194, 0.95), rgba(255, 207, 89, 0.52));
  box-shadow: 0 0 40px rgba(255, 197, 66, 0.45);
}

.content-section { padding: 56px 0; }
.alt-bg {
  background: linear-gradient(180deg, rgba(233,241,255,0.38), rgba(255,255,255,0.5));
  border-top: 1px solid rgba(191, 208, 234, 0.72);
  border-bottom: 1px solid rgba(191, 208, 234, 0.72);
}
.cards-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.info-card {
  padding: 22px;
  background: linear-gradient(180deg, #fff 0%, #f9fbff 100%);
}
.reference-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.reference-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f4f8ff);
  border: 1px solid #dde8f8;
}
.reference-item code,
textarea,
.reference-item .morse {
  font-family: "JetBrains Mono", monospace;
}
.reference-item .morse { color: var(--accent); }

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.steps article,
.faq-list details {
  padding: 22px;
  background: linear-gradient(180deg, #fff 0%, #f9fbff 100%);
}
.steps h3,
.info-card h3 { margin-top: 0; }
.faq-list { display: grid; gap: 14px; }
summary {
  cursor: pointer;
  font-weight: 700;
}
summary::-webkit-details-marker { display: none; }

.site-footer {
  border-top: 1px solid rgba(191, 208, 234, 0.72);
  background: rgba(248, 251, 255, 0.95);
}
.footer-links {
  display: flex;
  gap: 18px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .hero-inner,
  .cards-3,
  .steps,
  .settings-grid,
  .tool-shell {
    grid-template-columns: 1fr;
  }

  .hero-inner { display: grid; }
  .middle-controls {
    flex-direction: row;
    justify-content: center;
    min-width: 0;
  }
  .settings-grid { display: grid; }
  #modeLabel { max-width: none; }
}

@media (max-width: 720px) {
  .top-nav,
  .footer-inner,
  .header-inner,
  .panel-head,
  .status-row,
  .counter-row.between,
  .input-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-inner,
  .footer-inner { padding: 14px 0; }
  .reference-grid { grid-template-columns: 1fr; }
  .wrap { width: min(100% - 20px, 1180px); }
  .tool-shell,
  .hero-copy,
  .hero-card,
  .info-card,
  .steps article,
  .faq-list details,
  .settings-panel,
  .signal-stage { border-radius: 18px; }

  .hero { padding-top: 26px; }
  .hero-copy,
  .hero-card,
  .tool-shell,
  .settings-panel,
  .signal-stage,
  .info-card,
  .steps article,
  .faq-list details { padding-left: 18px; padding-right: 18px; }

  textarea { min-height: 220px; }
}


.download-card-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}


.page-hero {
  padding: 46px 0 18px;
}
.page-hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: stretch;
}
.page-hero-copy,
.page-hero-visual,
.highlight-card,
.table-card,
.cta-strip {
  border: 1px solid rgba(191, 208, 234, 0.92);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius);
}
.page-hero-copy {
  padding: 34px;
  background: linear-gradient(135deg, rgba(255,255,255,0.97), rgba(242,248,255,0.98));
}
.page-hero-copy h1 {
  margin: 16px 0 12px;
  font-size: clamp(2rem, 4.5vw, 3.55rem);
  line-height: 1.03;
  letter-spacing: -0.045em;
}
.page-hero-copy p,
.copy-grid p,
.highlight-card p,
.table-card p,
.cta-strip p,
.quick-list li {
  color: var(--muted);
  line-height: 1.72;
}
.page-hero-visual {
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.page-hero-visual img,
.feature-media img {
  width: 100%;
  display: block;
  border-radius: 18px;
}
.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #916300;
  background: var(--gold-soft);
  border: 1px solid #ffe09a;
  border-radius: 999px;
  padding: 8px 12px;
}
.copy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 20px;
}
.highlight-card,
.table-card,
.cta-strip {
  padding: 24px;
}
.highlight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 18px;
}
.morse-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  overflow: hidden;
}
.morse-table th, .morse-table td {
  border-bottom: 1px solid #e0e9f5;
  padding: 12px 14px;
  text-align: left;
}
.morse-table th {
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: #f7fbff;
}
.morse-table td:nth-child(2), .morse-pill, .morse-inline {
  font-family: "JetBrains Mono", monospace;
}
.morse-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid #cfe0ff;
  color: var(--accent);
  font-weight: 700;
}
.quick-list {
  margin: 12px 0 0;
  padding-left: 20px;
}
.quick-list li {
  margin-bottom: 8px;
}
.feature-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: center;
}
.feature-media figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}
.cta-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: linear-gradient(135deg, rgba(45,109,246,0.08), rgba(255,189,61,0.13));
}
@media (max-width: 980px) {
  .page-hero-grid, .copy-grid, .highlight-grid, .feature-split {
    grid-template-columns: 1fr;
  }
  .cta-strip {
    flex-direction: column;
    align-items: flex-start;
  }
}
