/* =============================================================
   THEME VARIABLES  — Aurora / Catppuccin-inspired palette
   ============================================================= */

/* Dark theme — default */
:root {
  --bg:             #1e1e2e;
  --bg-surface:     #181825;
  --bg-card:        #252538;
  --text:           #cdd6f4;
  --text-heading:   #89b4fa;  /* blue */
  --text-muted:     #6c7086;
  --accent:         #f38ba8;  /* pink / rose */
  --accent-2:       #cba6f7;  /* mauve / purple */
  --accent-3:       #89dceb;  /* sky / cyan — links, org names */
  --accent-4:       #a6e3a1;  /* green */
  --border:         #313244;
  --hero-overlay:   rgba(14, 14, 24, 0.52);
  --hero-bg-url:    url('../data/media/ethz_hg_dark.webp');
  --nav-bg:         rgba(30, 30, 46, 0.92);
  --nav-border:     rgba(49, 50, 68, 0.8);
  --shadow:         0 4px 28px rgba(0, 0, 0, 0.55);
  --radius:         8px;
  --radius-sm:      4px;
  --max-width:      860px;
  --font:           'Ubuntu', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition:     0.18s ease;
}

/* Light theme */
:root[data-theme="light"] {
  --bg:             #eff1f5;
  --bg-surface:     #e6e9ef;
  --bg-card:        #ffffff;
  --text:           #4c4f69;
  --text-heading:   #2563eb;  /* blue-600 */
  --text-muted:     #8c8fa1;
  --accent:         #db2777;  /* pink-600 */
  --accent-2:       #7c3aed;  /* violet-600 */
  --accent-3:       #0284c7;  /* sky-600 — links, org names */
  --accent-4:       #16a34a;  /* green-600 */
  --border:         #ccd0da;
  --hero-overlay:   rgba(28, 28, 40, 0.55);
  --hero-bg-url:    url('../data/media/ethz_hg.webp');
  --nav-bg:         rgba(239, 241, 245, 0.92);
  --nav-border:     rgba(204, 208, 218, 0.8);
  --shadow:         0 4px 28px rgba(0, 0, 0, 0.1);
}

/* Respect OS light preference when no explicit override */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:             #eff1f5;
    --bg-surface:     #e6e9ef;
    --bg-card:        #ffffff;
    --text:           #4c4f69;
    --text-heading:   #2563eb;
    --text-muted:     #8c8fa1;
    --accent:         #db2777;
    --accent-2:       #7c3aed;
    --accent-3:       #0284c7;
    --accent-4:       #16a34a;
    --border:         #ccd0da;
    --hero-overlay:   rgba(28, 28, 40, 0.55);
    --hero-bg-url:    url('../data/media/ethz_hg.webp');
    --nav-bg:         rgba(239, 241, 245, 0.92);
    --nav-border:     rgba(204, 208, 218, 0.8);
    --shadow:         0 4px 28px rgba(0, 0, 0, 0.1);
  }
}


/* =============================================================
   RESET & BASE
   ============================================================= */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition), color var(--transition);
}

main { flex: 1; }
img  { max-width: 100%; display: block; }
ul   { list-style: none; }
button { font-family: var(--font); }

a {
  color: var(--accent-3);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent); }

h1, h2, h3, h4 {
  color: var(--text-heading);
  line-height: 1.3;
  font-weight: 600;
}


/* =============================================================
   NAVBAR
   ============================================================= */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 2rem;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background var(--transition), border-color var(--transition);
}

.nav-logo {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo:hover { color: var(--accent); opacity: 0.8; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.nav-links a {
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition), background var(--transition);
}
.nav-links a:hover {
  color: var(--text-heading);
  background: var(--bg-card);
}
.nav-links a.active { color: var(--accent); }

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text);
  flex-shrink: 0;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-card);
}
.theme-toggle svg { width: 15px; height: 15px; pointer-events: none; }

/* Sun = shown in dark mode (click → go light);  Moon = shown in light mode (click → go dark) */
.toggle-sun  { display: none; }
.toggle-moon { display: block; }

:root[data-theme="dark"] .toggle-sun  { display: block; }
:root[data-theme="dark"] .toggle-moon { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .toggle-sun  { display: block; }
  :root:not([data-theme="light"]) .toggle-moon { display: none; }
}


/* =============================================================
   HERO
   ============================================================= */

.hero {
  position: relative;
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: var(--hero-bg-url);
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: var(--hero-overlay);
  z-index: 1;
  transition: background var(--transition);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 3rem 2rem;
  max-width: 660px;
  width: 100%;
}

.headshot {
  width: 156px;
  height: 156px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1.5rem;
  border: 3px solid var(--accent);
  box-shadow:
    0 0 0 5px rgba(243, 139, 168, 0.18),
    0 8px 36px rgba(0, 0, 0, 0.5);
}

.hero-name {
  font-size: clamp(2.1rem, 5vw, 3rem);
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  margin-bottom: 2rem;
  font-weight: 400;
}

