/* ===================================================
   TechGuides — styles.css
   CSS handles structure and component styles.
   Layout utilities, spacing, and responsive design
   are handled by Tailwind CSS.
   Animations are handled by GSAP + ScrollTrigger.
   =================================================== */

/* --- CSS custom properties --- */
:root {
  /* Brand colors */
  --teal: #06ad8f;
  --yellow: #ffc400;
  --teal-link: #037a65;
  --teal-emphasis: #036b58;

  /* Backgrounds */
  --bg-white: #ffffff;
  --bg-warm: #faf8f4;
  --bg-teal-tint: #edf9f6;
  --bg-surface: #f0f0ec;
  --bg-dark-surface: #163d36;

  /* Gradients */
  --hero-gradient: linear-gradient(135deg, #0a1f1b 0%, #0d3029 30%, #0f4a3f 60%, #0a3d34 100%);
  --warm-gradient: linear-gradient(180deg, #faf8f4 0%, #ffffff 100%);
  --tint-gradient: linear-gradient(180deg, #edf9f6 0%, #f7fcfa 100%);

  /* Borders and text */
  --border: #e2e0dc;
  --text-primary: #1f2937;
  --text-secondary: #4b5563;

  /* Spacing (8px base grid) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;
  --space-5xl: 128px;

  /* Layout */
  --max-width: 1200px;
  --text-max-width: 680px;
  --nav-height: 64px;

  /* Font */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

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

html {
  font-size: 100%;
}

body {
  font-family: var(--font);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-white);
  padding-top: var(--nav-height);
}

/* --- Skip link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--teal);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  z-index: 10000;
  transition: top 150ms ease;
}

.skip-link:focus {
  top: 0;
}

/* --- Base typography --- */
h1 {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

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

@media (min-width: 1024px) {
  h1 {
    font-size: 3.5rem;
  }

  h2 {
    font-size: 2.5rem;
  }

  h3 {
    font-size: 1.5rem;
  }
}

p {
  margin-bottom: 1.5em;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--teal-link);
  text-decoration: underline;
  transition: color 200ms ease;
}

a:hover {
  color: var(--teal-emphasis);
}

a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Vanta Pause Button Custom Class */
.vanta-pause-btn {
  position: absolute;
  bottom: var(--space-md);
  right: var(--space-md);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  z-index: 10;
  transition: all 200ms ease;
}

.vanta-pause-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.vanta-pause-btn:focus-visible {
  outline: 2px solid var(--yellow);
}


/* --- Layout container --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

@media (min-width: 640px) {
  .container {
    padding: 0 var(--space-xl);
  }
}

/* --- Section wrappers --- */
.section {
  padding: var(--space-2xl) 0;
}

@media (min-width: 1024px) {
  .section {
    padding: var(--space-5xl) 0;
    min-height: 60vh;
  }
}

.section--has-cards {
  min-height: auto;
}

@media (min-width: 1024px) {
  .section--has-cards {
    min-height: 70vh;
  }
}

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

.section--warm {
  background: var(--warm-gradient);
}

.section--warm-yellow {
  background: linear-gradient(180deg, #fffdf5 0%, #ffffff 100%);
}

.section--teal-tint {
  background: var(--tint-gradient);
}

.section--dark {
  background: var(--hero-gradient);
  color: #fff;
}

.section__heading {
  margin-bottom: var(--space-xl);
}

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

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

/* Teal accent bar — animated by GSAP (scaleX 0 → 1 from left) */
.section-accent {
  display: block;
  width: 80px;
  height: 5px;
  background-color: var(--teal);
  border-radius: 3px;
  margin-bottom: var(--space-md);
  transform-origin: left center;
}

/* Body text max-width container */
.body-text {
  max-width: var(--text-max-width);
}

/* --- Navigation — frosted glass --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 224, 220, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.nav__inner {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 640px) {
  .nav__inner {
    padding: 0 var(--space-xl);
  }
}

.nav__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.nav__logo img {
  height: 36px;
  width: auto;
}

.nav__links {
  display: none;
  list-style: none;
  gap: var(--space-xl);
  align-items: center;
}

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

.nav__links a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 3px solid transparent;
  border-radius: 1px;
  transition: border-color 200ms ease, color 200ms ease;
}

.nav__links a:hover,
.nav__links a[aria-current="page"] {
  border-bottom-color: var(--teal);
  color: var(--teal-emphasis);
}

.nav__links a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Hamburger */
.nav__hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

@media (min-width: 1024px) {
  .nav__hamburger {
    display: none;
  }
}

.nav__hamburger:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.nav__hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 200ms ease, opacity 200ms ease;
}

.nav__hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav__hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu */
.nav__mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: var(--space-sm) var(--space-md) var(--space-lg);
  z-index: 999;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.nav__mobile-menu.is-open {
  display: block;
}

.nav__mobile-menu ul {
  list-style: none;
}

.nav__mobile-menu a {
  display: block;
  padding: 12px 0;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.nav__mobile-menu li:last-child a {
  border-bottom: none;
}

.nav__mobile-menu a[aria-current="page"],
.nav__mobile-menu a:hover {
  color: var(--teal-emphasis);
}

/* --- Hero --- */
.hero {
  background: var(--hero-gradient);
  color: #fff;
  min-height: 100svh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero--compact {
  min-height: clamp(24rem, 60svh, 34rem);
}

/* Vanta.NET canvas sits absolutely inside .hero via JS.
   The CSS gradient acts as fallback if Vanta fails or is disabled. */

/* Yellow accent line in hero */
.hero__accent-line {
  width: 80px;
  height: 4px;
  background-color: var(--yellow);
  border-radius: 2px;
  margin-bottom: var(--space-lg);
}

.hero__content {
  max-width: var(--text-max-width);
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: var(--space-lg);
}

@media (min-width: 1024px) {
  .hero h1 {
    font-size: 5.5rem;
    line-height: 1.02;
    letter-spacing: -0.04em;
  }
}

/* Word spans injected by GSAP hero word split */
.hero__word {
  display: inline-block;
  overflow: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
  vertical-align: bottom;
}

.hero__word-inner {
  display: inline-block;
}

.hero__sub {
  font-size: 1.125rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: var(--space-xl);
  max-width: 560px;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 18px 36px;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-md);
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  min-height: 44px;
  transition: box-shadow 200ms ease, background-color 200ms ease, color 200ms ease;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.btn--primary {
  background-color: var(--yellow);
  color: var(--text-primary);
  border-color: var(--yellow);
}

.btn--primary:hover {
  box-shadow: 0 6px 30px rgba(255, 196, 0, 0.5);
  color: var(--text-primary);
  text-decoration: none;
}

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

.btn--secondary:hover {
  background-color: var(--teal);
  color: #fff;
  text-decoration: none;
}

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

.btn--on-dark:hover {
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.25);
  color: var(--text-primary);
  text-decoration: none;
}

/* --- Cards --- */
.card {
  background-color: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  transition: box-shadow 300ms ease;
  border-bottom: 3px solid transparent;
  min-height: 280px;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06), 0 12px 32px rgba(0, 0, 0, 0.1);
  border-bottom-color: var(--yellow);
}

/* Card icon — teal background circle with icon inside */
.card__icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background-color: rgba(6, 173, 143, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  transition: background-color 200ms ease;
}

.card:hover .card__icon-wrap {
  background-color: rgba(6, 173, 143, 0.2);
}

.card__icon {
  display: block;
  width: 32px;
  height: 32px;
  color: var(--teal);
  stroke-width: 1.5;
  flex-shrink: 0;
}

.card h3 {
  margin-bottom: var(--space-sm);
}

.card p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Arrow CTA link */
.card .card__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  margin-top: var(--space-md);
  font-size: 1rem;
  font-weight: 600;
  color: var(--teal-link);
  text-decoration: none;
}

.card .card__cta:hover {
  color: var(--teal-emphasis);
}

.card .card__cta:hover .arrow {
  color: var(--yellow);
}

.card .card__cta .arrow {
  display: inline-block;
  transition: color 200ms ease;
}

/* Card grids */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

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

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

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

/* --- Topic cards (workshops) --- */
.topic-card {
  background-color: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  display: flex;
  gap: var(--space-lg);
  align-items: flex-start;
}

.topic-card+.topic-card {
  margin-top: var(--space-md);
}

.topic-card__icon {
  width: 40px;
  height: 40px;
  color: var(--teal);
  flex-shrink: 0;
  stroke-width: 1.5;
  margin-top: 2px;
}

.topic-card__body h3 {
  color: var(--teal-emphasis);
  margin-bottom: var(--space-sm);
}

.topic-card__body p {
  margin-bottom: 0;
}

/* --- Resource cards --- */
.resource-card {
  background-color: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
}

.resource-card+.resource-card {
  margin-top: var(--space-md);
}

.resource-card__label {
  display: inline-block;
  background-color: var(--bg-teal-tint);
  color: var(--teal-emphasis);
  font-size: 1rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 99px;
  margin-bottom: var(--space-sm);
  letter-spacing: 0.02em;
}

.resource-card__label--available {
  background-color: var(--teal);
  color: #fff;
}

.resource-card__label--development {
  background-color: var(--bg-teal-tint);
  color: var(--teal-emphasis);
}

.resource-card h3 {
  margin-bottom: var(--space-xs);
}

.resource-card p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 0;
}

/* --- Recovery steps --- */
.recovery-steps {
  list-style: none;
  margin-top: var(--space-xl);
}

.recovery-step {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: var(--space-md);
  align-items: start;
}

.recovery-step+.recovery-step {
  margin-top: var(--space-xl);
}

.recovery-step__num {
  width: 52px;
  height: 52px;
  background-color: var(--teal);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.recovery-step__body h3 {
  margin-bottom: var(--space-xs);
}

.recovery-step__body p {
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* --- Callout box --- */
.callout {
  background: var(--tint-gradient);
  border-left: 4px solid var(--teal);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-xl) 0;
}

.callout p {
  margin-bottom: 0;
}

/* --- About: founders layout --- */
.founders-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  margin-top: var(--space-xl);
}

@media (min-width: 640px) {
  .founders-layout {
    grid-template-columns: 240px 1fr;
    gap: var(--space-3xl);
    align-items: start;
  }
}

.founders-layout__photo-placeholder {
  width: 100%;
  max-width: 240px;
  aspect-ratio: 1 / 1;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1rem;
  text-align: center;
  padding: var(--space-md);
}

/* --- Stat callouts (about page) — numbers animated by GSAP counter --- */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  margin: var(--space-xl) 0;
  max-width: var(--text-max-width);
}

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

