:root {
  --bg: #f8f7fb;
  --ink: #211b30;
  --muted: #696273;
  --purple: #6734bc;
  --purple2: #9568dc;
  --line: #e5e0ed;
  --card: #fff;
  --soft: #f0eaf9;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; color: var(--ink); background: var(--bg); font: 15px/1.65 Inter, system-ui, sans-serif; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--purple2); outline-offset: 4px; }
h1, h2, h3, h4 { font-family: "Space Grotesk", sans-serif; line-height: 1.2; overflow-wrap: anywhere; }
p { margin: 0 0 16px; }
.container { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.section { padding-block: 56px; border-top: 1px solid var(--line); scroll-margin-top: 88px; }
.section h2 { font-size: clamp(30px, 3.4vw, 42px); letter-spacing: -.04em; margin: 0 0 26px; }
.eyebrow, .section-kicker { color: var(--purple); font-size: 10px; font-weight: 800; letter-spacing: .15em; margin-bottom: 12px; }
.lead { max-width: 660px; color: var(--muted); font-size: 17px; }
.lead.small { font-size: 15px; }
.note { color: var(--muted); font-size: 12px; margin: 20px 0 0; }
.grid { display: grid; gap: 16px; }
.grid > *, .hero-grid > *, .role > * { min-width: 0; }

/* Navigation */
.nav-wrap { position: sticky; top: 0; z-index: 20; background: rgba(248,247,251,.95); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.nav { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 14px; font-weight: 800; white-space: nowrap; }
.brand-mark { background: var(--ink); color: white; border-radius: 9px; padding: 8px; font-size: 11px; }
.links { display: flex; align-items: center; gap: 20px; }
.links a { padding-block: 12px; color: var(--muted); font-size: 12px; font-weight: 600; text-decoration: none; }
.links a:hover, .repo-link:hover { color: var(--purple); }
.menu { display: none; min-width: 44px; min-height: 44px; border: 0; background: none; color: var(--ink); font-size: 24px; cursor: pointer; }

/* Introduction */
.hero { padding-block: 60px 40px; }
.hero-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); gap: 64px; align-items: center; }
.hero h1 { font-size: clamp(40px,5vw,62px); line-height: 1.07; letter-spacing: -.05em; margin: 0 0 22px; }
.hero h1 span { color: var(--purple); }
.hero .lead { margin: 0; }
.profile { margin: 0; border: 1px solid var(--line); background: white; border-radius: 20px; overflow: hidden; box-shadow: 0 16px 40px rgba(35,22,58,.08); }
.profile img { width: 100%; }
.profile figcaption { padding: 18px 22px; }
.profile strong { display: block; font: 700 23px "Space Grotesk", sans-serif; }
.profile figcaption span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; max-width: 100%; padding: 10px 17px; text-align: center; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 700; transition: background-color .2s, box-shadow .2s; }
.btn.primary { background: var(--purple); border-color: var(--purple); color: white; }
.btn.light { background: white; color: var(--ink); border-color: transparent; }
.btn:hover { box-shadow: 0 4px 14px rgba(50,30,80,.12); }
.metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.metrics > div { padding-right: 20px; }
.metrics > div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.metrics strong { display: block; font: 700 27px "Space Grotesk", sans-serif; }
.metrics span { font-size: 12px; color: var(--muted); }
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; }
.about-grid p { margin: 0; color: var(--muted); }
.chips { display: flex; gap: 7px; flex-wrap: wrap; align-content: flex-start; }
.chips span { font-size: 11px; padding: 6px 10px; border-radius: 7px; background: var(--soft); color: var(--purple); font-weight: 600; max-width: 100%; overflow-wrap: anywhere; }

