/* GB Technology and Security — Design Lab
   Original editorial scroll-world styling (not derived from Kage source). */

:root {
  --ink: #eef3f8;
  --ink-2: #ffffff;
  --charcoal: #d7e0ea;
  --bone: #101820;
  --bone-dim: #334155;
  --muted: #5b6b7c;
  --cyan: #007a8f;
  --cyan-bright: #00c2d6;
  --cyan-dim: rgba(0, 122, 143, 0.18);
  --amber: #b86a1c;
  --line: rgba(16, 24, 32, 0.12);
  --panel: rgba(255, 255, 255, 0.94);
  --panel-border: rgba(16, 24, 32, 0.1);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --display: "Source Serif 4", "Iowan Old Style", "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", sans-serif;

  --surface: #d9e2ec;
  --plates-bg: #c8d4e0;
  --pre-bg: #eef3f8;
  --header-bg: rgba(255, 255, 255, 0.9);
  --header-shadow: 0 8px 30px rgba(16, 24, 32, 0.06);
  --theme-toggle-bg: rgba(255, 255, 255, 0.7);
  --panel-shadow: 0 18px 50px rgba(16, 24, 32, 0.1);
  --ghost-bg: #fff;
  --ghost-hover-bg: #f4fbfd;
  --btn-secondary: #006677;
  --well-bg: #f7fafc;
  --text-soft: #243041;
  --heading: #0b1220;
  --footer-fade: linear-gradient(180deg, transparent, rgba(238, 243, 248, 0.88) 30%, #eef3f8);
  --scrim-a: rgba(238, 243, 248, 0.72);
  --scrim-b: rgba(238, 243, 248, 0.35);
  --scrim-c: rgba(238, 243, 248, 0.45);
  --scrim-d: rgba(238, 243, 248, 0.85);
  --scrim-radial: rgba(238, 243, 248, 0.15);
  --scrim-radial-edge: rgba(238, 243, 248, 0.55);
  --vignette: rgba(180, 195, 210, 0.35);
  --sticky-cta-bg: rgba(238, 243, 248, 0.92);
  --chapter-fade: rgba(238, 243, 248, 0.88);
}

html[data-theme="dark"] {
  --ink: #0b1220;
  --ink-2: #111827;
  --charcoal: #1a2433;
  --bone: #eef3f8;
  --bone-dim: #b7c2ce;
  --muted: #8b98a8;
  --cyan: #1ab0c4;
  --cyan-bright: #3ad7e8;
  --cyan-dim: rgba(0, 194, 214, 0.2);
  --amber: #e08a2c;
  --line: rgba(238, 243, 248, 0.12);
  --panel: rgba(17, 24, 39, 0.94);
  --panel-border: rgba(238, 243, 248, 0.12);

  --surface: #0b1220;
  --plates-bg: #0a1018;
  --pre-bg: #0b1220;
  --header-bg: rgba(11, 18, 32, 0.9);
  --header-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --theme-toggle-bg: rgba(17, 24, 39, 0.85);
  --panel-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
  --ghost-bg: rgba(17, 24, 39, 0.9);
  --ghost-hover-bg: rgba(26, 36, 51, 0.95);
  --btn-secondary: #008a9e;
  --well-bg: #152033;
  --text-soft: #c5d0db;
  --heading: #eef3f8;
  --footer-fade: linear-gradient(180deg, transparent, rgba(11, 18, 32, 0.88) 30%, #0b1220);
  --scrim-a: rgba(11, 18, 32, 0.78);
  --scrim-b: rgba(11, 18, 32, 0.45);
  --scrim-c: rgba(11, 18, 32, 0.55);
  --scrim-d: rgba(11, 18, 32, 0.88);
  --scrim-radial: rgba(11, 18, 32, 0.2);
  --scrim-radial-edge: rgba(11, 18, 32, 0.65);
  --vignette: rgba(0, 0, 0, 0.45);
  --sticky-cta-bg: rgba(11, 18, 32, 0.92);
  --chapter-fade: rgba(11, 18, 32, 0.88);
}

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

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--bone);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.55;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

#plates {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--plates-bg);
}

