/* Theme tokens */
:root {
  --bg: #0c0f0d;
  --bg-elev: #101613;
  --card: #0e1412;
  --text: #e7f0ec;
  --muted: #9db5ac;
  --primary: #2bd48a;
  --primary-600: #17b673;
  --accent: #88ffcc;
  --border: #1f2a25;
  --ring: 0 0 0 3px color-mix(in oklab, var(--primary) 30%, transparent);
  --shadow: 0 10px 30px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .03);
}

/* On desktop, align the right card's bottom with the left column content */
@media (min-width: 1024px) {
  .about .two-col {
    align-items: end
  }

  .about .two-col> :first-child {
    align-self: start
  }
}

/* Explicit dark alias so JS can toggle 'dark' or 'light' */
:root.dark {
  --bg: #0c0f0d;
  --bg-elev: #101613;
  --card: #0e1412;
  --text: #e7f0ec;
  --muted: #9db5ac;
  --primary: #2bd48a;
  --primary-600: #17b673;
  --accent: #88ffcc;
  --border: #1f2a25;
  --ring: 0 0 0 3px color-mix(in oklab, var(--primary) 30%, transparent);
  --shadow: 0 10px 30px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .03);
}

/* Explicit light theme override when JS toggles class on :root */
:root.light {
  --bg: #f6fbf8;
  --bg-elev: #ffffff;
  --card: #ffffff;
  --text: #0f1a16;
  --muted: #3f5a52;
  --primary: #0f9f67;
  --primary-600: #0d8a58;
  --accent: #0f9f67;
  --border: #e6efea;
  --shadow: 0 10px 30px rgba(16, 44, 36, .08), inset 0 1px 0 rgba(255, 255, 255, .6);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6fbf8;
    --bg-elev: #ffffff;
    --card: #ffffff;
    --text: #0f1a16;
    --muted: #3f5a52;
    --primary: #0f9f67;
    --primary-600: #0d8a58;
    --accent: #0f9f67;
    --border: #e6efea;
    --shadow: 0 10px 30px rgba(16, 44, 36, .08), inset 0 1px 0 rgba(255, 255, 255, .6);
  }
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: linear-gradient(180deg, color-mix(in oklab, var(--bg) 96%, #0b3d2e 4%), var(--bg) 30%) fixed;
  line-height: 1.6;
}

html {
  scroll-behavior: smooth
}

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

.container {
  width: min(1200px, 92vw);
  margin-inline: auto
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden
}

.skip-link:focus {
  position: static;
  width: auto;
  height: auto;
  padding: .5rem 1rem;
  background: var(--primary);
  color: white;
  border-radius: .5rem
}

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: color-mix(in oklab, var(--bg), #000 2%);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border)
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem 0
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem
}

.brand.small .brand-name {
  font-size: 1rem
}

.brand-name {
  font-weight: 800;
  letter-spacing: .2px
}

.logo {
  color: var(--primary)
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 1rem;
  align-items: center;
  margin: 0;
  padding: 0
}

.nav-menu a {
  color: var(--text);
  text-decoration: none;
  padding: .5rem .75rem;
  border-radius: .6rem
}

.nav-menu a:hover {
  background: var(--bg-elev)
}

.nav-menu a.active {
  color: var(--primary);
  background: var(--bg-elev);
  font-weight: 700
}

.nav-menu a:focus {
  outline: none;
  box-shadow: var(--ring)
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: .6rem;
  padding: .5rem;
  gap: .25rem
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text)
}

.icon-btn {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: .6rem;
  padding: .5rem;
  display: grid;
  place-items: center
}

.icon-btn .moon {
  display: none
}

:root.light .icon-btn .sun {
  display: none
}

:root.light .icon-btn .moon {
  display: block
}

/* Buttons */
.btn {
  --_bg: var(--bg-elev);
  --_fg: var(--text);
  --_bd: var(--border);
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1rem;
  border-radius: .8rem;
  border: 1px solid var(--_bd);
  background: var(--_bg);
  color: var(--_fg);
  text-decoration: none;
  font-weight: 600;
  box-shadow: var(--shadow)
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .3);
}

