@import url('https://fonts.googleapis.com/css2?family=Public+Sans:wght@300;400;500;600;700&display=swap');

/* Reset and Core tokens */
:root {
  --bg-color: #09090b;
  --bg-darker: #000000;
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;
  --accent-cyan: #00e5ff;
  --accent-blue: #3b82f6;
  
  --font-brand: 'Public Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Public Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Public Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --glass-bg: rgba(17, 17, 21, 0.45);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-hover-border: rgba(0, 229, 255, 0.25);
  --glass-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
  --glow-shadow: 0 10px 40px -15px rgba(0, 229, 255, 0.15);
  
  color-scheme: dark;
}

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

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  overflow-y: auto;
  touch-action: pan-y;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.site-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* Math Watermark Background */
.math-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.math-formula {
  position: absolute;
  font-family: 'Courier New', Courier, monospace;
  font-size: clamp(0.9rem, 1.5vw, 1.25rem);
  color: rgba(255, 255, 255, 0.025);
  user-select: none;
  white-space: nowrap;
}

.formula-1 { top: 8%; right: 28%; transform: rotate(-8deg); }
.formula-2 { top: 22%; right: 10%; transform: rotate(5deg); }
.formula-3 { top: 35%; right: 22%; transform: rotate(-3deg); }
.formula-4 { top: 12%; right: 5%; transform: rotate(12deg); }
.formula-5 { top: 28%; right: 38%; transform: rotate(-15deg); }
.formula-6 { top: 44%; right: 8%; transform: rotate(-5deg); }

/* Coordinates Grid Overlay */
.grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.005) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.005) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 2;
}

/* Header styling */
.main-header {
  position: relative;
  z-index: 50;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.4));
  mix-blend-mode: screen;
}

.brand-logo-text {
  font-family: var(--font-brand);
  font-size: 1.1rem;
  letter-spacing: 0.14em;
  color: var(--text-primary);
  font-weight: 600;
  padding-top: 1px;
}

.header-locations {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  font-family: var(--font-heading);
}

.loc-dot {
  color: rgba(255, 255, 255, 0.25);
  margin: 0 0.2rem;
}

.header-action {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  font-family: var(--font-heading);
  font-size: 0.8rem;
}

.lang-btn {
  background: none;
  border: none;
  padding: 0.15rem 0.25rem;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: 0.04em;
  transition: color 0.3s ease;
}

.lang-btn:hover {
  color: var(--text-secondary);
}

.lang-btn.active {
  color: var(--text-primary);
  font-weight: 600;
}

.lang-sep {
  color: rgba(255, 255, 255, 0.25);
}

.btn-launch {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 0.6rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  font-family: var(--font-heading);
}

.btn-launch:hover {
  background-color: var(--text-primary);
  color: var(--bg-darker);
  border-color: var(--text-primary);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.btn-launch:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
}

/* Hero Section */
.hero-section {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1400px;
  margin: 2.5rem auto 0 auto;
  padding: 0 2.5rem;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 3rem;
  min-height: calc(75vh - 80px);
}

/* Full-bleed deep-space background for the hero */
.hero-section::before {
  content: '';
  position: absolute;
  top: -7rem;
  bottom: -5rem;
  left: calc(-50vw + 50%);
  width: 100vw;
  background-image:
    linear-gradient(90deg, rgba(4, 5, 11, 0.92) 0%, rgba(4, 5, 11, 0.55) 38%, rgba(4, 5, 11, 0.1) 72%),
    linear-gradient(to bottom, var(--bg-color) 0%, rgba(4, 5, 11, 0) 22%, rgba(4, 5, 11, 0) 68%, var(--bg-color) 100%),
    url('img/hero-space.jpg');
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
  z-index: -1;
  pointer-events: none;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 680px;
  animation: slideInLeft 1s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.3rem, 4.8vw, 4.4rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  text-wrap: balance;
}

.hero-description {
  font-size: clamp(0.95rem, 1.5vw, 1.15rem);
  line-height: 1.55;
  color: var(--text-secondary);
  font-weight: 300;
  margin-bottom: 2rem;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.btn-solid {
  background-color: var(--text-primary);
  color: var(--bg-darker);
  border: 1px solid var(--text-primary);
  border-radius: 8px;
  padding: 0.85rem 1.6rem;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  font-family: var(--font-heading);
  letter-spacing: 0.02em;
}

.btn-solid:hover {
  background-color: transparent;
  color: var(--text-primary);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.btn-link {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.85rem 1.2rem;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-family: var(--font-heading);
  letter-spacing: 0.02em;
}

.btn-link:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background-color: rgba(255, 255, 255, 0.02);
}

.btn-solid:focus-visible, .btn-link:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
}

