/* ==========================================================================
   Cotheos — design tokens
   ========================================================================== */

:root {
  /* color */
  --bg: #090d17;
  --bg-elev: #0d1424;
  --surface: #101a30;
  --surface-2: #141f3a;
  --border: #223055;
  --border-soft: #1a2540;
  --text: #edf1fb;
  --text-muted: #92a0c2;
  --text-faint: #5c6a8e;

  --sky: #38bff8;
  --cyan: #0ea5e9;
  --indigo: #6366f1;
  --indigo-light: #818cf8;

  --gradient: linear-gradient(135deg, var(--cyan) 0%, var(--indigo) 100%);
  --gradient-soft: linear-gradient(
    135deg,
    rgba(14, 165, 233, 0.14),
    rgba(99, 102, 241, 0.14)
  );
  --gradient-text: linear-gradient(
    100deg,
    #7dd3fc 0%,
    #a5b4fc 60%,
    #818cf8 100%
  );

  /* type */
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* layout */
  --max-w: 1200px;
  --pad: clamp(20px, 5vw, 64px);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Reset
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: 1.08;
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sky);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--sky);
  display: inline-block;
}

.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

::selection {
  background: rgba(99, 102, 241, 0.35);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  font-family: var(--font-body);
  border: 1px solid transparent;
  transition:
    transform 0.35s var(--ease),
    box-shadow 0.35s var(--ease),
    border-color 0.25s ease,
    background 0.25s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient);
  color: #051020;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -8px rgba(14, 165, 233, 0.55);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--sky);
  background: rgba(56, 191, 248, 0.06);
}

.btn-sm {
  padding: 10px 18px;
  font-size: 13.5px;
}

/* ==========================================================================
   Nav
   ========================================================================== */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 18px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(9, 13, 23, 0.65);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition:
    border-color 0.4s ease,
    background 0.4s ease;
}

.site-nav.is-scrolled {
  border-bottom-color: var(--border-soft);
  background: rgba(9, 13, 23, 0.86);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.nav-brand svg {
  width: 28px;
  height: 28px;
}

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

.nav-links a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.25s ease;
  position: relative;
}

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

.nav-cta {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  padding: 6px;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  padding: 168px var(--pad) 100px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 40px;
  align-items: center;
  max-width: var(--max-w);
  margin: 0 auto;
}

.hero::before {
  content: "";
  position: absolute;
  top: -140px;
  right: -180px;
  width: 640px;
  height: 640px;
  background: radial-gradient(
    circle,
    rgba(99, 102, 241, 0.22),
    transparent 68%
  );
  filter: blur(10px);
  z-index: -1;
  pointer-events: none;
}

.hero-copy h1 {
  font-size: clamp(38px, 5.4vw, 66px);
  margin: 18px 0 22px;
  max-width: 15ch;
}

.hero-copy p {
  font-size: clamp(16px, 1.6vw, 18.5px);
  color: var(--text-muted);
  max-width: 46ch;
  margin-bottom: 34px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 46px;
}

.hero-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
  border-top: 1px solid var(--border-soft);
  padding-top: 20px;
}

.hero-capabilities span {
  color: var(--text-muted);
}

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
}

.orbit-svg {
  width: 100%;
  max-width: 480px;
  height: auto;
  overflow: visible;
}

.orbit-group-outer {
  transform-origin: 250px 250px;
  animation: spin-cw 34s linear infinite;
}
.orbit-group-mid {
  transform-origin: 250px 250px;
  animation: spin-ccw 22s linear infinite;
}
.orbit-node {
  transform-origin: 250px 250px;
  animation: spin-cw 34s linear infinite;
}

@keyframes spin-cw {
  to {
    transform: rotate(360deg);
  }
}
@keyframes spin-ccw {
  from {
    transform: rotate(360deg);
  }
  to {
    transform: rotate(0deg);
  }
}

.orbit-core {
  animation: pulse 3.2s ease-in-out infinite;
  transform-origin: 250px 250px;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.28);
  }
}

/* ==========================================================================
   Section shell
   ========================================================================== */

section {
  position: relative;
  padding: 120px 0;
}

.section-head {
  max-width: 640px;
  margin-bottom: 64px;
}

.section-head h2 {
  font-size: clamp(28px, 3.6vw, 42px);
  margin-top: 16px;
}

.section-head p {
  color: var(--text-muted);
  font-size: 16.5px;
  margin-top: 18px;
  max-width: 52ch;
}

.section-divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--border-soft),
    transparent
  );
  max-width: var(--max-w);
  margin: 0 auto;
}

/* ==========================================================================
   Services — bento grid
   ========================================================================== */

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 20px;
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 34px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition:
    transform 0.4s var(--ease),
    border-color 0.35s ease,
    background 0.35s ease;
  position: relative;
  overflow: hidden;
}

.service-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient-soft);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.service-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.4);
}

.service-card:hover::after {
  opacity: 1;
}

.service-card.span-2 {
  grid-column: span 2;
}

