/* ============================================================
   BASE.CSS — Variables, Reset, Typography, Global
   Chaitanya Pentakota Portfolio
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Mono:ital,wght@0,300;0,400;0,500;1,400&family=Clash+Display:wght@400;500;600;700&family=Syne:wght@400;500;600;700;800&display=swap');

/* ─── CSS VARIABLES ─────────────────────────────────────── */
:root {
  /* Base */
  --bg:             #050505;
  --surface:        #0d0d0d;
  --surface-2:      #141414;
  --border:         #1f1f1f;
  --border-light:   #2a2a2a;
  --text:           #f5f5f0;
  --text-dim:       #888;
  --text-faint:     #444;

  /* Section accent colors */
  --c-hero:         #0066FF;
  --c-story:        #00F5FF;
  --c-skills:       #39FF14;
  --c-projects:     #FF9500;
  --c-experience:   #A855F7;
  --c-contact:      #FF2D55;

  /* Current accent (changes per section via JS) */
  --accent:         #0066FF;

  /* Typography */
  --font-display:   'Bebas Neue', sans-serif;
  --font-heading:   'Syne', sans-serif;
  --font-mono:      'DM Mono', monospace;
  --font-body:      'Syne', sans-serif;

  /* Spacing */
  --nav-h:          72px;
  --section-px:     clamp(1.5rem, 5vw, 6rem);
  --section-py:     clamp(5rem, 10vh, 10rem);

  /* Transitions */
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:    cubic-bezier(0.87, 0, 0.13, 1);
}

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

html {
  scroll-behavior: auto; /* Lenis handles smooth scroll */
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
  cursor: none;
  line-height: 1.6;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

button {
  background: none;
  border: none;
  cursor: none;
  font-family: inherit;
}

ul, ol { list-style: none; }

/* ─── CUSTOM CURSOR ──────────────────────────────────────── */
#cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: background 0.3s, transform 0.15s;
  will-change: left, top;
}

#cursor-ring {
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  opacity: 0.5;
  will-change: left, top;
  transition: width 0.4s var(--ease-out-expo),
              height 0.4s var(--ease-out-expo),
              opacity 0.3s,
              border-color 0.3s,
              background 0.3s;
}

#cursor-ring.hovering {
  width: 70px;
  height: 70px;
  opacity: 0.2;
  background: var(--accent);
}

#cursor-ring.clicking {
  width: 20px;
  height: 20px;
  opacity: 0.8;
}

/* ─── NOISE TEXTURE OVERLAY ──────────────────────────────── */
#noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99000;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* ─── NAVIGATION ─────────────────────────────────────────── */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--section-px);
  transition: background 0.5s;
}

#nav::after {
  content: '';
  position: absolute;
  inset: 0;
  backdrop-filter: blur(16px) saturate(1.5);
  background: rgba(5, 5, 5, 0.6);
  border-bottom: 1px solid var(--border);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.5s;
}

#nav.scrolled::after { opacity: 1; }

.nav-logo {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--text-primary);
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  position: relative;
  transition: color 0.25s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.35s var(--ease-out-expo);
}

.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.nav-cta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--bg) !important;
  background: var(--accent);
  padding: 0.5rem 1.2rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: opacity 0.2s, transform 0.2s !important;
}
.nav-cta::after { display: none !important; }
.nav-cta:hover { opacity: 0.85; transform: translateY(-1px); }

/* ─── SECTION WRAPPER ────────────────────────────────────── */
.section-wrap {
  padding: var(--section-py) var(--section-px);
  position: relative;
  overflow: hidden;
}

/* ─── SECTION LABEL ──────────────────────────────────────── */
.s-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.s-label::before {
  content: '';
  width: 32px; height: 1px;
  background: var(--accent);
  flex-shrink: 0;
}

/* ─── DISPLAY TITLE ──────────────────────────────────────── */
.s-title {
  font-family: var(--font-display);
  font-size: clamp(4rem, 10vw, 10rem);
  line-height: 0.92;
  letter-spacing: 0.02em;
  color: var(--text);
}

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

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.9rem 2rem;
  transition: all 0.3s var(--ease-out-expo);
  white-space: nowrap;
  cursor: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  font-weight: 500;
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 102, 255, 0.35);
}

.btn-outline {
  border: 1px solid var(--border-light);
  color: var(--text-dim);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-3px);
}

.btn-icon { font-size: 1rem; }

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

/* ─── SCROLL REVEAL BASE ─────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(50px);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
}

.reveal-right {
  opacity: 0;
  transform: translateX(60px);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
}

/* ─── SECTION COLOR TRANSITIONS ──────────────────────────── */
.section-hero      { --accent: var(--c-hero); }
.section-story     { --accent: var(--c-story); }
.section-skills    { --accent: var(--c-skills); }
.section-projects  { --accent: var(--c-projects); }
.section-experience { --accent: var(--c-experience); }
.section-contact   { --accent: var(--c-contact); }

/* ─── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); }

/* ─── SELECTION ──────────────────────────────────────────── */
::selection {
  background: var(--accent);
  color: var(--bg);
}

/* ─── RESPONSIVE HELPERS ─────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  body { cursor: auto; }
  #cursor-dot, #cursor-ring { display: none; }
}