/* Resilient pilot onboarding — visual layer.
   Palette, type and the light-only rule come from wiki/concepts/brand-guide.md.
   Two typefaces maximum: Outfit for display, Switzer for everything else. */

/* Self-hosted so the route works offline and sends nothing to a font CDN.
   Drop the files into assets/fonts/ — until then the fallback stack applies. */
@font-face {
  font-family: "Outfit";
  src: url("assets/fonts/Outfit-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Switzer";
  src: url("assets/fonts/Switzer-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Switzer";
  src: url("assets/fonts/Switzer-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Switzer";
  src: url("assets/fonts/Switzer-Semibold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  /* Brand primaries */
  --sky: #b7dfed;
  --mint: #dff2e6;
  --peach: #f1e5de;
  --lavender: #e3dff2;

  /* Foundation */
  --white: #ffffff;
  --ink: #111111;
  --ui-black: #232323;
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #ececec;
  --gray-300: #dedede;
  --muted: #6b6b6b;
  --muted-soft: #8c8c8c;

  --font-display: "Outfit", "Switzer", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Switzer", Inter, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --line: 1px solid var(--gray-200);
  --shell-max: 1440px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

p {
  margin: 0;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

a {
  color: inherit;
}

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

/* ---------------------------------------------------------------- topbar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 32px;
  border-bottom: var(--line);
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

/* Canonical horizontal lockup. Never recoloured, never distorted:
   width is driven by a fixed height so the aspect ratio is preserved. */
.brand-logo {
  height: 30px;
  width: auto;
  flex: none;
}

.brand-divider {
  width: 1px;
  height: 20px;
  background: var(--gray-300);
  flex: none;
}

.brand-sub {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--muted);
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.prototype-pill {
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--sky);
  color: var(--ui-black);
  white-space: nowrap;
}

.text-button {
  background: none;
  border: var(--line);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.text-button:hover {
  color: var(--ink);
  border-color: var(--ui-black);
}

/* ----------------------------------------------------------------- shell */

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 48px;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 44px 32px 64px;
  align-items: start;
}

/* --------------------------------------------------------------- roadmap */

.roadmap {
  position: sticky;
  top: 104px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--muted-soft);
}

.roadmap h1 {
  font-size: 34px;
  line-height: 1.12;
}

.roadmap h1 em {
  font-style: normal;
  color: var(--muted);
}

.roadmap-copy {
  font-size: 14px;
  color: var(--muted);
  max-width: 30ch;
}

.progress-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.progress-label span:first-child {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
}

.progress-track {
  height: 5px;
  border-radius: 999px;
  background: var(--gray-200);
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--ui-black);
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.route-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.route-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--gray-50);
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.route-item:hover {
  background: var(--gray-100);
}

.route-number {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--white);
  border: var(--line);
  font-size: 12px;
  font-weight: 600;
}

.route-name {
  font-size: 14px;
  font-weight: 500;
}

.route-count {
  font-size: 12px;
  color: var(--muted-soft);
  font-variant-numeric: tabular-nums;
}

.route-item.is-active {
  background: var(--white);
  border-color: var(--ui-black);
}

.route-item.is-active[data-tone="blue"] {
  background: var(--sky);
  border-color: transparent;
}

.route-item.is-active[data-tone="green"] {
  background: var(--mint);
  border-color: transparent;
}

.route-item.is-active[data-tone="lime"] {
  background: var(--peach);
  border-color: transparent;
}

.route-item.is-active .route-number {
  border-color: transparent;
}

.route-item.is-done .route-number {
  background: var(--ui-black);
  color: var(--white);
  border-color: var(--ui-black);
}

.help-card {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--lavender);
}

.help-dot {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--ui-black);
  flex: none;
}

.help-card strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.help-card p {
  font-size: 13px;
  color: #4a4a4a;
}

/* ----------------------------------------------------------------- stage */

.stage {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 40px;
  align-items: start;
}

.copy-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.step-eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-soft);
  padding-bottom: 14px;
  border-bottom: var(--line);
}

.step-count {
  color: var(--ink);
  white-space: nowrap;
}

.copy-column h2 {
  font-size: 40px;
  line-height: 1.08;
}

.welcome-copy h2 {
  font-size: 44px;
}

.summary,
.welcome-lede {
  font-size: 17px;
  color: var(--muted);
  max-width: 46ch;
}

.welcome-lede {
  font-size: 18px;
}

.time-chip {
  align-self: flex-start;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--ui-black);
}

