/**
 * VindE - Global Stylesheet
 * 
 * Features:
 * 1. Dual-theme support with optimized variable mapping.
 * 2. Performance-first font stacks to eliminate layout thrashing.
 * 3. Component-specific transitions for a premium UI feel.
 */

/* ==========================================================================
   1. VARIABLES & THEMES
   ========================================================================== */

:root {
  /* DARK THEME (Default) */
  --bg: #0a0a0c;
  --surface: #141416;
  --text: #eeeeee;
  --text-dim: #888888;
  --accent-gold: #ffc107;
  --accent-red: #ff3b5c;
  --border-color: rgba(255, 255, 255, 0.05);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

body.light-theme {
  /* LIGHT THEME */
  --bg: #ffffff;
  --surface: #f2f2f2;
  --text: #000000;
  --text-dim: #555555;
  --accent-gold: #ffc107;
  --accent-red: #ff3b5c;
  --border-color: rgba(0, 0, 0, 0.1);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   2. GLOBAL RESET & LAYOUT
   ========================================================================== */

* {
  box-sizing: border-box;
  cursor: none !important; /* Enforces custom cursor utility */
}

html {
  scroll-behavior: smooth !important;
}

body,
html {
  margin: 0;
  padding: 0;
  height: 100%;
  background-color: var(--bg);
  color: var(--text);
  /* Optimized system font fallbacks prevent FOUT (Flash of Unstyled Text) */
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Centralized transition logic for theme-sensitive components */
header,
footer,
.feature-card,
.project-card,
.btn,
.project-detail,
.back-link,
#theme-toggle {
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

/* --- CUSTOM SCROLLBAR --- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-gold);
}

/* ==========================================================================
   3. CONTAINERS & TRANSITIONS
   ========================================================================== */

#header-placeholder,
#footer-placeholder {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Initialized via script.js upon successful fetch */
body.loaded #header-placeholder,
body.loaded #footer-placeholder {
  opacity: 1;
}

#page-content {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 140px 24px 40px;
  display: flex;
  flex-direction: column;

  /* Hidden state to manage FOUT and layout shifts during SPA navigation */
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease,
    visibility 0.4s;
}

#page-content.loaded {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ==========================================================================
   4. TYPOGRAPHY & UI
   ========================================================================== */

h1,
h2,
h3 {
  /* Arial Narrow fallback used to match condensed width of Oswald */
  font-family:
    "Oswald", "Arial Narrow", "Helvetica Neue", Helvetica, sans-serif-condensed,
    sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

h1 {
  font-size: 4rem;
  color: var(--accent-gold);
  text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
  line-height: 1;
}

body.light-theme h1 {
  text-shadow: none;
}
body.light-theme h2,
body.light-theme h3 {
  color: #000;
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--accent-gold);
}

.btn {
  display: inline-block;
  padding: 10px 24px;
  background: transparent;
  border: 2px solid var(--accent-gold);
  color: var(--accent-gold);
  font-family: "Oswald", sans-serif;
  font-size: 1.2rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.btn:hover {
  background: var(--accent-gold);
  color: #000;
  box-shadow: 0 0 15px rgba(255, 193, 7, 0.4);
}

/* ==========================================================================
   5. HOME PAGE CONTENT
   ========================================================================== */

.intro {
  height: 60vh;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 10%;
}

.intro h1 {
  font-size: 8rem;
  margin: 0;
  line-height: 0.9;
  letter-spacing: -3px;
  opacity: 0;
  animation: heroEnter 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards 0.1s;
}

.sub-text {
  font-family: "Oswald", sans-serif;
  font-size: 1.5rem;
  color: var(--text);
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 500;
  opacity: 0;
  animation: heroEnter 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards 0.3s;
}

.sub-text .slash {
  color: var(--accent-red);
  margin: 0 10px;
  font-weight: bold;
}

.desc {
  font-family: "Inter", sans-serif;
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-top: 1.5rem;
  line-height: 1.5;
  max-width: 500px;
  opacity: 0;
  animation: heroEnter 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards 0.5s;
}

/* --- CENTERED MINIMALIST HINTS --- */
.hint {
  margin-top: 4rem; /* Spaced further down to act as a section anchor */
  width: 100%;
  margin-left: -5%; /* Optical centering offset: negates half of the parent's 10% padding */

  display: flex;
  justify-content: center;
  align-items: center;
  gap: 60px; /* Generous gap for premium editorial feel */

  font-family: "Oswald", sans-serif;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 5px; /* High tracking for minimalist elegance */

  opacity: 0;
  animation: heroEnter 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards 0.8s;
}

.hint-item {
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0.5;
  transition:
    opacity 0.3s ease,
    color 0.3s ease;
}

.hint-item:hover {
  opacity: 1;
  color: var(--text);
}

.hint-item i {
  color: var(--accent-gold);
  font-size: 0.8rem;
  animation: hintBreathe 3s infinite ease-in-out;
}

/* ==========================================================================
   6. ANIMATION KEYFRAMES
   ========================================================================== */

@keyframes heroEnter {
  0% {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes hintBreathe {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

/* ==========================================================================
   7. RESPONSIVENESS
   ========================================================================== */

@media (max-width: 768px) {
  .intro {
    padding-left: 0;
    align-items: center;
    text-align: center;
  }
  .intro h1 {
    font-size: 5rem;
  }
  .desc {
    padding: 0 20px;
  }
  .hint {
    margin-left: 0;
    margin-top: 3.5rem;
    gap: 30px;
    letter-spacing: 3px;
    font-size: 0.7rem;
  }
}

@media (max-width: 900px) {
  #page-content {
    padding-top: 100px;
  }
}
