/* Shared design tokens. Bootstrap's color mode stays in sync with these. */
:root,
[data-bs-theme="light"] {
  --ink: #15233a;
  --muted: #52637a;
  --paper: #f4f7fb;
  --surface: #ffffff;
  --surface-alt: #eaf0f7;
  --line: #d4dfec;
  --blue: #285bd4;
  --blue-soft: #eaf0ff;
  --orange: #ae4d00;
  --hero: #edf3fb;
  --hero-text: #15233a;
  --hero-muted: #52637a;
  --nav-bg: rgba(244,247,251,.96);
  --nav-link: #52637a;
  --terminal: #162741;
  --terminal-border: #355070;
  --terminal-text: #d5e2f6;
  --terminal-muted: #a3b6d1;
  --shadow: 0 22px 54px rgba(19,42,76,.12);
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--paper);
  --bs-border-color: var(--line);
}
[data-bs-theme="dark"] {
  --ink: #edf3fc;
  --muted: #b0bed2;
  --paper: #101b2d;
  --surface: #17263c;
  --surface-alt: #132136;
  --line: #31445f;
  --blue: #9abaff;
  --blue-soft: #213956;
  --orange: #ffb47a;
  --hero: #0d1728;
  --hero-text: #edf3fc;
  --hero-muted: #b0bed2;
  --nav-bg: rgba(13,23,40,.96);
  --nav-link: #b0bed2;
  --terminal: #182b46;
  --terminal-border: #375270;
  --terminal-text: #e2ecfb;
  --terminal-muted: #a3b6d1;
  --shadow: 0 22px 54px rgba(0,0,0,.22);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 112px; }