.action-panel,
.tip-panel {
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  border: var(--line);
  background: var(--gray-50);
}

.action-panel h3,
.tip-panel h3 {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-soft);
  margin-bottom: 12px;
}

.action-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.action-list li {
  counter-increment: step;
  position: relative;
  padding-left: 34px;
  font-size: 15px;
  line-height: 1.5;
}

.action-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--sky);
  color: var(--ui-black);
  font-size: 11px;
  font-weight: 600;
}

.tip-panel {
  background: var(--peach);
  border-color: transparent;
}

.tip-panel p {
  font-size: 15px;
  color: #40403c;
}

/* --------------------------------------------------------------- choices */

.language-choice,
.device-choice {
  display: grid;
  gap: 10px;
}

/* A dropdown rather than a row of buttons: the language list is expected to
   grow well past the point where buttons stay readable. */
.language-choice {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  max-width: 420px;
}

.language-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-soft);
}

.select-shell {
  position: relative;
}

/* Chevron drawn with a border so no asset or external file is needed. */
.select-shell::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--ui-black);
  border-bottom: 2px solid var(--ui-black);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.select-shell select {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  padding: 17px 52px 17px 20px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-lg);
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.select-shell select:hover,
.select-shell select:focus {
  border-color: var(--ui-black);
}

.device-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-lg);
  background: var(--white);
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.device-option:hover {
  border-color: var(--ui-black);
}

.device-option.is-selected {
  border-color: var(--ui-black);
  background: var(--sky);
}

.device-option.is-selected .device-icon {
  background: var(--white);
}

.device-icon {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  background: var(--gray-100);
  position: relative;
}

.device-icon::after {
  content: "";
  position: absolute;
  inset: 9px 12px;
  border: 1.5px solid var(--ui-black);
  border-radius: 3px;
}

.device-option strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
}

.device-option small {
  font-size: 13px;
  color: var(--muted);
}

/* ---------------------------------------------------------------- visual */

.visual-column {
  min-width: 0;
}

.visual-card {
  border: var(--line);
  border-radius: var(--radius-lg);
  background: var(--gray-50);
  overflow: hidden;
}

.visual-label {
  padding: 14px 20px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--muted-soft);
  border-bottom: var(--line);
  background: var(--white);
}

.visual-inner {
  padding: 22px 20px;
}

.screenshot-caption {
  padding: 12px 20px 16px;
  font-size: 12px;
  color: var(--muted-soft);
  text-align: center;
}

.screenshot-gallery {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.screenshot-gallery.single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 260px;
  margin: 0 auto;
}

.screenshot-frame {
  border-radius: 14px;
  overflow: hidden;
  background: var(--white);
  border: var(--line);
}

.screenshot-frame img {
  width: 100%;
  height: auto;
}

/* ------------------------------------------------------------ store / QR */

.qr-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.qr-frame {
  width: 232px;
  height: 232px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--white);
  border: var(--line);
}

.qr-frame img {
  width: 100%;
  height: 100%;
}

.qr-hint {
  font-size: 14px;
  color: var(--muted);
  max-width: 30ch;
}

.qr-direct {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 14px;
  border-top: var(--line);
  width: 100%;
}

.qr-direct > span {
  font-size: 12px;
  color: var(--muted-soft);
}

.store-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--ui-black);
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.store-button:hover {
  opacity: 0.85;
}

/* -------------------------------------------------------- welcome visual */

.welcome-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.route-card {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--white);
  border: var(--line);
}

.route-card.garmin {
  background: var(--sky);
  border-color: transparent;
}

.route-card.resilient {
  background: var(--mint);
  border-color: transparent;
}

.route-card strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 5px;
}

.route-card p {
  font-size: 13px;
  color: #40403c;
}

.finish-badge {
  display: grid;
  place-items: center;
  padding: 26px;
  border-radius: var(--radius-md);
  background: var(--lavender);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.1em;
  line-height: 1.35;
  text-align: center;
}

.missing-visual {
  padding: 24px 20px;
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--gray-300);
  background: var(--white);
  text-align: left;
}

.missing-visual.note-visual {
  border-style: solid;
  border-color: transparent;
  background: var(--peach);
}

.missing-kicker {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-soft);
  margin-bottom: 8px;
}

.missing-visual h3 {
  font-size: 18px;
  margin-bottom: 6px;
}

.missing-visual p {
  font-size: 14px;
  color: var(--muted);
}

.missing-visual details {
  margin-top: 14px;
  font-size: 13px;
}

.missing-visual summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--ink);
}

