/* ============================================================
   OnCall EMS — oncallems.app
   Palette: station white / uniform navy / Omaha orange / EMS green
   Type: Barlow Condensed (display) · Public Sans (body) · IBM Plex Mono (utility)
   ============================================================ */

:root {
  --paper: #F5F7F4;
  --card: #FFFFFF;
  --ink: #16283A;
  --ink-2: #4A5D6E;
  --line: #D9E0DC;
  --orange: #E8501E;
  --orange-deep: #B33A0A;
  --green: #1F7A45;
  --green-soft: #E3F0E7;
  --navy: #14273B;
  --navy-2: #1D3550;
  --night-text: #E9EEF2;
  --night-muted: #9FB4C6;

  --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-body: 'Public Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --container: 1120px;
  --radius: 6px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

a { color: var(--orange-deep); }

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- type ---------- */

h1, h2, h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.015em;
  line-height: 1.02;
  font-weight: 700;
}

h1 { font-size: clamp(3rem, 6.5vw, 4.9rem); }
h2 { font-size: clamp(2.1rem, 3.6vw, 2.9rem); margin: 0.65rem 0 2.2rem; max-width: 22ch; }
h3 { font-size: 1.35rem; font-weight: 600; letter-spacing: 0.03em; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--orange-deep);
}

.eyebrow-night { color: var(--orange); }

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-solid {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}
.btn-solid:hover { background: var(--orange-deep); border-color: var(--orange-deep); }

.btn-ghost {
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

.btn-small { font-size: 1rem; padding: 0.45rem 1.1rem; }
.btn-big { font-size: 1.4rem; padding: 0.9rem 2.2rem; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 4.25rem;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
}

.wordmark-board { width: 1.7rem; height: 1.7rem; }

.wordmark-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.45rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.wordmark-text em { font-style: normal; color: var(--orange); }

.site-nav {
  display: flex;
  gap: 1.4rem;
  margin-left: auto;
}

.site-nav a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
}
.site-nav a:hover { color: var(--orange-deep); }

/* ---------- hero ---------- */

.hero { padding: 5.5rem 0 6rem; overflow: hidden; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 3.5rem;
  align-items: center;
}

.hero-copy .eyebrow { margin-bottom: 1.1rem; max-width: 40ch; }

.lede {
  font-size: 1.13rem;
  color: var(--ink-2);
  margin: 1.4rem 0 2rem;
  max-width: 52ch;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

.hero-note {
  margin-top: 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-2);
}

/* ---------- the board (signature) ---------- */

.hero-board { position: relative; }

.board {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 20px 50px -18px rgba(22, 40, 58, 0.28);
  padding: 1.1rem 1.1rem 1.3rem;
}

.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.board-title {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.chip {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 0.22rem 0.55rem;
  border-radius: 99px;
}

.chip-published { background: var(--green-soft); color: var(--green); }

.board-grid {
  display: grid;
  grid-template-columns: 5.4rem repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.b-day, .b-shift {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}

.b-day {
  text-align: center;
  padding: 0.3rem 0;
}
.b-day b { color: var(--ink); font-weight: 500; }

.b-shift {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.35;
  padding-right: 0.4rem;
}
.b-shift span { font-size: 0.58rem; color: var(--ink-2); opacity: 0.75; }

.b-cell {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 4.6rem;
}

.crew {
  font-size: 0.68rem;
  font-weight: 600;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.12rem 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* story cell: open slot → claimed */

.slot-open {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--orange-deep);
  border: 1.5px dashed var(--orange);
  border-radius: 4px;
  padding: 0.12rem 0.4rem;
  text-align: center;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.b-story { border-color: var(--orange); }

.crew-claimed {
  display: none;
  background: var(--green-soft);
  border-color: var(--green);
  color: var(--green);
}
.crew-claimed::before { content: "✓ "; }

.board.is-claimed .slot-open { display: none; }
.board.is-claimed .crew-claimed { display: block; animation: pop 0.35s ease; }
.board.is-claimed .b-story { border-color: var(--line); }

@keyframes pop {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.board-toast {
  position: absolute;
  right: -0.9rem;
  bottom: -1.5rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--navy);
  color: var(--night-text);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.78rem;
  box-shadow: 0 12px 30px -10px rgba(20, 39, 59, 0.5);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.board.is-claimed .board-toast { opacity: 1; transform: translateY(0); }

.toast-channel {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--night-muted);
}

.toast-check {
  width: 0.9rem;
  height: 0.9rem;
  color: #5FCE8A;
  flex-shrink: 0;
}

/* ---------- how it works ---------- */

.how {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--card);
  padding: 3.4rem 0;
}

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.2rem;
  margin-top: 1.6rem;
}

.steps li { position: relative; padding-top: 0.4rem; }

.step-n {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--orange-deep);
  display: block;
  margin-bottom: 0.4rem;
}
.step-n::after { content: " —"; color: var(--line); }

