/* ============================================
   GRIDDLE — Styles
   ============================================ */

/* ---------- Custom Properties ---------- */
:root {
  --primary: #0B1D3A;
  --accent: #00D4AA;
  --accent-hover: #00b894;
  --secondary: #3A5A8C;
  --bg-light: #F4F6F9;
  --bg-dark: #111827;
  --bg-charcoal: #111827;
  --text-primary: #1A1A2E;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --border: #E5E7EB;
  --border-dark: #2D3748;
  --success: #22C55E;
  --warning: #F59E0B;
  --danger: #EF4444;

  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

  --transition: 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

/* Fixed background canvas — stays behind all content like GCSC site */
#waveform-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* All content floats above the canvas */
nav, header, main, footer {
  position: relative;
  z-index: 2;
}

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

ul, ol {
  list-style: none;
}

/* ---------- Typography ---------- */
h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

h4 {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* Non-breaking word group — keeps words together on desktop, wraps on mobile */
.nb {
  white-space: nowrap;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 1rem;
}

/* ---------- Layout ---------- */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px);
}

.section {
  padding: clamp(48px, 8vw, 96px) 0;
  scroll-margin-top: 70px;
}

.section--light {
  background: var(--bg-light);
}

/* Sections with opaque backgrounds — blue-tinted to maintain brand feel */
.problem,
.technology,
.use-cases {
  background: #EEF1F8;
}

.section--light {
  background: #E4E9F3;
}

/* Dark variant — matches hero/CTA background, transparent so canvas shows through */
.section--dark {
  background: transparent;
  color: #fff;
}

.section--dark .eyebrow {
  color: var(--accent);
}

.section--dark h2 {
  color: #fff;
}

.section--dark .section__subtitle {
  color: var(--text-muted);
}

.section--dark .card {
  background: #1A2740;
  border: 1px solid #2A3A55;
}

.section--dark .card h3 {
  color: #fff;
}

.section--dark .card p {
  color: var(--text-muted);
}

.section--dark .comparison__card {
  background: #1A2740;
  border: 1px solid #2A3A55;
}

.section--dark .comparison__header {
  background: #0F1B2E;
  color: var(--text-muted);
  border-bottom-color: #2A3A55;
}

.section--dark .comparison__header--highlight {
  background: var(--accent);
  color: #fff;
  border-bottom-color: var(--accent);
}

.section--dark .comparison__card--highlight {
  border-color: var(--accent);
}

.section--dark .comparison__item {
  color: rgba(255, 255, 255, 0.8);
}

.section__header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto clamp(32px, 5vw, 56px);
}



.section__subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-top: 1rem;
  line-height: 1.7;
}

.grid-2-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}

.grid-3-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(16px, 3vw, 32px);
}

.grid-4-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(16px, 2.5vw, 24px);
}

