@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ==========================================
   DESIGN SYSTEM & VARIABLES
   ========================================== */
:root {
  /* Colors - Dark Mode (Default) */
  --bg-primary: #1a2422;
  --bg-secondary: #2C3531;
  --bg-card: #2e3d3a;
  --bg-glass: #2a3836;
  --border-color: rgba(209, 232, 226, 0.1);
  --border-glow: rgba(217, 176, 140, 0.35);

  --text-primary: #D1E8E2;
  --text-secondary: #9bbab3;
  --text-muted: #638880;

  /* Brand Accents */
  --accent-primary: #D9B08C;     /* Warm Copper */
  --accent-secondary: #FFCB9A;   /* Peach */
  --accent-tertiary: #116466;    /* Deep Teal */

  --gradient-brand: linear-gradient(135deg, #D9B08C 0%, #FFCB9A 100%);
  --gradient-glow: radial-gradient(circle at top right, rgba(17, 100, 102, 0.2) 0%, transparent 60%);
  
  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Fraunces', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Transitions */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
  
  /* Layout */
  --max-width: 1100px;
  --header-height: 80px;
}

/* Light Mode Variables override */
body.light-mode {
  --bg-primary: #f0ebe0;
  --bg-secondary: #e5dfd4;
  --bg-card: #f8f3ea;
  --bg-glass: rgba(248, 243, 234, 0.95);
  --border-color: rgba(44, 53, 49, 0.1);
  --border-glow: rgba(217, 176, 140, 0.4);

  --text-primary: #1a2422;
  --text-secondary: #3d5450;
  --text-muted: #638880;

  --gradient-glow: radial-gradient(circle at top right, rgba(17, 100, 102, 0.08) 0%, transparent 60%);
}

/* ==========================================
   BASE & RESET STYLES
   ========================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

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

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* Selection Highlight */
::selection {
  background-color: rgba(217, 176, 140, 0.3);
  color: var(--text-primary);
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

button, input, textarea {
  font-family: inherit;
  background: none;
  border: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* ==========================================
   LAYOUT UTILITIES
   ========================================== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 6rem 0;
  position: relative;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 500;
  margin-bottom: 3rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 40px;
  height: 3px;
  background: var(--accent-primary);
  border-radius: 2px;
  transition: var(--transition-smooth);
}


.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: var(--gradient-brand);
  color: #1a2422;
  box-shadow: 0 4px 15px rgba(217, 176, 140, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(217, 176, 140, 0.4);
}

.btn-secondary {
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

.btn-secondary:hover {
  border-color: var(--accent-primary);
  background: rgba(217, 176, 140, 0.06);
  transform: translateY(-2px);
}

/* ==========================================
   NAVIGATION HEADER
   ========================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  transition: var(--transition-smooth);
}

.header.scrolled {
  height: 70px;
  background-color: var(--bg-primary);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-primary);
  border-radius: 50%;
  display: inline-block;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: 0.5rem 0;
}

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


.nav-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--bg-secondary);
  min-width: 180px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5);
  z-index: 1000;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem 0;
}

.dropdown-content a {
  color: var(--text-secondary);
  padding: 0.8rem 1rem;
  text-decoration: none;
  display: block;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.dropdown-content a:hover {
  background-color: rgba(217, 176, 140, 0.06);
  color: var(--text-primary);
}

.nav-dropdown:hover .dropdown-content {
  display: block;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--accent-primary);
  transition: var(--transition-smooth);
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  border: 1px solid var(--border-color);
  width: 40px;
  height: 40px;
}

.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary);
  background: rgba(217, 176, 140, 0.08);
}

.theme-toggle .fa-sun {
  display: none;
}

body.light-mode .theme-toggle .fa-moon {
  display: none;
}

body.light-mode .theme-toggle .fa-sun {
  display: block;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  padding: 0.5rem;
}

.menu-toggle span {
  width: 25px;
  height: 2px;
  background-color: var(--text-primary);
  transition: var(--transition-smooth);
}

/* ==========================================
   HERO SECTION
   ========================================== */
.hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-height);
  position: relative;
  overflow: hidden;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(217, 176, 140, 0.1);
  border: 1px solid rgba(217, 176, 140, 0.25);
  border-radius: 4px;
  color: var(--accent-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-primary);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 3.5rem;
  line-height: 1.15;
  font-weight: 500;
  margin-bottom: 1rem;
}

.hero-title span.gradient {
  color: var(--accent-primary);
}

.hero-tagline {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 580px;
}

.hero-cta {
  display: flex;
  gap: 1rem;
}

/* Hero Visual Graphic (Abstract Economist/Sociologist Graph) */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.visual-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.visual-box {
  width: 100%;
  max-width: 380px;
  height: 380px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  border-radius: 16px;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
  z-index: 1;
  overflow: hidden;
  position: relative;
}

.visual-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(17, 100, 102, 0.12), transparent 60%);
  pointer-events: none;
}

