@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
  /* Default Light Values */
  --bg-color: #ffffff;
  --bg-subtle: #faf6f0;
  --card-bg: #ffffff;
  --accent: #0f172a;
  --accent-light: #1e3a8a;
  --text-main: #111827;
  --text-muted: #4b5563;
  --border: #e5e7eb;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 20px -2px rgba(0,0,0,0.06);
  --font-serif-headline: 'Playfair Display', Georgia, serif;
  --font-serif-body: 'EB Garamond', Georgia, serif;
  --header-bg: radial-gradient(circle at center, rgba(240, 253, 254, 0.45) 0%, rgba(224, 242, 254, 0.85) 70%, rgba(207, 250, 254, 0.95) 100%);
  --body-bg: linear-gradient(135deg, #fffdfa 0%, #fcf8f2 50%, #f7f0e6 100%);
}

/* Hard Dark Mode Override (For explicit manual dark mode selection) */
body.dark-mode {
  --bg-color: #0f172a;
  --bg-subtle: #1e293b;
  --card-bg: #1e293b;
  --accent: #f8fafc;
  --accent-light: #93c5fd;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px -2px rgba(0,0,0,0.4);
  --header-bg: radial-gradient(circle at center, rgba(15, 23, 42, 0.85) 0%, rgba(30, 41, 59, 0.95) 70%, rgba(15, 23, 42, 0.98) 100%);
  --body-bg: linear-gradient(135deg, #090d16 0%, #0f172a 50%, #172136 100%);
}

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

@keyframes pageScaleIn {
  from { opacity: 0; transform: scale(0.985); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes cascadeDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

.scroll-reveal {
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 1.6s cubic-bezier(0.16, 1, 0.3, 1), transform 1.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.scroll-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

body {
  background: var(--body-bg);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-serif-body);
  font-size: 1.15rem;
  line-height: 1.75;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background 0.5s ease, color 0.5s ease;
}

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--text-main);
}

header {
  position: sticky;
  top: 0;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: background 0.5s ease, border-color 0.5s ease;
}

nav {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.75rem 2rem 1.25rem 2rem;
  gap: 1rem;
}

.logo a {
  font-family: var(--font-serif-headline);
  font-weight: 700;
  font-size: 2.3rem;
  color: var(--text-main);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
  display: inline-block;
  padding-left: 0.18em;
  transition: color 0.5s ease;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  justify-content: center;
}

.nav-links a {
  font-family: var(--font-serif-body);
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 500;
  padding: 0.25rem 0;
  position: relative;
  transition: color 0.3s ease;
}

.nav-links a.active, .nav-links a:hover {
  color: var(--text-main);
}

/* Red Lighting Effect under Active Nav Link */
.nav-links a.active {
  position: relative;
  text-shadow: 0 -1px 6px rgba(239, 68, 68, 0.25), 0 -3px 12px rgba(239, 68, 68, 0.08);
  z-index: 2;
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 65px;
  background: linear-gradient(to top, rgba(239, 68, 68, 0.22) 0%, rgba(239, 68, 68, 0.08) 55%, rgba(239, 68, 68, 0.01) 90%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, black 0%, black 40%, transparent 100%), 
                      radial-gradient(ellipse at 50% 0%, transparent 0%, transparent 45%, black 75%);
  -webkit-mask-composite: source-in, destination-out;
  mask-image: linear-gradient(to top, black 0%, black 40%, transparent 100%), 
              radial-gradient(ellipse at 50% 0%, transparent 0%, transparent 45%, black 75%);
  mask-composite: intersect;
  border-radius: 4px;
  filter: blur(4px);
  pointer-events: none;
  z-index: 1;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 2rem;
  flex: 1;
  width: 100%;
  animation: pageScaleIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

h0 {
    font-family: var(--font-serif-headline);
    font-size: 3.25rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-main);
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
    text-align: center;
    transition: color 0.4s ease;
}

h1 {
  font-family: var(--font-serif-headline);
  font-size: 2.75rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-main);
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
  text-align: center;
  transition: color 0.5s ease;
}

h2 {
  font-family: var(--font-serif-headline);
  font-size: 2.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-main);
  letter-spacing: -0.01em;
  text-align: center;
  transition: color 0.5s ease;
}

h3 {
  font-family: var(--font-serif-headline);
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-main);
  text-align: center;
  transition: color 0.5s ease;
}

.tag {
  font-family: var(--font-serif-body);
  font-size: 0.9rem;
  font-style: italic;
  background: var(--bg-subtle);
  color: var(--text-muted);
  padding: 0.2rem 0.75rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  vertical-align: middle;
  display: inline-block;
  margin-left: 0.5rem;
}

.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero p {
  font-size: 1.5rem;
  color: var(--text-muted);
  max-width: 720px;
  margin-bottom: 2.5rem;
  text-align: center;
  transition: color 0.5s ease;
}

.btn-group {
  display: flex;
  gap: 1.5rem;
  margin-top: 2rem;
  justify-content: center;
}

.btn {
  font-family: var(--font-serif-body);
  display: inline-block;
  padding: 1rem 2.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.15rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: var(--text-main);
  color: var(--bg-color) !important;
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  border: 1px solid var(--border);
  color: var(--text-main) !important;
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
  margin-top: 2rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  text-align: center;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  justify-content: center;
}

