:root {
  /* Designer Palette - More Sophisticated */
  --bg-color: #fdfcfb;
  --text-main: #1a1a1a;
  --text-muted: #4a4a4a;
  --accent-pink: #fbcfe8;
  --accent-pink-dark: #f472b6;
  --accent-glow: rgba(244, 114, 182, 0.4);
  --border-color: rgba(0, 0, 0, 0.08);

  /* Elevation */
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 12px 24px -4px rgba(0, 0, 0, 0.05);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.4);

  /* Typography */
  --font-serif: 'Playfair Display', serif;
  --font-sans: 'Inter', sans-serif;
  --font-display: 'Alex Brush', cursive;

  /* Sizing */
  --max-width: 1200px;
  --header-height: 100px;
  --transition-main: 0.6s cubic-bezier(0.85, 0, 0.15, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: normal;
  /* Fixed from 1.7 to prevent overlap issues on tight spaces */
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

main {
  padding-top: calc(var(--header-height) + 2rem);
}

/* Typography */
h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  /* Increased from 400 */
  letter-spacing: -0.01em;
  line-height: 1.2;
}

h1 {
  font-size: clamp(3.5rem, 10vw, 6rem);
  /* Larger, more dramatic */
  margin-bottom: 2rem;
  letter-spacing: -0.04em;
  font-weight: 800;
}

h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 3rem;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

p {
  color: var(--text-muted);
  font-size: 1.15rem;
  /* Increased for magazine feel */
  line-height: 1.8;
  margin-bottom: 1.5rem;
  font-weight: 400;
}

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

/* Minimalism is about lines and spacing */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

@media (max-width: 600px) {
  .container {
    padding: 0 1.25rem;
  }
}

/* Graphical Background Elements */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: -2;
  pointer-events: none;
}

/* Header & Nav - Floating Dock Style */
header {
  height: var(--header-height);
  position: fixed;
  top: 2rem;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: all 0.5s var(--transition-main);
}

header .container {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  padding: 0.6rem 1.5rem;
  /* Reduced padding */
  box-shadow: var(--shadow-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  /* Ensure logo and nav stay on one line */
  width: 95%;
  /* Increased width */
  max-width: 1100px;
  /* Increased max-width */
  margin: 0 auto;
}

header.scrolled {
  top: 1rem;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.logo-img {
  height: 48px;
  /* Increased from 32px */
  width: auto;
  transition: transform 0.3s var(--transition-main);
}

.logo-container:hover .logo-img {
  transform: scale(1.1);
}

.logo-text {
  font-family: var(--font-display);
  font-size: 2.22rem;
  /* Increased significantly */
  font-weight: 400;
  color: var(--text-main);
  background: linear-gradient(135deg, var(--text-main) 30%, var(--accent-pink-dark));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 0.5rem;
  /* Significantly reduced gap */
  align-items: center;
  flex-wrap: nowrap;
  /* Force single line */
}

nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  /* Slightly smaller for single line fit */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.4rem 0.8rem;
  /* Reduced horizontal padding */
  border-radius: 50px;
  transition: all 0.3s ease;
  white-space: nowrap;
  /* Prevent text wrapping inside links */
}

nav a:hover,
nav a.active {
  background: white;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

/* Mobile Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  z-index: 1100;
  padding: 10px;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--text-main);
  transition: all 0.3s var(--ease-out);
}

/* Background Blobs for a 'Cool/Unique' feel */
.bg-blob {
  position: fixed;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, var(--accent-pink) 0%, rgba(255, 255, 255, 0) 70%);
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.4;
  pointer-events: none;
  animation: float-blob 20s infinite alternate ease-in-out;
}

.blob-1 {
  top: -10%;
  right: -10%;
}

.blob-2 {
  bottom: -10%;
  left: -10%;
  animation-delay: -5s;
}

@keyframes float-blob {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(10%, 10%) scale(1.1);
  }
}

/* Graphical Ornaments */
.hero::after {
  content: 'Physics';
  position: absolute;
  top: 10%;
  right: -5%;
  font-size: 15vw;
  font-family: var(--font-serif);
  color: var(--accent-pink);
  opacity: 0.1;
  z-index: -1;
  transform: rotate(15deg);
  pointer-events: none;
}

/* Updated Buttons - Graphical/Designer Style */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 1.2rem 2.8rem;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.5s var(--transition-main);
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.btn-primary {
  background: var(--text-main);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-pink-dark);
  transform: translateY(-5px);
  box-shadow: 0 20px 40px var(--accent-glow);
}

.btn-secondary {
  background: white;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-color);
  border-color: var(--accent-pink-dark);
  transform: translateY(-5px);
}

/* Hero - Graphical Redesign */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-content {
  max-width: 850px;
  position: relative;
  z-index: 2;
}

.hero h1 span {
  display: block;
  font-family: var(--font-display);
  font-size: 6vw;
  color: var(--accent-pink-dark);
  margin-top: -1rem;
  margin-left: 2rem;
}

.lead {
  font-family: var(--font-serif);
  border-left: 2px solid var(--accent-pink);
  padding-left: 2rem;
  margin-left: 1rem;
  font-size: 1.4rem;
  line-height: 1.8;
  color: var(--text-main);
  max-width: 600px;
}

@media (max-width: 600px) {
  .lead {
    font-size: 1.2rem;
    padding-left: 1rem;
    margin-left: 0;
  }
}

@media (max-width: 600px) {
  .lead {
    font-size: 1.1rem;
    line-height: 1.6;
  }
}

/* Card Grid - Asymmetrical Designer Layout */
.card-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2rem;
  padding: 3rem 0;
}

.glass-card:nth-child(1) {
  grid-column: 1 / 5;
}

