/* Editorial portfolio — warm paper, deep indigo, and a trace of amber. */
:root {
  color-scheme: light;
  --color-primary: #17385f;
  --color-primary-hover: #234c78;
  --color-primary-soft: #edf2f6;
  --color-accent: #a87618;
  --color-background: #f4f5f3;
  --color-surface: #fdfdfc;
  --color-panel: #eef1f2;
  --color-text: #18232e;
  --color-muted: #566370;
  --color-faint: #7a858f;
  --color-border: #e2e7eb;
  --color-border-soft: #eaedf1;
  --color-tag: #f1f3f3;
  --color-header: rgba(244, 245, 243, 0.88);
  --shadow-card: 0 1px 2px rgba(23, 42, 60, 0.025), 0 12px 36px -16px rgba(23, 42, 60, 0.13);
  --shadow-card-hover: 0 2px 4px rgba(23, 42, 60, 0.035), 0 24px 52px -20px rgba(23, 42, 60, 0.2);
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Consolas, "Liberation Mono", monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --header-height: 76px;
  --content-width: 1160px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --color-primary: #a9c6e2;
    --color-primary-hover: #c6daed;
    --color-primary-soft: #1d2c3b;
    --color-accent: #d0ae69;
    --color-background: #0e141a;
    --color-surface: #151e27;
    --color-panel: #1b2630;
    --color-text: #e7ebee;
    --color-muted: #abb7c2;
    --color-faint: #84939f;
    --color-border: #2b3742;
    --color-border-soft: #222e38;
    --color-tag: #1c2731;
    --color-header: rgba(14, 20, 26, 0.88);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.16), 0 16px 40px -18px rgba(0, 0, 0, 0.48);
    --shadow-card-hover: 0 2px 4px rgba(0, 0, 0, 0.2), 0 26px 56px -20px rgba(0, 0, 0, 0.62);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: clip;
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
}

/* An inline SVG turbulence field gives the page an almost imperceptible print grain. */
body::before {
  position: fixed;
  z-index: 30;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23000' filter='url(%23n)' opacity='.55' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
  content: "";
  opacity: 0.025;
  pointer-events: none;
}

body.menu-open, body.lightbox-open { overflow: hidden; }

h1, h2, h3, p, ul, ol { margin-top: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; font: inherit; }
svg { display: block; flex: 0 0 auto; }
::selection { background: #e6d8b8; color: #17385f; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 5px; }

.container {
  width: min(var(--content-width), calc(100% - 80px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-primary);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

/* Navigation */
.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  height: var(--header-height);
  border-bottom: 1px solid transparent;
  background: transparent;
  transition: background-color 400ms var(--ease-out), border-color 400ms var(--ease-out), box-shadow 400ms var(--ease-out);
}
.site-header.is-scrolled {
  border-bottom-color: var(--color-border-soft);
  background: var(--color-header);
  box-shadow: 0 8px 28px -20px rgba(23, 42, 60, 0.25);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
}
.nav { position: relative; display: flex; align-items: center; justify-content: space-between; height: 100%; }
.brand {
  display: inline-flex;
  flex: 0 0 auto;
  white-space: nowrap;
  align-items: center;
  min-height: 44px;
  color: var(--color-primary);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.nav-links { display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 15px;
  color: var(--color-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 240ms var(--ease-out);
}
.nav-links a::after {
  position: absolute;
  right: 15px;
  bottom: 4px;
  left: 15px;
  height: 1px;
  background: var(--color-accent);
  content: "";
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left;
  transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out);
}
.nav-links a:hover, .nav-links a.is-active, .nav-links a[aria-current="location"] { color: var(--color-primary); }
.nav-links a:hover::after, .nav-links a.is-active::after, .nav-links a[aria-current="location"]::after { opacity: 1; transform: scaleX(1); }
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  cursor: pointer;
}
.menu-toggle[hidden], .menu-toggle .close-icon { display: none; }
.menu-toggle[aria-expanded="true"] .menu-icon { display: none; }
.menu-toggle[aria-expanded="true"] .close-icon { display: block; }

/* Hero */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: clamp(48px, 7vw, 104px);
  min-height: calc(100svh - var(--header-height));
  padding-block: 72px 104px;
}
.hero::before {
  position: absolute;
  z-index: -2;
  top: 4%;
  right: -12%;
  width: 650px;
  height: 650px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(68, 111, 146, 0.12), rgba(68, 111, 146, 0) 69%);
  content: "";
  pointer-events: none;
}
.hero::after {
  position: absolute;
  z-index: -1;
  right: 0;
  bottom: 38px;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--color-border-soft), var(--color-border) 48%, transparent);
  content: "";
}
.hero-content { position: relative; z-index: 1; max-width: 660px; }
.eyebrow, .section-index {
  color: var(--color-faint);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}