.hero-graphic-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  animation: fadeIn 1.5s ease-out;
}

.glow-underlay {
  position: absolute;
  width: 75%;
  height: 75%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.08) 0%, rgba(59, 130, 246, 0.02) 50%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

.hero-tree-image {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 520px;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.08));
  user-select: none;
  -webkit-user-drag: none;
  animation: floatSlow 6s infinite ease-in-out;
  mix-blend-mode: screen;
}

/* Manifesto Section */
.manifesto-section {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1400px;
  margin: 5rem auto;
  padding: 5rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Full-bleed focal halo behind the manifesto (Von Restorff focal point) */
.manifesto-section::before {
  content: '';
  position: absolute;
  inset: 0;
  left: calc(-50vw + 50%);
  width: 100vw;
  background:
    radial-gradient(ellipse 62% 78% at 50% 50%, rgba(0, 160, 195, 0.38) 0%, rgba(30, 50, 105, 0.20) 42%, rgba(4, 5, 11, 0) 74%);
  z-index: -1;
  pointer-events: none;
}

.section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: 2rem;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

.section-divider-label {
  padding: 0 1.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--text-secondary);
  font-weight: 500;
  font-family: var(--font-heading);
}

.manifesto-text {
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  line-height: 1.5;
  color: var(--text-primary);
  font-weight: 300;
  max-width: 950px;
  text-wrap: pretty;
}

/* Bento Section */
.bento-section {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto 8rem auto;
  padding: 0 2.5rem;
}

.bento-header {
  margin-bottom: 3rem;
}

.bento-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.bento-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.75rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: var(--glass-shadow);
  min-height: 158px;
}

.bento-card:hover {
  border-color: var(--glass-hover-border);
  background: rgba(22, 22, 28, 0.55);
  transform: translateY(-2px);
  box-shadow: var(--glass-shadow), var(--glow-shadow);
}

.card-wide {
  flex-direction: row;
  justify-content: flex-start;
  gap: 2.2rem;
}

/* All capability cards share the horizontal (card-wide) layout in a 2-column grid. */

.card-graphic {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}

.card-research .card-graphic {
  width: 100%;
  height: 160px;
  margin-top: 1rem;
}

.svg-graphic {
  width: 100%;
  height: 100%;
}

.card-content {
  display: flex;
  flex-direction: column;
}

.card-research .card-content {
  width: 100%;
}

.card-number {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}

.card-subtitle {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-secondary);
  font-weight: 300;
}

/* Full-bleed proof band (NASA-style image moment) */
.proof-band {
  position: relative;
  z-index: 10;
  width: 100%;
  align-self: stretch;
  min-height: 60vh;
  margin: 6rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* Shorter image-only dividers between zones */
.proof-band--divider {
  min-height: 42vh;
}

.proof-band-1 {
  background-image:
    linear-gradient(rgba(4, 5, 11, 0.40), rgba(4, 5, 11, 0.48)),
    url('img/work-photo.jpg');
}

.proof-band-2 {
  background-image:
    linear-gradient(rgba(4, 5, 11, 0.42), rgba(4, 5, 11, 0.52)),
    url('img/band2.jpg');
}

.proof-band-3 {
  background-image:
    linear-gradient(rgba(4, 5, 11, 0.42), rgba(4, 5, 11, 0.52)),
    url('img/band3.jpg');
}

.proof-inner {
  max-width: 920px;
  padding: 3rem 2rem;
}

.proof-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #00e5ff;
  margin-bottom: 1rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.proof-line {
  font-size: clamp(1.8rem, 4.2vw, 3.2rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #fff;
  margin: 0;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.7);
}

/* Selected Work / Case Section */
.case-section {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto 8rem auto;
  padding: 4rem 2.5rem 2rem;
}

/* Full-bleed glow band behind Selected Work */
.case-section::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: -4rem;
  left: calc(-50vw + 50%);
  width: 100vw;
  background-image:
    linear-gradient(to bottom, rgba(4, 5, 11, 0.30) 0%, rgba(4, 5, 11, 0.35) 35%, rgba(4, 5, 11, 0.65) 100%),
    url('img/work-glow.jpg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  z-index: -1;
  pointer-events: none;
}

.case-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.case-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 2rem;
  scroll-margin-top: 2rem;
  position: relative;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--glass-shadow);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.case-card-feature {
  grid-column: 1 / -1;
}

.case-card-feature .case-title {
  font-size: 1.8rem;
  max-width: 22ch;
}

