/* ==========================================================================
   Academic Luxury & Engineering Style Sheet (Cloudflare Pages Ready)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=Fira+Code:wght@400;500&family=Inter:wght@300;400;500;600&display=swap');

/* --- CSS Variables & Color Palettes --- */
:root {
  /* Theme: Light Warm Parchment (Academic Day) */
  --bg-main: #FAF8F5;
  --bg-surface: #F2ECE1;
  --bg-surface-hover: #EBE3D3;
  --bg-glass: rgba(250, 248, 245, 0.85);
  
  --text-main: #1B1D1B;
  --text-muted: #525752;
  --text-light: #7A807A;
  
  --accent-gold: #B8860B;
  --accent-gold-soft: rgba(184, 134, 11, 0.12);
  --accent-navy: #1B2A4A;
  
  --border-subtle: #E2DACD;
  --border-strong: #C8BFAA;
  
  --shadow-sm: 0 2px 4px rgba(27, 29, 27, 0.03);
  --shadow-md: 0 8px 16px rgba(27, 29, 27, 0.05);
  --shadow-lg: 0 16px 32px rgba(27, 29, 27, 0.08);

  /* Typography */
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Fira Code', monospace;
  
  --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  /* Theme: Dark Library & Olive Graphite (Academic Night) */
  --bg-main: #121412;
  --bg-surface: #1B1E1B;
  --bg-surface-hover: #242824;
  --bg-glass: rgba(18, 20, 18, 0.85);
  
  --text-main: #EAE8E3;
  --text-muted: #A3A8A3;
  --text-light: #707570;
  
  --accent-gold: #D4AF37;
  --accent-gold-soft: rgba(212, 175, 55, 0.15);
  --accent-navy: #4A6984;
  
  --border-subtle: #2A2E2A;
  --border-strong: #3D423D;
  
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.4);
}

/* --- Base Reset & Global Layout --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- Typography System --- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--text-main);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 { font-size: 2.75rem; margin-bottom: 1rem; }
h2 { font-size: 2rem; margin-bottom: 0.85rem; }
h3 { font-size: 1.4rem; margin-bottom: 0.5rem; }

p {
  margin-bottom: 1.25rem;
  color: var(--text-muted);
}

p.lead-text {
  font-size: 1.15rem;
  color: var(--text-main);
  font-weight: 300;
  line-height: 1.7;
}

a {
  color: var(--accent-gold);
  text-decoration: none;
  transition: var(--transition-smooth);
}

a:hover {
  color: var(--text-main);
}

code, pre, .mono {
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

/* --- Tags & Badges --- */
.mono-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-gold);
  background: var(--accent-gold-soft);
  padding: 0.25rem 0.65rem;
  border-radius: 2px;
  border: 1px solid var(--accent-gold-soft);
  margin-bottom: 0.75rem;
}

/* --- Navigation & Glassmorphism Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 0;
}

.nav-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-main);
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  gap: 1.75rem;
  align-items: center;
}

.site-nav a {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 500;
  position: relative;
  padding: 0.2rem 0;
}

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: var(--accent-gold);
  transition: var(--transition-smooth);
}

.site-nav a:hover, .site-nav a.active {
  color: var(--text-main);
}

.site-nav a:hover::after, .site-nav a.active::after {
  width: 100%;
}

.theme-btn {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: var(--transition-smooth);
}

.theme-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent-gold);
  transform: rotate(180deg);
}

/* --- Container & Sections --- */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem;
  width: 100%;
  flex: 1;
}

.intro-section {
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 3.5rem;
}

/* --- Buttons & CTAs --- */
.cta-group {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 3px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.primary-btn {
  background-color: var(--text-main);
  color: var(--bg-main);
  border: 1px solid var(--text-main);
}

.primary-btn:hover {
  background-color: var(--accent-gold);
  border-color: var(--accent-gold);
  color: #FFF;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.secondary-btn {
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-strong);
}

.secondary-btn:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--accent-gold);
  transform: translateY(-2px);
}

/* --- Grid Systems & Cards --- */
.focus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}

.focus-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 1.75rem;
  border-radius: 4px;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-sm);
}

.focus-card:hover {
  border-color: var(--accent-gold);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.focus-card h3 {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}

/* --- Project Cards (Elevated Style) --- */
.project-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-gold);
  padding: 2rem;
  border-radius: 0 4px 4px 0;
  margin-bottom: 2rem;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-sm);
}

.project-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.mono-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-light);
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.tech-stack code {
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  transition: var(--transition-smooth);
}

.project-card:hover .tech-stack code {
  border-color: var(--border-strong);
}

/* --- Contact & Security Block --- */
.contact-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 2.5rem;
  border-radius: 4px;
  margin-top: 3rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

.pgp-box {
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  padding: 1.25rem;
  border-radius: 3px;
}

.pgp-key {
  background: transparent;
  color: var(--accent-gold);
  padding: 0.5rem 0;
  overflow-x: auto;
  font-size: 0.8rem;
}

/* --- Academic Curriculum Lists --- */
.curriculum-steps {
  list-style: none;
  counter-reset: step-counter;
  padding-left: 0;
  margin-top: 1.5rem;
}

.curriculum-steps li {
  counter-increment: step-counter;
  position: relative;
  padding-left: 3.25rem;
  margin-bottom: 2rem;
}

.curriculum-steps li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.25rem;
  height: 2.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: auto;
}

/* --- Responsive Adjustments --- */
@media (max-width: 640px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
  .site-nav { gap: 1rem; }
  .cta-group { flex-direction: column; }
  .project-card { padding: 1.25rem; }
}