.service-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-icon svg {
  width: 24px;
  height: 24px;
}

.service-card h3 {
  font-size: 19px;
  font-weight: 600;
}

.service-card p {
  color: var(--text-muted);
  font-size: 14.8px;
  max-width: 46ch;
}

.service-tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: auto;
}

/* ==========================================================================
   Approach — converging timeline
   ========================================================================== */

.approach {
  background: var(--bg-elev);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}

.approach-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.approach-line {
  position: absolute;
  top: 23px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--border) 8%,
    var(--border) 92%,
    transparent
  );
  z-index: 0;
}

.approach-step {
  position: relative;
  z-index: 1;
  padding-top: 4px;
}

.approach-index {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--sky);
  margin-bottom: 22px;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.approach-step:hover .approach-index {
  border-color: var(--sky);
  box-shadow: 0 0 0 4px rgba(56, 191, 248, 0.12);
}

.approach-step h3 {
  font-size: 17px;
  margin-bottom: 10px;
}

.approach-step p {
  color: var(--text-muted);
  font-size: 14.5px;
}

/* ==========================================================================
   Why / pillars
   ========================================================================== */

.why {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 60px;
  align-items: start;
}

.why-visual {
  position: relative;
  min-height: 360px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  background:
    radial-gradient(
      circle at 30% 20%,
      rgba(14, 165, 233, 0.12),
      transparent 55%
    ),
    var(--surface);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.why-visual svg {
  width: 62%;
  opacity: 0.9;
}

.why-pillars {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pillar {
  padding: 28px 0;
  border-top: 1px solid var(--border-soft);
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 20px;
}

.pillar:last-child {
  border-bottom: 1px solid var(--border-soft);
}

.pillar-mark {
  font-family: var(--font-mono);
  color: var(--indigo-light);
  font-size: 13px;
  padding-top: 3px;
}

.pillar h3 {
  font-size: 17.5px;
  margin-bottom: 8px;
}

.pillar p {
  color: var(--text-muted);
  font-size: 14.8px;
  max-width: 56ch;
}

/* ==========================================================================
   CTA / Contact
   ========================================================================== */

.cta-section {
  position: relative;
}

.cta-panel {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: clamp(32px, 5vw, 64px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  position: relative;
  overflow: hidden;
}

.cta-panel::before {
  content: "";
  position: absolute;
  bottom: -220px;
  left: -160px;
  width: 480px;
  height: 480px;
  background: radial-gradient(
    circle,
    rgba(56, 191, 248, 0.14),
    transparent 70%
  );
  pointer-events: none;
}

.cta-intro h2 {
  font-size: clamp(26px, 3.4vw, 36px);
  margin: 16px 0 18px;
}

.cta-intro p {
  color: var(--text-muted);
  font-size: 15.5px;
  max-width: 42ch;
  margin-bottom: 28px;
}

.cta-contact-line {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14.5px;
}

.cta-contact-line a {
  color: var(--sky);
  transition: color 0.2s ease;
}

.cta-contact-line a:hover {
  color: var(--indigo-light);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.field input,
.field textarea,
.field select {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14.5px;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease;
  width: 100%;
}

.field textarea {
  resize: vertical;
  min-height: 96px;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(56, 191, 248, 0.14);
}

.field select {
  appearance: none;
}

.field-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-note {
  font-size: 12.5px;
  color: var(--text-faint);
}

.form-status {
  font-size: 13.5px;
  min-height: 18px;
  color: var(--sky);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 56px 0 40px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
}

.footer-brand svg {
  width: 24px;
  height: 24px;
}

.footer-tag {
  color: var(--text-faint);
  font-size: 13.5px;
  margin-top: 10px;
  max-width: 34ch;
}

.footer-cols {
  display: flex;
  gap: 64px;
  flex-wrap: wrap;
}

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 16px;
  font-weight: 500;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.footer-col a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

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

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  border-top: 1px solid var(--border-soft);
  font-size: 12.5px;
  color: var(--text-faint);
  flex-wrap: wrap;
  gap: 12px;
}

/* ==========================================================================
   Reveal-on-scroll
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
}

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

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 140px;
    text-align: left;
  }
  .hero-visual {
    order: -1;
    min-height: 300px;
  }
  .orbit-svg {
    max-width: 320px;
  }
  .services-grid {
    grid-template-columns: 1fr 1fr;
  }
  .service-card.span-2 {
    grid-column: span 2;
  }
  .why {
    grid-template-columns: 1fr;
  }
  .why-visual {
    min-height: 260px;
  }
  .approach-track {
    grid-template-columns: 1fr 1fr;
    row-gap: 40px;
  }
  .approach-line {
    display: none;
  }
  .cta-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .services-grid {
    grid-template-columns: 1fr;
  }
  .service-card.span-2 {
    grid-column: span 1;
  }
  .approach-track {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .footer-cols {
    gap: 36px;
  }
  .hero-actions .btn {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .site-nav.menu-open .nav-links {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border-soft);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px var(--pad) 28px;
    gap: 18px;
  }
}
