/* =========================================
   BASE STYLES ("SILENCE" MODE)
   ========================================= */

:root {
  --bg-color: #fcfcfc;
  --text-primary: #111111;
  --text-secondary: #555555;
  --font-sans: 'Manrope', sans-serif;
  --font-serif: 'Playfair Display', serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.3s, color 0.3s;
}

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

.serif-italic {
  font-family: var(--font-serif);
  font-style: italic;
}

/* Loader */
.loader {
  position: fixed;
  inset: 0;
  background-color: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.8s ease;
}
.loader-text {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-style: italic;
  font-weight: 400;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 2rem;
  z-index: 100;
  mix-blend-mode: difference;
  color: #fff;
}
.logo {
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.2;
}
.nav-link {
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem 2rem 2rem;
}
.hero-container {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}
.hero-title-wrapper {
  margin-top: 4rem;
}
.hero-title {
  display: flex;
  flex-direction: column;
  font-size: clamp(4rem, 12vw, 10rem);
  line-height: 1;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.align-left { text-align: left; }
.align-center { text-align: center; }
.align-right { text-align: right; }

@keyframes hero-cascade {
  0% {
    opacity: 0;
    transform: translateY(40px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-segment {
  opacity: 0;
  animation: hero-cascade 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-title > span:nth-child(1) { animation-delay: 1.1s; }
.hero-title > span:nth-child(2) { animation-delay: 1.25s; }
.hero-title > span:nth-child(3) { animation-delay: 1.4s; }

.hero-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 4rem;
}
.bio {
  max-width: 450px;
  font-size: 1.2rem;
  font-weight: 400;
}
.scroll-indicator {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 700;
}
.scroll-indicator .line {
  width: 50px;
  height: 1px;
  background-color: var(--text-primary);
}

/* Marquee */
.marquee-container {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  padding: 3rem 0;
  border-top: 1px solid rgba(0,0,0,0.1);
  border-bottom: 1px solid rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.marquee-container.reverse .marquee-row {
  animation-direction: reverse;
}
.marquee-row {
  display: flex;
  width: max-content;
  animation: marquee 25s linear infinite;
}
.marquee-content {
  display: flex;
  flex-shrink: 0;
  align-items: center;
}
.marquee-content span {
  font-size: 2rem;
  font-weight: 500;
  margin: 0 1rem;
}
.marquee-content.large span {
  font-size: 4rem;
}
.separator {
  color: var(--text-secondary);
}

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

/* Gallery Section (Sticky Sidebar) */
.gallery-section {
  display: flex;
  padding: 8rem 2rem;
  gap: 4rem;
}
.border-top {
  border-top: 1px solid rgba(0,0,0,0.1);
}
.sticky-sidebar {
  width: 30%;
  position: sticky;
  top: 8rem;
  height: max-content;
}
.section-index {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.section-title {
  font-size: clamp(2.5rem, 4vw, 4rem);
  line-height: 1.1;
  text-transform: uppercase;
  font-weight: 800;
}
.scrolling-content {
  width: 70%;
  display: flex;
  flex-direction: column;
  gap: 8rem;
}

/* Project Item */
.project-item, .exp-item, .edu-item {
  transition: opacity 0.5s, transform 0.5s;
}
.project-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}
.project-name {
  font-size: 3rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}
.project-year {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}
.project-role {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  color: var(--text-secondary);
}
.project-desc {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  max-width: 650px;
}
.project-desc p {
  margin-bottom: 1rem;
}
.project-link {
  display: inline-block;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--text-primary);
  padding-bottom: 0.2rem;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}
.project-image-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background-color: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  border-radius: 8px;
}
.project-preview-frame {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: inherit;
  background: #fff;
}
.project-image-placeholder.alt-bg {
  background-color: #eaeaea;
}

/* Experience / Education Meta */
.exp-meta h3 {
  font-size: 2rem;
  font-weight: 800;
  text-transform: uppercase;
}
.exp-meta span {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  display: block;
  margin-bottom: 1rem;
}
.exp-role {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}
.exp-context {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  max-width: 600px;
}
.editorial-list {
  list-style: none;
  margin-top: 1rem;
}
.editorial-list li {
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  max-width: 700px;
}
.editorial-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-secondary);
}

/* Footer */
.footer {
  padding: 8rem 2rem 7rem;
  text-align: center;
}
.footer-title {
  font-size: clamp(4rem, 8vw, 8rem);
  line-height: 1.1;
  margin-bottom: 6rem;
  font-weight: 800;
  text-transform: uppercase;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(0,0,0,0.1);
  padding-top: 2rem;
  font-weight: 500;
}
.footer-email {
  font-size: 1.2rem;
  border-bottom: 1px solid var(--text-primary);
}
.footer-links {
  display: flex;
  gap: 2rem;
}

/* Toggle Component */
.layout-toggle {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255,255,255,0.85);
  padding: 0.5rem 1rem;
  border-radius: 3rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  backdrop-filter: blur(12px);
  z-index: 100;
  border: 1px solid rgba(0,0,0,0.05);
}
.toggle-track {
  display: flex;
  background: #f0f0f0;
  border-radius: 2rem;
  padding: 0.25rem;
}
.toggle-button {
  background: transparent;
  border: none;
  padding: 0.5rem 1.2rem;
  border-radius: 1.5rem;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  transition: all 0.3s ease;
}
.toggle-button.is-active {
  background: var(--text-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.toggle-copy {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* =========================================
   NOISE MODE: BRUTALIST OVERRIDES
   ========================================= */

/* GLOBAL CHANGES */
body.noise-mode {
  background-color: #f8f9fa; /* slightly cooler off-white */
  color: #111;
  font-family: 'IBM Plex Mono', monospace !important;
}

body.noise-mode * {
  border-radius: 0 !important;
}

/* Force Monospace for all typography */
body.noise-mode h1, 
body.noise-mode h2, 
body.noise-mode h3, 
body.noise-mode h4, 
body.noise-mode p,
body.noise-mode span,
body.noise-mode a,
body.noise-mode div,
body.noise-mode .serif-italic,
body.noise-mode li {
  font-family: 'IBM Plex Mono', monospace !important;
  font-style: normal !important; /* Disable italic for serif items */
  letter-spacing: -0.02em;
}

/* HERO SECTION */
body.noise-mode .hero {
  border-bottom: 2px solid #111;
  padding-top: 8rem;
  background-color: #fdf6e3; /* Soft pastel yellow background for the hero */
}

body.noise-mode .hero-container {
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
  max-width: 100%;
  gap: 0;
}

body.noise-mode .hero-title-wrapper {
  width: 100%;
  margin-top: 0;
}

body.noise-mode .hero-title {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

body.noise-mode .hero-segment {
  display: block;
  width: 100%;
  padding: 1.5rem 2rem;
  border-bottom: 2px solid #111;
  line-height: 1;
  text-transform: uppercase;
  border-top: 2px solid #111;
  margin-top: -2px; /* collapse double borders */
}

/* Mix fonts aggressively in the Hero Section for Noise Mode */
body.noise-mode .hero-title > span:nth-child(1) {
  font-family: 'Syne', sans-serif !important;
  font-weight: 800;
  font-size: clamp(4rem, 12vw, 10rem);
  letter-spacing: -0.04em;
  text-align: left !important;
}

body.noise-mode .hero-title > span:nth-child(2) {
  font-family: 'Syne', sans-serif !important;
  font-style: normal !important;
  font-weight: 800;
  font-size: clamp(4rem, 12vw, 10rem);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  text-align: left !important;
  /* Pastel purple background is already applied below */
}

body.noise-mode .hero-title > span:nth-child(3) {
  font-family: 'Syne', sans-serif !important;
  font-weight: 800;
  font-size: clamp(4rem, 12vw, 10rem);
  letter-spacing: -0.02em;
  text-align: left !important;
}

/* Stripe effect: Soft pastel purple */
body.noise-mode .hero-segment-secondary {
  background-color: #e2d9f3;
  color: #111;
}

body.noise-mode .hero-bottom {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  background: transparent;
  margin-top: 0;
  align-items: flex-start;
  gap: 2rem;
}

/* MARQUEE */
body.noise-mode .marquee-container {
  background-color: #d1f4e0; /* Pastel mint green */
  color: #111;
  border-bottom: 2px solid #111;
  border-top: 2px solid #111;
}

body.noise-mode .marquee-content span {
  color: #111;
}

/* Increase animation speed */
body.noise-mode .marquee-row {
  animation-duration: 5s !important;
}

/* THE GALLERY SECTIONS (Spreadsheet Layout) */
body.noise-mode .gallery-section {
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  border-top: none;
  background-color: #f8f9fa;
  gap: 0;
}

/* Destroy sticky sidebar layout */
body.noise-mode .sticky-sidebar {
  position: static !important;
  width: 100%;
  height: auto;
  border-right: none;
  border-bottom: 2px solid #111;
}

body.noise-mode .section-label-row {
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  gap: 2rem;
  padding: 1rem 2rem;
  background-color: #111;
  color: #fff;
  width: 100%;
}

body.noise-mode .section-title {
  margin: 0;
  font-size: 2rem;
}

body.noise-mode .scrolling-content {
  width: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0 !important;
}

/* Spreadsheet rows for items */
body.noise-mode .project-item,
body.noise-mode .exp-item,
body.noise-mode .edu-item {
  border-bottom: 2px solid #111;
  padding: 2rem;
  margin: 0 !important;
  opacity: 1 !important;
  transform: none !important;
  animation: none !important; /* Disable fade-in reveal */
  visibility: visible !important;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

/* Neo-brutalist hover states */
body.noise-mode .project-item:hover,
body.noise-mode .exp-item:hover,
body.noise-mode .edu-item:hover {
  background-color: #ffd6e0; /* Pastel pink on hover */
  cursor: pointer;
}

/* Specific section overrides */
body.noise-mode #experience .exp-item:hover {
  background-color: #cce3de; /* Pastel blue on hover */
}
body.noise-mode #education .edu-item:hover {
  background-color: #fdf6e3; /* Pastel yellow on hover */
}

body.noise-mode .project-item:last-child,
body.noise-mode .exp-item:last-child,
body.noise-mode .edu-item:last-child {
  border-bottom: 2px solid #111;
}

body.noise-mode .project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px dashed #111;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

body.noise-mode .project-image-placeholder {
  border: 2px solid #111;
  background-color: #fff;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
}

body.noise-mode .project-image-placeholder.alt-bg {
  background-color: #111;
  color: #fff;
}

/* Skills Marquee specific color */
body.noise-mode .skills-marquee-section .marquee-container {
  background-color: #e2d9f3; /* Pastel purple */
  border-top: none;
}

/* FOOTER */
body.noise-mode .footer {
  text-align: left;
  padding: 4rem 2rem;
  background: #111;
  color: #f8f9fa;
}

body.noise-mode .footer-top {
  border-bottom: 2px solid #333;
  padding-bottom: 2rem;
  margin-bottom: 2rem;
}

/* Split "Let's build" and "the future" to opposite corners */
body.noise-mode .footer-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: clamp(2rem, 6vw, 6rem);
  text-transform: uppercase;
  margin: 0;
  width: 100%;
}

/* Hide the <br> tag so the flex-between rule can separate the text chunks */
body.noise-mode .footer-title br {
  display: none;
}

body.noise-mode .footer-bottom {
  border-top: 2px solid #333;
}
body.noise-mode .footer-bottom a {
  color: #f8f9fa;
}

/* TOGGLE COMPONENT ADAPTATIONS */
body.noise-mode .layout-toggle {
  border: 2px solid #111;
  background: #fff;
  border-radius: 0;
  box-shadow: none;
}
body.noise-mode .toggle-track {
  border-radius: 0;
  border: 2px solid #111;
  background: #fff;
}
body.noise-mode .toggle-button {
  border-radius: 0;
  box-shadow: none;
}
body.noise-mode .toggle-button.is-active {
  background: #d1f4e0; /* Active state gets mint green */
  color: #111;
  border: 2px solid #111;
  margin: -2px; /* Pulls the border over the track border */
}


