/* =========================================================
   CASM Labs — styles.css
   ========================================================= */

/* --- Custom properties --- */
:root {
  --color-ink: #0D2C54;
  --color-plasma: #00BFFF;
  --color-plasma-accessible: #00688F;
  --color-cta: #A3E635;
  --color-silver: #E8ECF2;
  --color-white: #FFFFFF;

  --text-display: clamp(3rem, 7vw, 5.5rem);
  --text-hero: clamp(2.2rem, 5vw, 4.5rem);
  --text-statement: clamp(1.6rem, 3.5vw, 3rem);
  --text-heading: clamp(1.3rem, 2.5vw, 2rem);
  --text-body: clamp(1rem, 1.5vw, 1.15rem);
  --text-caption: 0.85rem;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  color: var(--color-ink);
  background: var(--color-white);
  overflow-x: hidden;
}

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

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

ul {
  list-style: none;
}

button {
  background: none;
  border: none;
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--color-plasma);
  color: white;
}

/* --- Preloader --- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--color-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease;
}

.preloader.is-done {
  opacity: 0;
  pointer-events: none;
}

.preloader-inner {
  text-align: center;
}

.preloader-wordmark {
  margin-bottom: 2rem;
  display: flex;
  justify-content: center;
}

.preloader-logo {
  height: 32px;
  width: auto;
  display: block;
}

.preloader-bar-track {
  width: 200px;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 auto 1.25rem;
}

.preloader-bar {
  width: 0%;
  height: 100%;
  background: white;
  transition: width 0.15s ease;
}

.preloader-percent {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.3);
}

/* --- Page reveal overlay --- */
.page-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: var(--color-ink);
  pointer-events: none;
}

.page-overlay.is-hidden {
  display: none;
}

/* --- Navigation --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: transparent;
  transition: background 0.3s ease;
}

.site-header.is-scrolled {
  background: var(--color-ink);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-wordmark {
  display: flex;
  align-items: center;
}

.nav-logo {
  height: 28px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.nav-active {
  color: var(--color-plasma);
}

.nav-active {
  color: var(--color-plasma) !important;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 1px;
  background: white;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.is-open .nav-toggle-bar:first-child {
  transform: translateY(3px) rotate(45deg);
}

.nav-toggle.is-open .nav-toggle-bar:last-child {
  transform: translateY(-3px) rotate(-45deg);
}

/* Mobile nav overlay */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--color-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.nav-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.nav-overlay-links {
  text-align: center;
}

.nav-overlay-links li {
  margin-bottom: 2rem;
}

.nav-overlay-links a {
  font-size: 2rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* --- Section labels --- */
.section-label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.section-label--dark {
  color: var(--color-plasma);
}

.section-label--light {
  color: var(--color-plasma-accessible);
}

.section-label--cta {
  color: var(--color-cta);
}

/* --- Section 1: Hero --- */
.hero {
  position: relative;
  height: 100vh;
  overflow: hidden;
  background: #000;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    rgba(13, 44, 84, 0.2) 0%,
    rgba(13, 44, 84, 0.45) 60%,
    rgba(13, 44, 84, 0.88) 100%
  );
}

.hero-content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 2rem 8vh 2rem;
  max-width: 1100px;
  margin: 0 auto;
  left: 0;
  right: 0;
}

.hero-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 1.5rem;
  font-weight: 400;
}

.hero-headline {
  font-size: var(--text-hero);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.03em;
  color: white;
  margin: 0 0 1.5rem 0;
  will-change: transform, opacity;
}

.hero-line-1,
.hero-line-2,
.hero-line-3 {
  display: block;
}