/* Feature card with a floating product image */
.case-card-media {
  display: grid;
  grid-template-columns: 1fr minmax(200px, 300px);
  gap: 2.5rem;
  align-items: center;
}

.case-media {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.case-media img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
  filter: drop-shadow(0 22px 32px rgba(0, 0, 0, 0.55));
}

/* Wider media column for landscape framed screenshots */
.case-card-media.media-wide {
  grid-template-columns: 1fr minmax(320px, 460px);
}

/* Stacked media for the smaller (half-width) cards: image below the text */
.case-card-stack {
  display: flex;
  flex-direction: column;
}

.case-media--stack {
  margin: 1.6rem 0 0 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.case-media--stack img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.5));
}

/* Framed screenshot variant (photos / UI captures with a background) */
.case-media--frame {
  width: 100%;
  align-self: stretch;
}

.case-media--frame img {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: none;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  filter: none;
}

@media (max-width: 768px) {
  .case-card-media,
  .case-card-media.media-wide {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .case-media img {
    max-height: 300px;
  }
}

.case-live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00e5ff;
  margin-right: 7px;
  box-shadow: 0 0 6px #00e5ff;
  animation: livePulse 1.8s infinite ease-in-out;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.case-card:hover {
  border-color: var(--glass-hover-border);
  box-shadow: var(--glass-shadow), var(--glow-shadow);
}

.case-tag {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #00e5ff;
}

.case-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0.8rem 0 0.9rem 0;
  line-height: 1.3;
}

.case-text {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
  font-weight: 300;
  max-width: 70ch;
}

/* Share button (projects + chapters) */
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  background: rgba(17, 17, 21, 0.55);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  vertical-align: middle;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.share-btn:hover {
  color: var(--accent-cyan);
  border-color: var(--glass-hover-border);
  background: rgba(0, 229, 255, 0.06);
}
.share-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.case-card > .share-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 6;
}
.section-divider .share-btn {
  width: 30px;
  height: 30px;
  margin-left: 0.25rem;
}
.share-btn.copied {
  color: var(--accent-cyan);
  border-color: var(--glass-hover-border);
}
.share-btn.copied::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.7rem;
  font-weight: 500;
  background: rgba(17, 17, 21, 0.95);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 3px 8px;
  border-radius: 6px;
  pointer-events: none;
}

/* Card Vector SVG Animations */
.trace {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1.5;
}

.pulse-glow {
  animation: glowPulse 3s infinite ease-in-out;
}

@keyframes glowPulse {
  0%, 100% { stroke-opacity: 0.3; filter: drop-shadow(0 0 2px rgba(0, 229, 255, 0.2)); }
  50% { stroke-opacity: 1; filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.8)); }
}

/* AI chip signal animation using CSS motion paths or dashoffsets */
.pulse-dot-1 {
  animation: travel-1 4s infinite linear;
}
.pulse-dot-2 {
  animation: travel-2 4s infinite linear 2s;
}

@keyframes travel-1 {
  0% { cx: 20px; cy: 60px; opacity: 0; }
  10% { opacity: 1; }
  45% { cx: 46px; cy: 60px; }
  55% { cx: 46px; cy: 60px; }
  90% { opacity: 1; }
  100% { cx: 60px; cy: 46px; opacity: 0; }
}

@keyframes travel-2 {
  0% { cx: 100px; cy: 60px; opacity: 0; }
  10% { opacity: 1; }
  45% { cx: 74px; cy: 60px; }
  55% { cx: 74px; cy: 60px; }
  90% { opacity: 1; }
  100% { cx: 60px; cy: 74px; opacity: 0; }
}

/* IoT signal waves */
.iot-core {
  animation: iotPulse 2s infinite ease-in-out;
}

