/* inter-latin-ext-wght-normal */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* inter-latin-wght-normal */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* space-grotesk-latin-ext-wght-normal */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url(/fonts/space-grotesk-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* space-grotesk-latin-wght-normal */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url(/fonts/space-grotesk-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* The interface palette stays blue in both themes. Document images keep their original colours. */
:root {
  --bg: #f0f6fc;
  --surface: #f8fbff;
  --surface-2: #e2eef9;
  --surface-raised: #ffffff;
  --text: #123456;
  --muted: #3b6083;
  --accent: #0755a8;
  --accent-strong: #054789;
  --accent-soft: #c4e5fb;
  --cyan: #007b9a;
  --line: rgba(30, 88, 142, .2);
  --line-strong: rgba(18, 91, 153, .42);
  --grid: rgba(45, 107, 159, .052);
  --glow: rgba(31, 153, 221, .11);
  --button-bg: #cce8fc;
  --button-hover: #b8ddfa;
  --button-text: #123456;
  --shadow: 0 20px 64px rgba(20, 67, 111, .09);
  --shadow-hover: 0 24px 58px rgba(20, 82, 139, .15);
  --radius: 22px;
  --content: min(1320px, calc(100% - 80px));
  --header-height: 84px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #06111f;
  --surface: #0b1b2e;
  --surface-2: #10263d;
  --surface-raised: #112a44;
  --text: #d0eaff;
  --muted: #a6c8e8;
  --accent: #79d8ff;
  --accent-strong: #b4eaff;
  --accent-soft: #153e58;
  --cyan: #7be5f4;
  --line: rgba(119, 184, 233, .2);
  --line-strong: rgba(112, 202, 255, .46);
  --grid: rgba(108, 170, 226, .042);
  --glow: rgba(38, 159, 255, .1);
  --button-bg: #123956;
  --button-hover: #174969;
  --button-text: #c3edff;
  --shadow: 0 24px 74px rgba(0, 6, 18, .34);
  --shadow-hover: 0 28px 64px rgba(0, 6, 18, .46), 0 0 38px rgba(54, 164, 255, .08);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
:root:not([data-theme]) {
  --bg: #06111f;
  --surface: #0b1b2e;
  --surface-2: #10263d;
  --surface-raised: #112a44;
  --text: #d0eaff;
  --muted: #a6c8e8;
  --accent: #79d8ff;
  --accent-strong: #b4eaff;
  --accent-soft: #153e58;
  --cyan: #7be5f4;
  --line: rgba(119, 184, 233, .2);
  --line-strong: rgba(112, 202, 255, .46);
  --grid: rgba(108, 170, 226, .042);
  --glow: rgba(38, 159, 255, .1);
  --button-bg: #123956;
  --button-hover: #174969;
  --button-text: #c3edff;
  --shadow: 0 24px 74px rgba(0, 6, 18, .34);
  --shadow-hover: 0 28px 64px rgba(0, 6, 18, .46), 0 0 38px rgba(54, 164, 255, .08);
  color-scheme: dark;
}
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 22px); }
body {
  margin: 0;
  min-width: 280px;
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(ellipse at 80% 4%, var(--glow), transparent 32%), linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: auto, 64px 64px, 64px 64px;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
}
body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
svg { flex-shrink: 0; }
button, input, textarea, select { font: inherit; color: var(--text); }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .7; }
button, a, input, textarea { touch-action: manipulation; }
button, .button, .text-link { -webkit-appearance: none; appearance: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 5px;
}
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); color: var(--text); }
:where(a, button) { transition: color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
:where(main, .hero-inner, .about-copy, .contact-grid, .skills, .card-grid, .list-grid, .cert-grid) > * { min-width: 0; }

.skip-link { position: fixed; left: 16px; top: -90px; z-index: 1000; background: var(--surface); color: var(--text); padding: 12px 18px; border: 1px solid var(--accent); border-radius: 10px; }
.skip-link:focus { top: 16px; }
.container { width: var(--content); margin-inline: auto; }
.section { padding: 104px 0; scroll-margin-top: calc(var(--header-height) + 20px); }
.section-sm { padding: 44px 0 84px; }
.eyebrow { display: flex; align-items: center; gap: 10px; font-size: .73rem; font-weight: 600; text-transform: uppercase; letter-spacing: .17em; color: var(--accent); margin: 0 0 20px; }
.eyebrow::before { content: ''; width: 22px; height: 1px; background: var(--accent); }
.display, h1, h2, h3 { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 600; letter-spacing: -.045em; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { overflow-wrap: anywhere; text-wrap: balance; }
h2 { font-size: clamp(2.2rem, 4.3vw, 4rem); line-height: 1.12; margin-bottom: 24px; }
.lede { font-size: clamp(1.02rem, 1.45vw, 1.18rem); line-height: 1.8; color: var(--muted); max-width: 740px; }
.reading-progress { position: fixed; inset: 0 0 auto; height: 2px; z-index: 110; transform-origin: left; transform: scaleX(var(--scroll-progress, 0)); background: linear-gradient(90deg, var(--accent), var(--cyan)); pointer-events: none; }

/* Navigation */
.nav-wrap { position: sticky; top: 0; z-index: 60; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); border-bottom: 1px solid var(--line); }
.nav { width: var(--content); margin: 0 auto; min-height: var(--header-height); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 600; font-size: .98rem; letter-spacing: -.035em; white-space: nowrap; justify-self: start; min-height: 44px; }
.brand img { width: 35px; height: 35px; object-fit: contain; border-radius: 9px; background: #f1f6fc; box-shadow: 0 0 0 1px var(--line); }
.nav-links { display: flex; align-items: center; justify-content: center; gap: 24px; font-size: .8rem; font-weight: 500; justify-self: center; }
.nav-links a { position: relative; min-height: 44px; display: inline-flex; align-items: center; color: var(--muted); white-space: nowrap; }
.nav-links a::after { content: ''; position: absolute; height: 2px; left: 0; right: 0; bottom: 3px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .2s ease; }
.nav-links a:hover, .nav-links a[aria-current='page'] { color: var(--accent); }
.nav-links a:hover::after, .nav-links a[aria-current='page']::after { transform: scaleX(1); }
.nav-actions { display: flex; align-items: center; gap: 8px; justify-self: end; }
.icon-btn, .lang-btn { min-width: 44px; height: 44px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--text); border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 600; }
.icon-btn[data-theme-toggle] { font-size: 1.18rem; }
.icon-btn:hover, .lang-btn:hover { border-color: var(--line-strong); background: var(--surface-2); transform: translateY(-2px); }
.cv-btn { min-height: 44px; display: inline-flex; align-items: center; padding: 0 15px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--button-bg); color: var(--button-text); font-size: .77rem; font-weight: 600; white-space: nowrap; }
.cv-btn:hover { background: var(--button-hover); border-color: var(--accent); transform: translateY(-2px); }
.lang { position: relative; }
.lang-menu { position: absolute; right: 0; top: calc(100% + 10px); width: 82px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-6px); transition: opacity .2s ease, transform .2s ease; }
.lang.open .lang-menu { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
.lang-menu a { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: 8px; font-size: .8rem; }
.lang-menu a:hover, .lang-menu a[aria-current] { background: var(--surface-2); color: var(--accent); }
.menu-btn { display: none; font-size: 1.2rem; }
.mobile-menu { display: none; }


.icon-btn svg, .mobile-sub button svg { width: 20px; height: 20px; }
.theme-icon { width: 20px; height: 20px; }
.nojs-nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; width: var(--content); margin: 18px auto 0; }
.nojs-nav a { min-height: 44px; display: inline-flex; align-items: center; padding: 8px 13px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: var(--surface); font-size: .8rem; }