@media (min-width: 768px) {
  .section {
    padding: 96px 0;
  }

  .grid-2-col {
    grid-template-columns: 55% 1fr;
  }

  .grid-3-col {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid-4-col {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

.btn--secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn--secondary:hover {
  background: rgba(0, 212, 170, 0.1);
  transform: translateY(-1px);
}

.btn--text {
  background: transparent;
  color: #fff;
  padding: 12px 8px;
  border: none;
}

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

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 120;
  padding: 22px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(14px);
  background: rgba(11, 29, 58, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.nav.nav--light {
  background: rgba(238, 241, 248, 0.92);
  border-bottom-color: rgba(11, 29, 58, 0.14);
}

.nav.nav--light .nav__links a {
  color: var(--primary);
}

.nav.nav--light .nav__logo-text {
  color: var(--primary);
}

.nav__logo-text {
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 1.5vw, 1.4rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.nav__logo-dot {
  color: var(--accent);
}

.nav__links {
  list-style: none;
  display: none;
  gap: 36px;
}

.nav__links a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 13px;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
  padding-bottom: 3px;
  transition: color 0.3s ease;
}

.nav__links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.nav__links a:hover {
  color: var(--accent);
}

.nav__links a:hover::after {
  width: 100%;
}

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

/* -- Hamburger button (mobile only) -- */
.nav__hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  width: 28px;
  height: 20px;
  position: relative;
}

.nav__hamburger span {
  display: block;
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav__hamburger span:nth-child(1) { top: 0; }
.nav__hamburger span:nth-child(2) { top: 9px; }
.nav__hamburger span:nth-child(3) { top: 18px; }

/* Animate to X when open */
.nav__hamburger.is-open span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.nav__hamburger.is-open span:nth-child(2) {
  opacity: 0;
}
.nav__hamburger.is-open span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}


/* Adapt hamburger color on light sections */
.nav.nav--light .nav__hamburger span {
  background: var(--primary);
}

/* Keep hamburger white when menu is open (dark overlay is showing) */
.nav__hamburger.is-open span {
  background: #fff;
}

/* Hide nav background when mobile menu is open so it blends with overlay */
.nav.nav--open {
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
}

.nav.nav--open .nav__logo-text {
  color: #fff;
}

/* ---------- Mobile overlay (outside nav to avoid stacking context) ---------- */
.mobile-overlay {
  display: none;
}

@media (max-width: 767px) {
  .nav {
    padding: 18px 24px;
  }

  .nav__hamburger {
    display: block;
  }

  /* Hide desktop links on mobile */
  .nav__links {
    display: none !important;
  }

  .mobile-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: #0B1D3A;
    z-index: 110;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

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

  .mobile-overlay__links {
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 0;
  }

  .mobile-overlay__links a {
    font-family: var(--font-body);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 14px 32px;
    display: block;
    transition: color 0.3s ease;
  }

  .mobile-overlay__links a:hover {
    color: var(--accent);
  }

  /* Allow all text to wrap freely on mobile */
  .nb {
    white-space: normal;
  }

  .btn {
    white-space: normal;
  }

  /* Full-width CTA buttons on mobile */
  .cta__buttons {
    flex-direction: column;
    align-items: center;
  }

  .cta__buttons .btn {
    width: 100%;
    max-width: 300px;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  overflow: hidden;
}

.hero__content {
  position: relative;
  text-align: center;
  max-width: 800px;
  padding: clamp(72px, 10vw, 120px) clamp(16px, 4vw, 48px) clamp(48px, 6vw, 80px);
}

.hero h1 {
  color: #fff;
  margin-bottom: 1.25rem;
}

.hero__subtitle {
  color: var(--text-muted);
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.hero__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-bottom: 2.5rem;
}

.hero__trust {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero__trust a {
  color: var(--accent);
  font-weight: 600;
  transition: color var(--transition);
}

.hero__trust a:hover {
  color: #fff;
}

/* ---------- Problem ---------- */
.problem__text {
  max-width: 720px;
}

.problem__text h2 {
  white-space: nowrap;
}

.problem__text p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-top: 1rem;
}

.problem__text h2 {
  color: var(--primary);
}

@media (max-width: 767px) {
  .problem__text h2 {
    white-space: normal;
  }
}

.problem__pain-points {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.problem__pain-points li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

.problem__pain-points .icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--danger);
}

.problem__diagram {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

/* ---------- Solution / Cards ---------- */
.card {
  background: #F5F7FC;
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card__icon {
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
}

.card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
}

/* ---------- Technology ---------- */
.technology__specs {
  max-width: 640px;
}

.technology__specs h2 {
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.technology__specs > p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.spec-list {
  display: flex;
  flex-direction: column;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.spec-row dt {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 400;
  flex-shrink: 0;
}

.spec-row dd {
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
}

/* Stack spec rows vertically on small screens so long values don't overflow */
@media (max-width: 480px) {
  .spec-row {
    flex-direction: column;
    gap: 2px;
  }

  .spec-row dd {
    text-align: left;
  }
}

/* ---------- Advantages / Comparison ---------- */
.comparison__card {
  background: #F5F7FC;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.comparison__card--highlight {
  box-shadow: var(--shadow-lg);
  transform: scale(1.03);
  border: 2px solid var(--accent);
}

.comparison__header {
  padding: 16px 24px;
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  background: #E4E9F3;
  color: var(--text-secondary);
  border-bottom: 1px solid #D0D7E6;
}

.comparison__header--highlight {
  background: var(--accent);
  color: #fff;
  border-bottom-color: var(--accent);
}

.comparison__list {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comparison__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-primary);
}

.comparison__item::before {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1.4;
}

.comparison__item--yes::before {
  content: "\2713";
  color: var(--success);
  font-weight: 700;
}

.comparison__item--no::before {
  content: "\2717";
  color: var(--danger);
  font-weight: 700;
}

.comparison__item--partial::before {
  content: "\25CF";
  color: var(--warning);
}

/* On mobile, put Griddle card first */
@media (max-width: 767px) {
  .comparison {
    display: flex;
    flex-direction: column;
  }

  .comparison__card--highlight {
    order: -1;
    transform: none;
  }
}

/* ---------- Use Cases ---------- */
.use-case {
  background: #F5F7FC;
  border-left: 4px solid var(--accent);
  padding: 24px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.use-case:hover {
  box-shadow: var(--shadow-md);
}

.use-case__icon {
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
}

.use-case p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ---------- CTA ---------- */
.cta {
  position: relative;
  background: transparent;
  text-align: center;
  padding: clamp(64px, 10vw, 120px) 0;
  overflow: hidden;
}

.cta__content {
  position: relative;
}

.cta h2 {
  color: #fff;
  margin-bottom: 1rem;
}

.cta__subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.cta__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

/* ---------- Footer ---------- */
.footer {
  background: rgba(11, 29, 58, 0.95);
  padding: 32px 48px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-body);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.05em;
}

.footer a {
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.3s ease;
}

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

@media (max-width: 767px) {
  .footer {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: 24px;
  }
}

/* ---------- Scroll Animations ---------- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger cards */
.grid-3-col .animate-on-scroll:nth-child(2) {
  transition-delay: 0.1s;
}

.grid-3-col .animate-on-scroll:nth-child(3) {
  transition-delay: 0.2s;
}

.grid-4-col .animate-on-scroll:nth-child(2) {
  transition-delay: 0.1s;
}

.grid-4-col .animate-on-scroll:nth-child(3) {
  transition-delay: 0.2s;
}

.grid-4-col .animate-on-scroll:nth-child(4) {
  transition-delay: 0.3s;
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }

  #waveform-bg {
    display: none;
  }

  /* Restore opaque backgrounds when canvas is hidden */
  .hero {
    background: var(--bg-dark);
  }

  .cta {
    background: var(--primary);
  }

  .footer {
    background: var(--bg-charcoal);
  }
}