.eyebrow { margin-bottom: 24px; }
.hero h1 {
  margin-bottom: 18px;
  color: var(--color-primary);
  font-size: clamp(64px, 6.8vw, 96px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.06;
  animation: hero-title-in 900ms var(--ease-out) both;
}
@keyframes hero-title-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-role {
  margin-bottom: 28px;
  color: var(--color-text);
  font-size: clamp(19px, 2vw, 24px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.5;
}
.hero-intro {
  max-width: 37rem;
  margin-bottom: 34px;
  color: var(--color-muted);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.85;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 34px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 21px;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  transition: background-color 300ms var(--ease-out), border-color 300ms var(--ease-out), color 300ms var(--ease-out), box-shadow 300ms var(--ease-out), transform 300ms var(--ease-out);
}
.button:hover { transform: translateY(-2px); }
.button-primary {
  border-color: #17385f;
  background: linear-gradient(145deg, #244a70, #17385f 70%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 6px 16px -8px rgba(23, 56, 95, 0.5);
  color: #fff;
}
.button-primary:hover {
  border-color: #234c78;
  background: linear-gradient(145deg, #2b537b, #1c416a 70%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 10px 22px -8px rgba(23, 56, 95, 0.48);
}
.button-secondary {
  border-color: var(--color-border);
  background: color-mix(in srgb, var(--color-surface) 74%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  color: var(--color-primary);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.button-secondary:hover { border-color: #b6c3cf; background: var(--color-surface); box-shadow: var(--shadow-card); }
.contact-list { display: flex; flex-wrap: wrap; gap: 12px 26px; color: var(--color-faint); font-size: 13px; font-style: normal; }
.contact-list a, .contact-list .location { display: inline-flex; align-items: center; min-height: 32px; gap: 8px; }
.contact-list a { transition: color 240ms var(--ease-out); }
.contact-list a:hover { color: var(--color-primary); }

/* Section headings are one aligned editorial unit. */
.section {
  position: relative;
  padding-block: 120px;
  border-top: 1px solid var(--color-border-soft);
  scroll-margin-top: calc(var(--header-height) + 20px);
}
.section::after {
  position: absolute;
  top: -1px;
  left: 0;
  width: 72px;
  height: 1px;
  background: var(--color-accent);
  content: "";
  opacity: 0.55;
}
.section-heading { margin-bottom: 52px; }
.section-heading .section-index { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.section-index::before { width: 20px; height: 1px; background: var(--color-accent); content: ""; }
.section-heading h2, .contact-inner h2 {
  margin-bottom: 0;
  color: var(--color-primary);
  font-size: clamp(32px, 3.5vw, 42px);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.18;
}

/* About: a measured editorial column with quiet numbered entries. */
.about-list { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; max-width: 720px; margin: 0; padding: 0; list-style: none; }
.about-list li { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 20px; padding: 26px 0; border-bottom: 1px solid var(--color-border-soft); }
.about-list li:first-child { padding-top: 0; }
.about-list li + li { padding-left: 0; border-left: 0; }
.about-list li:last-child { padding-right: 0; padding-bottom: 0; border-bottom: 0; }
.about-list p { max-width: none; margin: 0; color: var(--color-muted); font-size: 15px; line-height: 1.8; }
.item-number, .project-number, .work-number { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.item-number { padding-top: 5px; color: var(--color-accent); font-size: 12px; }

/* Cards: layered ambient shadows, precise rules, and generous radii. */
.project-list { display: grid; gap: 24px; }
.project-card, .work-card {
  border: 1px solid var(--color-border);
  border-radius: 18px;
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  transition: border-color 450ms var(--ease-out), box-shadow 450ms var(--ease-out), transform 450ms var(--ease-out);
}
.project-card { padding: 38px 40px 36px; }
.project-card:hover, .work-card:hover { border-color: #c4cfd8; box-shadow: var(--shadow-card-hover); transform: translateY(-4px); }
.project-heading { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 18px; margin-bottom: 26px; padding-bottom: 26px; border-bottom: 1px solid var(--color-border-soft); }
.project-number { margin: 6px 0 0; color: var(--color-accent); font-size: 12px; font-weight: 500; }
.project-heading h3 { margin-bottom: 7px; font-size: 20px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.5; }
.project-subtitle { margin-bottom: 0; color: var(--color-faint); font-size: 13px; }
.project-details { max-width: 72em; margin: 0 0 0 60px; padding-left: 1.1em; color: var(--color-muted); font-size: 15px; }
.project-details li { padding-left: 6px; }
.project-details li + li { margin-top: 13px; }
.project-details li::marker { color: #9baab7; }

/* Work */
#works { isolation: isolate; }
#works::before {
  position: absolute;
  z-index: -1;
  inset: 0 calc(50% - 50vw);
  background: linear-gradient(180deg, rgba(234, 237, 239, 0.42), rgba(244, 245, 243, 0));
  content: "";
}
.work-list { display: grid; gap: 26px; }
.work-card { padding: 34px; }
.work-video-card { display: grid; grid-template-columns: 348px minmax(0, 1fr); align-items: center; gap: clamp(32px, 4vw, 48px); }
.work-video-frame {
  width: 100%;
  max-width: 348px;
  margin-block: 0;
  margin-inline: auto;
  padding: 8px;
  border: 1px solid var(--color-border-soft);
  border-radius: 18px;
  background: var(--color-panel);
}
.work-video-frame video { display: block; width: 100%; height: auto; max-height: 510px; border-radius: 11px; aspect-ratio: 9 / 16; background: #101418; object-fit: contain; }
.work-description { padding-left: 34px; border-left: 1px solid var(--color-border-soft); }
.work-description .work-number { margin-bottom: 14px; color: var(--color-accent); font-size: 12px; font-weight: 500; }
.work-description h3 { max-width: 23em; margin-bottom: 17px; font-size: 21px; font-weight: 650; letter-spacing: -0.025em; line-height: 1.5; }
.work-description > p:last-child { max-width: 40em; margin-bottom: 0; color: var(--color-muted); font-size: 15px; line-height: 1.85; }
.work-cert-card { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); align-items: center; gap: 52px; }
.cert-trigger {
  display: block;
  width: 100%;
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--color-border-soft);
  border-radius: 14px;
  background: var(--color-panel);
  cursor: zoom-in;
}
.cert-thumb { display: block; width: 100%; height: auto; border-radius: 8px; aspect-ratio: 3407 / 2400; background: #fff; object-fit: contain; transition: opacity 350ms var(--ease-out), transform 500ms var(--ease-out); }
.cert-trigger:hover .cert-thumb { opacity: 0.94; transform: scale(1.01); }

/* Certificate dialog */
.cert-lightbox { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 56px 32px 32px; overflow: auto; border: 0; background: transparent; text-align: center; }
.cert-lightbox[open] { display: grid; place-items: center; }
.cert-lightbox::backdrop { background: rgba(8, 15, 22, 0.86); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.cert-lightbox > img { display: block; width: auto; max-width: min(100%, 1000px); height: auto; max-height: calc(100dvh - 88px); margin: auto; border-radius: 10px; box-shadow: 0 24px 72px rgba(0, 0, 0, 0.36); object-fit: contain; }
.lightbox-close { position: fixed; z-index: 1; top: 18px; right: 20px; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 50%; background: rgba(16, 20, 24, 0.5); color: #fff; cursor: pointer; transition: background-color 250ms var(--ease-out), transform 250ms var(--ease-out); }
.lightbox-close:hover { background: rgba(16, 20, 24, 0.85); transform: translateY(-2px); }

/* Skills: embedded panels, a third level in the surface hierarchy. */
.skills-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.skill-group { padding: 26px 28px 28px; border: 1px solid var(--color-border-soft); border-radius: 14px; background: var(--color-panel); }
.skill-group:last-child { grid-column: 1 / -1; }
.skill-group h3 { margin-bottom: 18px; color: var(--color-primary); font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tag-list li { padding: 4px 11px; border: 1px solid var(--color-border); border-radius: 7px; background: var(--color-surface); color: var(--color-muted); font-size: 13px; line-height: 1.75; transition: border-color 250ms var(--ease-out), color 250ms var(--ease-out); }
.tag-list li:hover { border-color: #b7c4cf; color: var(--color-primary); }

/* Contact and footer */
.contact-section {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--color-border);
  background: var(--color-panel);
  scroll-margin-top: var(--header-height);
}
.contact-section::before { position: absolute; top: -250px; left: 50%; width: 680px; height: 680px; border: 1px solid rgba(23, 56, 95, 0.055); border-radius: 50%; box-shadow: 0 0 0 90px rgba(23, 56, 95, 0.016), 0 0 0 180px rgba(23, 56, 95, 0.012); content: ""; transform: translateX(-50%); pointer-events: none; }
.contact-inner { position: relative; max-width: 780px; padding-block: 124px; text-align: center; }
.contact-inner .section-index { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 18px; }
.contact-inner h2 { margin-bottom: 22px; }
.contact-inner > p:not(.section-index) { max-width: 40em; margin: 0 auto 34px; color: var(--color-muted); }
.contact-inner .button { max-width: 100%; overflow-wrap: anywhere; }
.site-footer { border-top: 1px solid var(--color-border); color: var(--color-faint); font-size: 12px; }
.site-footer .container { padding-block: 28px; text-align: center; }
.site-footer p { margin-bottom: 0; }

@media (prefers-color-scheme: dark) {
  .button-primary { border-color: #3b5975; background: linear-gradient(145deg, #2d4d6b, #203d58 70%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 8px 20px -10px #000; color: #f3f7fa; }
  .button-primary:hover { border-color: #54718c; background: linear-gradient(145deg, #365b7e, #284a68 70%); }
  .button-secondary { box-shadow: none; }
  .project-card:hover, .work-card:hover, .tag-list li:hover { border-color: #46596b; }
  #works::before { background: linear-gradient(180deg, rgba(27, 38, 48, 0.38), rgba(14, 20, 26, 0)); }
  ::selection { background: #4a4435; color: #f3f5f7; }
}

/* Reveal only after JS has installed its 1.5-second fallback. */
.motion-ready :where(.section-heading, .about-list li, .project-card, .work-card, .skill-group, .contact-inner > *) {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 850ms var(--ease-out), transform 850ms var(--ease-out);
}
.motion-ready .is-visible { opacity: 1; transform: translateY(0); }
.motion-ready .about-list li:nth-child(2), .motion-ready .project-card:nth-child(2), .motion-ready .work-card:nth-child(2), .motion-ready .skill-group:nth-child(2) { transition-delay: 80ms; }
.motion-ready .about-list li:nth-child(3), .motion-ready .project-card:nth-child(3), .motion-ready .skill-group:nth-child(3) { transition-delay: 160ms; }
.motion-ready .skill-group:nth-child(4) { transition-delay: 240ms; }
.motion-ready .skill-group:nth-child(5) { transition-delay: 320ms; }
.motion-ready .is-visible.reveal-complete { transition-delay: 0ms; }

@media (max-width: 1050px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 42px; }
  .hero h1 { font-size: 76px; }
  .hero-role { font-size: 20px; }
  .work-video-card, .work-cert-card { gap: 32px; }
  .work-description { padding-left: 26px; }
}

@media (max-width: 900px) {
  .container { width: min(var(--content-width), calc(100% - 64px)); }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 50px; min-height: auto; padding-block: 72px 96px; }
  .hero-content { max-width: 660px; }
  .section { padding-block: 100px; }
  .about-list p { font-size: 14px; }
  .about-list li { padding-right: 24px; }
  .about-list li + li { padding-left: 24px; }
  .work-video-card, .work-cert-card { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .work-video-frame { max-width: 280px; }
  .work-description { padding: 28px 0 0; border-top: 1px solid var(--color-border-soft); border-left: 0; }
  .work-description > p:last-child, .work-description h3 { max-width: none; }
  .cert-trigger { max-width: 560px; margin-inline: auto; }
}

@media (max-width: 640px) {
  :root { --header-height: 64px; }
  .container { width: calc(100% - 40px); }
  body::before { opacity: 0.02; }
  .hero { gap: 42px; padding-block: 54px 80px; }
  .hero::before { right: -45%; width: 520px; height: 520px; }
  .hero::after { bottom: 28px; }
  .eyebrow { margin-bottom: 20px; font-size: 11px; }
  .hero h1 { margin-bottom: 16px; font-size: 60px; letter-spacing: -0.025em; }
  .hero-role { margin-bottom: 22px; font-size: 19px; line-height: 1.6; }
  .hero-intro { margin-bottom: 28px; font-size: 15px; line-height: 1.85; }
  .hero-actions { align-items: stretch; flex-direction: column; margin-bottom: 26px; }
  .hero-actions .button { width: 100%; }
  .contact-list { align-items: flex-start; flex-direction: column; gap: 6px; }
  .contact-list a { max-width: 100%; }
  .contact-list a span { overflow-wrap: anywhere; }
  .section, .contact-inner { padding-block: 88px; }
  .section-heading { margin-bottom: 36px; }
  .section-heading h2, .contact-inner h2 { font-size: 32px; }
  .about-list { grid-template-columns: minmax(0, 1fr); }
  .about-list li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 22px 0; border-bottom: 1px solid var(--color-border-soft); }
  .about-list li:first-child { padding-top: 0; }
  .about-list li + li { padding-left: 0; border-left: 0; }
  .about-list li:last-child { padding-bottom: 0; border-bottom: 0; }
  .about-list p { max-width: none; margin: 0; font-size: 14px; }
  .item-number { padding-top: 4px; }
  .project-list, .work-list { gap: 20px; }
  .project-card { padding: 26px 22px; border-radius: 16px; }
  .project-heading { grid-template-columns: 28px minmax(0, 1fr); gap: 10px; margin-bottom: 22px; padding-bottom: 22px; }
  .project-heading h3 { font-size: 18px; }
  .project-details { margin-left: 0; padding-left: 1.05em; font-size: 14px; }
  .project-details li { padding-left: 3px; }
  .work-card { padding: 20px; border-radius: 16px; }
  .work-video-frame { width: min(100%, 270px); }
  .work-description { padding-top: 24px; }
  .work-description h3 { font-size: 18px; }
  .work-description > p:last-child { font-size: 14px; }
  .cert-trigger { padding: 8px; }
  .cert-lightbox { padding: 64px 16px 20px; }
  .cert-lightbox > img { max-height: calc(100dvh - 84px); }
  .skills-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .skill-group { padding: 22px; }
  .skill-group:last-child { grid-column: auto; }
  .contact-inner .button { width: 100%; padding-inline: 14px; font-size: 13px; }

  /* Keep the brand intact; collapse navigation only after JS is available. */
  .js .menu-toggle:not([hidden]) { display: inline-flex; flex: 0 0 44px; }
  .js .nav-links { position: absolute; top: var(--header-height); right: -20px; left: -20px; display: none; align-items: stretch; flex-direction: column; gap: 0; padding: 10px 20px 18px; border-bottom: 1px solid var(--color-border); background: var(--color-header); box-shadow: 0 18px 28px -20px rgba(23, 42, 60, 0.22); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
  .js .nav-links.is-open { display: flex; }
  .js .nav-links a { width: 100%; min-height: 48px; padding: 10px 4px; }
  .js .nav-links a::after { right: auto; bottom: 7px; left: 4px; width: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .motion-ready :where(.section-heading, .about-list li, .project-card, .work-card, .skill-group, .contact-inner > *) { opacity: 1; transform: none; transition: none; }
  .hero h1 { opacity: 1; transform: none; animation: none !important; }
  .button:hover, .project-card:hover, .work-card:hover, .cert-trigger:hover img, .lightbox-close:hover { transform: none; }
}