.hero-intro {
  font-size: var(--text-body);
  color: rgba(255, 255, 255, 0.75);
  max-width: 600px;
  line-height: 1.7;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.hero-sub {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 3rem;
  font-weight: 400;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  right: 2rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.scroll-line {
  width: 48px;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.7);
  animation: scrollHint 1.8s ease-in-out infinite;
}

@keyframes scrollHint {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* --- Section 2: The problem --- */
.problem {
  background: linear-gradient(160deg, #0A1929 0%, #0D2C54 35%, #006994 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.problem-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 8rem 2rem;
  text-align: center;
}

.problem-display {
  font-size: var(--text-statement);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: white;
  text-align: center;
  max-width: 900px;
  margin-bottom: 2rem;
  will-change: transform, opacity, filter;
  transform-origin: center center;
  clip-path: inset(0 0% 0 0);
}

.problem-para {
  font-size: var(--text-body);
  color: rgba(255, 255, 255, 0.75);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.7;
  text-align: center;
}

.problem-para + .problem-para {
  margin-top: 1.2rem;
}

.problem-closing {
  color: var(--color-plasma);
  font-size: calc(var(--text-body) * 1.1);
}

/* --- Section 3 & 5: Photo sections --- */
.photo-section {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.photo-section-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-color: #1a1a1a;
  overflow: hidden;
}

.photo-section-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.photo-section-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
}

/* Section 3 (Our approach) overlay */
#approach .photo-section-overlay {
  background: rgba(232, 236, 242, 0.3);
}

/* Section 5 (Who we build for) overlay */
#people .photo-section-overlay {
  background: rgba(255, 255, 255, 0.25);
}

.photo-section-inner {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem 2rem;
}