/* Homepage: typography fills the canvas over the shared blue grid. */
.hero { min-height: min(820px, calc(100svh - var(--header-height))); display: flex; align-items: center; padding: 72px 0 88px; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; width: min(900px, 100%); height: 650px; left: 50%; top: 0; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse, var(--glow), transparent 67%); pointer-events: none; }
.hero-inner { width: var(--content); margin-inline: auto; position: relative; }
.hero-copy { max-width: 1100px; margin-inline: auto; text-align: center; }
.hero-identity { margin-bottom: 21px; }
.hero-name { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: 1.35rem; font-weight: 600; letter-spacing: -.035em; color: var(--text); margin-bottom: 7px; line-height: 1.3; }
.hero-role { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--accent); margin: 0; }
.hero-meta { display: grid; gap: 4px; color: var(--muted); font-size: .79rem; line-height: 1.6; margin-bottom: 28px; }
.hero-location { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: .76rem; font-weight: 500; letter-spacing: .02em; margin-bottom: 28px; }
.hero-location > span, .hero-location::before { flex-shrink: 0; }
.hero-location .status-dot, .hero-location > span:first-child:empty { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cyan) 11%, transparent); }
.hero-title { font-size: clamp(3rem, 6.5vw, 6.5rem); font-weight: 600; line-height: 1.065; letter-spacing: -.055em; margin: 0 auto 26px; max-width: 20ch; text-wrap: balance; }
.hero-title .accent, .hero-title .hero-accent { color: var(--accent); }
.hero-bio { font-size: clamp(1rem, 1.3vw, 1.1rem); line-height: 1.85; color: var(--muted); max-width: 660px; margin: 0 auto 30px; }
.hero-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; }
.text-link, .button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: 50px; padding: 13px 20px; border-radius: 12px 4px 12px 4px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-size: .82rem; font-weight: 600; line-height: 1.45; letter-spacing: -.01em; text-align: center; overflow-wrap: anywhere; }
.text-link:hover, .button:hover { border-color: var(--accent); background: var(--surface-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 7%, transparent); transform: translateY(-2px); }
.text-link .link-icon { transition: transform .2s ease; }
.text-link:hover .link-icon { transform: translate(2px, -2px); }
.button.primary, .hero-links .text-link:first-child { background: linear-gradient(125deg, var(--button-bg), var(--surface-2)); color: var(--button-text); border-color: var(--line-strong); box-shadow: inset 0 1px 0 color-mix(in srgb, var(--accent) 12%, transparent); }
.button.primary:hover, .hero-links .text-link:first-child:hover { background: var(--button-hover); border-color: var(--accent); box-shadow: 0 0 28px var(--glow); }
.hero-expertise { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 28px; }
.hero-expertise .tag { background: color-mix(in srgb, var(--surface) 50%, transparent); font-size: .65rem; padding: 5px 10px; }

