@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500&family=JetBrains+Mono:wght@400&family=Space+Grotesk:wght@500&display=swap');

:root {
  --bg:           #F4F2EF;
  --text:         #18181B;
  --text-muted:   #6B6B6B;
  --accent:       #5B7B6F;
  --accent-hover: #4A6A5E;
  --surface:      #E8E5E0;
  --border:       #D4D0CA;
  --border-hover: #A8A49E;

  --font-sans:    'DM Sans', sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --header-height: 52px;
}

[data-theme="dark"] {
  --bg:           #111110;
  --text:         #E5E2DC;
  --text-muted:   #88887F;
  --accent:       #6E9B8C;
  --accent-hover: #7FAAA0;
  --surface:      #1E1E1C;
  --border:       #2E2E2C;
  --border-hover: #444440;
}

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

html, body {
  height: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Theme toggle */
.theme-toggle {
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 17px;
  transition: color 0.2s ease, background-color 0.2s ease;
  line-height: 1;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background-color: var(--surface);
  color: var(--text);
}

/* Used on index.html only — keeps toggle fixed on the no-header home page */
.theme-toggle--home {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 100;
}

/* Breadcrumb — lives inside .page-header on subpages, not fixed on its own */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  letter-spacing: 0.01em;
}

.breadcrumb-home {
  color: var(--accent);
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.breadcrumb-home:hover {
  opacity: 0.65;
}

.breadcrumb-sep {
  color: var(--border-hover);
}

.breadcrumb-page {
  color: var(--text);
  font-size: 13px;
}

/* ─── Subpage header bar ─────────────────────────────────── */

.page-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.page-header-left {
  display: flex;
  align-items: center;
  min-width: 130px;
}

.page-header-center {
  flex: 1;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(8px, 1vw, 12px);
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  padding: 0 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-header-right {
  min-width: 130px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

/* Hide center text on narrow screens where it would crush the breadcrumb */
@media (max-width: 600px) {
  .page-header-center {
    display: none;
  }
}

/* Landing page layout */
.home-body {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.home-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-cluster {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: fadeInUp 0.45s ease both;
}

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

.btn-row {
  display: flex;
  gap: 10px;
}

/* Navigation buttons */
.nav-btn {
  display: inline-block;
  position: relative;
  padding: 14px 44px;
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.nav-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-legend {
  height: 22px;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  letter-spacing: 0.01em;
}

.btn-legend.visible {
  opacity: 1;
}

/* Home footer */
.home-footer {
  padding: 24px;
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: center;
  animation: fadeInUp 0.45s ease 0.12s both;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  padding: 8px;
  transition: color 0.2s ease;
}

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

.social-link svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
  transition: stroke 0.2s ease, transform 0.2s ease;
}

.social-link:hover svg {
  transform: scale(1.15);
}

/* ─── Contact page ──────────────────────────────────────── */

.contact-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.contact-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-height) + 36px) 24px 56px;
  gap: 36px;
}

.contact-quote {
  font-family: var(--font-sans);
  font-size: 15px;
  font-style: italic;
  color: var(--text-muted);
  border-left: 2px solid var(--accent);
  padding: 10px 16px;
  max-width: 380px;
  width: 100%;
  line-height: 1.7;
  animation: fadeInUp 0.45s ease both;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 380px;
  animation: fadeInUp 0.45s ease 0.08s both;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  background: transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.contact-link:hover {
  border-color: var(--accent);
  background-color: var(--surface);
}

.contact-link-icon {
  color: var(--text-muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

.contact-link:hover .contact-link-icon {
  color: var(--accent);
}

.contact-link-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

.contact-link-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.contact-link-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: color 0.2s ease;
}

.contact-link:hover .contact-link-label {
  color: var(--accent);
}

.contact-link-value {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.contact-meta {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeInUp 0.45s ease 0.16s both;
}

.contact-section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.contact-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.contact-table td {
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.contact-table tr:last-child td {
  border-bottom: none;
}

.contact-table td:first-child {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  width: 42%;
}

.contact-table td:last-child {
  font-weight: 500;
  text-align: right;
}

.lang-tags {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.lang-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  font-weight: 400;
}

/* ─── About Me page ─────────────────────────────────────── */

.about-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.about-main {
  flex: 1;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: calc(var(--header-height) + 32px) 24px 56px;
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.about-section {
  display: flex;
  flex-direction: column;
  gap: 28px;
  animation: fadeInUp 0.45s ease both;
}

.about-section:nth-child(2) { animation-delay: 0.06s; }
.about-section:nth-child(3) { animation-delay: 0.12s; }

.about-section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

/* ── Timeline ── */

.timeline {
  position: relative;
  padding-left: 104px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 104px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--border);
}

.timeline-node {
  position: relative;
  padding: 0 0 32px 24px;
}

.timeline-node:last-child {
  padding-bottom: 0;
}

.timeline-year {
  position: absolute;
  left: -104px;
  top: 1px;
  width: 90px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.timeline-dot {
  position: absolute;
  left: -5px;
  top: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.timeline-node--present .timeline-dot {
  background: var(--accent);
  border-color: var(--accent);
}

.timeline-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.55;
}

.timeline-detail {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.6;
}

.timeline-link {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  transition: opacity 0.2s ease;
}

.timeline-link:hover {
  opacity: 0.65;
}

/* ── Beyond Academics — two columns ── */

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.beyond-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.beyond-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.5;
}

.beyond-detail {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
}

.beyond-placeholder {
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 24px 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Work & Life ── */

.work-life-stack {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.wl-block-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.employment-entry {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.employment-entry:first-of-type {
  border-top: 1px solid var(--border);
}

.employment-entry--placeholder .employment-role {
  color: var(--text-muted);
  font-weight: 400;
}

.employment-entry--placeholder .employment-period {
  color: var(--text-muted);
  opacity: 0.6;
}

.employment-role {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.employment-period {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.hobby-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hobby-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px 11px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.hobby-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.photo-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.photo-face-wrap {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.photo-face-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-face-placeholder {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
}

.photo-gallery-item {
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-gallery-placeholder {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

/* ── Footer CTA ── */

.about-footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  display: flex;
  justify-content: flex-end;
}

.about-footer-link {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
  letter-spacing: 0.02em;
}

.about-footer-link:hover {
  color: var(--accent);
}