#plates .plate {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transform: scale(1.02);
  transition:
    opacity 0.7s var(--ease),
    transform 1s var(--ease);
}

#plates .plate.is-active {
  opacity: 1;
  transform: scale(1);
}

#plates .plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

#plates .plate-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, var(--scrim-a) 0%, var(--scrim-b) 28%, var(--scrim-c) 72%, var(--scrim-d) 100%),
    radial-gradient(ellipse at 70% 40%, var(--scrim-radial) 0%, var(--scrim-radial-edge) 100%);
  z-index: 1;
}

#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(ellipse at 50% 40%, transparent 45%, var(--vignette) 100%);
}

#pre {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: var(--pre-bg);
  color: var(--bone);
  transition: opacity 0.8s var(--ease), visibility 0.8s;
}

#pre.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pre-inner {
  width: min(320px, 80vw);
  text-align: center;
}

.pre-brand {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
}

.pre-track {
  height: 2px;
  background: var(--line);
  overflow: hidden;
}

.pre-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan-bright), var(--cyan));
  transition: width 0.2s linear;
}

.pre-pct {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: var(--header-bg);
  border-bottom: 1px solid var(--panel-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--header-shadow);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  margin-left: 0.15rem;
  border: 1px solid var(--panel-border);
  background: var(--theme-toggle-bg);
  color: var(--bone);
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}

.theme-toggle:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: var(--cyan-dim);
}

.theme-toggle .icon-moon {
  display: none;
}

html[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.brand span {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bone-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand strong {
  color: var(--bone);
  font-family: var(--sans);
  font-weight: 700;
}

#navlinks {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#navlinks a,
#navlinks button {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.45rem 0.65rem;
  border: 1px solid transparent;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}

#navlinks a:hover,
#navlinks button:hover,
#navlinks a.active,
#navlinks button.active {
  color: var(--bone);
  border-color: var(--panel-border);
  background: rgba(0, 122, 143, 0.08);
}

#navlinks a.cta-nav {
  background: var(--cyan);
  color: #fff;
  border-color: var(--cyan);
}

#navlinks a.cta-nav:hover {
  background: var(--btn-secondary);
  color: #fff;
}

main {
  position: relative;
  z-index: 10;
}

.chapter {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 7.5rem 5vw 5rem;
  position: relative;
}

.chapter:last-of-type {
  /* Extra bottom space so the final chapter can center above the footer */
  min-height: 110vh;
  padding-bottom: 8rem;
}

.chapter-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  opacity: 0.45;
  transform: translateY(12px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}

.chapter.is-active .chapter-shell {
  opacity: 1;
  transform: translateY(0);
}

.layout-media-left .chapter-shell {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

.layout-hero .chapter-shell {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  grid-template-areas:
    "copy media"
    "stats stats";
}

.layout-hero .chapter-copy {
  grid-area: copy;
}

.layout-hero .chapter-media {
  grid-area: media;
}

.layout-hero .stat-row {
  grid-area: stats;
}

.chapter-copy {
  position: relative;
  z-index: 2;
  padding: clamp(1.4rem, 2.8vw, 2.25rem);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  color: var(--bone);
  box-shadow: var(--panel-shadow);
}

.chapter-media {
  margin: 0;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  aspect-ratio: 4 / 3;
  min-height: 280px;
  background: var(--ghost-bg);
  box-shadow: var(--panel-shadow);
}

.chapter-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.04);
  transition: transform 1.2s var(--ease);
}

.chapter.is-active .chapter-media img {
  transform: scale(1);
}

.chapter-media figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.85rem 1rem;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(180deg, transparent, rgba(16, 24, 32, 0.78));
}

.eyebrow {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 1.25rem;
  font-weight: 700;
}

.eyebrow .num {
  color: var(--muted);
  font-weight: 500;
}

.chapter h1,
.chapter h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.35rem, 4.6vw, 3.55rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 1.25rem;
  color: var(--heading);
  text-shadow: none;
}

.chapter h1 {
  font-weight: 700;
}

.chapter h2 {
  font-weight: 600;
}

.lede {
  font-size: 1.08rem;
  color: var(--bone-dim);
  max-width: 42ch;
  margin: 0 0 1.5rem;
  line-height: 1.65;
}

.bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 1.75rem;
  display: grid;
  gap: 0.65rem;
}

.bullets li {
  position: relative;
  padding-left: 1.15rem;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.5;
}

.bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 7px;
  height: 2px;
  background: var(--cyan-bright);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.3rem;
  border: 1px solid var(--cyan);
  color: #fff;
  background: var(--cyan);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: transform 0.25s var(--ease), background 0.25s, color 0.25s, box-shadow 0.25s;
  box-shadow: 0 8px 20px var(--cyan-dim);
}

.btn:hover {
  transform: translateY(-1px);
  background: var(--btn-secondary);
  box-shadow: 0 10px 24px var(--cyan-dim);
}

.btn.ghost {
  background: var(--ghost-bg);
  color: var(--bone);
  border-color: var(--panel-border);
  box-shadow: none;
}

.btn.ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: var(--ghost-hover-bg);
}

.scroll-hint {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
}

.scroll-hint .bar {
  width: 2px;
  height: 42px;
  background: linear-gradient(180deg, var(--cyan-bright), transparent);
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.3;
    transform: scaleY(0.85);
  }
  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: 0 12px 36px rgba(16, 24, 32, 0.08);
}

.stat strong {
  display: block;
  font-family: var(--display);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--heading);
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.stat span {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.city-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 1.5rem 0 1.75rem;
}

.city-grid span {
  border: 1px solid var(--panel-border);
  padding: 0.7rem 0.8rem;
  font-size: 0.85rem;
  color: var(--text-soft);
  letter-spacing: 0.04em;
  background: var(--well-bg);
  font-weight: 500;
}

.partner {
  border-left: 3px solid var(--amber);
  padding: 0.85rem 0 0.85rem 1rem;
  margin: 0 0 1.5rem;
  color: var(--text-soft);
  font-size: 0.95rem;
  background: rgba(184, 106, 28, 0.06);
}

.partner a {
  color: var(--amber);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

.note {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 1rem;
}

footer.manifesto {
  position: relative;
  z-index: 10;
  min-height: 55vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 5vw 3.5rem;
  background: var(--footer-fade);
  text-align: center;
}

.manifesto-inner {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 2rem;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
}

.manifesto .cta-row {
  justify-content: center;
}

.manifesto .meta {
  justify-content: center;
}

.manifesto h2 {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 1rem;
  color: var(--heading);
}

.manifesto p {
  color: var(--bone-dim);
  max-width: 48ch;
  margin: 0 auto 1.5rem;
  font-size: 1.05rem;
}

.manifesto .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--panel-border);
  padding-top: 1.25rem;
}

.manifesto .meta a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.manifesto .meta a:hover {
  color: var(--cyan);
}

@media (max-width: 980px) {
  #navlinks a:not(.cta-nav),
  #navlinks button:not(.cta-nav):not(.theme-toggle) {
    display: none;
  }

  #navlinks {
    align-items: center;
  }

  .theme-toggle {
    margin-left: 0.35rem;
  }

  .chapter {
    padding: 6.5rem 1.25rem 4rem;
    min-height: auto;
  }

  .chapter-shell,
  .layout-media-left .chapter-shell,
  .layout-hero .chapter-shell {
    grid-template-columns: 1fr;
    grid-template-areas: none;
    gap: 1.25rem;
  }

  .layout-hero .chapter-copy,
  .layout-hero .chapter-media,
  .layout-hero .stat-row {
    grid-area: auto;
  }

  .layout-media-left .chapter-media {
    order: -1;
  }

  .chapter-media {
    aspect-ratio: 16 / 10;
    min-height: 200px;
  }

  .stat-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .city-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-hint .bar {
    animation: none;
  }

  .chapter-shell {
    transition: none;
  }
}

/* Sticky mobile CTA */
.sticky-mobile-cta {
  display: none;
}

@media (max-width: 900px) {
  .sticky-mobile-cta {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
    background: var(--sticky-cta-bg);
    border-top: 1px solid var(--panel-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -10px 30px var(--header-shadow);
  }

  .sticky-mobile-cta .btn {
    width: 100%;
  }

  body {
    padding-bottom: 5.5rem;
  }
}