.visual-header {
  display: none;
}

.visual-dot-container {
  display: flex;
  gap: 6px;
}

.visual-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--border-color);
}
.visual-dot:nth-child(1) { background-color: var(--text-muted); }
.visual-dot:nth-child(2) { background-color: var(--accent-secondary); }
.visual-dot:nth-child(3) { background-color: var(--accent-tertiary); }

.visual-status {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.visual-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.visual-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.visual-stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.visual-stat-value {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-primary);
}

.visual-graph {
  height: 80px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 4px;
}

.visual-graph-bar {
  flex: 1;
  background: var(--border-color);
  border-radius: 4px 4px 0 0;
  transition: var(--transition-smooth);
}

.visual-graph-bar:nth-child(1) { height: 30%; }
.visual-graph-bar:nth-child(2) { height: 45%; }
.visual-graph-bar:nth-child(3) { height: 60%; }
.visual-graph-bar:nth-child(4) { height: 85%; background: var(--accent-primary); }
.visual-graph-bar:nth-child(5) { height: 70%; }
.visual-graph-bar:nth-child(6) { height: 95%; background: var(--accent-secondary); }

.visual-footer {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================
   PROJECTS SECTION
   ========================================== */
.projects-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.projects-header .section-title {
  margin-bottom: 0;
}

.filter-tabs {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-secondary);
  padding: 0.3rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.filter-tab {
  padding: 0.5rem 1.2rem;
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.filter-tab:hover {
  color: var(--text-primary);
}

.filter-tab.active {
  background: var(--bg-primary);
  color: var(--accent-primary);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 3rem;
}

.project-card {
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  border-radius: 12px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
}

.card-glare {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 5;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gradient-brand);
  opacity: 0;
  transition: var(--transition-smooth);
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-glow);
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}

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

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

.project-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: rgba(209, 232, 226, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  border: 1px solid var(--border-color);
  font-size: 1.25rem;
  transition: var(--transition-smooth);
}

.project-card:hover .project-icon-box {
  background: rgba(217, 176, 140, 0.1);
  color: var(--accent-primary);
  border-color: rgba(217, 176, 140, 0.25);
}

.project-links {
  display: flex;
  gap: 0.8rem;
}

.project-link {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.project-link:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary);
  background: rgba(217, 176, 140, 0.08);
}

.project-body {
  margin-bottom: 1.5rem;
}

.project-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.project-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  background: rgba(209, 232, 226, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-secondary);
}

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

.stage-tag {
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 0.65rem;
}

.stage-tag.concept {
  background: rgba(255, 203, 154, 0.15);
  border-color: rgba(255, 203, 154, 0.4);
  color: var(--accent-secondary);
}

.stage-tag.prototype {
  background: rgba(17, 100, 102, 0.2);
  border-color: rgba(17, 100, 102, 0.5);
  color: #7ec8c9;
}

.stage-tag.game {
  background: rgba(217, 176, 140, 0.15);
  border-color: rgba(217, 176, 140, 0.4);
  color: var(--accent-primary);
}

