/* ===== Theme tokens ===== */
:root {
  --bg: #FFFFFF;
  --surface: #F5F6F8;
  --card: #FFFFFF;
  --text: #14171C;
  --muted: #5E6672;
  --line: #E3E6EA;
  --chip: #EEF0F3;
  --accent: #D52B1E;
  --map-bg: #FFFFFF;
  --map-land: #E7EBF0;
  --map-home: #C7D4E3;
  --map-grid: #EDF1F5;
  --head: "Outfit", "Segoe UI", Arial, sans-serif;
  --body: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1115; --surface: #161920; --card: #171A21; --text: #ECEEF2; --muted: #9AA3AF; --line: #262B34; --chip: #21252D;
    --map-bg: #13161C; --map-land: #252A33; --map-home: #3B4A5E; --map-grid: #1A1E25; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1115; --surface: #161920; --card: #171A21; --text: #ECEEF2; --muted: #9AA3AF; --line: #262B34; --chip: #21252D;
  --map-bg: #13161C; --map-land: #252A33; --map-home: #3B4A5E; --map-grid: #1A1E25; color-scheme: dark;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 16px; line-height: 1.6; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3 { font-family: var(--head); line-height: 1.15; margin: 0; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 20; background: var(--text); color: var(--bg); padding: 8px 12px; }
.skip:focus { left: 8px; }

/* ===== Split layout ===== */
.layout { display: grid; grid-template-columns: minmax(300px, 30%) 1fr; min-height: 100vh; }
.content { padding: 56px clamp(24px, 5vw, 72px) 32px; max-width: 1100px; width: 100%; }
.content section { margin-bottom: 88px; scroll-margin-top: 32px; }

/* ===== Left panel ===== */
.side {
  position: sticky; top: 0; height: 100vh; color: #fff; overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(10,12,18,0.55) 0%, rgba(10,12,18,0.82) 100%),
    var(--side-img, linear-gradient(160deg, #1D2A44 0%, #2B1F33 55%, #4A1E22 100%));
  background-size: cover; background-position: center;
}
.side-inner { display: flex; flex-direction: column; min-height: 100%; padding: 56px 40px 32px; }
.side-photo img { width: 132px; height: 132px; object-fit: cover; border-radius: 12px; border: 3px solid rgba(255,255,255,0.9); }
.side-name { font-size: 2rem; font-weight: 600; margin: 22px 0 4px; }
.side-name a { text-decoration: none; }
.side-name a:hover { color: #fff; }
.side-role { color: #D5DAE3; margin-bottom: 14px; }
.side-status { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18); padding: 5px 12px; border-radius: 999px; margin-bottom: 22px; align-self: flex-start; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #3DDC84; box-shadow: 0 0 0 3px rgba(61,220,132,0.2); flex: none; }
.side-links { list-style: none; padding: 0; margin: 0 0 20px; font-size: 0.92rem; }
.side-links li { display: flex; align-items: center; gap: 10px; padding: 5px 0; color: #D5DAE3; word-break: break-all; }
.side-links a { color: #fff; text-decoration-color: rgba(255,255,255,0.4); }
.side-links a:hover { color: #fff; text-decoration-color: var(--accent); }
.ico { width: 22px; flex: none; text-align: center; font-size: 0.72rem; font-weight: 700; color: #9FB0C8; }
.side-cv { display: inline-block; align-self: flex-start; background: var(--accent); color: #fff; text-decoration: none; font-weight: 600; font-size: 0.9rem; padding: 9px 18px; border-radius: 999px; margin-bottom: 24px; }
.side-cv:hover { color: #fff; background: #B32418; }
.side-nav { display: flex; flex-direction: column; gap: 2px; margin-top: auto; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.15); }
.side-nav a { color: #E6EAF0; text-decoration: none; font-family: var(--head); font-size: 1.05rem; padding: 6px 0; }
.side-nav a:hover { color: #fff; padding-left: 4px; }
.theme-toggle { margin-top: 18px; align-self: flex-start; background: transparent; color: #D5DAE3; border: 1px solid rgba(255,255,255,0.25); border-radius: 999px; padding: 6px 14px; font: 500 0.82rem var(--body); cursor: pointer; }
.theme-toggle:hover { border-color: #fff; color: #fff; }
.t-dark { display: none; }
:root[data-theme="dark"] .t-light { display: none; }
:root[data-theme="dark"] .t-dark { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .t-light { display: none; }
  :root:not([data-theme="light"]) .t-dark { display: inline; }
}

/* ===== Right content ===== */
.big { font-size: 2.8rem; font-size: clamp(2.2rem, 4vw, 3rem); font-weight: 600; letter-spacing: -0.02em; margin-bottom: 26px; }
.sub { font-size: 1.3rem; font-weight: 600; margin: 44px 0 16px; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 62ch; }
.intro { margin-bottom: 64px; max-width: 760px; }
.intro-head { font-family: var(--head); font-size: 2.1rem; font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 500; line-height: 1.25; margin-bottom: 16px; }
.intro-text { color: var(--muted); font-size: 1.08rem; max-width: 64ch; }

/* Work cards */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.card:hover { border-color: var(--muted); }
.card-img { display: block; background: #fff; border-bottom: 1px solid var(--line); }
.card-img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: left top; }
.card-body { padding: 18px 20px 20px; }
.card h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 8px; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card-body > p { color: var(--muted); font-size: 0.93rem; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 14px; font-size: 0.8rem; color: var(--muted); }
.chip { background: var(--chip); border-radius: 999px; padding: 2px 10px; font-weight: 500; }
.chip.pdf { background: var(--accent); color: #fff; text-decoration: none; }
.chip.pdf:hover { color: #fff; background: #B32418; }
.card.next { border-style: dashed; background: transparent; padding: 26px 24px; }
.next-title { font-family: var(--head); font-size: 1.15rem; font-weight: 600; margin-bottom: 6px; }
.card.next p:last-child { color: var(--muted); font-size: 0.93rem; margin: 0; }

/* Journey */
.map-box { margin-bottom: 22px; }
.journey-map { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: 12px; }
.journey-map rect { fill: var(--map-bg); }
.journey-map .grid-line { stroke: var(--map-grid); }
.journey-map .land { fill: var(--map-land); stroke: var(--map-bg); }
.journey-map .land.home { fill: var(--map-home); }
.journey-map .route-shadow { stroke: var(--map-bg); }
.journey-map .route { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.2s 0.4s ease-in-out forwards; }
.journey-map .pin circle:not(.pin-core) { fill: var(--map-bg); }
.journey-map .map-label text { font-family: var(--head); fill: var(--text); stroke: var(--map-bg); stroke-width: 5px; paint-order: stroke; }
.journey-map .map-label text.sub { font-family: var(--body); fill: var(--muted); }
.journey-map .map-km { stroke: var(--map-bg); stroke-width: 5px; paint-order: stroke; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .journey-map .route { animation: none; stroke-dashoffset: 0; } html { scroll-behavior: auto; } }

.degrees { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.degree { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.degree:last-child { border-top: 3px solid var(--accent); }
.degree header { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.logo { width: 56px; height: 56px; flex: none; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--line); padding: 5px; }
.logo.mono { display: flex; align-items: center; justify-content: center; font-family: var(--head); font-weight: 700; font-size: 0.95rem; color: #2F5D8C; background: var(--surface); }
.period { color: var(--accent); font-weight: 600; font-size: 0.82rem; margin-bottom: 3px; }
.degree h3 { font-size: 1.12rem; font-weight: 600; margin-bottom: 4px; }
.school { color: var(--muted); font-size: 0.88rem; margin: 0; }
.degree-work { list-style: none; padding: 0; margin: 0; }
.degree-work li { padding: 10px 0; border-top: 1px solid var(--line); font-size: 0.92rem; }
.degree-work strong { display: block; font-weight: 600; }
.degree-work span { color: var(--muted); }

.certs { list-style: none; padding: 0; margin: 0; max-width: 760px; }
.certs li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.certs span { display: block; color: var(--muted); font-size: 0.88rem; }
.badge { font-size: 0.76rem !important; font-weight: 600; color: #1E7A4A !important; background: rgba(30,122,74,0.12); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.badge.progress { color: #A16A00 !important; background: rgba(214,150,20,0.15); }

/* Power BI */
.visuals { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.visuals figure { margin: 0; }
.visuals img { width: 100%; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.visuals figcaption { font-size: 0.86rem; color: var(--muted); margin-top: 6px; }

/* Updates */
.updates { list-style: none; padding: 0; margin: 0 0 16px; max-width: 760px; }
.updates a { display: flex; justify-content: space-between; gap: 20px; padding: 14px 0; border-top: 1px solid var(--line); text-decoration: none; }
.u-title { font-family: var(--head); font-weight: 500; font-size: 1.08rem; }
.u-date { color: var(--muted); font-size: 0.86rem; white-space: nowrap; }
.updates a:hover .u-title { color: var(--accent); }
.more { font-weight: 600; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; }
.gallery figcaption { font-size: 0.82rem; color: var(--muted); margin-top: 5px; }

/* Articles and project cases */
.article { max-width: 820px; }
.crumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 14px; }
.crumb a { color: var(--muted); }
.title { font-size: 2.4rem; font-size: clamp(1.9rem, 3.6vw, 2.6rem); font-weight: 600; letter-spacing: -0.01em; margin-bottom: 16px; }
.cover { border: 1px solid var(--line); border-radius: 10px; margin: 24px 0; background: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 30px; }
.btn { display: inline-block; padding: 10px 18px; border-radius: 999px; border: 1.5px solid var(--text); text-decoration: none; font-weight: 600; font-size: 0.92rem; }
.btn:hover { background: var(--surface); color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #B32418; border-color: #B32418; color: #fff; }
.question { background: var(--surface); border: 1px solid var(--line); border-bottom: none; border-radius: 12px 12px 0 0; padding: 16px 20px; }
.label { font-size: 0.78rem; font-weight: 600; color: var(--accent); margin-bottom: 4px; }
.q { font-family: var(--head); font-size: 1.25rem; font-weight: 500; line-height: 1.35; margin: 0; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; border: 1px solid var(--line); border-radius: 0 0 12px 12px; overflow: hidden; }
.facts > div { padding: 14px 16px; border-right: 1px solid var(--line); }
.facts > div:last-child { border-right: none; }
.facts dt { font-size: 0.76rem; font-weight: 600; color: var(--accent); margin-bottom: 3px; }
.facts dd { margin: 0; font-size: 0.9rem; }
.findings { padding-left: 1.3em; }
.findings li { margin-bottom: 8px; }
.findings li::marker { color: var(--accent); font-weight: 700; }
.steps { list-style: none; counter-reset: s; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.steps li { counter-increment: s; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; font-size: 0.92rem; }
.steps li::before { content: counter(s); display: inline-block; font-family: var(--head); font-weight: 700; color: var(--accent); margin-right: 8px; }
.steps strong { font-family: var(--head); font-weight: 600; }
.steps span { display: block; color: var(--muted); margin-top: 4px; }
.prose { font-size: 1.02rem; }
.prose h2 { font-size: 1.4rem; margin: 1.8em 0 0.6em; }
.prose h3 { font-size: 1.15rem; margin: 1.5em 0 0.5em; }
.prose li { margin-bottom: 0.4em; }
.prose li::marker { color: var(--accent); }
.prose img { border: 1px solid var(--line); border-radius: 10px; margin: 1.4em 0 0.4em; background: #fff; }
.sources { padding-left: 1.2em; font-size: 0.92rem; }
.sources li { margin-bottom: 5px; }
.back { margin-top: 40px; font-weight: 600; }
.foot { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--muted); }

/* ===== Mobile: panel on top ===== */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: relative; height: auto; }
  .side-inner { padding: 36px 24px 26px; }
  .side-photo img { width: 104px; height: 104px; }
  .side-nav { flex-direction: row; flex-wrap: wrap; gap: 4px 18px; }
  .content { padding: 40px 20px 24px; }
  .cards, .degrees, .visuals, .steps { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts > div:nth-child(2n) { border-right: none; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .journey-map .map-label text { font-size: 30px; }
  .journey-map .map-label text.sub, .journey-map .map-km { font-size: 20px; }
}

/* ===== v3: gitfolio-inspired look and interactions (own code) ===== */
:root { --head: "Questrial", "Segoe UI", Arial, sans-serif; --body: "Poppins", -apple-system, "Segoe UI", Arial, sans-serif; --shadow: 0 18px 40px rgba(10,10,10,0.10); --side-overlay: linear-gradient(90deg, rgba(10,10,10,0.45), rgba(10,10,10,0.45)); }
:root[data-theme="dark"] { --bg: #0A0A0A; --card: #141414; --surface: #141414; --line: #232323; --chip: #1E1E1E; --map-bg: #111111; --map-grid: #171717; --map-land: #262626; --map-home: #3A475A; --shadow: 0 18px 40px rgba(0,0,0,0.6); --side-overlay: linear-gradient(90deg, rgba(10,10,10,0.25), #0A0A0A); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #0A0A0A; --card: #141414; --surface: #141414; --line: #232323; --chip: #1E1E1E; --map-bg: #111111; --map-grid: #171717; --map-land: #262626; --map-home: #3A475A; --shadow: 0 18px 40px rgba(0,0,0,0.6); --side-overlay: linear-gradient(90deg, rgba(10,10,10,0.25), #0A0A0A); } }
body { font-size: 15.5px; }

/* Panel: centred content, photo first, big bio line */
.side { background: var(--side-overlay), var(--side-img, linear-gradient(160deg, #1D2A44 0%, #2B1F33 55%, #4A1E22 100%)); background-size: cover; background-position: center; }
.side-inner { justify-content: center; padding: 48px 44px; }
.side-photo img { width: 170px; height: 170px; border-radius: 6px; border: none; }
.side-name { font-family: var(--body); font-weight: 700; font-size: 1.35rem; margin: 22px 0 2px; }
.side-role { font-weight: 600; font-size: 0.92rem; margin-bottom: 10px; }
.side-bio { font-family: var(--head); font-size: 1.6rem; line-height: 1.3; color: #fff; margin: 0 0 18px; }
.side-status { margin-bottom: 18px; }
.side-links { font-weight: 600; }
.side-nav { margin-top: 18px; flex-direction: row; flex-wrap: wrap; gap: 4px 18px; padding-top: 18px; }
.side-nav a { font-family: var(--body); font-weight: 600; font-size: 0.95rem; }
.side-nav a:hover { padding-left: 0; text-decoration: underline; text-decoration-color: var(--accent); }

/* Big bold section titles */
.big { font-family: var(--head); font-weight: 700; font-size: 3.1rem; letter-spacing: -0.01em; }
.intro { margin-bottom: 40px; }
.intro-text { font-size: 1.05rem; }

/* Cards that lift on hover */
.card, .degree, .post-card, .steps li { transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease; }
.card:hover, .post-card:hover { transform: scale(1.03); box-shadow: var(--shadow); border-color: transparent; }
.degree:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card h3 { font-family: var(--body); font-weight: 700; font-size: 1.15rem; }
.card-body > p { font-family: var(--head); font-size: 1rem; color: var(--text); opacity: 0.8; }
.card-meta { font-weight: 600; }
.card.next:hover { transform: none; box-shadow: none; }

/* Updates as picture cards */
.posts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-bottom: 18px; }
.post-card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; text-decoration: none; color: var(--text); }
.post-card:hover { color: var(--text); }
.post-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: left top; background: #fff; }
.post-body { display: block; padding: 16px 18px 18px; }
.post-title { display: block; font-weight: 700; font-size: 1.08rem; line-height: 1.3; margin-bottom: 6px; }
.post-sum { display: block; font-family: var(--head); opacity: 0.8; margin-bottom: 8px; }
.post-date { display: block; font-size: 0.8rem; color: var(--muted); font-weight: 600; }

.foot { text-align: center; border-top: none; font-family: var(--head); font-weight: 700; color: var(--text); }
::selection { background: var(--text); color: var(--bg); }

@media (prefers-reduced-motion: reduce) { .card, .degree, .post-card { transition: none; } .card:hover, .post-card:hover, .degree:hover { transform: none; } }
@media (max-width: 900px) {
  .side { background: var(--side-overlay-m, linear-gradient(rgba(10,10,10,0.5), rgba(10,10,10,0.5))), var(--side-img, linear-gradient(160deg, #1D2A44 0%, #2B1F33 55%, #4A1E22 100%)); background-size: cover; background-position: center; }
  :root[data-theme="dark"] .side { --side-overlay-m: linear-gradient(0deg, #0A0A0A 0%, rgba(10,10,10,0.35) 55%); }
  .side-inner { align-items: center; text-align: center; padding: 40px 22px 30px; }
  .side-photo img { width: 120px; height: 120px; }
  .side-bio { font-size: 1.3rem; }
  .side-status, .side-cv, .theme-toggle { align-self: center; }
  .side-links li { justify-content: center; }
  .side-nav { justify-content: center; border-top: none; }
  .posts { grid-template-columns: 1fr; }
  .big { font-size: 2.4rem; }
}
