/* =========================================================
Base stylesheet (structure only - colors from themes)
========================================================= */

/* Google Fonts - Syne (display), Instrument Sans (body), Space Mono (mono) */
/* Google Fonts loaded via <link> in index.html for non-blocking render */

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

/* =========================================================
   NETWORK BACKGROUND CANVAS
   ========================================================= */
#network-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

/* Everything else sits above the canvas */
.preloader,
.site-header,
#app,
.site-footer {
  position: relative;
  z-index: 1;
}

/* Global scrollbar — applied only to scrollable elements */
html,
body,
.proj-track,
.yt-strip,
.marquee-row,
.extra-journey-strip,
.about-tech {
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--accent) 80%, white); }

:root {
  /* Accent colors — defined in css/themes/original/dark.css & light.css */

/* Layout + sizing tokens */
--header-h: 56px;
--card-w: 800px;
--gap: 20px;
/* Interaction + rhythm */
--hover-scale: 1.08;
--vpad-top: 48px;
--vpad-bottom: 48px;

/* Typography - Font families */
--font-display: 'Syne', sans-serif;
--font-body: 'Instrument Sans', sans-serif;
--font-mono: 'Space Mono', monospace;
--font-family: var(--font-body);
--font-size-base: 16px;
--font-size-sm: 14px;
--font-size-xs: 12px;
--font-size-lg: 18px;

/* Heading sizes - consistent hierarchy */
--heading-1: clamp(2rem, 1.5rem + 2vw, 2.75rem);
--heading-2: clamp(1.5rem, 1.25rem + 1vw, 1.875rem);
--heading-3: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
--heading-4: clamp(1rem, 0.9rem + 0.3vw, 1.125rem);
--heading-5: 1rem;
--heading-6: 0.875rem;
}

html {
  min-height: 100%;
}

body {
min-height: 100%;
margin: 0;
font-family: var(--font-family);
font-size: var(--font-size-base);
background: var(--bg-primary);
color: var(--text-primary);
line-height: 1.5;
}

/* =========================================================
   Typography - Consistent heading styles
========================================================= */
h1 {
  font-size: var(--heading-1);
  font-weight: 800;
  line-height: 1.2;
}

h2 {
  font-size: var(--heading-2);
  font-weight: 800;
  line-height: 1.25;
}

h3 {
  font-size: var(--heading-3);
  font-weight: 700;
  line-height: 1.3;
}

h4 {
  font-size: var(--heading-4);
  font-weight: 700;
  line-height: 1.35;
}

h5 {
  font-size: var(--heading-5);
  font-weight: 600;
  line-height: 1.4;
}

h6 {
  font-size: var(--heading-6);
  font-weight: 600;
  line-height: 1.4;
}

/* =========================================================
   REVEAL ON SCROLL (used by animations.js)
   ========================================================= */
.reveal,
.reveal-up,
.reveal-left,
.reveal-scale {
  opacity: 0;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-up {
  transform: translateY(30px);
}

.reveal-left {
  transform: translateX(-30px);
}

.reveal-scale {
  transform: scale(0.95);
}

.reveal.is-visible,
.reveal-up.is-visible,
.reveal-left.is-visible,
.reveal-scale.is-visible {
  opacity: 1;
  transform: none;
}

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

/* Thin expanding ring that reveals new theme while outside shows old theme color */
.theme-ring{
  position: fixed;
  left: var(--cxpx);
  top: var(--cypx);
  transform: translate(-50%, -50%);
  width: 0;
  height: auto;
  aspect-ratio: 1 / 1; /* keep it a perfect circle */
  border-radius: 999px;
  border: 2px solid var(--ring-color, currentColor);
  /* Enormous box-shadow paints the outside area in previous theme bg */
  box-shadow: 0 0 0 1000vmax var(--prev-bg, transparent);
  pointer-events: none;
  z-index: 10000;
}

/* Basic element resets */
img, svg { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0; padding: 0; }
li { list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button,
input,
textarea,
select {
font: inherit;
color: inherit;
background: transparent;
border: none;
}

/* Focus visibility for keyboard users */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
outline: 2px solid var(--focus-outline);
outline-offset: 2px;
}

/* Make sure anchor targets aren't hidden under the fixed header */
.hero, .about, .work, .projects, .clients, .extra-section, .contact {
scroll-margin-top: calc(var(--header-h) + 12px);
}

/* Section shell defaults - each section fills the viewport */
.hero, .about, .work, .projects, .clients, .extra-section, .contact {
  min-height: calc(100vh - var(--header-h));
  padding: var(--vpad-top) min(6vw, 48px) var(--vpad-bottom);
}

/* Shared container helper */
.container {
width: min(1200px, 92vw);
margin-inline: auto;
}

/* Titles used across sections - new pattern: .section-heading > .section-label + .section-title */
.section-heading {
  margin-bottom: clamp(20px, 2.5vh, 36px);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.section-label::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 2px;
}

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

/* =========================================================
   Screen Reader Utilities
   ========================================================= */
.sr-only,
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* =========================================================
   Reusable components: tags, icon boxes
   ========================================================= */

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 9px;
  font-size: 11px;
  font-family: var(--font-mono);
  border-radius: 999px;
  border: 1px solid var(--border-primary);
  background: var(--bg-secondary);
  color: var(--text-muted);
}

/* Standardized icon box for SVG logos (tech stack, social, etc.) */
.icon-box {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: var(--bg-primary, #ffffff);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-primary, rgba(0,0,0,0.06));
  overflow: hidden;
}

.icon-box--sm {
  width: 18px;
  height: 18px;
  border-radius: 6px;
}

.icon-box img,
.icon-box svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}



/* Footer styles live in contact.css - base.css only provides minimal reset */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-primary);
}

/* Very short viewports */
@media (max-height: 720px) {
.hero, .about, .work, .projects, .clients, .extra-section, .contact {
padding-top: 32px;
padding-bottom: 32px;
}
}

/* =========================================================
   RESPONSIVE BREAKPOINTS
   ========================================================= */

/* Tablet */
@media (max-width: 1024px) {
  .about-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: auto !important;
  }
  .about-intro { grid-column: 1 / span 2; }
  .about-socials { grid-column: 1 / span 2; grid-row: auto; }
  .about-tech { grid-column: 1; grid-row: auto; }
  .about-photo { grid-column: 2; grid-row: auto; }
  .about-avail { grid-column: 1 / span 2; grid-row: auto; }

  .exp-layout {
    grid-template-columns: 1fr !important;
  }
  .exp-sidebar {
    position: static !important;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .hero-split {
    grid-template-columns: 1fr !important;
    gap: 0;
  }
  .hero-divider { display: none !important; }

  .featured-card {
    grid-template-columns: 1fr !important;
  }
}

/* Mobile */
@media (max-width: 640px) {
  :root {
    --header-h: 48px;
  }

  .site-header .nav {
    gap: 6px;
    font-size: 12px;
  }

  .about-grid {
    grid-template-columns: 1fr !important;
  }
  .about-intro,
  .about-socials,
  .about-tech,
  .about-photo,
  .about-avail {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  .about-stats {
    flex-wrap: wrap;
  }

  .proj-card {
    flex: 0 0 85vw !important;
  }

  .contact-layout {
    grid-template-columns: 1fr !important;
  }

  .rev-stats {
    flex-wrap: wrap;
  }

  .section-title {
    font-size: clamp(1.5rem, 5vw, 2rem);
  }

  .container {
    width: 95vw;
  }
}