.skill-badge {
  font-family: var(--font-serif-body);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 0.3rem 0.85rem;
  border-radius: 6px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.timeline {
  max-width: 800px;
  margin: 0 auto;
}

.timeline-item {
  border-left: 2px solid var(--border);
  padding-left: 2rem;
  margin-left: 0.5rem;
  margin-bottom: 2.5rem;
  position: relative;
  text-align: left;
}

form {
  display: grid;
  gap: 1.25rem;
  max-width: 600px;
  margin: 2rem auto 0 auto;
  text-align: left;
}

input, textarea, select {
  width: 100%;
  padding: 0.9rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-main);
  font-family: var(--font-serif-body);
  font-size: 1.05rem;
}

.video-container {
  width: 100%;
  max-width: 850px;
  margin: 1.5rem auto;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

video {
  width: 100%;
  height: auto;
  display: block;
}

footer {
  text-align: center;
  padding: 2.5rem 2rem 4.5rem 2rem;
  color: var(--text-muted);
  font-size: 1rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
  background: var(--bg-subtle);
}

/* --- View Mode & Solar Sync Mode Toggle Bar (Fixed at the Bottom) --- */
.view-mode-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  z-index: 1000;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
  flex-wrap: wrap;
}

.view-mode-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.view-mode-bar label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.toggle-switch-container {
  display: inline-flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px;
  gap: 4px;
}

.toggle-option {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 0.35rem 0.85rem;
  border-radius: 16px;
  font-size: 0.85rem;
  font-family: var(--font-serif-body);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.toggle-option.active {
  background: var(--text-main);
  color: var(--bg-color);
  box-shadow: var(--shadow-sm);
}

.solar-status {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  margin-left: 0.25rem;
}

/* --- Natural Mobile Mode (Fluid layout, NO phone frame/borders) --- */
body.mode-mobile {
  font-size: 1.05rem !important;
}

body.mode-mobile h1 { 
  font-size: 2.3rem !important; 
}

body.mode-mobile nav { 
  padding: 1.25rem 1rem 1rem 1rem !important; 
  gap: 0.75rem !important; 
}

body.mode-mobile .logo a { 
  font-size: 1.8rem !important; 
}

body.mode-mobile .nav-links { 
  gap: 1.25rem !important; 
  flex-wrap: wrap !important; 
  justify-content: center !important; 
}

body.mode-mobile .container { 
  padding: 2.5rem 1.25rem !important; 
}

body.mode-mobile .btn-group { 
  flex-direction: column !important; 
  width: 100% !important; 
  gap: 1rem !important; 
}

body.mode-mobile .btn { 
  width: 100% !important; 
  padding: 0.9rem 1.5rem !important; 
}

body.mode-mobile .grid { 
  grid-template-columns: 1fr !important; 
}



/* --- Restored Button Size & Dropdown Width Matching --- */
.view-mode-bar {
  padding: 0.75rem 1rem !important;
  gap: 1.25rem !important;
}

.view-mode-bar label {
  font-size: 0.9rem !important;
}

.toggle-switch-container {
  padding: 3px !important;
  gap: 4px !important;
  border-radius: 20px !important;
}

.toggle-option {
  padding: 0.35rem 0.85rem !important;
  font-size: 0.85rem !important;
  border-radius: 16px !important;
}

#theme-other-select {
  font-size: 0.85rem !important;
  padding: 0.35rem 0.6rem !important;
  height: auto;
  min-width: 110px; /* Matches approximate button width */
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-family: var(--font-serif-body);
  font-weight: 600;
  cursor: pointer;
  outline: none;
  border-left: 1px solid var(--border);
}

#theme-other-select option {
  background: var(--card-bg);
  color: var(--text-main);
}

/* --- Widen Solar Sync Mode Button & Dropdown Width Matching --- */
.view-mode-bar {
  padding: 0.75rem 1rem !important;
  gap: 1.25rem !important;
}

.view-mode-bar label {
  font-size: 0.9rem !important;
}

.toggle-switch-container {
  padding: 3px !important;
  gap: 4px !important;
  border-radius: 20px !important;
}

.toggle-option {
  padding: 0.35rem 0.85rem !important;
  font-size: 0.85rem !important;
  border-radius: 16px !important;
}

#solar-toggle {
  padding: 0.35rem 1.35rem !important;
  min-width: 170px !important;
  text-align: center !important;
}

#theme-other-select {
  font-size: 0.85rem !important;
  padding: 0.35rem 0.6rem !important;
  height: auto;
  min-width: 110px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-family: var(--font-serif-body);
  font-weight: 600;
  cursor: pointer;
  outline: none;
  border-left: 1px solid var(--border);
}

#theme-other-select option {
  background: var(--card-bg);
  color: var(--text-main);
}

/* --- Stacked Emoji & Text Buttons for Theme Bar --- */
#theme-light-btn, #theme-dark-btn, #solar-toggle {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1.2 !important;
  text-align: center !important;
}

#solar-toggle {
  min-width: 170px !important;
  padding: 0.35rem 0.9rem !important;
}