.glass-card:nth-child(2) {
  grid-column: 5 / 9;
}

.glass-card:nth-child(3) {
  grid-column: 9 / 13;
}

@media (max-width: 900px) {
  .card-grid {
    display: flex;
    flex-direction: column;
    padding: 4rem 0;
  }

  .glass-card {
    margin-top: 0 !important;
  }
}

/* Glass Cards - Graphical Re-design */
.glass-card {
  background: white;
  padding: 3rem 2rem;
  border-radius: 24px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  transition: all 0.5s var(--transition-main);
  position: relative;
  overflow: hidden;
  height: 100%;
  /* Ensure equal height in grids */
  display: flex;
  flex-direction: column;
}

.glass-card:hover {
  transform: translateY(-10px);
  border-color: var(--accent-pink-dark);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.08);
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-pink), var(--accent-pink-dark));
  opacity: 0;
  transition: opacity 0.3s;
}

.glass-card:hover::before {
  opacity: 1;
}

.glass-card h3 {
  font-family: var(--font-sans);
  /* Mixing for modern feel */
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: 0;
}

.glass-card a {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-main);
}

/* Footer - Simple and centered */
footer {
  padding: 4rem 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

@media (max-width: 600px) {
  footer {
    padding: 3rem 0;
  }
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 2rem;
}

.social-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Profile Image Handling */
.profile-container {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  margin-bottom: 4rem;
  background: var(--border-color);
}

.profile-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(20%);
  /* Artistic touch */
  transition: filter 0.6s var(--ease-out);
}

.profile-container:hover img {
  filter: grayscale(0%);
}

/* Interest Tags */
.interest-tag {
  font-size: 0.8rem;
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.8rem;
  color: var(--text-muted);
}

/* Enhanced Reveal Animations - Designer Motion */
[data-reveal] {
  opacity: 0;
  transform: translateY(60px);
  filter: blur(10px);
  transition:
    opacity 1s var(--transition-main),
    transform 1s var(--transition-main),
    filter 1s var(--transition-main);
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.reveal-delay-1 {
  transition-delay: 0.15s;
}

.reveal-delay-2 {
  transition-delay: 0.3s;
}

.reveal-delay-3 {
  transition-delay: 0.45s;
}

/* Elegant Section Dividers */
section {
  position: relative;
  padding: 5rem 0;
}

@media (max-width: 768px) {
  section {
    padding: 4rem 0;
  }
}

/* Specific Page Adjustments */
/* Moments Timeline Mobile */
@media (max-width: 600px) {
  .moments-timeline {
    padding-left: 2rem !important;
    margin-left: 0.5rem !important;
    border-left: 1px solid var(--accent-pink) !important;
  }

  .moments-timeline [style*="left: -3.35rem"] {
    left: -2.55rem !important;
    width: 0.8rem !important;
    height: 0.8rem !important;
  }

  .moments-timeline article.glass-card {
    padding: 1.5rem !important;
    margin-top: 1rem !important;
  }
}

/* Learn/Colloquium Mobile Font */
@media (max-width: 600px) {
  .colloquium-intro p {
    font-size: 1.1rem !important;
  }
}

.colloquium-word {
  font-size: 4rem;
}

@media (max-width: 600px) {
  .colloquium-word {
    font-size: 2.2rem;
  }

  h1 {
    font-size: 2.5rem !important;
    line-height: 1.1 !important;
  }

  .lead {
    font-size: 1.1rem !important;
    margin-top: 1rem !important;
  }
}

/* Quiet Archive Accordion Fix */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.6s var(--transition-main);
  background: rgba(0, 0, 0, 0.02);
  border-radius: 20px;
}

.accordion-content.show {
  max-height: 1000px;
  /* Large enough to show all content */
}

.accordion-button {
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border-radius: 100px;
}

.accordion-button .chev {
  transition: transform 0.3s ease;
}

.accordion-button.active .chev {
  transform: rotate(90deg);
}

.chapter-list li a {
  display: block;
  padding: 1rem;
  text-decoration: none;
  font-weight: 600;
  color: var(--text-main);
  transition: all 0.3s;
}

.chapter-list li a:hover {
  background: var(--accent-pink);
  transform: translateX(10px);
}


/* Mobile Navigation */
/* Mobile Navigation - Complete Re-design */
@media (max-width: 768px) {
  header {
    top: 1rem;
  }

  header .container {
    padding: 0.5rem 1.2rem;
    width: 92%;
  }

  .logo-text {
    font-size: 1.5rem;
  }

  .menu-toggle {
    display: flex;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
  }

  nav ul {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-color);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    transform: translateY(-100%);
    transition: transform 0.6s cubic-bezier(0.85, 0, 0.15, 1);
    z-index: 900;
    padding: 2rem;
  }

  nav ul.show {
    transform: translateY(0);
  }

  nav a {
    font-size: 2rem;
    font-family: var(--font-serif);
    text-transform: none;
    letter-spacing: -0.02em;
  }

  /* Artistic backdrop for mobile menu */
  nav ul::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -10%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--accent-pink) 0%, transparent 70%);
    filter: blur(100px);
    z-index: -1;
    opacity: 0.5;
  }

  .menu-toggle.active {
    background: var(--text-main);
  }

  .menu-toggle.active span {
    background: white;
  }
}

/* Extra Small Devices */
@media (max-width: 480px) {
  :root {
    --header-height: 70px;
  }

  h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
  }

  .btn {
    width: 100%;
    justify-content: center;
    margin-left: 0 !important;
    margin-bottom: 1rem;
  }

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

  .glass-card {
    padding: 1.5rem 1rem;
  }

  .card-grid {
    gap: 1.5rem;
    padding: 3rem 0;
  }
}