/* ---- theme tokens ----
   Dark is the default for everyone. The light theme applies only when the
   visitor chooses it with the header toggle (data-theme="light", set by
   scripts/theme.js). Light colours follow the Sorlos brand as used in
   Sorlos Athena: mint (#3aefcc) is unreadable as text on white (1.5:1), so
   text and thin lines use a deep teal there, and the main button is Dark. */
:root {
  color-scheme: dark;
  --bg: #070b0f;
  --bg-alt: #0b1116;
  --surface: #101820;
  --surface-2: #141e27;
  --border: #1c2a33;
  --gradient-edge: var(--border); /* darker end of card and About gradients */
  --text: #eaf5f2;
  --text-secondary: #93a8a6;
  --text-muted: #869998; /* 4.9:1 or better on every dark surface */
  --accent-text: #3aefcc; /* eyebrows, highlights, links */
  --accent-line: #3aefcc; /* step nodes, bullets */
  --accent-dim: #26a58f; /* section labels, CTA and portrait borders; 4.8:1 or better */
  --accent-tint: rgba(58, 239, 204, 0.08);
  --portrait-bg: linear-gradient(
    135deg,
    rgba(58, 239, 204, 0.18),
    rgba(58, 239, 204, 0.04)
  );
  --action-bg: #3aefcc; /* primary button */
  --action-text: #04241e;
  --header-bg: rgba(7, 11, 15, 0.85);
  --lattice: 58, 239, 204; /* hero canvas, as r, g, b */
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-alt: #f3f2f3; /* brand Light + 50% White */
  --surface: #ffffff;
  --surface-2: #e7e4e6; /* brand Light */
  --border: #d7d7d8;
  --gradient-edge: #e7e4e6;
  --text: #36393b; /* brand Dark: 11.6:1 on white */
  --text-secondary: #4a4d4f; /* 5.9:1 or better on every light surface */
  --text-muted: #5e6162; /* 4.9:1 or better on every light surface */
  --accent-text: #377067; /* mint + Dark: 4.5:1 or better on every light surface */
  --accent-line: #377067;
  --accent-dim: #377067;
  --accent-tint: #dcfcf6;
  --portrait-bg: #dcfcf6;
  --action-bg: #36393b;
  --action-text: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.85);
  --lattice: 55, 112, 103;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.mono {
  font-family: "IBM Plex Mono", monospace;
}

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

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px;
}

section {
  position: relative;
}

/* ---- nav ---- */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
}

nav.wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.02em;
  vertical-align: baseline;
}

.logo span {
  color: var(--accent-text);
}

.nav-links {
  display: flex;
  gap: 36px;
  align-items: center;
}

.nav-links a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.2s;
}

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

.nav-cta {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  border: 0.5px solid var(--accent-dim);
  color: var(--accent-text);
  padding: 9px 18px;
  border-radius: 2px;
  transition: all 0.2s;
}

.nav-cta:hover {
  background: var(--accent-tint);
}

/* Header logo: one image per theme */
.logo-on-dark {
  display: block;
}

.logo-on-light {
  display: none;
}

:root[data-theme="light"] .logo-on-dark {
  display: none;
}

:root[data-theme="light"] .logo-on-light {
  display: block;
}

/* Theme toggle: shows the icon of the theme it switches to */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: none;
  border: 0.5px solid var(--border);
  border-radius: 2px;
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    color 0.2s,
    border-color 0.2s;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-secondary);
}

.theme-toggle:focus-visible,
.nav-links a:focus-visible,
.btn-primary:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

.theme-toggle .icon-sun {
  display: block;
}

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

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

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

.nav-cta,
.theme-toggle {
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 820px) {
  .nav-links {
    gap: 12px;
  }

  .nav-links a:not(.nav-cta) {
    display: none;
  }
}

/* ---- hero ---- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 72px;
  overflow: hidden;
}

#lattice {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 680px;
}

.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--accent-text);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 20px;
  display: block;
}

.hero h1 {
  font-size: 56px;
  line-height: 1.08;
  margin-bottom: 24px;
}

.hero h1 em {
  color: var(--accent-text);
  font-style: normal;
}

.hero p {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 520px;
  margin-bottom: 36px;
}

.btn-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--action-bg);
  color: var(--action-text);
  font-weight: 500;
  font-size: 15px;
  padding: 14px 26px;
  border-radius: 2px;
  display: inline-block;
  transition: transform 0.15s;
}

.btn-primary:hover {
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .hero h1 {
    font-size: 38px;
  }
}

/* ---- section headers ---- */
.section-pad {
  padding: 120px 0;
}

