/* ============================================================
   Base & Reset
   ============================================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #000000;
  --text: #ffffff;
  /* 0.55 alpha on #000 ≈ #8c8c8c, ~6.15:1 contrast — passes WCAG AA for body text */
  --text-dim: rgba(255, 255, 255, 0.55);
  --border: rgba(255, 255, 255, 0.1);
  --accent: rgba(255, 255, 255, 0.08);
  --section-min: 75vh;
  --nav-h: 4rem;
  --pad-x: clamp(1.5rem, 6vw, 6rem);
  --pad-y: clamp(3rem, 8vh, 6rem);

  /* Font stacks */
  --font-body: 'Arimo', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', Menlo, Consolas, 'Courier New', monospace;
}

/* Fluid root font-size:
   - Up to ~1920px viewport → 16px (current "1K" baseline preserved)
   - Above 1920px → scales linearly (0.84vw)
   - Capped at 32px for ultra-wide / 4K
   All rem-based sizes in this file cascade from here,
   so layout proportions are preserved across displays. */
html {
  scroll-behavior: smooth;
  font-size: clamp(16px, 0.84vw, 32px);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Navigation
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad-x);
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}

.nav.scrolled {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: var(--border);
}

.nav-brand {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  /* Hidden by default; revealed (via .visible class from app.js)
     only after the hero scrolls out of view, so "SOMA COMPANY"
     never shows twice at once. */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.nav-brand.visible {
  opacity: 1;
  pointer-events: auto;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.2s;
}

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

/* ============================================================
   Hero (page title, not a full section)
   ============================================================ */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(var(--nav-h) + 3rem) var(--pad-x) 3rem;
  text-align: center;
  gap: 0.75rem;
}

.hero-brand {
  font-family: var(--font-body);
  font-size: clamp(2rem, 4.5vw, 4rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1;
  /* Offset wide letter-spacing so the text appears optically centred */
  padding-left: 0.08em;
  color: var(--text);
}

.hero-status {
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 0.85vw, 0.95rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

/* ============================================================
   Sections
   ============================================================ */
.section {
  min-height: var(--section-min);
  padding: var(--pad-y) var(--pad-x);
  padding-top: calc(var(--pad-y) + var(--nav-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.section:last-child {
  border-bottom: none;
}

/* Inner layout: label+title left, body right */
.section-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  max-width: 87.5rem;
  /* 1400px at 16px root; scales with viewport */
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 2;
}

/* Alternate visual side for even sections */
.section:nth-child(even) .section-inner {
  direction: rtl;
}

.section:nth-child(even) .section-text,
.section:nth-child(even) .section-visual {
  direction: ltr;
}

.section-text {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.section-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  font-weight: 400;
}

.section-label-line {
  width: 2rem;
  height: 1px;
  background: var(--border);
}

.section-title {
  font-family: var(--font-body);
  font-size: clamp(1.75rem, 3.2vw, 2.75rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.section-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  /* No fixed max-width — the body fills its grid column so every
     section has identical text width and scales with the fluid root. */
}

.section-body p,
.section-body li {
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  color: var(--text-dim);
  line-height: 1.75;
  font-weight: 400;
}

.section-body ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
}

.section-body li {
  position: relative;
  padding-left: 1.25rem;
}

.section-body li::before {
  content: '\2022';
  /* • bullet */
  position: absolute;
  left: 0;
  top: 0;
  color: var(--text-dim);
  line-height: inherit;
}

.section-body a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 0.2em;
  transition: text-decoration-color 0.2s;
}

.section-body a:hover {
  text-decoration-color: var(--text);
}

.section-body strong {
  color: var(--text);
  font-weight: 500;
}

/* ============================================================
   Visual / Animation area
   ============================================================ */
.section-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 20rem;
  position: relative;
}

.section-visual canvas,
.section-visual .anim {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
}

.section-visual img,
.section-visual video {
  max-width: 100%;
  max-height: 28.75rem;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
  opacity: 0.95;
}

/* ============================================================
   Animations
   ============================================================ */

/* Shared canvas wrapper */
.anim-canvas-wrap {
  width: 100%;
  height: 21.25rem;
  position: relative;
}

.anim-canvas-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Section 02 — drifting lines (CSS only) */
.anim-lines {
  width: 100%;
  height: 21.25rem;
  position: relative;
  overflow: hidden;
}

.anim-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  animation: driftLine 6s ease-in-out infinite;
}

@keyframes driftLine {
  0% {
    transform: translateY(0) scaleX(0.6);
    opacity: 0;
  }

  20% {
    opacity: 1;
  }

  80% {
    opacity: 1;
  }

  100% {
    transform: translateY(-60px) scaleX(1);
    opacity: 0;
  }
}

/* Section 04 — glowing orb (CSS only) */
.anim-orb-wrap {
  width: 100%;
  height: 21.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.anim-orb {
  width: 11.25rem;
  height: 11.25rem;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.02) 70%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  animation: orbPulse 4s ease-in-out infinite;
  position: relative;
}

.anim-orb::after {
  content: '';
  position: absolute;
  inset: -24px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.05);
  animation: orbPulse 4s ease-in-out infinite 1s;
}

