/* KISS mock-up: one stylesheet for every screen.
   iPad mini first (744 x 1133 portrait, 1133 x 744 landscape), then iPhone and laptop.
   Text is sized to read at arm's length. Touch targets are at least 44 x 44 points.
   Pinch-to-zoom is never blocked. */

:root {
  color-scheme: light;
  --k-font-body: 18px;
  --k-font-small: 15px;
  --k-font-caption: 17px;
  --k-font-h1: 24px;
  --k-font-h2: 20px;
  --k-font-hero: 34px;
  --k-space-1: 4px;
  --k-space-2: 8px;
  --k-space-3: 12px;
  --k-space-4: 16px;
  --k-space-5: 24px;
  --k-space-6: 32px;
  --k-target: 44px;
  --k-radius: 10px;

  --k-ink: #1b2430;
  --k-ink-soft: #4a5565;
  --k-bg: #f4f6f8;
  --k-surface: #ffffff;
  --k-line: #d5dbe3;
  --k-brand: #1d3f6e;
  --k-brand-ink: #ffffff;
  --k-focus: #0b5fff;

  --k-banner-bg: #fff3c4;
  --k-banner-ink: #5a4100;
  --k-banner-line: #e3c766;

  --k-caption-bg: #e8f0fb;
  --k-caption-ink: #1d3f6e;

  --k-built-bg: #dff3e4;
  --k-built-ink: #145a2a;
  --k-designed-bg: #e3ecfa;
  --k-designed-ink: #1d4a8a;
  --k-planned-bg: #eceef1;
  --k-planned-ink: #3d4652;

  --k-abnormal: #8a1c1c;
  --k-warn-bg: #fff1e0;
  --k-warn-ink: #7a3e00;

  --k-tender: #e69f00;  /* Okabe-Ito orange */
  --k-swollen: #0072b2; /* Okabe-Ito blue */
}

@media (max-width: 600px) {
  :root {
    --k-font-body: 17px;
    --k-font-caption: 16px;
    --k-font-h1: 21px;
    --k-font-hero: 28px;
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--k-bg);
  color: var(--k-ink);
  font: var(--k-font-body)/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Vertical scrolling and pinch-zoom stay with the browser; sideways swipes move between screens. */
  touch-action: pan-y pinch-zoom;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

a { color: var(--k-brand); }
:focus-visible { outline: 3px solid var(--k-focus); outline-offset: 2px; }

h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: var(--k-font-h1); }
h2 { font-size: var(--k-font-h2); }

/* The banner on every screen. */
.demo-banner {
  background: var(--k-banner-bg);
  color: var(--k-banner-ink);
  border-bottom: 1px solid var(--k-banner-line);
  padding: var(--k-space-2) var(--k-space-4);
  padding-top: max(var(--k-space-2), env(safe-area-inset-top));
  font-size: var(--k-font-small);
  font-weight: 600;
  text-align: center;
}

