/* =======================================================================================
   McGheeLab — Global Styles (Beginner-Friendly Edition)
   -----------------------------------------------------------------------
   GOALS
   - Keep all existing functionality and class names.
   - Organize logically and comment for clarity.
   - Maintain accessible, responsive UI behavior.

   HOW THIS FILE IS ORGANIZED
   01) Design Tokens & Resets
   02) Base Elements & Utilities
   03) Header (Fixed Top Banner + Nav Drawer)
   04) Hero (Video background + headline)
   05) Subnav (Sticky "chips" quick links)
   06) Page Layout, Cards, Grids, Media blocks
   07) Components (Team, Classes, Badges, Forms)
   08) Footer
   09) Projects (Thumb sizing)
   10) SVG Loader / Logo Animation
   11) Responsive Breakpoints
   12) Reduced Motion
   13) Header Logo Overrides (keep logo stable)

   TIP: CSS variables (custom properties) live in :root and are reused throughout.
   ======================================================================================= */


/* =========================================
   01) DESIGN TOKENS & RESETS
   - Tokens: colors, radii, shadows, layout constants.
   - Resets: box sizing + full-height base.
   ========================================= */
:root{
  /* ---- Color system ---- */
  --bg: #0b0d12;              /* Page background (dark) */
  --surface: #121620;         /* Surface for cards/overlays */
  --surface-2: #1a2030;       /* Secondary surface (buttons etc.) */
  --text: #eef2f7;            /* Primary text on dark bg */
  --muted: #a8b3c7;           /* Muted text color */
  --accent: #5baed1;          /* Accent (buttons) */
  --link: #7cc4ff;            /* Link color */

  /* ---- Loader/animated logo colors ---- */
  --loader-text-color: #f6e9fe;
  --loader-dot-color:  #ee0c0c;
  --loader-bg:         #100319;

  /* ---- Radii/Shadows ---- */
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0,0,0,.25);

  /* ---- Layout constants ---- */
  --banner-height: 64px;   /* JS updates this at runtime for sticky offsets */
  --content-max: 1100px;   /* Comfortable reading width */
}

/* Make width/height calculations include padding/border by default */
*{ box-sizing: border-box; }

/* Allow percentage-based children (e.g., full-height sections) */
html,body{ height:100%; }

/* Global body defaults */
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #0b0d12 0%, #0d111a 100%);
  line-height: 1.6; /* Good readability */
}


/* =========================================
   02) BASE ELEMENTS & UTILITIES
   - Helpers that you’ll reuse across pages.
   ========================================= */

/* Center content and add fluid side padding */
.max-w{
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 32px);
}

/* "Skip to content" link for keyboard users/screen readers */
.skip-link{
  position: absolute;
  left: -999px;       /* hide off-screen until focused */
  top: auto;
}
.skip-link:focus{
  left: 16px;
  top: 12px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px;
  z-index: 1000;
}

/* Links: keep clean, add underline on hover for clarity */
a{ color: var(--link); text-decoration: none; }
a:hover{ text-decoration: underline; }

/* A readable, modern default (also set in original CSS) */
html{
  font-family: 'Figtree', sans-serif;
  line-height: 1.5;
}

/* Normalize inline SVGs so they fill their containers */
svg{
  width: 100%;
  height: 100%;
  display: block;
}


/* =========================================
   03) HEADER (FIXED TOP BANNER + NAV DRAWER)
   - Banner is fixed and always visible.
   - Drawer slides under banner for primary navigation.
   ========================================= */

/* Fixed top banner: always at the top */
.top-banner{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;                     /* On top of subnav/drawer */
  height: var(--banner-height);
  display: grid;
  grid-template-columns: 1fr auto;  /* Brand on left, menu button on right */
  align-items: center;
  background: rgba(10,14,22,.75);   /* Slightly translucent + blur */
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding-inline: clamp(12px, 3vw, 24px);
}

/* Optional logo container styles (kept for compatibility) */
.logo-svg{ height: 40px; max-width: 20vw; width: auto; display: block; color: var(--text); }
.logo{ display: inline-flex; align-items: center; }

/* Hamburger button: square, rounded, easy tap target */
.hamburger{
  width: 44px; height: 44px;
  border: 0;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--surface-2);
  cursor: pointer;
}

/* Three bars of the hamburger icon */
.hamburger span{
  display:block;
  width: 20px; height: 2px;
  background: var(--text);
  margin:3px 0;
  transition: transform .25s ease, opacity .25s ease;
}