body { font-family: 'Manrope',system-ui,sans-serif; color: var(--ink); background: var(--paper); margin: 0; }
h1,h2,h3,p { margin-top: 0; }
h1,h2 { font-weight: 800; letter-spacing: -.055em; line-height: 1.07; }
h1 { font-size: clamp(3rem,5.5vw,5.3rem); margin-bottom: 25px; }
h1 em,h2 em { font-style: normal; color: var(--orange); }
h2 { font-size: clamp(2.4rem,4.5vw,4rem); margin: 14px 0 0; }
h2 span { color: var(--blue); }
h3 { font-weight: 700; letter-spacing: -.035em; }
a { text-underline-offset: 4px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 5px; border-radius: 3px; }
.container { position: relative; }
.skip-link { position: fixed; top: -80px; left: 20px; padding: 12px 20px; background: var(--surface); color: var(--ink); z-index: 1100; }
.skip-link:focus { top: 12px; }
.site-nav { background: var(--nav-bg); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); padding: 17px 0; z-index: 1030; }
.brand-mark { color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -.035em; display: inline-flex; align-items: center; gap: 10px; font-size: 17px; white-space: nowrap; }
.brand-mark:hover { color: var(--blue); }
.brand-mark>span { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #ffb47a; color: #101b2d; font: 500 12px 'DM Mono',monospace; }
.navbar-nav { gap: 18px; }
.site-nav .nav-link { color: var(--nav-link); font-size: 12px; font-weight: 700; padding: 10px 0; }
.site-nav .nav-link:hover,.site-nav .nav-link.active { color: var(--blue); }
.nav-link.active { text-decoration: underline; text-underline-offset: 6px; }
.nav-tools { display: flex; align-items: center; gap: 10px; margin-left: 26px; }
.navbar-toggler { border: 1px solid var(--line); color: var(--ink); font-size: 23px; padding: 2px 9px; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--surface); font: 600 11px 'Manrope',sans-serif; white-space: nowrap; }
.theme-toggle:hover { border-color: var(--blue); }
.theme-toggle svg { width: 18px; height: 18px; flex: 0 0 18px; }
.theme-sun { display: none; }
[data-bs-theme="dark"] .theme-sun { display: block; }
[data-bs-theme="dark"] .theme-moon { display: none; }
.btn { border-radius: 7px; font-weight: 700; font-size: 13px; padding: 12px 18px; }
.btn-lg { padding: 14px 20px; }
.btn-primary { --bs-btn-bg: #285bd4; --bs-btn-border-color: #285bd4; --bs-btn-hover-bg: #1d48b1; --bs-btn-hover-border-color: #1d48b1; --bs-btn-active-bg: #1d48b1; --bs-btn-active-border-color: #1d48b1; --bs-btn-color: #fff; }
.btn-outline-light { --bs-btn-color: var(--ink); --bs-btn-border-color: var(--line); --bs-btn-hover-color: var(--paper); --bs-btn-hover-bg: var(--ink); --bs-btn-hover-border-color: var(--ink); --bs-btn-active-color: var(--paper); --bs-btn-active-bg: var(--ink); }
.btn-light { --bs-btn-bg: var(--ink); --bs-btn-color: var(--paper); --bs-btn-border-color: var(--ink); --bs-btn-hover-bg: var(--blue); --bs-btn-hover-color: var(--paper); --bs-btn-hover-border-color: var(--blue); }
.text-link { display: inline-flex; align-items: center; gap: 9px; color: var(--blue); font-size: 13px; font-weight: 700; text-decoration: none; }
.text-link:hover { color: var(--ink); text-decoration: underline; }
.eyebrow { font: 500 11px/1.7 'DM Mono',monospace; text-transform: uppercase; letter-spacing: .1em; color: var(--blue); margin: 0; }
.status-dot { display: inline-block; width: 7px; height: 7px; background: #278460; border-radius: 50%; margin-right: 8px; box-shadow: 0 0 0 4px rgba(39,132,96,.1); }
[data-bs-theme="dark"] .status-dot { background: #61d6a4; }
.hero-section,.about-hero { background: var(--hero); color: var(--hero-text); padding: 172px 0 112px; position: relative; }
.hero-section::before { content: ''; position: absolute; width: 400px; height: 400px; border: 1px solid var(--line); border-radius: 50%; right: 3%; top: 100px; pointer-events: none; opacity: .5; }
.hero-copy { max-width: 560px; font-size: 17px; line-height: 1.85; color: var(--hero-muted); }
.hero-meta { font: 10px/1.6 'DM Mono',monospace; color: var(--muted); display: flex; align-items: center; gap: 12px; text-transform: uppercase; letter-spacing: .04em; flex-wrap: wrap; }
.meta-line { width: 30px; height: 1px; background: var(--muted); }
.terminal-column { position: relative; padding-bottom: 12px; }
.terminal-card { background: var(--terminal); border: 1px solid var(--terminal-border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; transform: rotate(2deg); position: relative; z-index: 1; }
.terminal-top { height: 42px; border-bottom: 1px solid var(--terminal-border); display: flex; align-items: center; padding: 0 15px; gap: 7px; }
.terminal-dot { width: 8px; height: 8px; border-radius: 50%; }
.red { background: #fa6b65; }.yellow { background: #ffc15c; }.green { background: #58d68d; }
.terminal-label { font: 11px 'DM Mono',monospace; color: var(--terminal-muted); margin-left: 8px; }
.terminal-body { padding: 26px 25px 30px; font: 13px/1.9 'DM Mono',monospace; color: var(--terminal-muted); min-height: 315px; }
.terminal-body p { margin-bottom: 8px; }
.prompt { color: #ffb47a; margin-right: 8px; }
.terminal-value { color: var(--terminal-text); padding-left: 18px; }
.cursor { height: 16px; width: 8px; background: #ffb47a; display: inline-block; vertical-align: middle; animation: blink 1.2s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.floating-note { position: absolute; right: 0; bottom: -10px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 9px; display: flex; align-items: center; gap: 12px; padding: 14px 16px; box-shadow: var(--shadow); z-index: 2; }
.floating-note i { font-size: 24px; color: var(--blue); }
.floating-note strong,.floating-note small { display: block; }
.floating-note strong { font-size: 12px; }.floating-note small { font-size: 10px; color: var(--muted); margin-top: 2px; }
.section-padding { padding: 104px 0; }
.section-intro { max-width: 335px; color: var(--muted); line-height: 1.8; font-size: 14px; margin: 0 0 4px; }
.service-card { background: var(--surface); border: 1px solid var(--line); padding: 29px; height: 100%; min-height: 268px; transition: transform .2s,box-shadow .2s; }
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.icon-wrap { width: 42px; height: 42px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-size: 20px; margin-bottom: 30px; flex-shrink: 0; }
.service-card h3 { font-size: 18px; margin-bottom: 12px; }
.service-card p { font-size: 13px; line-height: 1.8; color: var(--muted); margin-bottom: 0; }
.featured-service { background: #285bd4; border-color: #285bd4; color: #fff; }
.featured-service .icon-wrap { background: rgba(255,255,255,.15); color: #fff; }
.featured-service p { color: #fff; }
.work-section { background: var(--surface-alt); }
.project-list { border-top: 1px solid var(--line); }
.project-row { display: grid; grid-template-columns: 65px 1fr 35px; gap: 20px; padding: 35px 0; border-bottom: 1px solid var(--line); align-items: start; }
.project-number { font: 500 13px 'DM Mono',monospace; color: var(--blue); padding-top: 3px; }
.project-type { font: 500 10px 'DM Mono',monospace; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 11px; }
.project-info h3 { font-size: 25px; margin-bottom: 10px; }
.project-info>p:not(.project-type) { color: var(--muted); font-size: 14px; line-height: 1.8; max-width: 640px; margin-bottom: 15px; }
.tag-list { display: flex; gap: 7px; flex-wrap: wrap; }
.tag-list span { font: 10px/1.5 'DM Mono',monospace; color: var(--muted); border: 1px solid var(--line); padding: 6px 9px; border-radius: 4px; }
.project-arrow { color: var(--blue); font-size: 22px; text-align: right; }
.about-section { background: var(--surface); }
.about-lead { font-size: 23px; line-height: 1.5; letter-spacing: -.035em; margin-bottom: 20px; }
.about-copy { font-size: 14px; line-height: 1.9; color: var(--muted); }
.contact-section { background: var(--hero); padding: 90px 0; }
.contact-card { border: 1px solid var(--line); padding: 48px; background: var(--surface); }
.contact-card h2 { color: var(--ink); font-size: clamp(2.2rem,4vw,3.5rem); margin-bottom: 22px; }
.contact-card p:not(.eyebrow) { color: var(--muted); font-size: 14px; line-height: 1.8; max-width: 520px; margin-bottom: 0; }
.site-footer { background: var(--hero); border-top: 1px solid var(--line); padding: 38px 0; }
.footer-note,.copyright { font-size: 11px; color: var(--muted); margin: 15px 0 0; }
.footer-links { display: flex; justify-content: flex-end; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 11px; }
.footer-links a:hover { color: var(--blue); text-decoration: underline; }
/* Dedicated biography, credentials and education. */
.about-hero.section-padding { padding-top: 130px; }
.about-hero h1 { font-size: clamp(2.8rem,5.3vw,5rem); }
.back-link { display: inline-flex; gap: 9px; color: var(--muted); text-decoration: none; font: 11px 'DM Mono',monospace; margin-bottom: 24px; }
.back-link:hover { color: var(--blue); }
.portrait-card { margin: 0 0 0 16px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); padding: 12px; border-radius: 12px; transform: rotate(1.5deg); }
.portrait-image { width: 100%; height: auto; max-height: 475px; object-fit: cover; object-position: center; display: block; border-radius: 5px; }
.portrait-card figcaption { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 6px 7px; }
.portrait-card strong { display: block; font-size: 14px; }
.portrait-card figcaption span { display: block; font: 10px/1.8 'DM Mono',monospace; color: var(--muted); margin-top: 3px; }
.portrait-card figcaption>i { color: var(--blue); font-size: 24px; }
.about-subnav { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.about-subnav nav { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px 22px; padding: 20px 0; }
.about-subnav a { color: var(--muted); font: 11px/2 'DM Mono',monospace; text-decoration: none; padding: 4px 0; }
.about-subnav a:hover { color: var(--blue); }
.language-note { display: flex; gap: 15px; border-top: 1px solid var(--line); padding-top: 24px; margin-top: 28px; }
.language-note>i { font-size: 25px; color: var(--blue); }
.language-note strong { display: block; font-size: 13px; margin-bottom: 5px; }
.language-note span { font-size: 12px; color: var(--muted); }
.experience-card { border-top: 2px solid var(--blue); padding-top: 22px; height: 100%; }
.experience-index { color: var(--blue); font: 10px 'DM Mono',monospace; text-transform: uppercase; }
.experience-card h3 { font-size: 22px; line-height: 1.3; margin: 22px 0 14px; }
.experience-card p { color: var(--muted); font-size: 13px; line-height: 1.8; margin-bottom: 20px; }
.professional-background { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; border: 1px solid var(--line); padding: 26px 30px; margin-top: 44px; background: var(--surface); }
.professional-background h3 { font-size: 18px; }
.professional-background p { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 0; }
.certificate-card { background: var(--surface); border: 1px solid var(--line); padding: 28px; display: flex; flex-direction: column; height: 100%; min-height: 320px; }
.certificate-top { display: flex; align-items: start; justify-content: space-between; gap: 15px; margin-bottom: 28px; }
.certificate-top .icon-wrap { margin: 0; }
.certificate-label { font: 9px 'DM Mono',monospace; color: var(--muted); border: 1px solid var(--line); padding: 7px 9px; border-radius: 20px; }
.certificate-card h3 { font-size: 23px; margin-bottom: 10px; }
.certificate-issuer { font-size: 13px; color: var(--muted); margin-bottom: 9px; }
.certificate-date { font: 11px/1.8 'DM Mono',monospace; color: var(--muted); }
.credential-id { font: 9px/1.7 'DM Mono',monospace; color: var(--muted); overflow-wrap: anywhere; }
.certificate-card .text-link { font-size: 11px; margin-top: auto; padding-top: 20px; }
.learning-card { padding: 28px; background: var(--blue-soft); min-height: 320px; height: 100%; display: flex; flex-direction: column; }
.learning-card>i { color: var(--blue); font-size: 32px; margin-bottom: 27px; }
.learning-card h3 { font-size: 26px; line-height: 1.3; }
.learning-card p { font-size: 13px; line-height: 1.8; color: var(--muted); }
.learning-card .text-link { margin-top: auto; font-size: 11px; padding-top: 15px; }
.education-entry { border-top: 1px solid var(--line); padding: 24px 0 18px; }
.education-entry h3 { font-size: 22px; }
.education-entry p:not(.project-type) { color: var(--muted); font-size: 13px; line-height: 1.8; }
/* Legal pages share the same navigation and theme control. */
.legal-page { padding: 150px 0 100px; min-height: 75vh; }
.legal-page h1 { font-size: clamp(3.1rem,6vw,5.6rem); margin-top: 15px; margin-bottom: 25px; }
.legal-page .lead { font-size: 17px; color: var(--muted); max-width: 680px; line-height: 1.8; }
.legal-content { max-width: 780px; margin-top: 50px; border-top: 1px solid var(--line); padding-top: 12px; }
.legal-content h2 { font-size: 25px; margin: 36px 0 14px; letter-spacing: -.035em; }
.legal-content p,.legal-content li { color: var(--muted); font-size: 14px; line-height: 1.9; }
.legal-content a { color: var(--blue); }
@media (max-width: 1199px) {
  .navbar-nav { gap: 14px; }.nav-tools { margin-left: 18px; }
  .hero-section h1 { font-size: 4.2rem; }
}
@media (max-width: 991px) {
  .hero-section,.about-hero { padding: 136px 0 80px; }
  .hero-section h1 { font-size: clamp(3rem,7vw,4.6rem); }
  .navbar-collapse { padding-top: 17px; }.navbar-nav { gap: 0; }
  .site-nav .nav-link { padding: 12px 0; font-size: 14px; }
  .nav-tools { margin-left: auto; }
  .terminal-column { max-width: 600px; margin: 24px auto 0; }
  .terminal-card { transform: none; }
  .floating-note { right: 0; bottom: -16px; }
  .section-padding { padding: 80px 0; }
  .contact-card { padding: 35px; }
  .footer-links { justify-content: flex-start; }
  .portrait-card { max-width: 460px; margin: 12px auto 0; transform: none; }
  .portrait-image { max-height: 480px; }
  .about-hero.section-padding { padding-top: 122px; }
  .experience-card h3 { font-size: 20px; }
}
@media (max-width: 575px) {
  .site-nav { padding: 13px 0; }.brand-mark { font-size: 15px; gap: 7px; }
  .brand-mark>span { width: 30px; height: 30px; font-size: 11px; }
  .theme-toggle { width: 40px; height: 40px; padding: 9px; }.theme-toggle>span { display: none; }
  .nav-tools { gap: 7px; }.navbar-toggler { min-height: 40px; }
  h1,.hero-section h1,.about-hero h1 { font-size: clamp(2.7rem,9.4vw,3.5rem); letter-spacing: -.05em; }
  h2 { font-size: 2.65rem; }.eyebrow { font-size: 10px; }
  .hero-copy { font-size: 15px; }.hero-meta { font-size: 9px; }
  .hero-section { padding-bottom: 85px; }.hero-section::before { display: none; }
  .section-padding { padding: 65px 0; }.section-heading.mb-5 { margin-bottom: 30px!important; }
  .terminal-body { font-size: 11px; padding: 24px 20px; min-height: 290px; }
  .floating-note { right: 12px; }.service-card { min-height: 235px; padding: 25px; }
  .project-row { grid-template-columns: 25px 1fr 20px; gap: 10px; }.project-info h3 { font-size: 20px; }
  .project-info>p:not(.project-type) { font-size: 13px; }.tag-list span { font-size: 9px; }
  .about-lead { font-size: 21px; }.contact-card { padding: 28px 22px; }.contact-card h2 { font-size: 2.3rem; }
  .contact-section { padding: 55px 0; }.contact-card .btn { font-size: 12px; padding: 13px; }
  .about-subnav nav { gap: 9px 18px; justify-content: flex-start; padding: 16px 0; }.about-subnav a { font-size: 10px; }
  .professional-background { padding: 23px; }.certificate-card,.learning-card { min-height: 300px; }
  .legal-page { padding-top: 122px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,*::before,*::after { animation: none!important; transition: none!important; }
}

/* Certificate gallery: preserve complete documents at every screen size. */
.portrait-image { height: clamp(360px, 38vw, 500px); max-height: none; object-fit: cover; object-position: center 22%; }
.certificate-card { padding: 0; overflow: hidden; min-height: 0; }
.certificate-preview, .certificate-placeholder { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 16 / 11; background: #edf0f5; border-bottom: 1px solid var(--line); padding: 16px; overflow: hidden; }
.certificate-preview img { display: block; width: 100%; height: 100%; object-fit: contain; transition: transform .2s ease; }
.certificate-preview:hover img { transform: scale(1.025); }
.certificate-preview:focus-visible { outline-offset: -5px; }
.preview-hint { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); white-space: nowrap; display: flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 4px; background: #14243d; color: #fff; font: 10px/1.4 'DM Mono',monospace; opacity: 0; transition: opacity .2s; }
.certificate-preview:hover .preview-hint,.certificate-preview:focus-visible .preview-hint { opacity: 1; }
.certificate-placeholder { flex-direction: column; gap: 18px; background: var(--blue-soft); color: var(--blue); }
.certificate-placeholder>i { font-size: 42px; }
.certificate-placeholder>span { font: 10px 'DM Mono',monospace; color: var(--muted); }
.certificate-details { padding: 25px; display: flex; flex-direction: column; flex: 1; }
.certificate-category { display: block; margin-bottom: 14px; color: var(--blue); font: 10px 'DM Mono',monospace; text-transform: uppercase; letter-spacing: .05em; }
.certificate-details h3 { font-size: 20px; line-height: 1.4; }
.certificate-summary { color: var(--muted); font-size: 12px; line-height: 1.8; }
.certificate-actions { display: flex; gap: 14px; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 19px; border-top: 1px solid var(--line); }
.certificate-card .certificate-actions .text-link { padding-top: 0; margin-top: 0; font-size: 11px; }
.certificate-download { display: inline-flex; align-items: center; gap: 5px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; color: var(--blue); text-decoration: none; font: 10px 'DM Mono',monospace; flex-shrink: 0; }
.certificate-download:hover { border-color: var(--blue); }
.certificate-modal { --bs-modal-bg: var(--surface); --bs-modal-color: var(--ink); --bs-modal-border-color: var(--line); --bs-modal-header-border-color: var(--line); --bs-modal-footer-border-color: var(--line); }
.certificate-modal .modal-header { align-items: flex-start; padding: 22px 26px; gap: 20px; }
.certificate-modal .modal-title { font-size: 21px; line-height: 1.4; margin: 0; letter-spacing: -.035em; }
.certificate-modal .btn-close { flex-shrink: 0; padding: 12px; margin: -5px -10px 0 0; }
.modal-certificate-meta { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 6px 0 0; }
.certificate-modal .modal-body { background: var(--surface-alt); padding: 24px; text-align: center; }
.certificate-modal-image { display: block; width: auto; max-width: 100%; height: auto; max-height: 68vh; max-height: 68dvh; object-fit: contain; margin: auto; background: white; box-shadow: var(--shadow); }
.certificate-modal [hidden] { display: none !important; }
.certificate-preview-error { color: var(--muted); font-size: 14px; margin: 24px 0; }
.certificate-modal .modal-footer { gap: 8px; padding: 16px 22px; }
.certificate-modal .modal-footer .btn { font-size: 12px; margin: 0; }
@media (max-width: 575px) {
  .portrait-image { height: 440px; }
  .certificate-details { padding: 23px; }
  .certificate-card { min-height: 0; }
  .preview-hint { opacity: 1; }
  .certificate-modal .modal-header { padding: 18px; }
  .certificate-modal .modal-title { font-size: 18px; }
  .certificate-modal .modal-body { padding: 14px; }
  .certificate-modal .modal-footer { padding: 14px; justify-content: flex-start; }
  .certificate-modal .modal-footer .btn { font-size: 11px; padding: 11px; }
}
@media (hover: none) { .preview-hint { opacity: 1; } }