/* Buttons and button-like links. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--k-target);
  min-height: var(--k-target);
  padding: 0 var(--k-space-4);
  border: 1px solid var(--k-line);
  border-radius: var(--k-radius);
  background: var(--k-surface);
  color: var(--k-brand);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary { background: var(--k-brand); border-color: var(--k-brand); color: var(--k-brand-ink); }

/* The screen header: where you are, who uses it, and its status. */
.screen-head {
  display: flex;
  align-items: center;
  gap: var(--k-space-3);
  padding: var(--k-space-3) var(--k-space-4);
  background: var(--k-surface);
  border-bottom: 1px solid var(--k-line);
}
.screen-head .titles { flex: 1; min-width: 0; }
.division {
  margin: 0;
  font-size: var(--k-font-small);
  color: var(--k-ink-soft);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Status chips: Built, Designed, Planned. Always words, never colour alone. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--k-space-1);
  padding: 2px var(--k-space-3);
  border-radius: 999px;
  font-size: var(--k-font-small);
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}
.chip-built { background: var(--k-built-bg); color: var(--k-built-ink); border-color: #9fd2ac; }
.chip-designed { background: var(--k-designed-bg); color: var(--k-designed-ink); border-color: #a9c2ea; }
.chip-planned { background: var(--k-planned-bg); color: var(--k-planned-ink); border-color: #c3c9d1; }
.chip .chip-note { font-weight: 500; }

/* The one-line caption: what the member is looking at and why it helps. */
.caption {
  margin: 0;
  padding: var(--k-space-3) var(--k-space-4);
  background: var(--k-caption-bg);
  color: var(--k-caption-ink);
  font-size: var(--k-font-caption);
  border-bottom: 1px solid #c8d8f0;
}
.captions-off .caption { display: none; }

main {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: var(--k-space-4);
}

/* Panels inside a screen. */
.panel {
  background: var(--k-surface);
  border: 1px solid var(--k-line);
  border-radius: var(--k-radius);
  padding: var(--k-space-4);
  margin-bottom: var(--k-space-4);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--k-space-3);
  margin-bottom: var(--k-space-3);
}
.placeholder { color: var(--k-ink-soft); margin: 0; }

/* Tables that scroll sideways keep their own horizontal swipe. */
.scroll-x { overflow-x: auto; touch-action: pan-x pan-y pinch-zoom; }

/* Back, the numbered steps, and Next. */
.tour-nav {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: var(--k-space-3);
  padding: var(--k-space-3) var(--k-space-4);
  padding-bottom: max(var(--k-space-3), env(safe-area-inset-bottom));
  background: var(--k-surface);
  border-top: 1px solid var(--k-line);
}
.tour-nav:empty { display: none; }
.steps {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: var(--k-space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}
.steps a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--k-target);
  height: var(--k-target);
  border-radius: 50%;
  border: 1px solid var(--k-line);
  text-decoration: none;
  font-weight: 600;
  color: var(--k-ink-soft);
}
.steps a[aria-current="step"] { background: var(--k-brand); border-color: var(--k-brand); color: var(--k-brand-ink); }
.step-count { display: none; flex: 1; margin: 0; text-align: center; font-size: var(--k-font-small); color: var(--k-ink-soft); }

@media (max-width: 640px) {
  .steps { display: none; }
  .step-count { display: block; }
  .screen-head { flex-wrap: wrap; }
  .screen-head .titles { flex-basis: 100%; }
  .screen-head .caption-toggle { margin-left: auto; }
}

.site-foot {
  padding: var(--k-space-3) var(--k-space-4);
  font-size: var(--k-font-small);
  color: var(--k-ink-soft);
  text-align: center;
}

/* The start screen. */
.start-brand {
  margin: 0;
  font-size: var(--k-font-h2);
  font-weight: 700;
  color: var(--k-brand);
}
.start-hero { padding: var(--k-space-5) 0 var(--k-space-3); }
.start-hero h1 { font-size: var(--k-font-hero); margin-top: var(--k-space-2); }
.start-hero p { max-width: 46em; }
.start-tools { display: flex; flex-wrap: wrap; gap: var(--k-space-3); align-items: center; }
.legend { display: grid; gap: var(--k-space-2); margin: 0; padding: 0; list-style: none; }
.legend li { display: flex; gap: var(--k-space-3); align-items: baseline; }
.tour-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--k-space-4);
  margin: var(--k-space-4) 0;
  padding: 0;
  list-style: none;
}
.tour-card {
  display: flex;
  flex-direction: column;
  gap: var(--k-space-2);
  height: 100%;
  min-height: 160px;
  padding: var(--k-space-5);
  background: var(--k-surface);
  border: 1px solid var(--k-line);
  border-radius: var(--k-radius);
  color: var(--k-ink);
  text-decoration: none;
}
.tour-card:hover { border-color: var(--k-brand); }
.tour-card .tour-number { font-size: var(--k-font-small); font-weight: 700; color: var(--k-ink-soft); text-transform: uppercase; letter-spacing: 0.04em; }
.tour-card h2 { color: var(--k-brand); }
.tour-card .tour-meta { margin-top: auto; font-size: var(--k-font-small); color: var(--k-ink-soft); }
.tour-card-leadership { border-color: var(--k-brand); border-width: 2px; }