.content-panel {
  background: rgba(13, 44, 84, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 3rem 3.5rem;
  max-width: 680px;
  border: 1px solid rgba(0, 191, 255, 0.1);
}

/* Right-aligned panel for Section 5 */
.photo-section--right .content-panel {
  margin-left: auto;
}

.panel-heading {
  font-size: var(--text-statement);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: white;
  margin-bottom: 1.5rem;
}

.panel-body {
  font-size: var(--text-body);
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.7;
  margin-bottom: 1.2rem;
}

.panel-body:last-child {
  margin-bottom: 0;
}

.panel-closing {
  color: var(--color-plasma);
  font-size: calc(var(--text-body) * 1.1);
}

/* --- Section 4: Our technology --- */
.technology {
  background: linear-gradient(135deg, #071525 0%, #0D2C54 30%, #005577 65%, #007C99 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.technology-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 8rem 2rem;
}

.technology-heading {
  font-size: var(--text-statement);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: white;
  margin-bottom: 2rem;
}

.technology-para {
  font-size: var(--text-body);
  color: rgba(255, 255, 255, 0.75);
  max-width: 680px;
  line-height: 1.7;
  margin-bottom: 1.2rem;
}

.technology-para:last-child {
  margin-bottom: 0;
}

.technology-closing {
  font-size: calc(var(--text-body) * 1.1);
  color: var(--color-plasma);
}

/* --- Section 6: Products --- */
.products {
  background: var(--color-silver);
  padding: 8rem 2rem;
}

.products-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.products .section-label {
  color: var(--color-plasma-accessible);
  margin-bottom: 3rem;
}

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

.product-logo-box {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(13, 44, 84, 0.08);
}

.product-logo {
  max-width: 200px;
  width: 100%;
  height: auto;
  filter: none;
  opacity: 1;
}

.product-tagline {
  font-style: italic;
  color: #4F6683;
  font-size: var(--text-body);
  margin-top: 1rem;
  text-align: center;
}

.products-heading {
  font-size: var(--text-statement);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--color-ink);
  margin-bottom: 1.5rem;
  overflow: visible;
  padding-bottom: 0.1em;
}

.product-body {
  font-size: var(--text-body);
  color: rgba(13, 44, 84, 0.7);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.product-body:last-child {
  margin-bottom: 0;
}

.products-footnote {
  font-size: var(--text-caption);
  color: #4F6683;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(13, 44, 84, 0.1);
}

/* --- Section 7: Contact --- */
.contact {
  background: var(--color-white);
  position: relative;
}

.contact-inner {
  display: grid;
  grid-template-columns: 0.6fr 1fr;
  gap: 4rem;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
  padding: 12vh 2rem;
}

.contact-heading {
  font-size: var(--text-statement);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--color-ink);
  margin-bottom: 3rem;
}

.contact-body {
  font-size: var(--text-body);
  color: rgba(13, 44, 84, 0.7);
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.contact-email {
  color: var(--color-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--color-plasma-accessible);
  padding-bottom: 0.1em;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.contact-email:hover {
  color: var(--color-plasma-accessible);
}

.company-info {
  font-size: var(--text-caption);
  color: #627690;
  line-height: 2.2;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(0, 104, 143, 0.3);
}

/* --- Section 8: Footer --- */
.footer {
  background: linear-gradient(180deg, #0D2C54 0%, #060E1A 100%);
  padding: 5rem 2rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
}

.footer-wordmark {
  margin-bottom: 0.5rem;
}

.footer-logo {
  height: 22px;
  width: auto;
  display: block;
  margin-bottom: 0.5rem;
}

.footer-tagline {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.05em;
}

.footer-copy {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  text-align: right;
  margin-bottom: 0.4rem;
}

.footer-sub {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  text-align: right;
}

.footer-reg {
  font-size: var(--text-caption);
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.6;
  text-align: right;
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
}

.footer-legal {
  display: flex !important;
  flex-wrap: wrap;
  gap: 1.5rem !important;
  justify-content: flex-end;
  margin-top: 0.75rem;
  align-items: center;
}

.footer-legal > * {
  display: inline-block !important;
}

.footer-legal a,
.footer-legal .iubenda-black.iubenda-noiframe.iubenda-embed {
  font-size: 0.75rem !important;
  color: rgba(255, 255, 255, 0.7) !important;
  text-decoration: none !important;
  transition: color 0.2s;
  white-space: nowrap;
}

.footer-legal a:hover,
.footer-legal .iubenda-black.iubenda-noiframe.iubenda-embed:hover {
  color: #00BFFF !important;
}

/* --- Alt-word descender fix --- */
.alt-word {
  padding-bottom: 0.15em;
}

/* --- CTA buttons (global style) --- */
.cta-button {
  display: inline-block;
  background: var(--color-cta);
  color: var(--color-ink);
  font-weight: 500;
  padding: 12px 28px;
  border-radius: 6px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.cta-button:hover {
  filter: brightness(1.1);
  transform: scale(1.02);
}

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

  .nav-toggle {
    display: flex;
  }

  /* Photo sections */
  .photo-section {
    min-height: auto;
  }

  .photo-section-inner {
    padding: 2rem 1rem;
  }

  .content-panel {
    max-width: 100%;
    padding: 2rem;
    margin: 1rem;
  }

  .photo-section--right .content-panel {
    margin-left: 1rem;
  }

  /* Products */
  .product-feature {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .product-logo-box {
    max-width: 280px;
  }

  /* Contact */
  .contact-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Footer */
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
  }

  .footer-copy,
  .footer-sub,
  .footer-reg {
    text-align: left;
  }

  .footer-legal {
    justify-content: flex-start;
    gap: 1rem !important;
  }
}

/* =========================================================
   How we use AI page
   ========================================================= */

.ai-page-hero {
  background: linear-gradient(135deg, #0D2C54 0%, #006994 100%);
  padding: 140px 48px 80px;
}

.ai-page-hero-inner {
  max-width: 720px;
  margin: 0 auto;
}

.ai-page-hero h1 {
  font-size: var(--text-hero);
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.1;
}

.ai-page-body {
  background: #FFFFFF;
  padding: 4rem 2rem;
}

.ai-page-body-inner {
  max-width: 720px;
  margin: 0 auto;
}

.ai-page-body-inner p {
  font-size: var(--text-body);
  color: rgba(13, 44, 84, 0.8);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.ai-page-body-inner h2 {
  font-size: var(--text-heading);
  color: var(--color-ink);
  font-weight: 700;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(13, 44, 84, 0.1);
}

.ai-page-body-inner h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.ai-page-body-inner h3 {
  font-size: calc(var(--text-body) * 1.05);
  color: var(--color-ink);
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.ai-page-body-inner ul {
  padding-left: 1.5rem;
  margin: 0.75rem 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: disc;
}

.ai-page-body-inner li {
  font-size: var(--text-body);
  line-height: 1.7;
  color: rgba(13, 44, 84, 0.8);
}

.ai-page-body-inner a {
  color: var(--color-plasma-accessible);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

.ai-page-body-inner a:hover {
  color: var(--color-ink);
}

.ai-lead-text {
  font-weight: 600;
  font-size: calc(var(--text-body) * 1.1) !important;
  color: var(--color-ink) !important;
}

@media (max-width: 720px) {
  .ai-page-hero {
    padding: 100px 24px 60px;
  }

  .ai-page-body {
    padding: 2.5rem 1.5rem;
  }
}
