/* --- Variables & Reset --- */
:root {
  --bg-color: #ffffff;
  --card-bg: #ffffff;
  --text-primary: #111111;
  --text-secondary: #444444;
  --accent: #000000;
  --border-color: #e5e5e5;
  --nav-height: 80px;
  --marquee-height: 32px;
  --transition: all 0.3s ease;
}

/* --- Dark Theme Overrides (Inverted) --- */
[data-theme="dark"] {
  --bg-color: #111111;
  --card-bg: #111111;
  --text-primary: #ffffff;
  --text-secondary: #bbbbbb;
  --accent: #ffffff;
  --border-color: #333333;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  padding-top: var(--marquee-height); /* Push content down for marquee */
  font-family: "Inter", sans-serif;
  line-height: 1.6;
}

/* --- Typography --- */
h1,
h2,
h3 {
  color: var(--text-primary);
  font-family: "Playfair Display", serif;
  font-weight: 700;
}

.subtitle {
  color: var(--text-secondary);
  font-family: "Inter", sans-serif;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 3rem;
  position: relative;
  display: inline-block;
}

/* --- Layout Utilities --- */
.section-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 100px 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.text-center {
  text-align: center;
}

/* --- Navbar --- */
.navbar {
  height: var(--nav-height);
  background: transparent;
  transition: var(--transition);
  position: fixed;
  width: 100%;
  top: var(--marquee-height); /* Sit below the marquee */
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-color);
}

.navbar.scrolled {
  /* Minimalist style doesn't change much on scroll */
  border-bottom: 1px solid var(--accent);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
}

.logo {
  color: var(--accent);
  font-family: "Playfair Display", serif;
  font-weight: 400;
  text-decoration: none;
  font-size: 1.5rem;
}

#theme-toggle {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
}

/* --- Hero Section --- */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  max-width: 1000px;
  margin: 0 auto;
}

.title {
  font-size: clamp(40px, 8vw, 80px);
  line-height: 1.1;
  color: var(--text-primary);
  position: relative;
  z-index: 1;
}

.text-gradient {
  /* Removed gradient for minimalist look */
  color: var(--text-primary);
  display: inline-block;
}

.role {
  font-size: clamp(30px, 5vw, 60px);
  line-height: 1.1;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.typing-text::after {
  content: "|";
  animation: blink 1s step-end infinite;
  color: var(--accent);
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.description {
  max-width: 500px;
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 50px;
}

/* --- Buttons --- */
.cta-button {
  display: inline-block;
  padding: 14px 28px;
  background-color: var(--accent);
  color: var(--bg-color);
  border: 1px solid var(--accent);
  text-decoration: none;
  border-radius: 0; /* Sharp edges */
  font-family: "Inter", sans-serif;
  transition: var(--transition);
}

.cta-button:hover {
  background: transparent;
  color: var(--accent);
}

/* --- Tech Stack Tags --- */
.tech-stack {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tech-stack span {
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border-color);
  padding: 4px 12px;
  border-radius: 0;
}

/* --- Project Grid --- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.project-card {
  background: transparent;
  border: 1px solid var(--border-color);
  padding: 2rem;
  border-radius: 0;
  transition: var(--transition);
  position: relative;
  top: 0;
}

.project-card:hover {
  border-color: var(--accent);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.external-links a {
  color: var(--text-secondary);
  text-decoration: none;
  margin-left: 10px;
  font-size: 0.9rem;
}

.external-links a:hover {
  color: var(--accent);
}

.project-card h3 {
  margin-bottom: 10px;
  color: var(--text-primary);
}

.project-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.card-tech-list {
  list-style: none;
  display: flex;
  gap: 15px;
  font-family: "Inter", sans-serif;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* --- Animations --- */
.hidden {
  opacity: 0;
  filter: blur(5px);
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.show {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

.project-card:nth-child(2) {
  transition-delay: 0.1s;
}
.project-card:nth-child(3) {
  transition-delay: 0.2s;
}

/* --- Stock Marquee --- */
.stock-marquee {
  width: 100%;
  height: var(--marquee-height);
  background: var(--accent);
  color: var(--bg-color);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1001;
  overflow: hidden;
  display: flex;
  align-items: center;
  font-family: "Inter", sans-serif;
  font-size: 0.8rem;
}

.marquee-content {
  display: flex;
  gap: 2rem;
  animation: scroll 80s linear infinite;
  white-space: nowrap;
  width: max-content; /* Ensure container fits all items */
  padding-right: 2rem; /* Adds a gap at the end to match the loop */
  will-change: transform; /* Hardware acceleration for smoothness */
}

@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ticker-item strong {
  font-weight: 700;
}

.ticker-item svg {
  width: 14px;
  height: 14px;
}

.ticker-item.up svg { stroke: #4ade80; } /* Green */
.ticker-item.down svg { stroke: #f87171; } /* Red */

/* --- Footer --- */
footer {
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
  font-family: "Inter", sans-serif;
  font-size: 0.8rem;
}

/* --- Mobile Nav (Hidden by default) --- */
.menu-toggle {
  display: none;
}

@media screen and (max-width: 768px) {
  .nav-menu {
    position: fixed;
    left: -100%;
    top: calc(var(--nav-height) + var(--marquee-height));
    flex-direction: column;
    background-color: var(--bg-color);
    width: 100%;
    height: 100vh;
    text-align: center;
    transition: 0.3s;
    padding-top: 2rem;
  }

  .nav-menu.active {
    left: 0;
  }

  .menu-toggle {
    display: block;
    cursor: pointer;
  }

  .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--text-primary);
    transition: all 0.3s ease-in-out;
  }
}

/* --- 3D Background --- */
#three-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1; /* Behind content */
  opacity: 0.5; /* Subtle blend */
  pointer-events: none; /* Allow clicks to pass through to buttons */
}