.btn-primary:hover {
  background: var(--primary-600);
}

.btn:active {
  transform: translateY(0)
}

.btn-primary {
  --_bg: var(--primary);
  --_fg: white;
  --_bd: color-mix(in oklab, var(--primary) 70%, black)
}

.btn-ghost {
  background: transparent
}

.btn-sm {
  padding: .5rem .75rem
}

/* Hero */
.hero {
  padding: clamp(2rem, 3vw, 3rem) 0 2rem
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 2rem;
  align-items: center
}

.hero-copy h1 {
  font-family: "DM Serif Display", serif;
  font-size: clamp(2.2rem, 2.8vw, 3.2rem);
  line-height: 1.1;
  margin: .2rem 0 1rem
}

.hero-copy .lead {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 60ch
}

.hero-cta {
  display: flex;
  gap: .75rem;
  margin-top: 1rem
}

.hero-trust {
  display: flex;
  gap: 1rem;
  margin-top: 1.2rem;
  padding: 0;
  list-style: none;
  color: var(--muted)
}

.hero-visual {
  position: relative;
  background: color-mix(in oklab, var(--card) 40%, transparent);
  backdrop-filter: blur(10px);
  border-radius: 1.2rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Add any new styles below this line */

.empty-state-public {
  grid-column: 1 / -1;
  /* Span full width of the grid */
  text-align: center;
  padding: 4rem 2rem;
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.empty-state-public h3 {
  font-size: 1.75rem;
  color: var(--text-heading);
  margin-bottom: 0.5rem;
}

.empty-state-public p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
}

/* Animated Headline */
.animated-headline span {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp .6s ease-out forwards;
}

.animated-headline span:nth-child(1) {
  animation-delay: .1s;
}

.animated-headline span:nth-child(2) {
  animation-delay: .2s;
}

.animated-headline span:nth-child(3) {
  animation-delay: .3s;
}

.animated-headline span:nth-child(4) {
  animation-delay: .4s;
}

.animated-headline span:nth-child(5) {
  animation-delay: .5s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-visual video {
  display: block;
  /* Fix for the 'white line' issue */
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .5s ease-in-out;
}

.product-card img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  object-position: center;
  opacity: 1;
}

.hero-visual.is-loaded .spinner {
  opacity: 0;
}

.hero-visual.is-loaded video {
  opacity: 1;
}

.spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 1;
  transition: opacity 0.3s;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.orb {
  position: absolute;
  inset: auto -10% -10% auto;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, var(--accent), transparent 60%);
  filter: blur(14px);
  opacity: .5;
  pointer-events: none
}

.accent {
  color: var(--accent)
}

/* Sections */
section {
  scroll-margin-top: 80px
}

/* Reserve space for the fixed header */
body.with-fixed-header {
  padding-top: var(--header-h, 64px)
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem
}

.section-head .controls {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: nowrap
}

.section-head .controls .input-wrap {
  flex: 1 1 220px;
  min-width: 180px
}

.section-head .controls select {
  flex: 0 0 auto;
  width: 180px
}

.two-col {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 2rem;
  align-items: start
}

.muted {
  color: var(--muted)
}

/* Stats */
.stats {
  padding: 2rem 0
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem
}

.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: var(--shadow)
}

.stat .value {
  font-family: "DM Serif Display", serif;
  font-size: 1.8rem
}

.stat .label {
  color: var(--muted)
}

/* --- Site Overlay Announcements --- */
#siteOverlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: auto;
}

.site-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
}

.site-overlay-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.site-overlay-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 0.75rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.site-overlay-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: #111827;
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.site-overlay-close:hover {
  background: #ffffff;
}

.site-overlay-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  color: #111827;
  font-size: 1.75rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.site-overlay-prev {
  left: 1.25rem;
}

.site-overlay-next {
  right: 1.25rem;
}

@media (max-width: 640px) {
  .site-overlay-content {
    padding: 1rem;
  }

  .site-overlay-close {
    width: 32px;
    height: 32px;
    font-size: 1.25rem;
  }

  .site-overlay-nav {
    width: 32px;
    height: 32px;
    font-size: 1.5rem;
  }
}

