/* MorseSpeaker site — QSL-card design system
   Palette: postal paper, navy ink, carmine stamp, slate secondary */
:root {
  --paper: #f6f3ec;
  --card: #fdfbf6;
  --ink: #1e2a38;
  --slate: #55647a;
  --stamp: #9e2b25;
  --hairline: #ddd6c6;
  --focus: #1e5aa8;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", -apple-system, "Segoe UI", sans-serif;
  font-size: 1.06rem;
  line-height: 1.65;
}

/* Airmail edge: a nod to the QSL card without shouting */
.airmail {
  height: 8px;
  background: repeating-linear-gradient(
    -45deg,
    var(--stamp) 0 14px,
    var(--card) 14px 22px,
    var(--ink) 22px 36px,
    var(--card) 36px 44px
  );
}

.skip-link {
  position: absolute;
  left: -9999px;
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 10;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

.wrap {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header / nav */
header.site {
  border-bottom: 1px solid var(--hairline);
  background: var(--card);
}
.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 1.1rem 0;
}
.wordmark {
  font-family: "Special Elite", "Courier New", monospace;
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.02em;
}
nav.site-nav a {
  color: var(--slate);
  text-decoration: none;
  font-size: 0.95rem;
  margin-left: 1.4rem;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
nav.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--stamp);
}
nav.site-nav a:hover { color: var(--ink); }

a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Hero */
.hero {
  padding: 4.5rem 0 3.5rem;
  text-align: center;
}
.hero h1 {
  font-family: "Special Elite", "Courier New", monospace;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  margin: 0 0 0.4rem;
  letter-spacing: 0.03em;
}
.hero .tagline {
  font-size: 1.25rem;
  color: var(--slate);
  max-width: 34rem;
  margin: 1.4rem auto 0;
}

/* Morse rendered as shapes, not punctuation */
.morse {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 0.9rem;
}
.morse .dit,
.morse .dah {
  display: inline-block;
  height: 8px;
  background: var(--stamp);
  border-radius: 4px;
}
.morse .dit { width: 8px; }
.morse .dah { width: 26px; }
.morse .lgap { width: 10px; height: 1px; }
.morse .wgap { width: 26px; height: 1px; }

/* Hero keys itself once on load */
.hero .morse .dit,
.hero .morse .dah {
  opacity: 0;
  animation: key 0.18s ease-out forwards;
}
@keyframes key { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .hero .morse .dit, .hero .morse .dah { opacity: 1; }
}

.btn {
  display: inline-block;
  background: var(--stamp);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  padding: 0.85rem 1.9rem;
  border-radius: 6px;
  margin-top: 2rem;
}
.btn:hover { background: #86241f; }
.btn-note {
  display: block;
  color: var(--slate);
  font-size: 0.9rem;
  margin-top: 0.7rem;
}

/* Sections labeled in morse */
section.block {
  border-top: 1px solid var(--hairline);
  padding: 3.2rem 0;
}
.section-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.6rem;
}
.section-label h2 {
  font-family: "Special Elite", "Courier New", monospace;
  font-size: 1.5rem;
  margin: 0;
  letter-spacing: 0.04em;
}
.section-label .morse { justify-content: flex-start; margin: 0; }
.section-label .morse .dit,
.section-label .morse .dah { height: 6px; background: var(--slate); }
.section-label .morse .dit { width: 6px; }
.section-label .morse .dah { width: 20px; }

/* Feature cards */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.1rem;
  padding: 0;
  margin: 0;
  list-style: none;
}
.features li {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 1.2rem 1.3rem;
}
.features h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}
.features p {
  margin: 0;
  color: var(--slate);
  font-size: 0.97rem;
}

/* Setup steps */
.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 42rem;
}
.steps li {
  position: relative;
  padding: 0.35rem 0 0.35rem 3rem;
  margin-bottom: 0.9rem;
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.35rem;
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Special Elite", monospace;
  font-size: 1rem;
}

/* Prose pages */
.prose { max-width: 44rem; padding: 3rem 0 4rem; }
.prose h1 {
  font-family: "Special Elite", "Courier New", monospace;
  font-size: 2.1rem;
  margin-bottom: 0.4rem;
}
.prose .updated { color: var(--slate); font-size: 0.92rem; margin-top: 0; }
.prose h2 {
  font-family: "Special Elite", "Courier New", monospace;
  font-size: 1.3rem;
  margin-top: 2.2rem;
}
.prose ul { padding-left: 1.3rem; }
.prose li { margin-bottom: 0.4rem; }

.callout {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-left: 4px solid var(--stamp);
  border-radius: 6px;
  padding: 1rem 1.2rem;
  margin: 1.6rem 0;
}

/* Footer */
footer.site {
  border-top: 1px solid var(--hairline);
  background: var(--card);
  padding: 2rem 0 2.4rem;
  color: var(--slate);
  font-size: 0.95rem;
}
footer.site .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem 2rem;
}
footer.site a { color: var(--slate); }
footer.site a:hover { color: var(--ink); }
.sk {
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.05em;
}
