/* Tokens */
:root {
  --ink: #14181d;
  --paper: #ffffff;
  --gray: #6a7076;
  --line: #e4e6e8;
  --red: #e20e17;
  --board-bg: #0e1216;
  --board-amber: #f5b841;
  --board-green: #3ecf6e;
  --display: "Archivo", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --body: system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html, body { height: 100%; }

body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Nav */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(20px, 6vw, 72px);
  border-bottom: 1px solid var(--line);
}

.nav-logo { height: 26px; width: auto; }

.nav-links { display: flex; gap: 28px; align-items: center; }

.nav-links a {
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.nav-links a:hover { color: var(--red); }

.nav-cta {
  color: var(--red) !important;
  border: 1.5px solid var(--red);
  padding: 7px 18px;
  border-radius: 999px;
}

/* Hero */
.hero {
  padding: clamp(16px, 3vh, 36px) clamp(20px, 6vw, 72px) clamp(12px, 2.5vh, 28px);
  max-width: 1400px;
  display: flex;
  align-items: flex-end;
  gap: clamp(24px, 4vw, 64px);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 12px;
}

.hero-copy { flex: 1; }

.hero h1 {
  font-family: var(--display);
  font-variation-settings: "wdth" 118;
  font-weight: 750;
  font-size: clamp(32px, 4.6vw, 58px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hero-sub {
  max-width: 460px;
  font-size: 15px;
  color: var(--gray);
  padding-bottom: 4px;
}

/* Departure board */
.board {
  margin: 0 clamp(20px, 6vw, 72px) clamp(16px, 3vh, 32px);
  background: var(--board-bg);
  border-radius: 10px;
  overflow: hidden;
  font-family: var(--mono);
}

.board-head {
  display: flex;
  justify-content: space-between;
  padding: 14px 24px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--board-amber);
  border-bottom: 1px solid #232a31;
}

.board-row {
  display: grid;
  grid-template-columns: 2.4fr 0.8fr 1fr 1fr 1.1fr auto;
  gap: 18px;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #232a31;
}

.board-row:last-child { border-bottom: none; }

.cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.cell-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5c666f;
}

.cell-value {
  font-size: 15px;
  font-weight: 500;
  color: #f2f4f5;
  text-transform: uppercase;
}

.status-boarding {
  color: var(--board-green);
  animation: blink 1.6s step-end infinite;
}

.status-closed { color: #5c666f; }

.is-closed .cell-value:not(.status-closed) { color: #5c666f; }

@keyframes blink { 50% { opacity: 0.25; } }

.apply-btn {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 14px 30px;
  cursor: pointer;
  transition: background 0.15s;
}

.apply-btn:hover { background: #c00c14; }
.apply-btn:focus-visible { outline: 3px solid var(--board-amber); outline-offset: 2px; }

.apply-btn-disabled {
  background: #232a31;
  color: #5c666f;
  cursor: default;
  text-align: center;
}

.apply-btn-disabled:hover { background: #232a31; }

/* Details */
.details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 4vw, 56px);
  padding: 0 clamp(20px, 6vw, 72px) clamp(12px, 2.5vh, 28px);
  max-width: 1400px;
}

.detail h2 {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
  padding-top: 10px;
  border-top: 3px solid var(--red);
}

.detail p { font-size: 13.5px; color: var(--gray); }

/* Modal */
.modal[hidden],
.call-panel[hidden] { display: none; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(14, 18, 22, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal-card {
  position: relative;
  background: var(--paper);
  border-radius: 12px;
  padding: 36px;
  width: min(440px, 100%);
}

.modal-card h2 {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 750;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.modal-card .eyebrow { margin-bottom: 12px; }

.modal-sub { font-size: 14px; color: var(--gray); margin-bottom: 22px; }

.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  font-size: 26px;
  color: var(--gray);
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover { color: var(--ink); }

#apply-form { display: flex; flex-direction: column; gap: 16px; }

#apply-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

#apply-form input {
  font-family: var(--body);
  font-size: 15px;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
}

#apply-form input:focus-visible {
  outline: none;
  border-color: var(--red);
}

.form-error {
  font-size: 13px;
  color: var(--red);
}

.submit-btn {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 15px;
  cursor: pointer;
  margin-top: 6px;
}

.submit-btn:hover { background: #c00c14; }
.submit-btn:disabled { opacity: 0.6; cursor: wait; }
.submit-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

/* Call panel */
.call-panel {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--board-bg);
  border-radius: 999px;
  padding: 14px 22px;
  font-family: var(--mono);
  z-index: 60;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.35);
}

.call-light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--board-amber);
  animation: blink 1.2s step-end infinite;
}

.call-panel[data-state="live"] .call-light { background: var(--board-green); animation: none; }
.call-panel[data-state="ended"] .call-light { background: #5c666f; animation: none; }

.call-info { display: flex; flex-direction: column; }

.call-status {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #f2f4f5;
}

.call-panel[data-state="live"] .call-status { color: var(--board-green); }

.call-timer { font-size: 12px; color: #5c666f; }

.call-actions { display: flex; gap: 10px; }

.call-actions button {
  font-family: var(--body);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1.5px solid #3a434c;
  background: transparent;
  color: #f2f4f5;
  cursor: pointer;
}

.call-actions button:hover { border-color: #f2f4f5; }
.call-actions button.danger { background: var(--red); border-color: var(--red); }
.call-actions button.danger:hover { background: #c00c14; }
.call-actions button:disabled { opacity: 0.5; cursor: default; }

/* Responsive */
@media (max-width: 900px) {
  .board-row {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .cell-role { grid-column: 1 / -1; }
  .apply-btn { grid-column: 1 / -1; }
  .details { grid-template-columns: 1fr; }
  .nav-links a:not(.nav-cta) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .status-boarding, .call-light { animation: none; }
}