.hero-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.5rem 1.05rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition:
    background var(--transition),
    border-color var(--transition),
    transform 0.12s ease;
}
.hero-link:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  color: #ffffff;
  transform: translateY(-2px);
}
.hero-link svg { width: 15px; height: 15px; flex-shrink: 0; }


/* =============================================================
   SECTION LAYOUT
   ============================================================= */

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 2rem;
}
.section + .section { border-top: 1px solid var(--border); }

/* Aurora gradient text for section headings */
.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  letter-spacing: 0.01em;
  background: linear-gradient(to right, var(--text-heading), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-title::after {
  content: '';
  flex: 1;
  min-width: 2rem;
  height: 1px;
  background: linear-gradient(to right, var(--border), transparent);
  -webkit-text-fill-color: initial;
}


/* =============================================================
   PAGE HEADER (projects / photos pages)
   ============================================================= */

.page-header {
  padding-bottom: 2rem;
  border-bottom: none;
}

.page-title {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  background: linear-gradient(to right, var(--text-heading), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.4rem;
}

.page-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
}


/* =============================================================
   BIO
   ============================================================= */

.bio-text {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text);
  max-width: 680px;
}


/* =============================================================
   TIMELINE  (experience & education)
   ============================================================= */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.entry {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  transition:
    border-left-color var(--transition),
    box-shadow var(--transition),
    border-color var(--transition);
}
.entry:hover {
  border-left-color: var(--accent);
  box-shadow: var(--shadow);
}

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.entry-meta { flex: 1; min-width: 0; }

.entry-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 0.2rem;
}

.entry-org {
  font-size: 0.875rem;
  color: var(--accent-3);
}

.entry-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  padding-top: 0.12rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.entry-bullets {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.entry-bullets li {
  display: flex;
  gap: 0.55rem;
  font-size: 0.9rem;
  line-height: 1.6;
}
.entry-bullets li::before {
  content: '▸';
  color: var(--accent);
  flex-shrink: 0;
  font-size: 0.72em;
  margin-top: 0.25em;
}


/* =============================================================
   SKILLS
   ============================================================= */

.skills-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.skill-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  transition: border-color var(--transition);
}
.skill-group:hover { border-color: var(--accent-2); }

.skill-group--wide { grid-column: 1 / -1; }

.skill-group-title {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-2);
  margin-bottom: 0.85rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  display: inline-block;
  padding: 0.22rem 0.62rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text);
  transition: border-color var(--transition), color var(--transition);
}
.tag:hover {
  border-color: var(--accent-3);
  color: var(--accent-3);
}


/* =============================================================
   PROJECT CARDS
   ============================================================= */

.project-list {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.project-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.project-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-surface);
}
.project-media img,
.project-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.project-card:hover .project-media img { transform: scale(1.03); }

.project-body { padding: 1.75rem 2rem 1.5rem; }

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

.project-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.project-tag {
  font-size: 0.75rem;
  color: var(--accent-2);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.project-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 0.2rem;
  line-height: 1.3;
}

.project-subtitle {
  font-size: 0.88rem;
  color: var(--accent-3);
  margin-bottom: 1rem;
  font-style: italic;
}

.project-desc {
  font-size: 0.925rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 1.4rem;
  max-width: 700px;
}

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

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.project-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-surface);
}
.project-link svg { width: 13px; height: 13px; flex-shrink: 0; }


/* =============================================================
   PHOTO GALLERY
   ============================================================= */

.photo-grid {
  padding: 0 2rem 4rem;
  columns: 3 240px;
  column-gap: 0.75rem;
  max-width: 1200px;
  margin: 0 auto;
}

.photo-item {
  display: block;
  break-inside: avoid;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: zoom-in;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.photo-item:hover {
  transform: scale(1.016);
  box-shadow: var(--shadow);
}
.photo-item img {
  width: 100%;
  display: block;
  border-radius: var(--radius-sm);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }

.lightbox-img {
  max-width: min(90vw, 1200px);
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.8);
  cursor: default;
  display: block;
}

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: color 0.15s;
  z-index: 201;
}
.lightbox-close:hover { color: #fff; }

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  z-index: 201;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.18); color: #fff; }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }


/* =============================================================
   FOOTER
   ============================================================= */

footer {
  text-align: center;
  padding: 1.75rem 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: auto;
}


/* =============================================================
   RESPONSIVE
   ============================================================= */

@media (max-width: 640px) {
  .navbar  { padding: 0 1rem; }
  .section { padding: 3rem 1.25rem; }

  .hero-content { padding: 2rem 1.25rem; }
  .headshot { width: 128px; height: 128px; }

  .entry-header { flex-direction: column; gap: 0.2rem; }
  .entry-date   { padding-top: 0; }

  .skills-layout { grid-template-columns: 1fr; }
  .skill-group--wide { grid-column: 1; }

  .project-list  { padding: 0 1.25rem 3rem; }
  .project-body  { padding: 1.25rem 1.25rem 1rem; }

  .photo-grid { padding: 0 1rem 3rem; }
  .lightbox-nav { display: none; }
}