.missing-visual details p {
  margin-top: 8px;
  font-size: 13px;
}

/* ------------------------------------------------ manual pairing fallback */

/* Collapsed by default. Reads as help that is there if you need it, rather
   than three more steps stacked onto the happy path. */
.manual-panel {
  margin-top: 16px;
  border-radius: var(--radius-md);
  border: var(--line);
  background: var(--white);
}

.manual-panel summary {
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.manual-panel summary::-webkit-details-marker {
  display: none;
}

.manual-panel summary::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: none;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.18s ease;
}

.manual-panel[open] summary::before {
  transform: rotate(45deg);
}

.manual-intro {
  padding: 0 18px 4px;
  font-size: 13px;
  color: var(--muted);
}

.manual-steps {
  margin: 0;
  padding: 14px 18px 18px;
  list-style: none;
  counter-reset: manual;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 16px;
}

.manual-steps li {
  counter-increment: manual;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: #40403c;
}

.manual-shot {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: var(--line);
  background: var(--gray-100);
}

.manual-shot img {
  width: 100%;
  height: auto;
}

.manual-steps li::before {
  content: counter(manual);
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--sky);
  color: var(--ui-black);
  font-size: 11px;
  font-weight: 600;
  order: -1;
}

/* ------------------------------------------------------------ navigation */

.navigation-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  border-top: var(--line);
}

.keyboard-hint {
  font-size: 12px;
  color: var(--muted-soft);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 26px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  border: 1.5px solid transparent;
  transition: opacity 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.primary-button {
  background: var(--ui-black);
  color: var(--white);
}

.primary-button:hover {
  opacity: 0.85;
}

.secondary-button {
  background: var(--white);
  border-color: var(--gray-300);
  color: var(--ink);
}

.secondary-button:hover:not(:disabled) {
  border-color: var(--ui-black);
}

.secondary-button:disabled {
  color: var(--gray-300);
  cursor: not-allowed;
  border-color: var(--gray-200);
}

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

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 26px 32px 40px;
  border-top: var(--line);
  font-size: 12px;
  color: var(--muted-soft);
  text-align: center;
}

/* Swiss identity marker, per the brand guide's footer rule. */
.footer-swiss {
  width: 15px;
  height: 15px;
  border-radius: 3px;
  background: #d52b1e;
  position: relative;
  flex: none;
}

.footer-swiss::before,
.footer-swiss::after {
  content: "";
  position: absolute;
  background: var(--white);
}

.footer-swiss::before {
  left: 6.5px;
  top: 3.5px;
  width: 2px;
  height: 8px;
}

.footer-swiss::after {
  top: 6.5px;
  left: 3.5px;
  height: 2px;
  width: 8px;
}

/* --------------------------------------------------------------- motion */

.fade-in {
  animation: fade-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

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

@media (max-width: 1180px) {
  .screen {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .copy-column h2,
  .welcome-copy h2 {
    font-size: 34px;
  }

  .screenshot-gallery.single {
    max-width: 300px;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding: 28px 20px 48px;
  }

  /* Participants usually open this on the phone they are setting up, so the
     current task comes first and the route summary moves below it. */
  .stage {
    order: 1;
  }

  .roadmap {
    order: 2;
    position: static;
    gap: 18px;
    padding-top: 28px;
    border-top: var(--line);
  }

  .roadmap h1 {
    font-size: 28px;
  }

  .route-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .route-item {
    flex: 1 1 190px;
  }

  .topbar {
    padding: 14px 20px;
  }

  .site-footer {
    padding: 22px 20px 34px;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 15px;
  }

  .copy-column h2,
  .welcome-copy h2 {
    font-size: 28px;
  }

  .summary,
  .welcome-lede {
    font-size: 16px;
  }

  .prototype-pill {
    display: none;
  }

  /* "installation pilote" is long enough to collide with Restart on a phone. */
  .brand-sub,
  .brand-divider {
    display: none;
  }

  .brand-logo {
    height: 26px;
  }

  .navigation-bar {
    flex-wrap: wrap;
    gap: 12px;
  }

  .keyboard-hint {
    display: none;
  }

  .primary-button,
  .secondary-button {
    flex: 1 1 auto;
    justify-content: center;
  }

  .screenshot-gallery {
    gap: 10px;
  }

  .qr-frame {
    width: 200px;
    height: 200px;
  }

  .visual-inner {
    padding: 18px 14px;
  }

  .action-panel,
  .tip-panel {
    padding: 16px 18px;
  }
}