/* Portfolio: featured cards and compact project collections */
.projects { grid-template-columns: repeat(2,minmax(0,1fr)); }
.portfolio-group { margin-block: 28px 20px; }
.portfolio-heading, .expertise > h3 { margin: 0 0 16px; font-size: 20px; letter-spacing: -.02em; }
.card { min-width: 0; padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.card.featured { border-color: #d0bbea; background: linear-gradient(125deg,white,#f1eafa); }
.card h3, .card h4 { font-size: 23px; margin: 10px 0; letter-spacing: -.02em; }
.card p { color: var(--muted); font-size: 14px; }
.card p:last-child { margin-bottom: 0; }
.tag, .book-type { color: var(--purple); font-size: 9px; font-weight: 800; letter-spacing: .1em; line-height: 1.6; }
.stack { display: block; max-width: 100%; color: var(--purple); font-size: 11px; font-weight: 600; margin-top: 16px; overflow-wrap: anywhere; }
.project-actions { margin-top: 14px; }
.repo-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--purple); font-size: 12px; font-weight: 700; text-decoration: none; }
.project-collection { background: white; border: 1px solid var(--line); border-radius: 14px; margin-top: 12px; overflow: clip; scroll-margin-top: 88px; }
.project-collection > summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; list-style: none; }
summary { cursor: pointer; }
.project-collection > summary::-webkit-details-marker { display: none; }
.project-collection summary strong { display: block; font: 700 19px "Space Grotesk", sans-serif; }
.project-collection summary small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.disclosure-icon { flex-shrink: 0; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--soft); color: var(--purple); font-size: 22px; }
.project-collection[open] .disclosure-icon { transform: rotate(45deg); }
.project-collection > summary:hover { background: #faf8fd; }
.portfolio-projects { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 0 24px 24px; gap: 0 24px; }
.portfolio-projects .card { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 20px 0; }
.portfolio-projects .card h4 { font-size: 18px; }
.portfolio-projects .card p { font-size: 13px; }
.expertise { margin-top: 30px; }
.expertise-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; }
.expertise-grid article { padding: 20px 0 0; border-top: 2px solid var(--line); }
.expertise-number { color: var(--purple); font-size: 11px; font-weight: 800; }
.expertise-grid h4 { margin: 10px 0; font-size: 18px; }
.expertise-grid p { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.expertise-grid small { display: block; color: var(--purple); font-size: 11px; }

/* Experience */
.timeline { border-left: 1px solid #d7c9e9; margin-left: 5px; }
.role { display: grid; grid-template-columns: 160px minmax(0,1fr); gap: 30px; position: relative; padding: 0 0 28px 24px; }
.role:last-child { padding-bottom: 0; }
.role::before { content: ''; width: 9px; height: 9px; position: absolute; top: 7px; left: -5px; border-radius: 50%; background: var(--purple); box-shadow: 0 0 0 4px var(--bg); }
.date { color: var(--muted); font-size: 12px; font-weight: 600; }
.role h3 { margin: 0 0 6px; font-size: 17px; line-height: 1.4; }
.role-company { margin: 0; color: var(--muted); font-size: 13px; }
.role-disclosure > summary { color: var(--purple); font-size: 12px; font-weight: 600; padding-block: 12px; min-height: 44px; }
.role-details { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.role-details li + li { margin-top: 8px; }

/* Education and credentials */
.education-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.education-grid h3 { font-size: 21px; }
.education-courses { grid-column: 1/-1; }
.education-subjects { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 24px; list-style: none; padding: 0; margin: 14px 0 0; color: var(--muted); font-size: 12px; }
.cert-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.cert { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.cert b { display: block; color: var(--purple); font-size: 10px; font-weight: 600; }
.cert h3 { font-size: 15px; line-height: 1.45; margin: 8px 0 0; }
.cert-learning { margin-top: 28px; }
.cert-learning-title { margin: 0 0 14px; font-size: 18px; }
.learning-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; align-items: start; }
.learning-group { background: white; border: 1px solid var(--line); border-radius: 12px; }
.learning-group:last-child { grid-column: 1/-1; }
.learning-group > summary { padding: 15px 18px; font-size: 13px; font-weight: 600; }
.learning-list { list-style: none; padding: 0 18px 18px; margin: 0; }
.learning-list li { padding-top: 12px; border-top: 1px solid var(--line); }
.learning-list li + li { margin-top: 12px; }
.learning-list strong { display: block; font-size: 12px; font-weight: 600; }
.learning-list span { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }

/* Each publication has a full-width row with its cover beside the explanation. */
.book-grid { grid-template-columns: minmax(0,1fr); gap: 28px; }
.book { display: grid; grid-template-columns: minmax(0,.85fr) minmax(0,1.15fr); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: white; scroll-margin-top: 88px; box-shadow: 0 8px 28px rgba(35,22,58,.05); }
.mas-cover, .series-cover { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 390px; padding: 32px; background: radial-gradient(ellipse at 50% 35%, #fff 0%, #f0eaf8 75%); }
.mas-cover { border-right: 1px solid var(--line); }
.mas-cover img { width: 100%; height: auto; max-height: 340px; object-fit: contain; border-radius: 6px; box-shadow: 0 14px 28px rgba(35,22,58,.2); }
.series-cover { background: linear-gradient(145deg,#f7f5fa,#e9e3f0); }
.series-cover img { width: 100%; height: auto; max-height: 340px; object-fit: contain; border-radius: 6px; box-shadow: 0 12px 28px rgba(35,22,58,.12); }
.mas-content, .series-content { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; justify-content: center; padding: 36px 40px; }
.book h3 { font-size: clamp(25px,2.7vw,32px); line-height: 1.16; letter-spacing: -.035em; margin: 12px 0 16px; }
.book p { color: var(--muted); font-size: 14px; line-height: 1.75; margin-bottom: 18px; }
.book p.book-author { font-size: 11px; font-weight: 600; margin-bottom: 18px; letter-spacing: .02em; }
.book-topics { display: flex; flex-wrap: wrap; gap: 7px; list-style: none; margin: 0 0 24px; padding: 0; }
.book-topics li { padding: 5px 9px; border-radius: 6px; background: var(--soft); color: var(--purple); font-size: 10px; font-weight: 600; }
.book .btn { margin-top: 0; padding-inline: 20px; }
.book.ink { background: linear-gradient(135deg,#21182f,#30203f); color: white; border-color: #30203f; }
.book.ink .book-type { color: #d7b9ff; }
.book.ink p { color: #d1c8df; }
.book.ink .book-topics li { background: rgba(215,185,255,.1); color: #e4d2ff; }
.book-no { font-size: 10px; letter-spacing: .12em; color: #e4d2ff; font-weight: 700; margin-bottom: 12px; padding: 5px 9px; border: 1px solid rgba(215,185,255,.25); border-radius: 6px; }
.media { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding-block: 32px; }
.media h2 { font-size: 25px; margin-bottom: 10px; }
.media p { color: var(--muted); font-size: 13px; margin: 0; max-width: 620px; }
.media .btn { flex-shrink: 0; }
.contact { padding-bottom: 64px; }
.contact p { color: var(--muted); max-width: 660px; }
footer { padding-block: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }

/* Responsive layouts */
@media (max-width: 1000px) {
  .hero-grid { gap: 36px; }
  .links { gap: 12px; }
  .links a { font-size: 11px; }
}
@media (max-width: 800px) {
  .container { width: calc(100% - 40px); }
  .menu { display: block; }
  .links { display: none; position: absolute; inset: 72px 0 auto; background: var(--bg); padding: 14px 20px; border-bottom: 1px solid var(--line); box-shadow: 0 12px 22px rgba(35,22,58,.08); max-height: calc(100dvh - 72px); overflow-y: auto; }
  .links.open { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .links a { display: flex; align-items: center; min-height: 44px; padding: 10px; font-size: 14px; }
  .hero { padding-block: 40px 32px; }
  .hero-grid { grid-template-columns: minmax(0,1fr); gap: 28px; }
  .hero h1 { font-size: clamp(38px,7.5vw,56px); max-width: 620px; }
  .profile { width: min(100%,360px); justify-self: center; }
  .section { padding-block: 40px; }
  .about-grid { grid-template-columns: minmax(0,1fr); gap: 22px; }
  .expertise-grid { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .cert-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .role { grid-template-columns: minmax(0,1fr); gap: 8px; padding-left: 20px; }
  .book { grid-template-columns: minmax(0,1fr); }
  .mas-cover, .series-cover { min-height: 0; height: 310px; padding: 24px; }
  .mas-cover { border-right: 0; border-bottom: 1px solid var(--line); }
  .mas-cover img { width: auto; max-height: 100%; }
  .series-cover img { width: auto; max-height: 100%; }
  .mas-content, .series-content { padding: 28px; }
  .media { flex-direction: column; align-items: flex-start; gap: 18px; }
}
@media (max-width: 540px) {
  .container { width: calc(100% - 32px); }
  .brand { font-size: 13px; }
  .hero h1 { font-size: clamp(34px,9vw,46px); }
  .hero .lead { font-size: 15px; }
  .eyebrow { letter-spacing: .1em; font-size: 9px; }
  .section h2 { font-size: 30px; margin-bottom: 22px; }
  .actions .btn { flex: 1 1 calc(50% - 10px); padding-inline: 10px; }
  .hero .actions .btn:first-child, .contact .actions .btn:last-child { flex-basis: 100%; }
  .metrics { gap: 12px; margin-top: 28px; }
  .metrics > div { padding: 0; }
  .metrics > div + div { padding-left: 12px; }
  .metrics strong { font-size: 23px; }
  .metrics span { display: block; font-size: 10px; }
  .projects, .portfolio-projects, .education-grid, .education-subjects, .cert-grid, .learning-grid { grid-template-columns: minmax(0,1fr); }
  .card { padding: 20px; }
  .project-collection > summary { padding: 18px; gap: 12px; }
  .project-collection summary strong { font-size: 17px; }
  .portfolio-projects { padding: 0 18px 18px; }
  .education-courses, .learning-group:last-child { grid-column: auto; }
  .mas-content, .series-content { padding: 24px; }
  .book h3 { font-size: 25px; }
  .book .btn { width: 100%; }
  .mas-cover, .series-cover { height: 280px; padding: 20px; }
  .profile strong { font-size: 21px; }
  .contact { padding-bottom: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