/* Cards and content sections */
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.section-head h2 { margin-bottom: 0; }
#projects.section, #certifications.section { border-top: 1px solid var(--line); }
#projects.section { background: color-mix(in srgb, var(--surface) 44%, transparent); }
.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.card-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { min-height: 350px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 96%, transparent); border-radius: var(--radius) 7px var(--radius) 7px; padding: 26px; display: flex; flex-direction: column; position: relative; overflow: hidden; isolation: isolate; transition: transform .3s cubic-bezier(.2,.8,.2,1), border-color .3s ease, box-shadow .3s ease; }
.card::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(450px circle at var(--pointer-x, 50%) var(--pointer-y, 0%), color-mix(in srgb, var(--accent) 10%, transparent), transparent 65%); opacity: .65; pointer-events: none; transition: opacity .25s ease; }
.card:hover::before { opacity: 1; }
.card:hover { transform: translateY(-6px); border-color: var(--line-strong); box-shadow: var(--shadow-hover); }
.card-with-media { padding: 0; }
.card-media { aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--surface-2); position: relative; }
.card-media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.card:hover .card-media img { transform: scale(1.035); }
.card-content { display: flex; flex-direction: column; flex: 1; padding: 0; position: relative; }
.card-with-media .card-content { padding: 25px; }
.card-kicker { font: .67rem/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; text-transform: uppercase; letter-spacing: .11em; color: var(--accent); margin-bottom: 18px; }
.card h3 { font-size: clamp(1.45rem, 2vw, 2rem); font-weight: 500; line-height: 1.2; letter-spacing: -.04em; margin: auto 0 18px; }
.card-with-media h3 { margin: 0 0 16px; }
.card p { color: var(--muted); font-size: .84rem; line-height: 1.8; margin-bottom: 0; }
.card-with-media p { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.card-bottom { margin-top: auto; padding-top: 24px; display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; font-size: .65rem; line-height: 1.6; color: var(--muted); background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.arrow { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 36px; height: 36px; border: 1px solid var(--line-strong); border-radius: 10px 3px 10px 3px; color: var(--accent); font-size: 1.3rem; line-height: 1; transition: transform .25s ease, background .25s ease; }
.card:hover .arrow { transform: translate(2px, -2px); background: var(--accent-soft); }
.card-inverse { background: linear-gradient(145deg, var(--surface-2), var(--surface)); border-color: var(--line-strong); }
.card-inverse h3 { font-size: clamp(2.1rem, 3vw, 3rem); max-width: 6ch; }
.card-inverse::after { content: ''; position: absolute; width: 220px; height: 220px; border: 1px solid var(--line); border-radius: 50%; top: -60px; right: -85px; box-shadow: 0 0 0 28px color-mix(in srgb, var(--line) 45%, transparent), 0 0 0 56px color-mix(in srgb, var(--line) 22%, transparent); pointer-events: none; }

.page-hero { padding: 92px 0 36px; position: relative; }
.page-hero::after { content: ''; position: absolute; bottom: 0; left: calc((100% - var(--content)) / 2); width: 62px; height: 2px; background: var(--accent); }
.page-hero h1 { font-size: clamp(2.9rem, 6.5vw, 6.2rem); line-height: 1.09; max-width: 1100px; margin-bottom: 26px; }
.page-hero .lede { max-width: 780px; margin-bottom: 24px; }
.list-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.list-grid-projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.list-grid .card { min-height: 400px; }
.list-grid-projects .card h3 { font-size: clamp(1.65rem, 2.5vw, 2.6rem); }
.list-grid-projects .card-with-media p { -webkit-line-clamp: 5; }

/* Project workspace */
.case-hero { padding: 76px 0 48px; }
.case-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font: .72rem/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; margin-bottom: 26px; }
.case-meta span { border: 1px solid var(--line); padding: 5px 10px; border-radius: 6px; background: var(--surface); }
.case-hero h1 { font-size: clamp(2.7rem, 5.6vw, 5.5rem); line-height: 1.1; max-width: 1100px; margin-bottom: 28px; }
.case-summary { font-size: clamp(1.05rem, 1.6vw, 1.25rem); line-height: 1.8; max-width: 850px; color: var(--muted); }
.case-cover { border: 1px solid var(--line-strong); border-radius: var(--radius) 6px var(--radius) 6px; overflow: hidden; background: var(--surface); aspect-ratio: 16 / 6; margin-block: 0 32px; }
.case-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.action-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.project-source-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; font-size: .8rem; color: var(--muted); }
.project-source-links a:not(.button) { min-height: 44px; display: inline-flex; align-items: center; border-bottom: 1px solid var(--line); gap: 8px; }
.project-source-links a:hover { color: var(--accent); }
.project-source-links .button { min-height: 44px; padding: 10px 14px; background: transparent; color: var(--muted); font-size: .75rem; }
.artifact-tabs { position: sticky; top: calc(var(--header-height) - 1px); z-index: 30; scroll-margin-top: calc(var(--header-height) + 14px); display: flex; flex-wrap: wrap; gap: 6px; width: var(--content); margin: 0 auto; padding: 9px; border: 1px solid var(--line-strong); border-radius: 15px 5px 15px 5px; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(20px); box-shadow: 0 8px 22px color-mix(in srgb, var(--bg) 45%, transparent); }
.artifact-tabs button, .artifact-tabs a { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; border: 1px solid transparent; border-radius: 9px 3px 9px 3px; background: transparent; color: var(--muted); padding: 10px 22px; font-size: .84rem; font-weight: 600; }
.artifact-tabs [aria-selected='true'], .artifact-tabs [aria-current='true'] { color: var(--button-text); border-color: var(--line-strong); background: var(--button-bg); box-shadow: inset 0 1px 0 color-mix(in srgb, var(--accent) 14%, transparent); }
.artifact-tabs button:hover, .artifact-tabs a:hover { color: var(--accent); background: var(--surface-2); }
.project-artifact-section { padding: 48px 0 76px; scroll-margin-top: calc(var(--header-height) + 90px); }
.artifact-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: start; gap: 20px 40px; margin-bottom: 26px; }
.artifact-head h2 { font-size: clamp(2rem, 3.6vw, 3.3rem); margin-bottom: 16px; }
.artifact-head p { max-width: 720px; color: var(--muted); font-size: .95rem; margin-bottom: 0; }
.artifact-head .text-link { flex-shrink: 0; margin-top: 5px; min-height: 44px; padding: 10px 15px; font-size: .76rem; }
.notebook-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; border: 1px solid var(--line-strong); border-bottom: 0; padding: 16px 22px; border-radius: 16px 5px 0 0; color: var(--muted); background: var(--surface-2); font: .69rem/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; }
.notebook-toolbar a { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.notebook-shell { border: 1px solid var(--line-strong); border-radius: 0 0 16px 5px; background: var(--surface); max-height: 80vh; overflow: auto; scrollbar-gutter: stable; overscroll-behavior: contain; box-shadow: var(--shadow); }
.notebook-content { padding: 20px 32px; min-width: 0; }
.nb-cell { padding: 26px 0; min-width: 0; border-bottom: 1px solid var(--line); }
.nb-cell:last-child { border-bottom: 0; }
.nb-markdown { overflow-wrap: anywhere; color: var(--text); font-size: .9rem; }
.nb-markdown h1, .nb-markdown h2, .nb-markdown h3, .nb-markdown h4 { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 600; line-height: 1.35; letter-spacing: -.025em; margin: 20px 0 14px; }
.nb-markdown h1 { font-size: 1.8rem; }
.nb-markdown h2 { font-size: 1.5rem; }
.nb-markdown h3 { font-size: 1.2rem; }
.nb-markdown p { margin-bottom: 14px; }
.nb-markdown a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.nb-markdown code { background: var(--surface-2); color: var(--text); padding: 2px 5px; border-radius: 4px; font-size: .88em; }
.nb-markdown pre, .nb-code, .nb-output pre { color: var(--text); margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); overflow: auto; font: .79rem/1.8 ui-monospace, SFMono-Regular, Consolas, monospace; tab-size: 4; white-space: pre; }
.nb-markdown pre code { background: none; padding: 0; }
.nb-code-label, .nb-output-label { color: var(--accent); font: .7rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; margin: 0 0 10px; }
.nb-output-label { margin-top: 16px; }
.nb-output { margin-top: 14px; overflow: auto; min-width: 0; color: var(--text); }
.nb-output img { max-width: 100%; height: auto; border-radius: 8px; background: #fff; }
.nb-output table, .nb-markdown table { border-collapse: collapse; min-width: 100%; color: var(--text); font-size: .75rem; font-variant-numeric: tabular-nums; }
.nb-output th, .nb-output td, .nb-markdown th, .nb-markdown td { padding: 10px 13px; border: 1px solid var(--line); text-align: left; white-space: nowrap; }
.nb-output th, .nb-markdown th { background: var(--surface-2); font-weight: 600; }
.nb-output tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.nb-output pre { background: transparent; border: 0; padding: 12px 0; }
.nb-code-cell { background: transparent; }
.pdf-frame { margin-top: 28px; height: min(78vh, 960px); min-height: 420px; border: 1px solid var(--line-strong); border-radius: 16px 5px 16px 5px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.pdf-frame iframe { width: 100%; height: 100%; border: 0; }
.project-report-frame { margin-top: 0; }
.empty-pdf { display: grid; place-items: center; height: 100%; color: var(--muted); padding: 40px; text-align: center; }

/* Certifications and about */
.cert-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.cert { border: 1px solid var(--line); border-radius: var(--radius) 6px var(--radius) 6px; min-height: 380px; display: flex; flex-direction: column; background: var(--surface); overflow: hidden; transition: transform .3s cubic-bezier(.2,.8,.2,1), border-color .25s ease, box-shadow .25s ease; }
.cert:hover { transform: translateY(-5px); border-color: var(--line-strong); box-shadow: var(--shadow-hover); }
.cert-media { aspect-ratio: 4 / 3; overflow: hidden; background: #fff; border-bottom: 1px solid var(--line); }
.cert-media img { width: 100%; height: 100%; object-fit: contain; object-position: top center; transition: transform .4s ease; }
.cert:hover .cert-media img { transform: scale(1.025); }
.cert-body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.cert-year { color: var(--accent); font: .69rem/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .02em; }
.cert h3 { font-size: 1.5rem; font-weight: 500; line-height: 1.3; margin: 19px 0 13px; }
.cert p { color: var(--muted); font-size: .84rem; margin: 0; }
.cert .qualification-subtitle { margin: 0 0 10px; color: var(--text); }
.cert-link { margin-top: auto; padding-top: 26px; color: var(--accent); font-size: .75rem; font-weight: 600; }
.about-copy { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(32px, 5vw, 64px); row-gap: 28px; }
.about-copy p { font-size: 1.01rem; line-height: 1.95; color: var(--muted); margin: 0; }
.about-copy p:first-child { grid-column: 1 / -1; color: var(--text); font-size: clamp(1.15rem, 1.7vw, 1.45rem); margin-bottom: 8px; }
.skills { margin-top: 64px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.skill-group { border: 1px solid var(--line); border-radius: 18px 5px 18px 5px; background: var(--surface); padding: 26px; }
.skill-group h3 { color: var(--accent); font: 600 .73rem/1.6 'Inter', sans-serif; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 22px; }
.skill-list { display: flex; flex-wrap: wrap; gap: 9px; }
.skill-list .tag { padding: 6px 10px; font-size: .73rem; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 64px; align-items: start; }
.contact-form-shell { min-height: 540px; border: 1px solid var(--line); border-radius: 22px 6px 22px 6px; background: color-mix(in srgb, var(--surface) 94%, transparent); padding: 30px; box-shadow: var(--shadow); }
.contact-form { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; }
.field label { font-size: .69rem; font-weight: 600; text-transform: uppercase; letter-spacing: .13em; color: var(--muted); }
.field input, .field textarea { width: 100%; min-width: 0; border: 1px solid var(--line-strong); border-radius: 10px 3px 10px 3px; background: var(--bg); color: var(--text); padding: 13px 15px; outline: none; transition: border .2s ease, box-shadow .2s ease; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 1; }
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 11%, transparent); }
.contact-form .button { justify-self: start; min-width: 180px; }
.contact-details { display: grid; gap: 0; border-top: 1px solid var(--line-strong); margin-top: 0; }
.contact-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 22px; padding: 24px 0; border-bottom: 1px solid var(--line); font-size: .85rem; overflow-wrap: anywhere; }
.contact-row > * { min-width: 0; }
.contact-row > span:first-child { color: var(--muted); font-size: .76rem; }
.contact-row a:hover { color: var(--accent); }
.contact-row [data-reveal-phone] { min-height: 44px; padding: 8px 10px; font-size: .73rem; color: var(--accent); }
.status { min-height: 24px; margin: 0; color: var(--muted); font-size: .84rem; }
.contact-success { min-height: 480px; display: flex; flex-direction: column; justify-content: center; opacity: 0; transform: translateY(12px); transition: opacity .45s ease, transform .45s ease; outline: none; scroll-margin-top: calc(var(--header-height) + 25px); }
.contact-success.show { opacity: 1; transform: none; }
.contact-success h2 { font-size: clamp(2.8rem, 4.5vw, 4.5rem); margin-bottom: 24px; }
.contact-success p { max-width: 560px; color: var(--muted); font-size: 1.05rem; }
.contact-cta { position: relative; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 72px 0; background: radial-gradient(ellipse at 85% 50%, var(--glow), transparent 60%), var(--surface); }
.contact-cta-inner { display: flex; justify-content: space-between; align-items: center; gap: 40px; }
.contact-cta h2 { margin: 0 0 16px; }
.contact-cta .lede { margin: 0; max-width: 650px; font-size: 1rem; }
.contact-cta .button { flex-shrink: 0; min-width: 154px; }

.footer { padding: 32px 0 38px; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; align-items: center; font-size: .73rem; color: var(--muted); }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
.footer-links a:hover { color: var(--accent); }
.back-to-top { position: fixed; right: max(24px, calc((100vw - 1420px) / 2)); bottom: 24px; z-index: 40; display: inline-flex; justify-content: center; align-items: center; width: 48px; height: 48px; background: var(--surface-2); color: var(--accent); border: 1px solid var(--line-strong); border-radius: 13px 4px 13px 4px; box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(12px); transition: opacity .2s ease, transform .2s ease; }
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: var(--button-bg); border-color: var(--accent); transform: translateY(-3px); }
.reveal { opacity: 1; transform: none; }
.reveal-pending { opacity: 0; transform: translateY(20px); transition: opacity .65s ease, transform .65s cubic-bezier(.2,.8,.2,1); }
.reveal.visible { opacity: 1; transform: none; }

