/* WebbAI Design Tokens & Styles */

:root {
  /* Type Scale */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);
  --text-hero: clamp(3rem,     0.5rem  + 7vw,    8rem);

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;

  /* Fonts */
  --font-display: 'Clash Display', 'Helvetica Neue', sans-serif;
  --font-body: 'Satoshi', 'Inter', sans-serif;
}

/* ── DARK THEME (default) ── */
:root, [data-theme="dark"] {
  --color-bg:             #0a0a0f;
  --color-surface:        #111118;
  --color-surface-2:      #16161f;
  --color-surface-offset: #1a1a24;
  --color-divider:        #23232f;
  --color-border:         #2a2a38;
  --color-text:           #e8e8ec;
  --color-text-muted:     #8b8b96;
  --color-text-faint:     #56566a;
  --color-text-inverse:   #0a0a0f;
  --color-primary:        #00c2d1;
  --color-primary-hover:  #00a5b3;
  --color-primary-active: #008895;
  --color-primary-highlight: #00c2d120;
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.5);
}

/* ── LIGHT THEME ── */
[data-theme="light"] {
  --color-bg:             #f4f4f7;
  --color-surface:        #ffffff;
  --color-surface-2:      #fafafe;
  --color-surface-offset: #eeeef2;
  --color-divider:        #dddde3;
  --color-border:         #ccccda;
  --color-text:           #111118;
  --color-text-muted:     #62627a;
  --color-text-faint:     #9a9ab0;
  --color-text-inverse:   #f4f4f7;
  --color-primary:        #0090a0;
  --color-primary-hover:  #007a88;
  --color-primary-active: #006470;
  --color-primary-highlight: #0090a018;
  --shadow-sm: 0 1px 2px oklch(0.2 0.01 260 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.2 0.01 260 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.2 0.01 260 / 0.12);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --color-bg:             #f4f4f7;
    --color-surface:        #ffffff;
    --color-surface-2:      #fafafe;
    --color-surface-offset: #eeeef2;
    --color-divider:        #dddde3;
    --color-border:         #ccccda;
    --color-text:           #111118;
    --color-text-muted:     #62627a;
    --color-text-faint:     #9a9ab0;
    --color-text-inverse:   #f4f4f7;
    --color-primary:        #0090a0;
    --color-primary-hover:  #007a88;
    --color-primary-active: #006470;
    --color-primary-highlight: #0090a018;
    --shadow-sm: 0 1px 2px oklch(0.2 0.01 260 / 0.06);
    --shadow-md: 0 4px 12px oklch(0.2 0.01 260 / 0.08);
    --shadow-lg: 0 12px 32px oklch(0.2 0.01 260 / 0.12);
  }
}


/* ════════════════════════════════════
   LAYOUT
   ════════════════════════════════════ */

.container {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

@media (min-width: 768px) {
  .container { padding-inline: var(--space-8); }
}

.section {
  padding-block: clamp(var(--space-12), 8vw, var(--space-24));
}

.section--tight {
  padding-block: clamp(var(--space-8), 5vw, var(--space-16));
}


/* ════════════════════════════════════
   HEADER / NAV
   ════════════════════════════════════ */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--color-bg) 85%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-divider);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.header--scrolled {
  box-shadow: var(--shadow-sm);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--color-text);
}

.header__logo svg {
  width: 36px;
  height: 36px;
}

.header__logo-text {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.header__nav {
  display: none;
  align-items: center;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .header__nav { display: flex; }
}

.header__nav a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-interactive);
}

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

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.theme-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  transition: color var(--transition-interactive), background var(--transition-interactive);
}

.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-surface);
}

.mobile-menu-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
}

@media (min-width: 768px) {
  .mobile-menu-btn { display: none; }
}

.mobile-menu-btn:hover {
  color: var(--color-text);
}

/* Mobile nav overlay */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--color-bg);
  padding: var(--space-8) var(--space-4);
  flex-direction: column;
  gap: var(--space-6);
}

.mobile-nav.active {
  display: flex;
}

.mobile-nav__header {
  display: flex;
  justify-content: flex-end;
}

.mobile-nav__close {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}

.mobile-nav__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-top: var(--space-8);
}

.mobile-nav__links a {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
}