/* Cards & grids */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: var(--shadow);
  transition: transform .3s, box-shadow .3s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, .3);
}

.card.highlight {
  border-color: color-mix(in oklab, var(--primary) 40%, var(--border))
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem
}

/* Inputs */
.input-wrap {
  position: relative
}

.input-wrap input {
  width: 100%;
  padding: .8rem 2.2rem .8rem .9rem;
  border-radius: .8rem;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text)
}

.input-wrap .icon-search {
  position: absolute;
  right: .6rem;
  top: 50%;
  translate: 0 -50%;
  opacity: .6
}

select {
  padding: .8rem .9rem;
  border-radius: .8rem;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text)
}

/* Product */
.product-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: .5rem
}

.product-meta {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap
}

.chip {
  font-size: .8rem;
  padding: .2rem .5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--muted)
}

/* Research */
.chips {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap
}

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

.list li {
  padding: .6rem;
  border-radius: .6rem;
  border: 1px dashed var(--border)
}

/* Pillars & checklist */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .8rem
}

.pillar {
  padding: .9rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--card)
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .5rem
}

.checklist li {
  display: flex;
  gap: .5rem
}

.checklist li::before {
  content: "✓";
  color: var(--primary)
}

/* Team */
.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem
}

.member {
  display: grid;
  gap: .4rem
}

.member .avatar {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  object-fit: cover;
  object-position: center;
  border: 1px solid var(--border)
}

.member .role {
  color: var(--muted);
  font-size: .9rem
}

/* News */
.list-articles {
  display: grid;
  gap: 1rem
}

.article {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
  background: var(--card)
}

.article img {
  border-radius: .6rem;
  border: 1px solid var(--border);
  object-fit: cover;
  aspect-ratio: 16/10
}

.article .meta {
  color: var(--muted);
  font-size: .9rem
}

/* Contact */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .8rem
}

.form-grid label {
  display: grid;
  gap: .3rem
}

.form-grid input,
.form-grid textarea,
.form-grid select {
  padding: .8rem;
  border-radius: .6rem;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text)
}

.form-grid .span-2 {
  grid-column: 1/-1
}

.form-status {
  margin-top: .5rem;
  color: var(--muted)
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .4rem
}

/* Footer */
.site-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-elev), var(--bg));
  padding: 2rem 0
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1rem;
  align-items: start
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .4rem
}

.footer-links a {
  text-decoration: none;
  color: var(--text)
}

.footer-links a:hover {
  color: var(--primary)
}

/* Scroll-triggered Animations */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 1200px) {
  .container {
    width: min(1000px, 92vw)
  }
}

@media (max-width: 1024px) {
  .two-col {
    grid-template-columns: 1fr
  }

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

  .team-grid {
    grid-template-columns: repeat(3, 1fr)
  }

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

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr
  }

  .section-head {
    flex-direction: column;
    align-items: stretch
  }

  /* Keep search + category on the same row using grid */
  .section-head .controls {
    align-self: stretch;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: .6rem
  }

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

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

  .form-grid {
    grid-template-columns: 1fr
  }

  .pillars {
    grid-template-columns: 1fr
  }

  .footer-grid {
    grid-template-columns: 1fr
  }

  .footer-grid>*+* {
    margin-top: .75rem
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-grid
  }

  .nav-menu {
    position: absolute;
    inset: 60px 1rem auto 1rem;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    padding: 1rem;
    display: none;
    flex-direction: column
  }

  .nav-menu.open {
    display: flex
  }

  .card-grid {
    grid-template-columns: 1fr
  }

  .pillars {
    grid-template-columns: 1fr
  }

  .footer-grid {
    grid-template-columns: 1fr
  }
}

@media (max-width: 520px) {
  .section-head .controls {
    grid-template-columns: 1fr
  }

  .section-head .controls select {
    width: 100%
  }

  .brand-name {
    font-size: 1rem
  }

  .btn {
    padding: .6rem .8rem
  }

  .stat .value {
    font-size: 1.4rem
  }
}