/* Wide screens keep text and navigation comfortably readable. */
@media (min-width: 1600px) {
  .hero { padding-block: 88px 104px; }
}
@media (max-width: 1200px) {
  :root { --content: calc(100% - 56px); }
  .nav { gap: 20px; }
  .nav-links { gap: 17px; font-size: .76rem; }
  .nav-actions .cv-btn { display: none; }
  .hero-meta { font-size: .73rem; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card-with-media .card-content { padding: 22px; }
  .contact-grid { gap: 42px; }
}
@media (max-width: 1080px) {
  .nav { grid-template-columns: 1fr auto; }
  .nav-links { display: none; }
  .menu-btn { display: inline-flex; }
  .nav-actions .cv-btn { display: inline-flex; }
  .nav-actions .lang { display: none; }
  .mobile-menu { position: fixed; inset: var(--header-height) 0 0; background: var(--bg); background-image: radial-gradient(ellipse at 100% 0, var(--glow), transparent 65%); padding: 28px max(28px, calc((100vw - 800px) / 2)) 50px; z-index: 55; overflow: auto; overscroll-behavior: contain; }
  .mobile-menu.open { display: block; }
  .mobile-menu > a { display: flex; align-items: center; font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: clamp(1.7rem, 4vw, 2.8rem); font-weight: 500; letter-spacing: -.045em; line-height: 1.25; min-height: 64px; padding: 13px 0; border-bottom: 1px solid var(--line); }
  .mobile-menu > a:hover, .mobile-menu > a[aria-current='page'] { color: var(--accent); }
  .mobile-sub { margin-top: 28px; padding-top: 10px; display: flex; flex-wrap: wrap; gap: 10px; }
  .mobile-sub a, .mobile-sub button { display: inline-flex; justify-content: center; align-items: center; font-family: 'Inter', sans-serif; font-size: .8rem; min-height: 46px; padding: 11px 15px; border: 1px solid var(--line-strong); border-radius: 10px 3px 10px 3px; background: var(--surface); color: var(--text); }
  .hero { min-height: auto; padding-block: 64px 80px; }
  .hero-bio { font-size: .94rem; }
  .hero-links { gap: 10px; }
  .hero-links .text-link { padding: 12px 14px; font-size: .74rem; }
  .card-grid-3, .cert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid-3 .card-inverse { min-height: 210px; grid-column: 1 / -1; }
  .card-grid-3 .card-inverse h3 { max-width: none; }
  .about-copy p { font-size: .93rem; }
  .skills { gap: 16px; }
  .skill-group { padding: 20px; }
  .contact-grid { gap: 30px; grid-template-columns: 1.1fr .9fr; }
  .contact-form-shell { padding: 24px; }
}
@media (max-width: 760px) {
  :root { --content: calc(100% - 40px); --header-height: 72px; --radius: 18px; }
  body { background-size: auto, 48px 48px, 48px 48px; }
  .nav { gap: 12px; }
  .brand { font-size: .95rem; gap: 9px; }
  .brand img { width: 32px; height: 32px; }
  .nav-actions { gap: 7px; }
  .nav-actions .cv-btn { display: none; }
  .section { padding: 72px 0; }
  .section-sm { padding: 36px 0 64px; }
  .hero { padding: 46px 0 68px; }
  .hero-identity { margin-bottom: 18px; }
  .hero-name { font-size: 1.25rem; margin-bottom: 7px; }
  .hero-role { font-size: .7rem; }
  .hero-meta { margin-bottom: 22px; font-size: .76rem; }
  .hero-location { margin-bottom: 22px; }
  .hero-title { font-size: clamp(2.5rem, 8.8vw, 4.5rem); margin-bottom: 23px; }
  .hero-bio { max-width: 600px; font-size: 1rem; margin-bottom: 26px; }
  .hero-links .text-link { min-height: 50px; padding: 13px 18px; font-size: .8rem; }
  .hero-expertise { margin-top: 24px; }
  .section-head { margin-bottom: 28px; align-items: start; flex-direction: column; }
  .card-grid, .card-grid-3, .list-grid, .list-grid-projects, .cert-grid, .skills { grid-template-columns: 1fr; gap: 20px; }
  .card-grid-3 .card-inverse { grid-column: auto; }
  .card-grid .card-inverse { min-height: 210px; }
  .card, .list-grid .card { min-height: 320px; }
  .card h3 { font-size: 1.9rem; }
  .card-with-media .card-content { padding: 24px; }
  .card p { font-size: .89rem; }
  .card-inverse h3 { font-size: 2.5rem; }
  .list-grid-projects .card h3 { font-size: clamp(1.8rem, 6vw, 2.5rem); }
  .card-with-media p { -webkit-line-clamp: 5; }
  .page-hero { padding: 58px 0 25px; }
  .page-hero h1 { font-size: clamp(2.6rem, 8.5vw, 4rem); }
  .page-hero .lede { font-size: 1rem; }
  .case-hero { padding: 50px 0 32px; }
  .case-meta { font-size: .65rem; margin-bottom: 24px; }
  .case-hero h1 { font-size: clamp(2.45rem, 8.1vw, 4rem); }
  .case-cover { aspect-ratio: 16 / 9; margin-bottom: 24px; }
  .case-summary { font-size: 1rem; }
  .action-row { margin-top: 24px; }
  .action-row .button { flex-grow: 1; }
  .artifact-tabs { top: calc(var(--header-height) - 1px); padding: 7px; gap: 5px; }
  .artifact-tabs button, .artifact-tabs a { flex: 1; min-width: 0; padding: 11px 12px; font-size: .78rem; }
  .project-artifact-section { padding: 34px 0 54px; scroll-margin-top: calc(var(--header-height) + 85px); }
  .artifact-head { gap: 17px; }
  .artifact-head p { font-size: .89rem; }
  .artifact-head .text-link { margin-top: 0; }
  .notebook-content { padding: 14px 18px; }
  .notebook-toolbar { padding: 15px 18px; font-size: .65rem; }
  .nb-cell { padding: 22px 0; }
  .nb-markdown { font-size: .85rem; }
  .nb-markdown pre, .nb-code, .nb-output pre { font-size: .73rem; padding: 14px; }
  .nb-output pre { padding: 10px 0; }
  .pdf-frame { min-height: 420px; height: 70vh; }
  .contact-grid { grid-template-columns: 1fr; gap: 34px; }
  .about-copy { grid-template-columns: 1fr; gap: 22px; }
  .about-copy p { font-size: 1rem; }
  .about-copy p:first-child { font-size: 1.08rem; }
  .skills { margin-top: 36px; }
  .skill-group { padding: 24px; }
  .cert h3 { font-size: 1.6rem; }
  .contact-form-shell { min-height: 0; padding: 24px; }
  .contact-success { min-height: 400px; }
  .contact-details { margin-top: 4px; }
  .contact-cta { padding: 56px 0; }
  .contact-cta-inner { align-items: start; flex-direction: column; gap: 24px; }
  .footer { padding: 24px 0 28px; }
  .footer-inner { align-items: start; flex-direction: column; gap: 12px; }
  .footer-links { gap: 8px 24px; }
  .back-to-top { right: 18px; bottom: 18px; width: 44px; height: 44px; }
}
@media (max-width: 380px) {
  :root { --content: calc(100% - 32px); }
  .brand { font-size: .84rem; gap: 7px; }
  .brand img { width: 29px; height: 29px; }
  .nav-actions { gap: 5px; }
  .icon-btn { min-width: 42px; width: 42px; }
  .hero-title { font-size: 2.5rem; }
  .hero-links { flex-direction: column; align-items: stretch; }
  .hero-links .text-link { justify-content: space-between; }
  .card-with-media .card-content, .cert-body, .contact-form-shell { padding: 20px; }
  .contact-row { font-size: .8rem; }
  .notebook-content { padding-inline: 12px; }
  .notebook-toolbar { padding-inline: 12px; }
  .nb-markdown h1 { font-size: 1.55rem; }
  .artifact-tabs button, .artifact-tabs a { font-size: .72rem; padding-inline: 8px; }
}
@media (hover: none) {
  .card:hover, .cert:hover, .button:hover, .text-link:hover, .icon-btn:hover, .lang-btn:hover, .cv-btn:hover { transform: none; }
  .card:hover .card-media img, .cert:hover .cert-media img { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .reveal, .reveal-pending { opacity: 1; transform: none; }
}
@media print {
  body { background: none; }
  .nav-wrap, .mobile-menu, .back-to-top, .reading-progress { display: none !important; }
  .container, .hero-inner { width: 100%; }
  .hero { min-height: 0; }
  .section { padding: 30px 0; }
  .card, .cert, .contact-form-shell { break-inside: avoid; box-shadow: none; }
  .notebook-shell { max-height: none; overflow: visible; }
  .reveal-pending { opacity: 1; transform: none; }
}