.stat-callout {
  background-color: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.stat-callout__number {
  display: block;
  font-size: 3rem;
  font-weight: 800;
  color: var(--teal);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
}

@media (min-width: 640px) {
  .stat-callout__number {
    font-size: 3.5rem;
  }
}

.stat-callout__label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* --- Partners: org entries --- */
.partner-entry {
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--border);
}

.partner-entry:first-child {
  padding-top: 0;
}

.partner-entry:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.partner-entry h3 {
  margin-bottom: var(--space-sm);
  color: var(--teal-emphasis);
}

.partner-entry p {
  margin-bottom: 0;
}

/* --- Contact email link --- */
.contact-email {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--teal-link);
  text-decoration: none;
  margin: var(--space-md) 0 var(--space-xl);
}

.contact-email:hover {
  color: var(--teal-emphasis);
  text-decoration: underline;
}

.contact-email svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  stroke-width: 1.5;
}

/* --- Footer --- */
.footer {
  background: var(--hero-gradient);
  color: #fff;
  padding: var(--space-2xl) 0 0;
  border-top: 4px solid var(--yellow);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  padding-bottom: var(--space-2xl);
}

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

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

.footer__col-heading {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: var(--space-md);
}

.footer__col p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
  margin-bottom: 0;
}

.footer__col ul {
  list-style: none;
}

.footer__col li {
  margin-bottom: var(--space-sm);
}

.footer__col a {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 200ms ease;
}

.footer__col a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer__col a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 2px;
}

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: var(--space-md) 0;
}

.footer__bottom p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0;
}

/* --- Reduced motion ---
   GSAP handles the reduced motion check in JS.
   These CSS rules ensure no animation flicker
   and preserve color-only transitions. */
@media (prefers-reduced-motion: reduce) {

  .btn:hover,
  .card:hover,
  .card .card__cta:hover .arrow {
    transform: none !important;
  }
}