@keyframes orbPulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.7;
  }

  50% {
    transform: scale(1.06);
    opacity: 1;
  }
}

/* ============================================================
   Footer — two-tier: main contact row + subtle copyright strip
   ============================================================ */
.footer {
  padding: 2.5rem var(--pad-x) 1.25rem;
  border-top: 1px solid var(--border);
  scroll-margin-top: var(--nav-h);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--text-dim);
}

.footer-inner {
  max-width: 87.5rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.footer-main {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  gap: 2rem 4rem;
  flex-wrap: wrap;
}

.footer-brand-col {
  display: flex;
  align-items: flex-start;
}

.footer-brand {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text);
}

/* Labeled column (Contact / Socials) */
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.footer-col-title {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  opacity: 0.7;
}

/* Contacts */
.footer-contacts {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-contact {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-dim);
  transition: color 0.2s;
}

.footer-contact-name {
  color: var(--text);
  min-width: 10rem;
  transition: color 0.2s;
}

.footer-contact:hover {
  color: var(--text);
}
.footer-contact:hover .footer-contact-email {
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 0.25em;
}

/* Instagram — pill-style link with icon + label so it stands alone */
.footer-social {
  align-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
.footer-social:hover {
  border-color: var(--text);
  background: var(--accent);
}
.footer-social svg {
  width: 1.1rem;
  height: 1.1rem;
  display: block;
}
.footer-social-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* Bottom strip: quiet copyright */
.footer-bottom {
  padding-top: 0.5rem;
  display: flex;
  justify-content: center;
}

.footer-copy {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

/* Mobile: stack everything left-aligned, keep Instagram prominent */
@media (max-width: 768px) {
  .footer {
    padding: 2.25rem var(--pad-x) 1.25rem;
  }
  .footer-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.75rem;
  }
  .footer-col {
    gap: 0.75rem;
  }
  .footer-contact {
    flex-direction: column;
    gap: 0.1rem;
  }
  .footer-contact-name {
    min-width: 0;
  }
  .footer-bottom {
    justify-content: flex-start;
  }
}

/* ============================================================
   Scroll reveal
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

.reveal-delay-1 {
  transition-delay: 0.1s;
}

.reveal-delay-2 {
  transition-delay: 0.22s;
}

.reveal-delay-3 {
  transition-delay: 0.38s;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .section-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .section:nth-child(even) .section-inner {
    direction: ltr;
  }

  .section-visual {
    min-height: 13.75rem;
  }

  .anim-canvas-wrap,
  .anim-lines,
  .anim-orb-wrap {
    height: 13.75rem;
  }

  .anim-orb {
    width: 7.5rem;
    height: 7.5rem;
  }
}