/* ==========================================
   PHILOSOPHY / STATS SECTION (SOCIOLOGIST BACKGROUND)
   ========================================== */
.philosophy {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.philosophy-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 5rem;
  align-items: center;
}

.philosophy-content p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

.philosophy-content pstrong {
  color: var(--text-primary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.stat-card {
  padding: 2rem;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  border-radius: 16px;
  text-align: center;
  transition: var(--transition-smooth);
}

.stat-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-3px);
}

.stat-number {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 0.5rem;
  display: block;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ==========================================
   SKILLS & DISRUPTIONS
   ========================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4rem;
}

.skills-column-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 2rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.skills-column-title i {
  color: var(--accent-primary);
}

.skills-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.skill-item {
  width: 100%;
}

.skill-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.skill-name {
  color: var(--text-primary);
}

.skill-percentage {
  color: var(--accent-primary);
  font-family: var(--font-mono);
}

.skill-bar-bg {
  height: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  background: var(--accent-primary);
  width: 0%; /* Populated in JS */
  transition: width 1.5s cubic-bezier(0.1, 0.8, 0.25, 1);
  border-radius: 3px;
}

.skill-bar-fill.gold {
  background: var(--accent-secondary);
}

/* ==========================================
   CONTACT SECTION
   ========================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 4rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.contact-info-text {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
}

.contact-methods {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-method-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  transition: var(--transition-smooth);
}

.contact-method-card:hover {
  border-color: var(--accent-primary);
  background: rgba(217, 176, 140, 0.06);
}

.contact-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(209, 232, 226, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  border: 1px solid var(--border-color);
  font-size: 1.1rem;
}

.contact-detail-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.contact-detail-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

.contact-form {
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  padding: 2.5rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: 0 15px 40px rgba(0,0,0,0.25);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: var(--transition-smooth);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(217, 176, 140, 0.1);
  background: var(--bg-primary);
}

textarea.form-input {
  resize: vertical;
  min-height: 120px;
}

.form-status {
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 0.5rem;
  display: none;
}

.form-status.success {
  color: var(--accent-primary);
}

.form-status.error {
  color: #ef4444;
}

/* ==========================================
   FOOTER
   ========================================== */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 3rem 0;
  background-color: var(--bg-primary);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-socials {
  display: flex;
  gap: 1.25rem;
}

.social-link {
  color: var(--text-muted);
  font-size: 1.2rem;
  transition: var(--transition-fast);
}

.social-link:hover {
  color: var(--accent-primary);
}

/* ==========================================
   KEYFRAME ANIMATIONS
   ========================================== */
@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(217, 176, 140, 0.5);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(217, 176, 140, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(217, 176, 140, 0);
  }
}

@keyframes morphing {
  0% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
  50% { border-radius: 70% 30% 30% 70% / 70% 30% 70% 30%; }
  100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
}

/* Reveal on Scroll styling class */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}



/* ==========================================
   RESPONSIVE DESIGN MEDIA QUERIES
   ========================================== */
@media (max-width: 968px) {
  :root {
    --header-height: 70px;
  }
  
  .section {
    padding: 6rem 0 3rem;
  }
  
  .section-title {
    font-size: 2.25rem;
  }
  
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }
  
  .hero-badge {
    margin-left: auto;
    margin-right: auto;
  }
  
  .hero-tagline {
    margin-left: auto;
    margin-right: auto;
  }
  
  .hero-cta {
    justify-content: center;
  }
  
  .hero-visual {
    order: -1;
  }
  
  .philosophy-grid, .skills-grid, .contact-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .menu-toggle {
    display: flex;
    z-index: 1001;
  }
  
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background-color: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    flex-direction: column;
    justify-content: center;
    gap: 2.5rem;
    padding: 2rem;
    transition: var(--transition-smooth);
    z-index: 1000;
  }
  
  .nav-links.open {
    right: 0;
  }

  .nav-dropdown {
    width: 100%;
    text-align: center;
  }
  .dropdown-content {
    position: static;
    display: none;
    box-shadow: none;
    border: none;
    background: transparent;
  }
  .nav-dropdown:hover .dropdown-content, .nav-dropdown:active .dropdown-content {
    display: block;
  }
  .dropdown-content a {
    padding: 0.5rem;
  }

  
  /* Menu Hamburger Animation */
  .menu-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
  }
  .menu-toggle.open span:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1.25rem;
  }
  
  .hero-title {
    font-size: 2.5rem;
    min-height: 11.5rem;
  }
  
  .projects-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .filter-tabs {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .contact-form {
    padding: 1.5rem;
  }
}