.steps h3 { margin-bottom: 0.35rem; }
.steps p { font-size: 0.94rem; color: var(--ink-2); }

/* ---------- feature sections ---------- */

.section { padding: 5.5rem 0; }

.section-tint {
  background: var(--card);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem 3.5rem;
}

.feature {
  border-top: 2px solid var(--ink);
  padding-top: 0.9rem;
}

.feature dt {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.25rem;
}

.feature dd { color: var(--ink-2); font-size: 0.98rem; }

/* ---------- slack night band ---------- */

.night {
  background: var(--navy);
  color: var(--night-text);
}

.night h2 { color: #fff; }

.night-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 4rem;
  align-items: center;
}

.features-night .feature { border-top-color: var(--orange); }
.features-night dd { color: var(--night-muted); }
.features-stack { grid-template-columns: 1fr; gap: 1.6rem; }

.slack-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.slack-msg {
  display: flex;
  gap: 0.8rem;
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 0.95rem 1.1rem;
  font-size: 0.9rem;
  line-height: 1.45;
  box-shadow: 0 10px 30px -14px rgba(0, 0, 0, 0.55);
}

.slack-msg:nth-child(2) { margin-left: 2.2rem; }
.slack-msg:nth-child(3) { margin-right: 2.2rem; }

.slack-avatar { width: 2.25rem; height: 2.25rem; flex-shrink: 0; }
.slack-avatar svg { width: 100%; height: 100%; }

.slack-meta {
  font-size: 0.8rem;
  margin-bottom: 0.15rem;
}

.slack-app {
  font-size: 0.6rem;
  font-weight: 700;
  background: #E8E8E8;
  color: #616061;
  border-radius: 3px;
  padding: 0.05rem 0.3rem;
  vertical-align: 1px;
}

.slack-time { color: #616061; font-size: 0.72rem; margin-left: 0.3rem; }

.slack-btn {
  display: inline-block;
  margin-top: 0.55rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 5px;
  padding: 0.25rem 0.8rem;
}

/* ---------- managed ---------- */

.managed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
}

.managed-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--orange);
  border-radius: var(--radius);
  padding: 1.8rem 2rem;
}

.managed-card h3 { margin-bottom: 0.5rem; }
.managed-card p { color: var(--ink-2); font-size: 0.98rem; }

/* ---------- CTA band ---------- */

.cta-band {
  background: var(--navy);
  color: var(--night-text);
  padding: 5.5rem 0;
  text-align: center;
}

.cta-inner h2 { color: #fff; margin: 0 auto 1rem; }

.cta-inner p {
  color: var(--night-muted);
  max-width: 46ch;
  margin: 0 auto 2.2rem;
}

/* ---------- footer ---------- */

.site-footer {
  background: var(--navy);
  border-top: 1px solid var(--navy-2);
  padding: 1.4rem 0;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--night-muted);
}

/* ---------- reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .slot-open { animation: none; }
  .board.is-claimed .crew-claimed { animation: none; }
  .board-toast { transition: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .hero { padding: 3.5rem 0 4.5rem; }
  .hero-grid { grid-template-columns: 1fr; gap: 3.5rem; }
  .night-grid { grid-template-columns: 1fr; gap: 3rem; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .site-nav { display: none; }
}

@media (max-width: 640px) {
  .features { grid-template-columns: 1fr; }
  .managed-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: 1.6rem; }
  .board-grid { grid-template-columns: 4.4rem repeat(3, minmax(0, 1fr)); }
  .b-hide-sm { display: none; }
  .board-toast { right: 0.5rem; bottom: -1.7rem; }
  .slack-msg:nth-child(2) { margin-left: 0; }
  .slack-msg:nth-child(3) { margin-right: 0; }
}