@keyframes iotPulse {
  0%, 100% { r: 3.5; opacity: 0.7; }
  50% { r: 5; opacity: 1; filter: drop-shadow(0 0 4px #00e5ff); }
}

.wave {
  transform-origin: center;
  animation: ripple 3s infinite linear;
}

.wave-1 { animation-delay: 0s; }
.wave-2 { animation-delay: 1s; }
.wave-3 { animation-delay: 2s; }

@keyframes ripple {
  0% { transform: scale(0.6); opacity: 0; }
  30% { opacity: 0.6; }
  100% { transform: scale(1.15); opacity: 0; }
}

/* Molecule floating */
.molecule-svg {
  animation: floatSlow 5s infinite ease-in-out;
}

.bond {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1.5;
}

.atom-neutral {
  fill: #18181b;
  stroke: rgba(255, 255, 255, 0.25);
  stroke-width: 1.5;
}

.atom-highlight {
  fill: var(--accent-cyan);
  filter: drop-shadow(0 0 6px var(--accent-cyan));
}

.atom-halo {
  fill: none;
  stroke: var(--accent-cyan);
  stroke-width: 1;
  stroke-opacity: 0.15;
  transform-origin: 60px 35px;
  animation: haloPulse 2.5s infinite ease-in-out;
}

@keyframes haloPulse {
  0%, 100% { transform: scale(0.8); stroke-opacity: 0.05; }
  50% { transform: scale(1.15); stroke-opacity: 0.3; }
}

/* Footer Styling */
.main-footer {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1400px;
  margin: auto auto 0 auto;
  padding: 3rem 2.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-left {
  display: flex;
  align-items: center;
}

.interactive-locations {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.location-group {
  position: relative;
}

.loc-trigger {
  font-size: 0.88rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.3s ease;
  font-family: var(--font-heading);
}

.loc-trigger:hover {
  color: var(--text-primary);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.loc-details-bubble {
  position: absolute;
  bottom: 150%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #0c0c0e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 100;
  pointer-events: none;
}

.loc-details-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #0c0c0e transparent transparent transparent;
}

.location-group:hover .loc-details-bubble,
.location-group.active .loc-details-bubble {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Header location bubbles open downward (header sits at the top) */
.header-locations .loc-trigger {
  font-size: inherit;
  color: inherit;
}

.header-locations .loc-trigger:hover {
  color: var(--text-primary);
}

.header-locations .loc-details-bubble {
  bottom: auto;
  top: 150%;
  transform: translateX(-50%) translateY(-10px);
}

.header-locations .location-group:hover .loc-details-bubble,
.header-locations .location-group.active .loc-details-bubble {
  transform: translateX(-50%) translateY(0);
}

.header-locations .loc-details-bubble::after {
  top: auto;
  bottom: 100%;
  border-color: transparent transparent #0c0c0e transparent;
}

.bubble-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.bubble-link {
  font-size: 0.76rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.bubble-link:hover {
  color: var(--accent-cyan);
}

.footer-dot {
  color: rgba(255, 255, 255, 0.15);
  font-size: 0.75rem;
}

.footer-center-right {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--text-secondary);
}

.copyright-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.footer-star-container {
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-secondary);
}

.sparkle-star {
  transition: transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1), color 0.3s ease;
}

.footer-star-container:hover .sparkle-star {
  transform: rotate(90deg) scale(1.1);
  color: var(--accent-cyan);
}

/* Modal Styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: rgba(17, 17, 21, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  padding: 2.2rem;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.modal-overlay.active .modal-container {
  transform: translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s ease;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.modal-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.modal-form {
  display: block;
}

.form-group {
  margin-bottom: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.7rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.15);
}

.btn-submit {
  width: 100%;
  background-color: var(--text-primary);
  color: var(--bg-darker);
  border: 1px solid var(--text-primary);
  border-radius: 8px;
  padding: 0.8rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-heading);
}

.btn-submit:hover {
  background-color: transparent;
  color: var(--text-primary);
}

.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.modal-success-msg {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem 0;
}

.modal-success-msg.active {
  display: flex;
}

.modal-success-msg h4 {
  font-family: var(--font-heading);
  color: var(--accent-cyan);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.modal-success-msg p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, 30px) scale(1.05); }
}

/* Back-to-top button */
.back-to-top {
  position: fixed;
  bottom: calc(1.5rem + env(safe-area-inset-bottom));
  right: 1.5rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(17, 17, 21, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 200;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  border-color: rgba(0, 229, 255, 0.5);
  color: #00e5ff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 14px rgba(0, 229, 255, 0.3);
}

/* Responsive adjustments */
@media (max-width: 1100px) {
  .hero-section {
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
    text-align: center;
  }
  
  .hero-content {
    align-items: center;
    max-width: 100%;
  }
  
  .hero-actions {
    justify-content: center;
  }
  
  .hero-graphic-container {
    max-width: 420px;
    margin: 0 auto;
  }
}

@media (max-width: 900px) {
  .bento-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .case-grid {
    grid-template-columns: 1fr;
  }

  .case-card-feature .case-title {
    font-size: 1.5rem;
  }
  
  .card-wide, .card-tall {
    grid-column: auto !important;
    grid-row: auto !important;
  }
  
  .card-research {
    flex-direction: row;
    text-align: left;
    gap: 2.2rem;
  }
  
  .card-research .card-graphic {
    width: 100px;
    height: 100px;
    margin-top: 0;
  }
}

@media (max-width: 768px) {
  .main-header {
    padding: 1.25rem 1.5rem;
    flex-direction: column;
    gap: 1rem;
  }
  
  .header-locations {
    order: 3;
    font-size: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Header location bubbles: keep within the viewport on mobile */
  .header-locations .loc-details-bubble {
    min-width: 0;
    width: max-content;
    max-width: calc(100vw - 3rem);
  }

  .header-locations .loc-details-bubble::after {
    display: none;
  }

  .header-locations .location-group:first-of-type .loc-details-bubble {
    left: 0;
    right: auto;
    transform: translateX(0) translateY(-10px);
  }

  .header-locations .location-group:first-of-type:hover .loc-details-bubble,
  .header-locations .location-group:first-of-type.active .loc-details-bubble {
    transform: translateX(0) translateY(0);
  }

  .header-locations .location-group:last-of-type .loc-details-bubble {
    left: auto;
    right: 0;
    transform: translateX(0) translateY(-10px);
  }

  .header-locations .location-group:last-of-type:hover .loc-details-bubble,
  .header-locations .location-group:last-of-type.active .loc-details-bubble {
    transform: translateX(0) translateY(0);
  }

  /* Footer location bubbles: same edge anchoring as the header on mobile */
  .interactive-locations .loc-details-bubble {
    min-width: 0;
    width: max-content;
    max-width: calc(100vw - 3rem);
  }

  .interactive-locations .loc-details-bubble::after {
    display: none;
  }

  .interactive-locations .location-group:first-of-type .loc-details-bubble {
    left: 0;
    right: auto;
    transform: translateX(0) translateY(10px);
  }

  .interactive-locations .location-group:first-of-type:hover .loc-details-bubble,
  .interactive-locations .location-group:first-of-type.active .loc-details-bubble {
    transform: translateX(0) translateY(0);
  }

  .interactive-locations .location-group:last-of-type .loc-details-bubble {
    left: auto;
    right: 0;
    transform: translateX(0) translateY(10px);
  }

  .interactive-locations .location-group:last-of-type:hover .loc-details-bubble,
  .interactive-locations .location-group:last-of-type.active .loc-details-bubble {
    transform: translateX(0) translateY(0);
  }

  .header-action {
    order: 2;
  }
  
  .hero-section {
    padding: 0 1.5rem;
  }
  
  .manifesto-section {
    padding: 0 1.5rem;
    margin: 3.5rem auto;
  }
  
  .bento-section {
    padding: 0 1.5rem;
    margin-bottom: 5rem;
  }

  .case-section {
    padding: 0 1.5rem;
    margin-bottom: 5rem;
  }

  .proof-band {
    background-attachment: scroll;
    min-height: 48vh;
    margin: 4rem 0;
  }

  .proof-band--divider {
    min-height: 32vh;
  }

  .case-card {
    padding: 1.75rem;
  }

  .case-title {
    font-size: 1.3rem;
  }

  .main-footer {
    padding: 2.5rem 1.5rem;
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }
  
  .footer-center-right {
    flex-direction: column;
    gap: 1rem;
  }
  
  .card-wide, .card-research {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.2rem;
    height: auto;
    padding: 1.5rem;
  }
  
  .card-graphic, .card-research .card-graphic {
    width: 80px;
    height: 80px;
  }

  .math-background {
    display: none;
  }

  .interactive-locations {
    flex-wrap: wrap;
    justify-content: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Legal Pages Styling */
.legal-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 900px;
  margin: 4rem auto 8rem auto;
  padding: 0 2.5rem;
  animation: fadeIn 1s ease-out;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 2rem;
  transition: color 0.2s ease;
  font-family: var(--font-heading);
}

.btn-back:hover {
  color: var(--accent-cyan);
}

.legal-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.15;
}

.legal-date {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.legal-content {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-secondary);
  font-weight: 300;
}

.legal-content h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 2.5rem 0 1rem 0;
}

.legal-content p {
  margin-bottom: 1.25rem;
  text-wrap: pretty;
}

.legal-content ul {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.legal-content li {
  margin-bottom: 0.5rem;
}

/* Prevent horizontal overflow on screens smaller than the maximum container width (1400px) */
@media (max-width: 1400px) {
  .hero-section::before,
  .manifesto-section::before,
  .case-section::before {
    width: 100%;
    left: 0;
    transform: none;
  }
  
  .proof-band {
    width: 100%;
    left: 0;
    transform: none;
  }
}