.eyebrow-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--accent-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: block;
}

h2.section-title {
  font-size: 36px;
  margin-bottom: 20px;
  max-width: 640px;
}

/* ---- mission ---- */
.mission {
  background: var(--bg-alt);
}

.mission-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: center;
}

.mission-text p {
  color: var(--text-secondary);
  font-size: 17px;
  margin-bottom: 20px;
  max-width: 520px;
}

.equation-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 32px;
}

.equation-card .mono {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: block;
}

.equation {
  font-family: "IBM Plex Mono", monospace;
  font-size: 22px;
  color: var(--accent-text);
  margin-bottom: 20px;
}

.eq-row {
  display: flex;
  justify-content: space-between;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 8px 0;
  border-top: 0.5px solid var(--border);
}

@media (max-width: 820px) {
  .mission-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- services ---- */
.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 56px;
}

.service-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 36px;
  position: relative;
  overflow: hidden;
}

.service-num {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 24px;
}

.service-card h3 {
  font-size: 22px;
  margin-bottom: 12px;
}

.service-card p {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 24px;
}

.service-list {
  list-style: none;
}

.service-list li {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 10px 0;
  border-top: 0.5px solid var(--border);
  display: flex;
  gap: 10px;
}

.service-list li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-line);
  margin-top: 7px;
  flex-shrink: 0;
}

@media (max-width: 820px) {
  .services-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- founders ---- */
.founders {
  background: var(--bg-alt);
}

.founders-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 56px;
}

.founder-card {
  background-image: linear-gradient(45deg, var(--gradient-edge), var(--surface));
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 32px;
  text-align: center;
}

.founder-card h3 {
  font-size: 19px;
  margin-bottom: 4px;
}

.founder-role {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: block;
}

.founder-card p {
  color: var(--text-secondary);
  font-size: 14.5px;
}
img.founder-portrait {
  width: 128px;
  border-radius: 8px;
  background: var(--portrait-bg);
  border: 0.5px solid var(--accent-dim);
}

@media (max-width: 820px) {
  .founders-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- contact ---- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 64px;
  margin-top: 56px;
}

.contact-info p {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 28px;
  max-width: 340px;
}

.contact-line {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 10px;
}

.contact-line a,
.contact-line address {
  color: var(--accent-text);
}

.contact-line address {
  display: inline-block;
  vertical-align: top;
  font-style: normal;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.contact-link:hover {
  color: var(--text);
}

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

@media (max-width: 820px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- about & footer ---- */
footer {
  padding: 48px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

footer .mono {
  font-size: 12px;
  color: var(--text-muted);
}

.about {
  border-top: 0.5px solid var(--border);
  background: linear-gradient(145deg, var(--bg-alt), var(--gradient-edge));
  padding-bottom: 24px;
}

.about .section-pad {
  padding-bottom: 48px;
}

.about-text p + p {
  margin-top: 1.6em;
}

.logo-small {
  font-size: 15px;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 64px;
  align-items: center;
}

/* ---- migration path ---- */
.path {
  margin-top: 80px;
}

.path-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.path-step {
  position: relative;
  padding-top: 32px;
}

/* connector line running through the steps */
.path-step::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 0;
  right: -20px;
  height: 0.5px;
  background: var(--border);
}

.path-step:last-child::before {
  right: 0;
  background: linear-gradient(90deg, var(--border), transparent);
}

/* node marker */
.path-step::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--accent-line);
}

.path-step .path-num {
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  color: var(--accent-text);
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  text-transform: uppercase;
}

.path-step p {
  font-size: 14px;
  color: var(--text-secondary);
}

@media (max-width: 960px) {
  .path-steps {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .path-step {
    padding: 0 0 32px 36px;
  }

  .path-step::before {
    top: 5px;
    bottom: 0;
    left: 5px;
    right: auto;
    width: 0.5px;
    height: auto;
  }

  .path-step:last-child {
    padding-bottom: 0;
  }

  .path-step:last-child::before {
    display: none;
  }
}

@media (max-width: 820px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}