/* ==========================================
   WORKFLOW DIAGRAM RESPONSIVENESS
   ========================================== */
.workflow-wrapper {
  padding: 2.5rem 0; /* Only vertical padding, no side box padding needed */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.workflow-inner {
  min-width: 800px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .workflow-wrapper {
    padding: 1rem; /* Massively reduce padding on mobile to maximize scroll viewport */
    border-radius: 12px;
  }
}

/* ==========================================
   WORKFLOW SIMPLE / DETAILED TOGGLE
   ========================================== */
.workflow-view-toggle {
  display: flex;
  gap: 0.4rem;
  width: fit-content;
  background: var(--bg-secondary);
  padding: 0.3rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.workflow-view-btn {
  padding: 0.5rem 1.2rem;
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.workflow-view-btn:hover {
  color: var(--text-primary);
}

.workflow-view-btn.active {
  background: var(--bg-primary);
  color: var(--accent-primary);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.workflow-view {
  display: none;
}

.workflow-view.active {
  display: block;
  animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   MERMAID DIAGRAM CUSTOM THEME
   ========================================== */
.mermaid {
  background: transparent !important;
  font-family: var(--font-sans) !important;
  display: flex;
  justify-content: center;
  width: 100%;
}

.mermaid svg {
  background: transparent !important;
  max-width: 100% !important;
  height: auto !important;
}

/* Base Node Setup */
.mermaid .node rect, 
.mermaid .node circle, 
.mermaid .node polygon,
.mermaid .node path {
  stroke-width: 1.5px !important;
  transition: var(--transition-smooth);
}

/* ==========================================
   MERMAID SEMANTIC CLASSES (DARK MODE DEFAULT)
   ========================================== */
.mermaid .human rect, .mermaid .human polygon, .mermaid .human circle, .mermaid .human path, .mermaid .human ellipse { fill: #1a2c2e !important; stroke: #7ec8c9 !important; }
.mermaid .obsidian rect, .mermaid .obsidian polygon, .mermaid .obsidian circle, .mermaid .obsidian path, .mermaid .obsidian ellipse { fill: #2a2018 !important; stroke: #D9B08C !important; }
.mermaid .agent rect, .mermaid .agent polygon, .mermaid .agent circle, .mermaid .agent path, .mermaid .agent ellipse { fill: #2a2018 !important; stroke: #FFCB9A !important; }
.mermaid .ai rect, .mermaid .ai polygon, .mermaid .ai circle, .mermaid .ai path, .mermaid .ai ellipse { fill: #1a2c2e !important; stroke: #116466 !important; }
.mermaid .execute rect, .mermaid .execute polygon, .mermaid .execute circle, .mermaid .execute path, .mermaid .execute ellipse { fill: #1a2c2e !important; stroke: #116466 !important; }
.mermaid .existing rect, .mermaid .existing polygon, .mermaid .existing circle, .mermaid .existing path, .mermaid .existing ellipse { fill: #231e1a !important; stroke: #9bbab3 !important; }
.mermaid .deliver rect, .mermaid .deliver polygon, .mermaid .deliver circle, .mermaid .deliver path, .mermaid .deliver ellipse { fill: #1e2922 !important; stroke: #D9B08C !important; }
.mermaid .feedback rect, .mermaid .feedback polygon, .mermaid .feedback circle, .mermaid .feedback path, .mermaid .feedback ellipse { fill: #1e2922 !important; stroke: #9bbab3 !important; }
.mermaid .brand rect, .mermaid .brand polygon, .mermaid .brand circle, .mermaid .brand path, .mermaid .brand ellipse { fill: #2e3d3a !important; stroke: #D9B08C !important; }

/* ==========================================
   MERMAID SEMANTIC CLASSES (LIGHT MODE)
   ========================================== */
body.light-mode .mermaid .human rect, body.light-mode .mermaid .human polygon, body.light-mode .mermaid .human circle, body.light-mode .mermaid .human path, body.light-mode .mermaid .human ellipse { fill: #eff6ff !important; stroke: #3b82f6 !important; }
body.light-mode .mermaid .obsidian rect, body.light-mode .mermaid .obsidian polygon, body.light-mode .mermaid .obsidian circle, body.light-mode .mermaid .obsidian path, body.light-mode .mermaid .obsidian ellipse { fill: #f5f3ff !important; stroke: #8b5cf6 !important; }
body.light-mode .mermaid .agent rect, body.light-mode .mermaid .agent polygon, body.light-mode .mermaid .agent circle, body.light-mode .mermaid .agent path, body.light-mode .mermaid .agent ellipse { fill: #fdf3e8 !important; stroke: #D9B08C !important; }
body.light-mode .mermaid .ai rect, body.light-mode .mermaid .ai polygon, body.light-mode .mermaid .ai circle, body.light-mode .mermaid .ai path, body.light-mode .mermaid .ai ellipse { fill: #e8f4f4 !important; stroke: #116466 !important; }
body.light-mode .mermaid .execute rect, body.light-mode .mermaid .execute polygon, body.light-mode .mermaid .execute circle, body.light-mode .mermaid .execute path, body.light-mode .mermaid .execute ellipse { fill: #e8f4f4 !important; stroke: #116466 !important; }
body.light-mode .mermaid .existing rect, body.light-mode .mermaid .existing polygon, body.light-mode .mermaid .existing circle, body.light-mode .mermaid .existing path, body.light-mode .mermaid .existing ellipse { fill: #f0ede8 !important; stroke: #638880 !important; }
body.light-mode .mermaid .deliver rect, body.light-mode .mermaid .deliver polygon, body.light-mode .mermaid .deliver circle, body.light-mode .mermaid .deliver path, body.light-mode .mermaid .deliver ellipse { fill: #fdf3e8 !important; stroke: #D9B08C !important; }
body.light-mode .mermaid .feedback rect, body.light-mode .mermaid .feedback polygon, body.light-mode .mermaid .feedback circle, body.light-mode .mermaid .feedback path, body.light-mode .mermaid .feedback ellipse { fill: #eaf2f0 !important; stroke: #638880 !important; }
body.light-mode .mermaid .brand rect, body.light-mode .mermaid .brand polygon, body.light-mode .mermaid .brand circle, body.light-mode .mermaid .brand path, body.light-mode .mermaid .brand ellipse { fill: #f8f3ea !important; stroke: #D9B08C !important; }

.mermaid .node:hover rect,
.mermaid .node:hover circle,
.mermaid .node:hover polygon,
.mermaid .node:hover path {
  stroke: var(--accent-primary) !important;
  filter: drop-shadow(0 0 6px rgba(217, 176, 140, 0.35));
}

/* Ensure all text inside nodes is forcefully readable */
body.light-mode .mermaid .node .label,
body.light-mode .mermaid .node .label *,
body.light-mode .mermaid .node text,
body.light-mode .mermaid .node tspan {
  color: #0f172a !important;
  fill: #0f172a !important;
}

/* Edge Labels (text on the connecting arrows) */
body.light-mode .mermaid .edgeLabel,
body.light-mode .mermaid .edgeLabel span,
body.light-mode .mermaid .edgeLabel div {
  background-color: rgba(255, 255, 255, 0.95) !important;
  color: #0f172a !important;
}
body.light-mode .mermaid .edgeLabel rect {
  fill: rgba(255, 255, 255, 0.95) !important;
}
body.light-mode .mermaid .edgeLabel * {
  color: #0f172a !important;
}

.mermaid .edgePath .path {
  stroke: var(--text-muted) !important;
  stroke-width: 1.5px !important;
}

.mermaid .edgePath .arrowheadPath {
  fill: var(--text-muted) !important;
  stroke: var(--text-muted) !important;
}

.mermaid .cluster rect {
  fill: rgba(255, 255, 255, 0.02) !important;
  stroke: var(--border-color) !important;
  stroke-dasharray: 5 5;
}

.mermaid .cluster-label text,
.mermaid .cluster-label span,
.mermaid .cluster .label foreignObject {
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  fill: var(--text-primary) !important;
  color: var(--text-primary) !important;
}

body.light-mode .mermaid .cluster rect {
  fill: rgba(0, 0, 0, 0.02) !important;
}


/* Collapsible Project Details */
.project-details {
  margin-top: 1rem;
}

.project-summary {
  cursor: pointer;
  color: var(--accent-primary);
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  list-style: none; /* remove default triangle in some browsers */
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Remove default marker for Webkit */
.project-summary::-webkit-details-marker {
  display: none;
}

.project-summary::after {
  content: '\f107'; /* FontAwesome chevron-down */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  transition: transform 0.3s ease;
  font-size: 0.8rem;
}

.project-details[open] .project-summary::after {
  transform: rotate(180deg);
}

.project-details[open] .project-description {
  animation: fadeIn 0.3s ease-in-out;
}

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

.project-header-left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.project-card:hover .project-tag.stage-tag.concept {
  border-color: rgba(255, 203, 154, 0.4);
}

.project-card:hover .project-tag.stage-tag.prototype {
  border-color: rgba(17, 100, 102, 0.5);
}

.project-card:hover .project-tag.stage-tag.game {
  border-color: rgba(217, 176, 140, 0.4);
}

/* ==========================================
   JOURNEY PAGE — STICKY SUB-NAVIGATION
   ========================================== */
.journey-subnav {
  position: sticky;
  top: var(--header-height);
  z-index: 900;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.journey-subnav-links {
  display: flex;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.journey-subnav-links::-webkit-scrollbar { display: none; }

.journey-subnav-link {
  padding: 1rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: var(--transition-smooth);
  white-space: nowrap;
  display: inline-block;
  text-decoration: none;
}

.journey-subnav-link:hover,
.journey-subnav-link.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

/* ==========================================
   TIMELINE
   ========================================== */
.timeline {
  position: relative;
  max-width: 780px;
  padding: 0.5rem 0 4rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--border-color) 4%,
    var(--border-color) 96%,
    transparent
  );
}

#timeline-canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

.timeline-entry {
  position: relative;
  padding-left: 56px;
  margin-bottom: 2.75rem;
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.timeline-entry.visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-dot {
  position: absolute;
  left: 10px;
  top: 7px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid var(--bg-primary);
  z-index: 2;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-entry:hover .timeline-dot { transform: scale(1.25); }

.timeline-entry[data-type="milestone"] .timeline-dot {
  background: var(--gradient-brand);
  box-shadow: 0 0 12px rgba(217, 176, 140, 0.5);
  width: 22px; height: 22px; left: 8px; top: 5px;
}

.timeline-entry[data-type="study"] .timeline-dot { background: #116466; }
.timeline-entry[data-type="prototype"] .timeline-dot { background: var(--accent-primary); }
.timeline-entry[data-type="concept"] .timeline-dot { background: var(--accent-secondary); }
.timeline-entry[data-type="blog"] .timeline-dot { background: var(--text-muted); }

.timeline-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.timeline-badge {
  font-family: var(--font-mono);
  font-size: 0.63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.2rem 0.55rem;
  border-radius: 50px;
}

.timeline-badge.milestone { background: rgba(217,176,140,0.12); color: var(--accent-primary); border: 1px solid rgba(217,176,140,0.3); }
.timeline-badge.study     { background: rgba(17,100,102,0.15); color: #7ec8c9; border: 1px solid rgba(17,100,102,0.4); }
.timeline-badge.prototype { background: rgba(217,176,140,0.12); color: var(--accent-primary); border: 1px solid rgba(217,176,140,0.3); }
.timeline-badge.concept   { background: rgba(255,203,154,0.12); color: var(--accent-secondary); border: 1px solid rgba(255,203,154,0.3); }
.timeline-badge.game      { background: rgba(217,176,140,0.12); color: var(--accent-primary); border: 1px solid rgba(217,176,140,0.3); }
.timeline-badge.blog      { background: rgba(209,232,226,0.08); color: var(--text-secondary); border: 1px solid rgba(209,232,226,0.2); }

.timeline-date-text {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.timeline-card {
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  border-radius: 10px;
  padding: 1.4rem 1.5rem 1.4rem 1.75rem;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.timeline-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 14px 0 0 14px;
}

.timeline-entry[data-type="milestone"] .timeline-card { border-color: rgba(217,176,140,0.25); background: rgba(217,176,140,0.04); }
.timeline-entry[data-type="milestone"] .timeline-card::before { background: var(--gradient-brand); }
.timeline-entry[data-type="study"]     .timeline-card::before { background: #116466; }
.timeline-entry[data-type="prototype"] .timeline-card::before { background: var(--accent-primary); }
.timeline-entry[data-type="concept"]   .timeline-card::before { background: var(--accent-secondary); }
.timeline-entry[data-type="blog"]      .timeline-card::before { background: var(--text-muted); }

.timeline-card:hover {
  transform: translateX(5px);
  border-color: var(--border-glow);
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
}

.timeline-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.timeline-desc {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.65;
}

.timeline-footer {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.timeline-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.18rem 0.5rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  color: var(--text-muted);
}

body.light-mode .timeline-tag { background: rgba(0,0,0,0.03); }

.timeline-details {
  margin-top: 0.75rem;
}

.timeline-details summary {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--accent-primary);
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.timeline-details summary::-webkit-details-marker { display: none; }

.timeline-details summary::before {
  content: '›';
  font-size: 1rem;
  transition: transform 0.2s ease;
  display: inline-block;
}

.timeline-details[open] summary::before {
  transform: rotate(90deg);
}

.timeline-details-text {
  margin-top: 0.6rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.timeline-readmore {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--accent-primary);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: opacity 0.15s ease;
}
.timeline-readmore:hover { opacity: 0.75; }

.timeline-link-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.78rem;
  transition: var(--transition-fast);
  text-decoration: none;
}

.timeline-link-btn:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background: rgba(217,176,140,0.08);
}

@media (max-width: 768px) {
  .journey-subnav-link { padding: 0.85rem 1rem; font-size: 0.82rem; }
  .timeline::before { left: 12px; }
  .timeline-entry { padding-left: 40px; }
  .timeline-dot { left: 4px; width: 16px; height: 16px; }
  .timeline-entry[data-type="milestone"] .timeline-dot { width: 18px; height: 18px; left: 3px; }
}

/* ==========================================
   FEATURED PROJECTS CAROUSEL
   ========================================== */
.carousel-container {
  position: relative;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.carousel-slide {
  min-width: 100%;
  padding: 2rem 0;
}

.carousel-dots {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-color);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.carousel-dot.active {
  background: var(--accent-primary);
  width: 28px;
  border-radius: 5px;
}

.carousel-dot:hover {
  background: var(--accent-primary);
}

.carousel-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: rgba(217, 176, 140, 0.08);
}

.carousel-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .carousel-slide {
    padding: 1.5rem 0;
  }

  .carousel-slide > div {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
}