/* ════════════════════════════════════
   BUTTONS
   ════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  transition: background var(--transition-interactive),
              color var(--transition-interactive),
              transform var(--transition-interactive),
              box-shadow var(--transition-interactive);
  cursor: pointer;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--color-primary);
  color: #0a0a0f;
}

.btn--primary:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 0 20px var(--color-primary-highlight);
}

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

.btn--ghost:hover {
  background: var(--color-surface);
  border-color: var(--color-text-faint);
}


/* ════════════════════════════════════
   HERO
   ════════════════════════════════════ */

.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
}

.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    var(--color-bg) 0%,
    transparent 30%,
    transparent 60%,
    var(--color-bg) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero__label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}

.hero__title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: var(--space-6);
}

.hero__desc {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 560px;
  margin-bottom: var(--space-8);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}


/* ════════════════════════════════════
   SERVICES
   ════════════════════════════════════ */

.services__grid {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .services__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }
}

@media (min-width: 1024px) {
  .services__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* First card spans 2 columns on tablet */
@media (min-width: 768px) and (max-width: 1023px) {
  .services__grid .service-card:first-child {
    grid-column: 1 / -1;
  }
}

.service-card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.service-card__number {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}

.service-card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-3);
}

.service-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}


/* ════════════════════════════════════
   SECTION HEADERS
   ════════════════════════════════════ */

.section-header {
  margin-bottom: clamp(var(--space-8), 4vw, var(--space-12));
}

.section-header__label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}

.section-header__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.section-header__desc {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 560px;
  margin-top: var(--space-4);
}


/* ════════════════════════════════════
   PROCESS
   ════════════════════════════════════ */

.process {
  position: relative;
}

.process__image {
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: clamp(var(--space-8), 5vw, var(--space-12));
}

.process__image img {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.process__steps {
  display: grid;
  gap: var(--space-8);
}

@media (min-width: 768px) {
  .process__steps {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8) var(--space-12);
  }
}

.process-step {
  display: flex;
  gap: var(--space-4);
}

.process-step__marker {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-primary);
  background: var(--color-primary-highlight);
  border-radius: var(--radius-md);
}

.process-step__content h3 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.process-step__content p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}


/* ════════════════════════════════════
   RESULTS / STATS
   ════════════════════════════════════ */

.results {
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
}

.results__grid {
  display: grid;
  gap: var(--space-6);
  text-align: center;
}

@media (min-width: 640px) {
  .results__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .results__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat__number {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.stat__label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}


/* ════════════════════════════════════
   ABOUT / CREDIBILITY
   ════════════════════════════════════ */

.about__layout {
  display: grid;
  gap: var(--space-8);
  align-items: center;
}

@media (min-width: 768px) {
  .about__layout {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
  }
}

.about__image {
  border-radius: var(--radius-xl);
  overflow: hidden;
  order: -1;
}

@media (min-width: 768px) {
  .about__image { order: 0; }
}

.about__image img {
  width: 100%;
  height: auto;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.about__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.about__text {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
}

.about__credentials {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.credential-tag {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-1) var(--space-3);
  background: var(--color-surface-offset);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
}


/* ════════════════════════════════════
   CTA
   ════════════════════════════════════ */

.cta {
  text-align: center;
}

.cta__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-4);
}

.cta__desc {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 480px;
  margin-inline: auto;
  margin-bottom: var(--space-8);
}

.cta__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}


/* ════════════════════════════════════
   FOOTER
   ════════════════════════════════════ */

.footer {
  border-top: 1px solid var(--color-divider);
  padding-block: var(--space-8);
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: center;
  text-align: center;
}

@media (min-width: 768px) {
  .footer__inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer__left {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer__brand {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.footer__copy {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.footer__links {
  display: flex;
  gap: var(--space-4);
}

.footer__links a {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-decoration: none;
  transition: color var(--transition-interactive);
}

.footer__links a:hover {
  color: var(--color-text-muted);
}


/* ════════════════════════════════════
   SCROLL ANIMATIONS (JS-driven via IntersectionObserver)
   ════════════════════════════════════ */

.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@media (prefers-reduced-motion: reduce) {
  .fade-in, .reveal-up {
    opacity: 1;
    transform: none;
    transition: none;
  }
}


/* ════════════════════════════════════
   SKIP LINK
   ════════════════════════════════════ */

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--color-primary);
  color: var(--color-bg);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 600;
  z-index: 999;
}

.skip-link:focus {
  top: var(--space-2);
}