/* When menu is open, animate to an “X” */
.hamburger[aria-expanded="true"] span:nth-child(1){ transform: translateY(5px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2){ opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3){ transform: translateY(-5px) rotate(-45deg); }

/* Drawer nav sits directly under the fixed banner */
.nav-drawer{
  position: fixed;
  top: var(--banner-height); right: 0; left: 0;
  transform: translateY(-120%);      /* Hidden by default (slides down) */
  transition: transform .25s ease;
  background: rgba(13,17,26,.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding: 16px 24px;
  z-index: 95;                       /* Under banner, above subnav */
}

/* When “open” class is added by JS, show the drawer */
.nav-drawer.open{ transform: translateY(0); }

/* Drawer nav list basics */
.nav-drawer ul{
  list-style: none;
  padding: 0; margin: 0;
  display: grid; gap: 8px;
}
.nav-drawer a{
  display: block;
  padding: 10px 8px;
  border-radius: 8px;
}

/* Current page link highlighted */
.nav-drawer a[aria-current="page"]{
  background: rgba(91,209,185,.12);
}


/* =========================================
   04) HERO (VIDEO BACKGROUND + HEADLINE)
   - Sits under banner; margin-top equals banner height.
   - Contains background video with a subtle overlay (scrim).
   ========================================= */
.hero{
  position: relative;
  overflow: hidden;
  margin-top: var(--banner-height);        /* Keep clear of fixed banner */
  min-height: clamp(380px, 55vh, 720px);   /* Responsive height */
  display: grid; align-content: end;       /* Content near bottom edge */
}

/* Absolutely position video to fill hero */
.video-wrap{ position:absolute; inset:0; z-index:0; }

/* Cover video; keep subtle and not distracting */
.hero video{
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: .2;
  display: block;
}

/* Dark radial overlay to improve text contrast */
.video-scrim{
  position:absolute; inset:0;
  background: radial-gradient(
    120% 70% at 50% 10%,
    rgba(0,0,0,.0) 0,
    rgba(0,0,0,.35) 60%,
    rgba(0,0,0,.55) 100%
  );
}

/* Inner hero content container */
.hero-content{
  position: relative; z-index: 1;                /* Above the video */
  padding: clamp(28px, 6vw, 64px) 0;
}

/* Section eyebrow/subtitle */
.eyebrow{
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--muted);
  font-size: .85rem;
  margin: 0 0 8px;
}

/* Main hero heading */
.hero h1{
  margin: 0;
  font-size: clamp(1.6rem, 3.8vw, 3rem);
  line-height: 1.2;
  max-width: 22ch;  /* Optimal line length */
}

/* Optional: highlight part of the mission with pink as requested */
.hero .hero-highlight{
  color: #ff5bb5;
  font-weight: 700;
}


/* =========================================
   05) SUBNAV (STICKY "CHIPS" QUICK LINKS)
   - Sits right below the fixed banner on every page.
   - Scrollable on small screens, wraps on large screens.
   ========================================= */
.subnav{
  position: sticky;                     /* Sticks while scrolling */
  top: var(--banner-height);
  z-index: 90;
  background: rgba(18,22,32,.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 16px;
}

/* Horizontal, swipeable "chip" row */
.subnav .track{
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 8px;
  overflow-x: auto; overflow-y: hidden;         /* Horizontal scroll only */
  -webkit-overflow-scrolling: touch;            /* Smooth iOS scrolling */
  scroll-snap-type: x proximity;                /* Snap assist on scroll */
  scrollbar-width: none;                        /* Hide Firefox scrollbar */
}
/* Hide scrollbar in WebKit browsers */
.subnav .track::-webkit-scrollbar{ display: none; }

.subnav li{ flex: 0 0 auto; scroll-snap-align: start; }

.subnav a{
  display: inline-block;
  padding: 8px 10px;
  border-radius: 8px;
  white-space: nowrap;                   /* Keep chips on one line */
  background: rgba(255,255,255,.04);
}
.subnav a:hover{ background: rgba(255,255,255,.08); }

/* Active chip (set by JS via aria-current / class) */
.subnav a.is-active,
.subnav a[aria-current="true"]{
  background: rgba(91,209,185,.25);
  outline: 1px solid rgba(91,209,185,.5);
}

/* Gradient "edge" hints to indicate overflow on small screens */
.subnav::before,
.subnav::after{
  content:"";
  position:absolute; top:0; bottom:0;
  width:36px; pointer-events:none;      /* Click-through */
}
.subnav::before{
  left:0;
  background: linear-gradient(90deg, rgba(18,22,32,.85), rgba(18,22,32,0));
}
.subnav::after{
  right:0;
  background: linear-gradient(270deg, rgba(18,22,32,.85), rgba(18,22,32,0));
}


/* =========================================
   06) PAGE LAYOUT, CARDS, GRIDS, MEDIA BLOCKS
   - Generic page spacing + reusable card/grid/media patterns.
   ========================================= */

/* Outer padding for page content area */
.page{ padding-block: clamp(24px, 5vw, 48px); }

/* Vertical spacing between sections */
.section{ margin-bottom: clamp(24px, 5vw, 56px); }

/* Section headings */
.section h2{
  font-size: clamp(1.25rem, 2.1vw, 1.6rem);
  margin: 0 0 12px;
}

/* Reveal-on-scroll animation (JS toggles .is-visible) */
.reveal{
  opacity: 0;
  transform: translateY(14px) scale(.98);
  filter: blur(2px);
}
.reveal.is-visible{
  opacity: 1;
  transform: none;
  filter: none;
  transition: opacity .5s ease, transform .5s ease, filter .5s ease;
}

/* Card look shared by many blocks */
.card{
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Basic CSS grid helper */
.grid{ display: grid; gap: clamp(12px, 2.3vw, 24px); }

/* Grid that fits as many 250px-wide items as possible */
.grid-fit-250{ grid-template-columns: repeat(auto-fit, minmax(250px,1fr)); }

/* Two-column media layout: text + image/video */
.media{
  display: grid;
  grid-template-columns: 1fr minmax(260px, 420px);
  gap: clamp(12px, 2.2vw, 28px);
  align-items: start;
}
/* Images inside media: full width, rounded, subtle border */
.media img{
  width: 100%; height: auto;
  border-radius: 12px;
  display: block;
  border: 1px solid rgba(255,255,255,.06);
}
/* Videos inside media: match image styling */
.media video{
  width: 100%; height: auto;
  border-radius: 12px;
  display: block;
  border: 1px solid rgba(255,255,255,.06);
}


/* =========================================
   07) COMPONENTS (TEAM, CLASSES, BADGES, FORMS)
   - Small building blocks used across pages.
   ========================================= */

/* Team member card */
.person{
  display: grid;
  gap: 10px;
  padding: 12px;
  align-content: start;
}
.person img{
  width: 30%;                  /* Small portrait within card */
  aspect-ratio: 1/1;           /* Square */
  object-fit: cover;
  border-radius: 10px;
}
.person .role{
  color: var(--muted);
  font-size: .95rem;
}

/* Course/Generic item spacing within cards */
.class-item{ padding: 16px; }

/* Small rounded pill for metadata (levels, tags, etc.) */
.badge{
  display:inline-block;
  padding: 4px 8px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:100px;
  font-size:.8rem;
  color: var(--muted);
}

/* Forms: consistent controls and spacing */
form{ display: grid; gap: 12px; }
input, textarea, select, button{ font: inherit; color: var(--text); }

/* Inputs/Textareas share the same surface look */
input, textarea{
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  padding: 10px 12px;
}
textarea{ min-height: 120px; resize: vertical; }

/* Primary button uses accent color */
button{
  background: var(--accent);
  color: #031a16;           /* Dark text on light accent */
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}
button:hover{ filter: brightness(1.2); } /* Subtle hover lift */

a.btn{
  display: inline-block;
  background: var(--accent);
  color: #000000;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  text-decoration: none;
  border: 0;
}
a.btn:hover{
  filter: brightness(1.2);
  text-decoration: none;
}

/* =========================================
   08) FOOTER
   - Simple three-column layout on large screens;
     stacks to one column on small screens.
   ========================================= */
.site-footer{
  background: #0a0e17;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* Main footer grid */
.footer-grid{
  display: grid; gap: 18px;
  padding-block: clamp(20px, 4vw, 36px);
  grid-template-columns: 2fr 1fr 2fr;  /* Left/Center/Right */
}

.footer-heading{
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
}

.footer-links{
  list-style: none;
  padding: 0; margin: 0;
  display: grid; gap: 8px;
}

/* Legal strip at the very bottom */
.legal{
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 10px 0;
  text-align: center;
  color: var(--muted);
}


/* =========================================
   09) PROJECTS (CONSISTENT THUMBNAIL SIZING)
   - Ensure cards use the same aspect ratio for images.
   ========================================= */
.project-card .thumb{
  width: 100%;
  aspect-ratio: 16/9;                 /* Consistent visual rhythm */
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.06);
  margin-bottom: 10px;
}
.project-card .thumb img{
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}


/* =========================================
   10) SVG LOADER / LOGO ANIMATION
   - Keeps original animated wordmark behavior.
   - The "text-body" strokes in, then fills; the "dot" fades in.
   ========================================= */

/* Defaults for larger screens (scales with viewport) */
svg text{
  font-size: 3vw;        /* Scales with viewport width */
  max-height: 1vw;       /* Keeps strokes slim on large screens */
  stroke-width: 1;
  letter-spacing: -2px;
}

html {
    font-family: 'Figtree', sans-serif;

}

/* Animated stroke for the main text */
svg text.text-body{
  stroke: var(--loader-text-color);
  animation: 4s animate-stroke alternate ease-in-out infinite;
}

/* The dot (•) fills/fades */
svg text.dot{
  fill: var(--loader-dot-color);
  stroke: var(--loader-dot-color);
  animation: 4s animate-dot alternate ease-in-out infinite;
}

/* Keyframes for the stroke animation */
@keyframes animate-stroke{
  0%{
    fill: transparent;
    stroke: var(--loader-text-color);
    stroke-width: 1;
    stroke-dasharray: 0 32%;
    stroke-dashoffset: 25;
  }
  50%{
    fill: transparent;
    stroke: var(--loader-text-color);
    stroke-width: 3;
    stroke-dasharray: 50% 0;
    stroke-dashoffset: 0;
  }
  80%,100%{
    fill: var(--loader-text-color);
    stroke: 20;                 /* legacy value retained */
    stroke-width: 0;
    stroke-dasharray: 32 0%;
    stroke-dashoffset: -25%;
  }
}

/* Keyframes for the dot fade-in */
@keyframes animate-dot{
  0%,50%{
    fill: var(--loader-dot-color);
    opacity: 0;
  }
  80%,100%{
    fill: var(--loader-dot-color);
    opacity: 1;
  }
}


/* =========================================
   11) RESPONSIVE BREAKPOINTS
   - Tweak layouts/typography for smaller screens.
   ========================================= */

/* Subnav wraps on wider screens (no scroll needed) */
@media (min-width: 901px){
  .subnav .track{ overflow: visible; flex-wrap: wrap; }
  .subnav::before, .subnav::after{ display: none; }
}

/* Stack two-column media & footer on tablets/phones */
@media (max-width: 900px){
  .media{ grid-template-columns: 1fr; }
  .footer-grid{ grid-template-columns: 1fr; }
}

/* Phone-sized adjustments */
@media (max-width: 600px){
  .hero{ min-height: 420px; } /* Ensure adequate hero height */
  .logo-svg{ height: 38px; }  /* Legacy logo size hook */

  /* Scale animated SVG text for small screens */
  svg text{
    font-size: 10vw;
    max-height: 2vw;
    stroke-width: 0.8;
    letter-spacing: -1px;
  }
}

/* Medium screens: gently reduce SVG text size */
@media (max-width: 992px){
  svg text{
    font-size: 4vw;
    max-height: 1.5vw;
    stroke-width: 0.9;
    letter-spacing: -1.5px;
  }
}


/* =========================================
   12) REDUCED MOTION
   - Respect user's OS preference to minimize motion.
   ========================================= */
@media (prefers-reduced-motion: reduce){
  .hero video{ display: none; }              /* Remove moving background */
  .reveal{ opacity: 1; transform: none; filter: none; } /* Disable reveal */
}


/* =========================================
   13) HEADER LOGO OVERRIDES (KEEP LOGO STABLE)
   - The animated logo in the fixed header should NOT be affected
     by the global responsive SVG rules above. Keep it a fixed size.
   ========================================= */
.top-banner .logo-animated{
  height: 40px;        /* Constant header logo height */
  width: auto;         /* Preserve aspect ratio */
  display: block;
}

/* Fix font size/spacing inside the header logo SVG only */
.top-banner .logo-animated text{
  font-size: 80px;     /* Constant text size in the logo */
  letter-spacing: -2px;
  stroke-width: 1;
}

/* Prevent responsive SVG rules from leaking into header logo */
.top-banner .logo-animated,
.top-banner .logo-animated text{
  /* Intentionally left without vw-based sizes */
}


/* =========================================
   14) Z-INDEX SAFETY (LAYER ORDER)
   - Ensure the proper stacking of header, nav drawer, and subnav.
   ========================================= */
.top-banner { z-index: 100; }   /* Highest */
.nav-drawer { z-index: 95;  top: var(--banner-height); } /* Under banner */
.subnav     { z-index: 90;  top: var(--banner-height); } /* Under drawer */

/* Ensure hero never slides under the fixed banner */
.hero { margin-top: var(--banner-height); }
