:root {
  --sidebar: #0f1b2d;
  --sidebar-2: #16263d;
  --sidebar-text: #c7d2e1;
  --accent: #14b8a6;
  --accent-ink: #0f766e;
  --accent-soft: #e6f7f5;
  --bg: #f5f7fa;
  --card: #ffffff;
  --ink: #142033;
  --muted: #5b6b80;
  --line: #e3e8ef;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 4px 16px rgba(15, 27, 45, .05);
  --sidebar-w: 260px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}
h1, h2, h3 { font-family: "Space Grotesk", Inter, sans-serif; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--accent-ink); }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
svg.fill { fill: currentColor; stroke: none; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  color: var(--sidebar-text);
  display: flex; flex-direction: column;
  padding: 28px 18px;
  z-index: 30;
}
.sidebar-profile { display: flex; align-items: center; gap: 12px; padding: 0 8px 24px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-name { color: #fff; font-weight: 600; font-family: "Space Grotesk", sans-serif; }
.sidebar-role { font-size: .8rem; color: #8fa1b8; }

.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 20px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--sidebar-text); text-decoration: none; font-size: .95rem; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: rgba(20,184,166,.16); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav a.active svg { color: var(--accent); }

.sidebar-foot { margin-top: auto; display: flex; gap: 10px; padding: 0 8px; }
.sidebar-foot a {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,.06); color: var(--sidebar-text);
}
.sidebar-foot a:hover { background: var(--accent); color: #fff; }

/* ---------- Avatar ---------- */
.avatar {
  position: relative; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), #2563eb);
  display: grid; place-items: center;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.avatar-initials { color: #fff; font-family: "Space Grotesk", sans-serif; font-weight: 700; }
.avatar-sm { width: 48px; height: 48px; }
.avatar-sm .avatar-initials { font-size: 1rem; }
.avatar-lg { width: 240px; height: 240px; border: 6px solid #fff; box-shadow: 0 12px 40px rgba(15,27,45,.18); }
.avatar-lg .avatar-initials { font-size: 4.5rem; }

/* ---------- Layout ---------- */
.content { margin-left: var(--sidebar-w); padding: 48px clamp(20px, 5vw, 64px) 32px; max-width: calc(1100px + var(--sidebar-w)); }
.page { display: none; animation: fade .3s ease; }
.page.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { margin: 0; }
.section-title { margin: 40px 0 18px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card > :last-child { margin-bottom: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.grid-2 .card { margin: 0; }
.lead { font-size: 1.08rem; }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  text-decoration: none; transition: transform .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent-ink); color: #fff; }
.btn-primary:hover { background: #0b5f58; }
.btn-ghost { border: 1.5px solid var(--line); color: var(--ink); background: #fff; }
.btn-ghost:hover { border-color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 40px;
  background: radial-gradient(circle at 85% 30%, rgba(20,184,166,.15), transparent 55%), var(--card);
  border: 1px solid var(--line); border-radius: 20px; padding: 48px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.eyebrow { color: var(--accent-ink); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; margin-bottom: 6px; }
.tagline { color: var(--muted); font-size: 1.1rem; max-width: 560px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stat b { display: block; font-family: "Space Grotesk", sans-serif; font-size: 2rem; color: var(--accent-ink); line-height: 1.1; }
.stat span { color: var(--muted); font-size: .88rem; }

.highlights { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 20px 0; }
.highlights > div { background: var(--accent-soft); border-radius: 12px; padding: 16px 18px; }
.highlights h3 { color: var(--accent-ink); font-size: .98rem; margin-bottom: 4px; }
.highlights p { margin: 0; font-size: .92rem; }

.checks { list-style: none; padding: 0; margin: 0; }
.checks li { position: relative; padding-left: 28px; margin-bottom: 10px; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: .35em; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f766e' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center/10px no-repeat;
}

/* ---------- Timeline ---------- */
.timeline { list-style: none; padding: 0 0 0 28px; margin: 0; border-left: 2px solid var(--line); }
.timeline > li { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; margin-bottom: 18px; box-shadow: var(--shadow); }
.timeline > li::before {
  content: ""; position: absolute; left: -38px; top: 28px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 3px solid var(--accent);
}
.timeline > li:first-child::before { background: var(--accent); }
.tl-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tl-head h3 { margin: 0 0 2px; }
.org { color: var(--muted); font-size: .92rem; margin: 0; }
.date { font-size: .85rem; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft); padding: 4px 12px; border-radius: 999px; height: fit-content; white-space: nowrap; }
.timeline ul { margin: 14px 0 0; padding-left: 20px; }
.timeline ul li { margin-bottom: 6px; }
.edu h3 { margin-bottom: 4px; }

/* ---------- Skills ---------- */
.skill-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.skill-groups .card { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { background: var(--bg); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; font-size: .88rem; font-weight: 500; }

/* ---------- Articles / Awards ---------- */
.list { display: grid; gap: 16px; }
.list .card { margin: 0; }
.link-card { display: block; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.link-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.tag { display: inline-block; font-size: .75rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; margin-bottom: 10px; }
.arrow { color: var(--accent-ink); font-weight: 600; font-size: .92rem; }
.award { display: flex; gap: 18px; align-items: flex-start; }
.award-icon { font-size: 1.6rem; width: 52px; height: 52px; border-radius: 12px; background: var(--accent-soft); display: grid; place-items: center; flex-shrink: 0; }
.award p { margin: 0; color: var(--muted); }

/* ---------- Hobbies ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.gallery figure { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.ph {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  background: linear-gradient(160deg, #cfe9e5, #9cc7d6 55%, #6f93b3);
}
.ph::after { /* mountain placeholder, hidden behind the photo when present */
  content: ""; position: absolute; inset: auto 0 0 0; height: 55%;
  background: #0f1b2d; opacity: .35;
  clip-path: polygon(0 100%, 0 60%, 22% 20%, 40% 55%, 62% 0, 100% 70%, 100% 100%);
}
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; transition: transform .4s; }
.gallery figure:hover img { transform: scale(1.04); }
figcaption { padding: 12px 16px; font-weight: 500; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.contact { display: flex; align-items: center; gap: 16px; text-decoration: none; color: inherit; margin: 0; }
a.contact:hover { border-color: var(--accent); }
.contact svg { width: 44px; height: 44px; padding: 11px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); }
.contact span { display: block; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.contact b { font-weight: 600; word-break: break-word; }

.footer { color: var(--muted); font-size: .85rem; text-align: center; padding: 40px 0 8px; }

/* ---------- Mobile ---------- */
.topbar { display: none; }
.scrim { display: none; }

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .hero { flex-direction: column-reverse; text-align: center; padding: 32px 24px; }
  .hero-actions { justify-content: center; }
  .tagline { margin-inline: auto; }
  .avatar-lg { width: 180px; height: 180px; }
}

@media (max-width: 760px) {
  .topbar {
    display: flex; align-items: center; gap: 14px;
    position: sticky; top: 0; z-index: 20; height: 60px; padding: 0 16px;
    background: var(--sidebar); color: #fff; font-family: "Space Grotesk", sans-serif; font-weight: 600;
  }
  .menu-btn { width: 40px; height: 40px; border: 0; background: transparent; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 8px; cursor: pointer; }
  .menu-btn span { height: 2px; background: #fff; border-radius: 2px; }
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 25; }
  .content { margin-left: 0; padding: 24px 16px; }
  .card { padding: 20px; }
  .grid-2, .skill-groups, .gallery, .contact-grid { grid-template-columns: 1fr; }
  .timeline { padding-left: 20px; }
  .timeline > li { padding: 18px; }
  .timeline > li::before { left: -30px; }
}
