/* ================================================================
   BASE.CSS — Typography, Layout Utilities, Shared Components
   ================================================================ */

/* ── Google Fonts Import ── */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Container ── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

/* ── Section ── */
.section {
  padding: var(--section-pad) 0;
  position: relative;
  overflow: hidden;
}

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

/* Section tint overlays (each section gets personality) */
#about::before    { content: ''; position: absolute; inset: 0; background: var(--tint-about);   pointer-events: none; z-index: 0; }
#skills::before   { content: ''; position: absolute; inset: 0; background: var(--tint-skills);  pointer-events: none; z-index: 0; }
#media::before    { content: ''; position: absolute; inset: 0; background: var(--tint-media);   pointer-events: none; z-index: 0; }
#contact::before  { content: ''; position: absolute; inset: 0; background: var(--tint-contact); pointer-events: none; z-index: 0; }

/* Ensure container children sit above tint */
#about .container, #skills .container, #media .container, #contact .container { position: relative; z-index: 1; }

/* Section accent line at top */
#about   { border-top: none; background: var(--bg-primary); }
#projects { border-top: none; background: var(--bg-secondary); }
#skills  { border-top: none; }
#media   { border-top: none; background: var(--bg-primary); }
#contact { border-top: none; background: var(--bg-secondary); }

.section--glow::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 300px;
  background: var(--section-glow-warm);
  pointer-events: none;
  z-index: 0;
}

/* Reveal helpers for scroll animations */
.fly-left,
.fly-right,
.fly-up {
  opacity: 0;
  will-change: transform, opacity;
}
.fly-left  { transform: translateX(-60px); }
.fly-right { transform: translateX(60px); }
.fly-up    { transform: translateY(50px); }

/* ── Section Header ── */
.section-label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

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

.section-title {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

/* ── Text Utilities ── */
.text-accent    { color: var(--accent); }
.text-muted     { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-mono      { font-family: var(--font-mono); }
.font-display   { font-family: var(--font-display); }

/* ── Outline / Ghost Text ── */
.text-outline {
  -webkit-text-stroke: 1px var(--border-hover);
  color: transparent;
}

/* ── Flex & Grid Utilities ── */
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col     { display: flex; flex-direction: column; }
.grid         { display: grid; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 100px;
  transition: all var(--duration-mid) var(--ease-out);
  position: relative;
  overflow: hidden;
}

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

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-dark);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-mid) var(--ease-out);
}

.btn-primary:hover::before { transform: scaleX(1); }
.btn-primary:hover { color: #fff; }

/* Ensure text stays above ::before overlay */
.btn { isolation: isolate; }
.btn::before { z-index: -1; }

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

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

/* ── Divider ── */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border-color);
}

/* ── Tag / Chip ── */
.tag {
  display: inline-block;
  padding: 0.3em 0.85em;
  border: 1px solid var(--border-color);
  border-radius: 100px;
  font-size: var(--fs-small);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

/* ── Reveal (animated by GSAP) ── */
.reveal-line {
  overflow: hidden;
  display: block;
}

.reveal-line span {
  display: block;
  transform: translateY(110%);
  will-change: transform;
}

/* ── Magnetic (JS handles the movement) ── */
.magnetic {
  display: inline-block;
}

/* ── Section Dividers ── */
.sec-divider {
  position: relative;
  height: 62px;
  overflow: hidden;
  pointer-events: none;
  margin-top: -2px;
  margin-bottom: -2px;
}

.sec-divider-svg {
  position: absolute;
  bottom: -1px;
  left: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
}

/* Bubble divider (hero → about) */
.sec-divider--wave {
  height: 80px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sec-divider-bubbles {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.sdb {
  display: block;
  border-radius: 50%;
  background: var(--border-color);
  animation: sdb-pulse 3s ease-in-out infinite;
}
.sdb--1 { width: 10px; height: 10px; background: var(--accent); opacity: 0.5; animation-delay: 0s; }
.sdb--2 { width: 14px; height: 14px; background: var(--accent2); opacity: 0.4; animation-delay: 0.4s; }
.sdb--3 { width: 10px; height: 10px; background: var(--accent3); opacity: 0.5; animation-delay: 0.8s; }

@keyframes sdb-pulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50%       { transform: scale(1.4); opacity: 0.8; }
}

/* ── Noise Overlay ── */
.noise {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: var(--z-above);
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  animation: noise 0.5s steps(2) infinite;
}

@keyframes noise {
  0%   { transform: translate(0,0); }
  25%  { transform: translate(-1%, 1%); }
  50%  { transform: translate(1%, -1%); }
  75%  { transform: translate(-1%, -1%); }
  100% { transform: translate(1%, 1%); }
}
