:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-strong: #eaf0f7;
  --sidebar: #1e293b;
  --sidebar-soft: #334155;
  --text: #0f172a;
  --muted: #475569;
  --primary: #2563eb;
  --primary-soft: #dbeafe;
  --border: #d7e0ea;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --radius: 22px;
  --radius-sm: 14px;
  --max-width: 1240px;

  /* Transition vars */
  --slide-duration: 520ms;
  --slide-easing: cubic-bezier(0.2, 0.9, 0.2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.07), transparent 24%),
    var(--bg);
  line-height: 1.6;
}

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

.skip-link { position: absolute; left: 1rem; top: -3rem; background: var(--sidebar); color: #fff; padding: 0.75rem 1rem; border-radius: 999px; z-index: 999; transition: top 0.2s ease; }
.skip-link:focus { top: 1rem; }

.page { width: min(var(--max-width), calc(100% - 2rem)); margin: 1rem auto 2rem; display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 1.25rem; align-items: start; }

.sidebar, .main { min-width: 0; }
.sidebar { position: sticky; top: 1rem; background: linear-gradient(180deg, #1e293b 0%, #111827 100%); color: #e2e8f0; border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }

.sidebar__nav { margin-top: 1rem; display: grid; gap: 0.5rem; }
.sidebar__nav a { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.85rem 0.95rem; border-radius: 14px; background: rgba(255,255,255,0.03); color: #cbd5e1; transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease; border: 1px solid transparent; }
.sidebar__nav a::after { content: '›'; opacity: 0.8; }
.sidebar__nav a:hover, .sidebar__nav a:focus-visible, .sidebar__nav a.is-active { background: rgba(255,255,255,0.1); color: #fff; transform: translateX(3px); border-color: rgba(255,255,255,0.08); outline: none; }

.sidebar__panel { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); border-radius: 18px; padding: 1rem; margin-top: 1rem; }

.sidebar h2, .sidebar h3, .main h1, .main h2, .main h3, .main h4, .main p { margin-top: 0; }

.profile { display:flex; align-items:center; gap:1rem; }
.avatar { width:72px; height:72px; border-radius:50%; display:grid; place-items:center; font-size:1.45rem; font-weight:800; letter-spacing:0.05em; color:#0f172a; background: linear-gradient(135deg,#f8fafc,#cbd5e1); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35); flex:0 0 auto; }
.profile__name { font-size:1.25rem; font-weight:800; margin-bottom:0.15rem; }
.profile__title { color:#cbd5e1; font-size:0.98rem; }

.sidebar__grid { display:grid; gap:0.8rem; margin-top:0.85rem; font-size:0.95rem; }
.contact-row { display:grid; grid-template-columns: 88px 1fr; gap:0.8rem; align-items:start; }
.contact-row__label { color:#94a3b8; font-weight:600; }
.contact-row__value { color:#f8fafc; word-break:break-word; }

.print-button { width:100%; border:0; cursor:pointer; margin-top:1rem; padding:0.95rem 1rem; border-radius:14px; font:inherit; font-weight:700; color:#0f172a; background: linear-gradient(135deg,#e2e8f0,#cbd5e1); transition: transform 0.2s ease, filter 0.2s ease; }
.print-button:hover, .print-button:focus-visible { transform: translateY(-1px); filter: brightness(1.03); outline: none; }

.main { /* make the main column a scroll container that shows one section at a time */
  display:block;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  padding: 1rem 0;
}

/* Provide top/bottom spacers so first and last sections can be centered */
.main::before,
.main::after {
  content: "";
  display: block;
  height: 0;
  flex: none;
}
.hero, .card, .section { border-radius: var(--radius); }
.hero { position:relative; overflow:hidden; padding:2rem; }
.hero::before { content:''; position:absolute; inset:auto -5rem -5rem auto; width:18rem; height:18rem; border-radius:50%;}
.hero__inner { position:relative; display:flex; gap:1.25rem; align-items:center; }
.hero__avatar { width:96px; height:96px; border-radius:28px; display:grid; place-items:center; font-size:2rem; font-weight:800; color:#0f172a; background: linear-gradient(135deg,#dbeafe,#bfdbfe 50%,#e2e8f0); flex:0 0 auto; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.7); }
.eyebrow { display:inline-flex; align-items:center; gap:0.5rem; color:var(--primary); font-size:0.9rem; font-weight:700; text-transform:uppercase; letter-spacing:0.08em; margin-bottom:0.5rem; }
.hero h1 { font-size: clamp(2rem,5vw,3.25rem); line-height:1.05; margin-bottom:0.55rem; }
.hero__subtitle { font-size:1.1rem; color:var(--muted); margin-bottom:1rem; max-width:62ch; }
.hero__meta { display:flex; flex-wrap:wrap; gap:0.65rem; }
.pill { display:inline-flex; align-items:center; gap:0.4rem; padding:0.5rem 0.8rem; border-radius:999px; background:var(--primary-soft); color:#1d4ed8; font-size:0.9rem; font-weight:600; }

.section--hero {
  max-width: 1040px;
  padding: 2rem;
  min-height: calc(100vh - 2rem) !important;
}

.section--hero .hero__inner {
  align-items: flex-start;
}

.section--hero h2 {
  margin-bottom: 0.35rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
}

/* Full-screen sections with centered content */
.section {
  min-height: calc(100vh - 2rem) !important;
  padding: clamp(1.5rem, 4vh, 2.5rem) 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  scroll-snap-align: start;
  max-width: 900px;
  margin: 0 auto;
}

/* Transition states */
.section-hidden { opacity: 0; transform: translateY(28px) scale(0.995); transition: opacity var(--slide-duration) var(--slide-easing), transform var(--slide-duration) var(--slide-easing); pointer-events: none; }
.section-visible { opacity: 1; transform: translateY(0) scale(1); transition: opacity var(--slide-duration) var(--slide-easing), transform var(--slide-duration) var(--slide-easing); pointer-events: auto; }
.section-passing { opacity: 0.75; transform: translateY(-12px) scale(0.998); transition: opacity calc(var(--slide-duration) / 2) var(--slide-easing), transform calc(var(--slide-duration) / 2) var(--slide-easing); }

.section__header { display:flex; align-items:flex-end; justify-content:space-between; gap:1rem; margin-bottom:1rem; }
.section__header h2 { font-size:1.35rem; margin-bottom:0.15rem; }
.section__header p { color:var(--muted); margin:0; }

.section__actions { display:flex; flex-wrap:wrap; gap:0.5rem; }

.info-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:1rem; }
.info-item { padding:1rem; background: linear-gradient(180deg,#f8fbff,#eff5fb); border:1px solid var(--border); border-radius:var(--radius-sm); }
.info-item__label { font-size:0.86rem; color:var(--muted); margin-bottom:0.35rem; font-weight:700; text-transform:uppercase; letter-spacing:0.04em; }
.info-item__value { font-weight:600; word-break:break-word; }

.timeline { min-height: 0; gap:1rem; display: flex; flex-direction: column; }
.timeline__item { position:relative; padding-left:1.35rem; }
.timeline__item::before { content:''; position:absolute; left:0; top:0.4rem; width:0.7rem; height:0.7rem; border-radius:50%; background:var(--primary); box-shadow:0 0 0 6px rgba(37,99,235,0.12); }
.timeline__item::after { content:''; position:absolute; left:0.32rem; top:1rem; bottom:-1rem; width:2px; background: linear-gradient(180deg, rgba(37,99,235,0.35), rgba(37,99,235,0.05)); }
.timeline__item:last-child::after { display:none; }
.timeline__topline { display:flex; flex-wrap:wrap; justify-content:space-between; gap:0.5rem; margin-bottom:0.25rem; }
.timeline__title { font-weight:800; }
.timeline__meta { color:var(--muted); font-weight:600; }

.list { margin:0.6rem 0 0; padding-left:1.1rem; }
.list li + li { margin-top:0.35rem; }

.badge-group { display:grid; gap:1rem; }
.badge-block h3 { font-size:1rem; margin-bottom:0.6rem; }
.badges { display:flex; flex-wrap:wrap; gap:0.6rem; }
.badge { padding:0.55rem 0.8rem; border-radius:999px; background:#eef4ff; border:1px solid #dce7ff; color:#1d4ed8; font-weight:600; font-size:0.93rem; }

.project-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:1rem; }
.project-card { padding:1.15rem; border-radius:var(--radius-sm); border:1px solid var(--border); background: linear-gradient(180deg,#ffffff,#f8fbff); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.project-card:hover { transform: translateY(-3px); box-shadow: 0 16px 30px rgba(15,23,42,0.09); }
.project-card h3 { margin-bottom:0.45rem; }

.gallery-button { display:inline-flex; align-items:center; justify-content:center; margin-top:0.9rem; padding:0.75rem 1rem; border:0; border-radius:999px; font:inherit; font-weight:700; color:#fff; background: linear-gradient(135deg,#2563eb,#1d4ed8); cursor:pointer; transition: transform 0.2s ease, filter 0.2s ease; }
.gallery-button:hover, .gallery-button:focus-visible { transform: translateY(-1px); filter: brightness(1.04); outline:none; }

.gallery-dialog { width: min(960px, calc(100vw - 1.5rem)); max-height: 88vh; border:none; border-radius:24px; padding:0; box-shadow:0 30px 80px rgba(15,23,42,0.3); background:#ffffff; color:var(--text); }
.gallery-dialog::backdrop { background: rgba(15,23,42,0.65); backdrop-filter: blur(4px); }
.gallery-dialog__inner { padding:1.25rem; }
.gallery-dialog__header { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; margin-bottom:1rem; }
.gallery-dialog__title { margin:0; font-size:1.35rem; }
.gallery-dialog__close { border:0; background:#e2e8f0; color:#0f172a; width:2.5rem; height:2.5rem; border-radius:999px; cursor:pointer; font:inherit; font-size:1.2rem; line-height:1; flex:0 0 auto; }

/* Horizontal image strip (full images) */
.gallery-grid { display:flex; gap:0.75rem; overflow-x:auto; overflow-y:hidden; padding-bottom:0.5rem; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.gallery-grid figure { margin:0; overflow:hidden; border-radius:12px; border:0; background:transparent; cursor:pointer; flex:0 0 auto; display:flex; align-items:center; justify-content:center; scroll-snap-align:center; padding:0.25rem; }
.gallery-grid img { display:block; width:auto; height: min(78vh, 760px); max-width: calc(100vw - 6rem); object-fit:contain; background:#0f172a; border-radius:10px; }
.gallery-grid figcaption { display:none; }
.gallery-grid figure:hover, .gallery-grid figure:focus-visible { outline:none; box-shadow:0 10px 24px rgba(15,23,42,0.12); transform: translateY(-1px); transition: transform 0.2s ease, box-shadow 0.2s ease; }
@media (max-width:720px) { .gallery-grid img { height: min(62vh,520px); max-width: calc(100vw - 3rem); } }

.image-viewer-dialog { width: min(96vw,1320px); border:none; border-radius:24px; padding:0; background:#0f172a; color:#fff; box-shadow: 0 32px 90px rgba(15,23,42,0.45); }
.image-viewer-dialog::backdrop { background: rgba(15,23,42,0.8); backdrop-filter: blur(5px); }
.image-viewer-dialog__inner { display:grid; gap:0.9rem; padding:1rem; }
.image-viewer-dialog__header { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.image-viewer-dialog__title { margin:0; font-size:1.05rem; font-weight:700; }
.image-viewer-dialog__close { border:0; width:2.6rem; height:2.6rem; border-radius:999px; background: rgba(255,255,255,0.12); color:#fff; cursor:pointer; font:inherit; font-size:1.4rem; line-height:1; }
.image-viewer-dialog__image { width:100%; max-height:82vh; object-fit:contain; border-radius:18px; background:#020617; }
.image-viewer-dialog__caption { margin:0; color:#cbd5e1; font-size:0.95rem; }

.tag-row { display:flex; flex-wrap:wrap; gap:0.45rem; margin:0.8rem 0 0.9rem; }
.tag { display:inline-flex; align-items:center; padding:0.35rem 0.6rem; border-radius:999px; background:#e0f2fe; color:#075985; font-size:0.82rem; font-weight:600; }

.language-list { display:grid; gap:0.95rem; }
.language-item { display:grid; gap:0.35rem; }
.language-item__top { display:flex; justify-content:space-between; gap:1rem; font-weight:600; }

.progress { width:100%; height:0.8rem; background:#e2e8f0; border-radius:999px; overflow:hidden; }
.progress__bar { height:100%; border-radius:inherit; background: linear-gradient(90deg,#2563eb,#38bdf8); }

.interest-list { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:0.8rem 1rem; margin:0; padding-left:1.1rem; }
.footer { color:var(--muted); font-size:0.93rem; text-align:center; padding:0.5rem 0 0.25rem; }

.content-card { padding: 1.25rem; background: var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); }

@media (max-width:1080px) { .page { grid-template-columns: 1fr; } .sidebar { position: static; } }
@media (max-width:760px) { .page { width: min(100% - 1rem, var(--max-width)); margin-top:0.5rem; } .hero__inner, .section__header, .timeline__topline, .language-item__top { flex-direction:column; align-items:flex-start; } .info-grid, .project-grid, .interest-list { grid-template-columns:1fr; } .contact-row { grid-template-columns:1fr; gap:0.1rem; } .hero, .section, .sidebar { padding:1rem; } .hero__avatar { width:80px; height:80px; border-radius:22px; } }
@media (max-width:760px) {
  .main { scroll-snap-type: none; }
  .section { min-height: auto; margin: 0 0 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  @page { margin:12mm; }
  html { scroll-behavior: auto; }
  body { background:#fff; color:#000; }
  .page { width:100%; margin:0; grid-template-columns:1fr; gap:0.8rem; }
  .sidebar { position: static; background:#fff; color:#000; box-shadow:none; border:1px solid #cbd5e1; }
  .sidebar__nav, .print-button, .skip-link { display:none !important; }
  .sidebar__panel { background:#fff; border-color:#d1d5db; }
  .contact-row__label, .timeline__meta, .hero__subtitle, .section__header p, .footer, .profile__title { color:#374151 !important; }
  .main, .hero, .section, .card, .project-card, .info-item { box-shadow:none !important; }
  .hero, .section, .info-item, .project-card { border-color:#cbd5e1; }
  .hero::before { display:none; }
  .hero, .section, .sidebar { break-inside: avoid; page-break-inside: avoid; }
  .project-card:hover, .sidebar__nav a:hover { transform:none; }
  .tag, .badge, .pill { border:1px solid #cbd5e1; background:#f8fafc; color:#111827; }
}
