@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/inter-latin-variable.woff2") format("woff2");
}

@font-face {
  font-family: Newsreader;
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("assets/fonts/newsreader-latin-variable.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --navy: #0b2339;
  --deep: #071c30;
  --gold: #dbbc86;
  --gold-dark: #73532e;
  --ink: #15283b;
  --muted: #596776;
  --paper: #ffffff;
  --cream: #f7f4ee;
  --line: #dce2e7;
  --card-border: #ded8cd;
  --control-border: #b9c5d0;
  --topic-ink: #34495b;
  --honor-border: #c9b48f;
  --contact-line: #e0d9ce;
  --focus-color: #956624;
  --action-background: #0b2339;
  --action-ink: #ffffff;
  --action-hover: #193b55;
  --brand-background: var(--cream);
  --brand-primary: var(--navy);
  --brand-secondary: var(--gold-dark);
  --brand-border: var(--gold-dark);
  --hero-surface: var(--cream);
  --hero-ink: var(--navy);
  --hero-muted: #34495b;
  --hero-accent: var(--gold-dark);
  --hero-button-background: var(--action-background);
  --hero-button-ink: var(--action-ink);
  --hero-button-hover: var(--action-hover);
  --hero-button-border: var(--hero-button-background);
  --hero-outline-background: var(--hero-surface);
  --hero-outline-border: #687989;
  --hero-outline-hover: var(--paper);
  --hero-outline-border-hover: #425a70;
  --hero-bottom-surface: var(--paper);
  --hero-fade: linear-gradient(90deg, #000 0%, rgb(0 0 0 / .98) 12%, rgb(0 0 0 / .96) 25%, rgb(0 0 0 / .92) 38%, rgb(0 0 0 / .85) 50%, rgb(0 0 0 / .72) 56%, rgb(0 0 0 / .46) 62%, rgb(0 0 0 / .16) 68%, rgb(0 0 0 / .03) 73%, transparent 78%);
  --hero-focus-color: var(--hero-accent);
  --hero-selection-background: var(--hero-accent);
  --hero-selection-ink: var(--hero-surface);
  --theme-glow-center: 255 246 226;
  --theme-glow-edge: 219 188 134;
  --theme-dim-color: var(--hero-surface);
  --card-shadow: 0 12px 30px rgb(7 28 48 / .08);
  --theme-duration: .24s;
  --theme-delay: 0s;
  --content-width: 1180px;
  --font-display: Newsreader, "Iowan Old Style", Georgia, serif;
  --header-height: 5rem;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e7edf3;
  --muted: #b4c2d0;
  --paper: #0b1623;
  --cream: #101f2e;
  --line: #2d4256;
  --gold-dark: #dbbc86;
  --card-border: #334558;
  --control-border: #52677a;
  --topic-ink: #ced8e3;
  --honor-border: #857454;
  --contact-line: #2d4256;
  --focus-color: #dbbc86;
  --action-background: #dbbc86;
  --action-ink: #071c30;
  --action-hover: #e7cca2;
  --brand-background: var(--deep);
  --brand-primary: var(--gold);
  --brand-secondary: #ffffff;
  --brand-border: var(--gold);
  --hero-surface: #04101d;
  --hero-ink: #f4f6f8;
  --hero-muted: #c8d5e2;
  --hero-accent: #e7cca2;
  --hero-button-background: #e7cca2;
  --hero-button-ink: var(--hero-surface);
  --hero-button-hover: #f2dfbb;
  --hero-outline-background: var(--hero-surface);
  --hero-outline-border: #b3c0cb;
  --hero-outline-hover: #0c2135;
  --hero-outline-border-hover: var(--hero-accent);
  --theme-glow-center: 240 231 211;
  --theme-glow-edge: 231 204 162;
  --card-shadow: 0 12px 30px rgb(0 0 0 / .25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 1rem); scrollbar-color: var(--control-border) var(--paper); accent-color: var(--gold-dark); caret-color: var(--gold-dark); }
body { margin: 0; color: var(--ink); background: var(--paper); font: 400 1rem/1.7 Inter, "Helvetica Neue", Arial, sans-serif; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased; }
button { font: inherit; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
svg { stroke-linecap: round; stroke-linejoin: round; }
[hidden], .icon-sprite { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.2; overflow-wrap: anywhere; text-wrap: balance; }
p { text-wrap: pretty; }
h1, h2 { font-family: var(--font-display); font-optical-sizing: auto; letter-spacing: -.015em; }
h2 { font-size: clamp(2.1rem, 3.4vw, 3.1rem); font-weight: 500; line-height: 1.12; }
h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -.02em; }
p + p { margin-top: 1.15rem; }
::selection { color: var(--deep); background: var(--gold); }
:focus-visible { outline: 3px solid var(--focus-color); outline-offset: 5px; }
.hero :focus-visible { outline-color: var(--hero-focus-color); }
.hero ::selection { color: var(--hero-selection-ink); background: var(--hero-selection-background); }
.experience :focus-visible { outline-color: var(--gold); }
.wrap { width: min(var(--content-width), calc(100% - 5rem)); margin-inline: auto; }
.section { padding: 5.5rem 0; }
.section-heading { max-width: 45rem; margin-bottom: 2.5rem; }
.section-heading > p:last-child { color: var(--muted); margin-top: 1rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: .85rem 1.4rem; border: 1px solid transparent; border-radius: 5px; font-size: 1rem; font-weight: 600; line-height: 1.45; text-align: center; cursor: pointer; transition: background-color .15s, border-color .15s; }
.button-gold { color: var(--hero-button-ink); background: var(--hero-button-background); border-color: var(--hero-button-border); }
.button-gold:hover { background: var(--hero-button-hover); border-color: var(--hero-button-hover); }
.button-outline { color: var(--hero-ink); border-color: var(--hero-outline-border); background: var(--hero-outline-background); }
.button-outline:hover { background: var(--hero-outline-hover); border-color: var(--hero-outline-border-hover); }
.button-navy { color: var(--action-ink); background: var(--action-background); }
.button-navy:hover { background: var(--action-hover); }
.button-light { color: var(--ink); background: var(--paper); border-color: var(--control-border); }
.button-light:hover { background: var(--cream); }

/* The complete link list remains usable when JavaScript is unavailable. */
.skip-link { position: absolute; top: -12rem; left: 1rem; z-index: 100; max-width: calc(100% - 2rem); padding: .8rem 1.2rem; color: var(--ink); background: var(--paper); }
.skip-link:focus { top: .5rem; }
.site-header { position: relative; z-index: 30; background: var(--paper); border-bottom: 1px solid var(--line); }
.site-header.nav-enhanced { position: sticky; top: 0; }
.header-inner { min-height: 5rem; display: flex; align-items: center; justify-content: space-between; gap: 1.3rem; padding-block: .7rem; }
.brand { display: inline-flex; align-items: center; justify-content: center; width: 52px; min-height: 52px; flex-shrink: 0; }
.brand-logo { width: 52px; height: 52px; }
.brand-background { fill: var(--brand-background); }
.brand-a { stroke: var(--brand-primary); }
.brand-t { stroke: var(--brand-secondary); }
.brand-border, .brand-corner { stroke: var(--brand-border); }
.theme-ready .brand-logo :where(rect, path) { transition: fill var(--theme-duration) ease var(--theme-delay), stroke var(--theme-duration) ease var(--theme-delay); }
.nav { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: .4rem 1rem; font-size: .875rem; font-weight: 500; margin-left: auto; }
.nav > a { display: flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; padding: .5rem .1rem; border-bottom: 2px solid transparent; }
.nav > a:hover, .nav > a[aria-current="location"] { border-bottom-color: var(--gold-dark); }
.header-actions { display: flex; align-items: center; gap: .65rem; flex-shrink: 0; }
.nav > .nav-contact { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .5rem .85rem; border: 1px solid var(--control-border); border-radius: 4px; font-size: .875rem; font-weight: 500; line-height: 1.4; }
.nav-contact:hover { background: var(--cream); }
.nav-toggle { display: none; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border: 1px solid var(--control-border); border-radius: 4px; background: var(--paper); color: var(--ink); flex-shrink: 0; }
.nav-toggle svg { width: 1.4rem; height: 1.4rem; }
.theme-toggle { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; flex-shrink: 0; color: var(--ink); background: var(--paper); border: 1px solid var(--control-border); border-radius: 4px; cursor: pointer; }
.theme-toggle svg { position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; pointer-events: none; transform-origin: center; }
.theme-ready .theme-toggle svg { transition: opacity .28s ease, transform .4s cubic-bezier(.22,.8,.24,1), visibility 0s linear .28s; }
.theme-toggle:hover { background: var(--cream); }
.theme-toggle[aria-pressed="true"] { color: var(--gold); border-color: var(--honor-border); background: var(--cream); }
.theme-toggle .theme-moon { opacity: 1; visibility: visible; transform: translateY(0) rotate(0) scale(1); }
.theme-toggle .theme-sun { opacity: 0; visibility: hidden; transform: translateY(10px) rotate(-80deg) scale(.35); }
.theme-toggle[aria-pressed="true"] .theme-moon { opacity: 0; visibility: hidden; transform: translateY(-10px) rotate(65deg) scale(.35); }
.theme-toggle[aria-pressed="true"] .theme-sun { opacity: 1; visibility: visible; transform: translateY(0) rotate(0) scale(1); transition-delay: 0s; }
.theme-toggle:not([aria-pressed="true"]) .theme-moon { transition-delay: 0s; }

/* Keep the portrait's original proportions; never stretch its dimensions. */
.hero { position: relative; overflow: hidden; min-height: 42rem; display: flex; align-items: center; background: var(--hero-surface); color: var(--hero-ink); }
.hero-media { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-photo { width: 100%; height: 100%; object-fit: cover; object-position: right center; }
/* Stable alpha gradients tint the image through theme colors without editing it. */
.hero-panel { position: absolute; inset: 0; width: 100%; pointer-events: none; background: var(--hero-surface); -webkit-mask-image: var(--hero-fade); mask-image: var(--hero-fade); mask-mode: alpha; }
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: clamp(2rem, 5vw, 4rem); z-index: 3; pointer-events: none; background: var(--hero-bottom-surface); -webkit-mask-image: linear-gradient(180deg, transparent, rgb(0 0 0 / .15) 30%, rgb(0 0 0 / .55) 65%, #000); mask-image: linear-gradient(180deg, transparent, rgb(0 0 0 / .15) 30%, rgb(0 0 0 / .55) 65%, #000); mask-mode: alpha; }
.hero-inner { position: relative; z-index: 1; padding-block: 4.5rem; }
.hero-copy { width: min(53%, 36rem); }
.hero h1 { font-size: clamp(3rem, 5.6vw, 5.2rem); font-weight: 500; line-height: 1.02; letter-spacing: -.025em; color: inherit; white-space: nowrap; overflow-wrap: normal; }
.hero-role { margin-top: 1.2rem; color: var(--hero-accent); font-size: clamp(1.1rem, 1.65vw, 1.4rem); font-weight: 500; line-height: 1.45; }
.hero .tagline { margin-top: 1.5rem; width: min(100%, 29rem); font-size: 1.15rem; font-weight: 500; line-height: 1.6; }
.hero .intro { margin-top: 1rem; width: min(100%, 30rem); color: var(--hero-muted); font-size: 1rem; line-height: 1.75; }
.hero-actions { display: flex; flex-wrap: wrap; width: min(100%, 36rem); gap: .8rem; margin-top: 1.75rem; }
.credibility { border-bottom: 1px solid var(--line); }
.credibility-inner { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; padding-block: 1.6rem; }
.credential { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.credential svg { width: 1.6rem; height: 1.6rem; flex-shrink: 0; color: var(--gold-dark); }
.credential strong { display: block; font-size: .9375rem; font-weight: 600; line-height: 1.5; }
.credential span { display: block; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.about-grid { display: grid; grid-template-columns: .85fr 1.15fr; align-items: start; gap: 5rem; }
.about-heading h2 { max-width: 27rem; }
.about-body p { color: var(--muted); }
.about-body p:first-child { color: var(--ink); font-size: 1.1rem; }
.services { background: var(--cream); }
.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.service-card { display: flex; flex-direction: column; align-items: flex-start; gap: 1.2rem; min-width: 0; padding: 1.8rem; background: var(--paper); border: 1px solid var(--card-border); border-radius: 6px; }
.service-card h3 { font-size: 1.15rem; line-height: 1.45; margin-bottom: .8rem; }
.service-card p { color: var(--muted); font-size: 1rem; }
.service-card { gap: 0; }
.working-style { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem 2rem; margin: 2rem 0 0; padding: 1.6rem 0 0; list-style: none; border-top: 1px solid var(--line); }
.working-style li { color: var(--muted); font-size: .9375rem; line-height: 1.6; }
.working-style strong { display: block; color: var(--ink); font-size: 1rem; font-weight: 600; margin-bottom: .2rem; }
.timeline-item + .timeline-item { margin-top: 2.75rem; }
.recognition-section .section-heading h2 { text-wrap: balance; }
.experience { background: var(--navy); color: #fff; }
.experience-grid { display: grid; grid-template-columns: .75fr 1.25fr; gap: 4rem; }
.experience-heading p { color: #cdd7e0; margin-top: 1.3rem; max-width: 25rem; }
.timeline { border-left: 1px solid #8196a8; margin-left: .4rem; padding-left: 2rem; }
.timeline-item { position: relative; }
.timeline-item::before { content: ""; position: absolute; left: -2.4rem; top: .4rem; width: .75rem; height: .75rem; background: var(--gold); border: 2px solid var(--navy); border-radius: 50%; outline: 1px solid #dbbc8680; }
.timeline .period { display: block; color: var(--gold); font-size: .9375rem; margin-bottom: .7rem; }
.timeline h3 { font-size: 1.4rem; line-height: 1.4; margin-bottom: .5rem; }
.timeline .company { margin-bottom: 1rem; }
.timeline ul { margin: 0; padding-left: 1.2rem; display: grid; gap: .6rem; color: #d0dae3; }
.timeline li::marker { color: var(--gold); }
.contact { padding-block: 5rem; background: var(--cream); border-top: 1px solid var(--contact-line); }
.contact-inner { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: start; }
.contact-heading { display: grid; grid-template-columns: .9fr 1.1fr; grid-template-rows: auto 1fr; column-gap: 4rem; }
.contact-heading > h2 { grid-column: 1; }
.contact h2 { font-size: clamp(2rem, 3.5vw, 3rem); }
.contact-copy { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--muted); max-width: 42rem; }
.contact-panel { padding: 1.9rem; background: var(--paper); border: 1px solid var(--card-border); border-radius: 6px; min-width: 0; }
.contact-details { display: grid; grid-template-columns: 1.05fr 1.25fr .8fr 1fr; gap: clamp(.9rem, 2vw, 1.5rem); padding-bottom: 1.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.contact-row { display: flex; align-items: flex-start; min-width: 0; gap: .8rem; }
.contact-row svg { width: 1.3rem; height: 1.3rem; flex-shrink: 0; color: var(--gold-dark); margin-top: .2rem; }
.contact-row > div { min-width: 0; }
.contact-row strong { display: block; font-size: .9375rem; font-weight: 600; margin-bottom: .2rem; }
.contact-row a, .contact-row p { color: var(--muted); overflow-wrap: anywhere; }
.contact-row a { display: inline-block; max-width: 100%; min-height: 2.75rem; padding-block: .4rem; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.contact-row p { min-height: 2.75rem; padding-block: .4rem; }
.contact-row a:hover { color: var(--ink); }
.contact-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .75rem; }
.contact-actions .button { min-width: min(10rem, 100%); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: 1.4rem; font-size: .9375rem; color: var(--muted); }
.footer-name { color: var(--ink); font-weight: 600; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.4rem; }
.footer-links a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.footer-links a:hover { text-decoration: underline; }

@media (min-width: 1700px) {
  .hero { min-height: 46rem; }
  .hero-photo { object-position: right top; }
}
@media (max-width: 1100px) {
  .wrap { width: calc(100% - 3rem); }
  .about-grid, .experience-grid, .contact-inner { gap: 2.5rem; }
  .hero-photo { object-position: 72% center; }
  .hero h1 { font-size: clamp(2.8rem, 6.1vw, 4.5rem); white-space: normal; overflow-wrap: anywhere; }
}
@media (max-width: 960px) {
  .header-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; min-height: 4.5rem; gap: .65rem 1rem; }
  .brand { grid-column: 1; }
  .nav-toggle { grid-column: 2; }
  .header-actions { grid-column: 3; justify-self: end; }
  .nav { grid-column: 1 / -1; width: 100%; justify-content: flex-start; gap: .3rem 1rem; margin-left: 0; }
  .nav-enhanced .nav-toggle:not([hidden]) { display: inline-flex; }
  .nav-enhanced .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; width: auto; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0; padding: .7rem 1.5rem 1rem; background: var(--paper); border-bottom: 1px solid var(--line); max-height: calc(100dvh - var(--header-height) - .75rem); overflow-y: auto; overscroll-behavior: contain; }
  .nav-enhanced .nav.is-open { display: flex; }
  .nav > a { padding: .75rem .4rem; font-size: 1rem; }
  .nav > .nav-contact { margin-top: .5rem; padding: .75rem; font-size: 1rem; }
  /* Below 961px the portrait leads, full width, with the copy underneath it. */
  .hero { --hero-photo-h: clamp(300px, 70vw, 500px); --hero-fade: linear-gradient(180deg, transparent 0%, rgb(0 0 0 / .25) 35%, rgb(0 0 0 / .75) 70%, #000 100%); flex-direction: column; align-items: stretch; min-height: 0; }
  .hero-media { position: relative; inset: auto; height: var(--hero-photo-h); flex-shrink: 0; }
  .hero-photo { object-position: 78% 20%; }
  .hero-panel { inset: calc(var(--hero-photo-h) - 6rem) 0 auto; height: 6rem; }
  .hero-inner { padding-top: 1.75rem; padding-bottom: 3.5rem; }
  .hero-copy { width: 100%; max-width: 38rem; }
  .credibility-inner { gap: 1.2rem; }
  .credential { align-items: flex-start; }
  .credential strong, .credential span { overflow-wrap: anywhere; }
}
@media (max-width: 760px) {
  .wrap { width: calc(100% - 2.5rem); }
  .section { padding-block: 4rem; }
  .hero .tagline, .hero .intro, .hero-actions { width: 100%; }
  .hero h1 { font-size: clamp(2.4rem, 8.6vw, 3.6rem); }
  .hero .tagline { font-size: 1.1rem; }
  .credibility-inner { grid-template-columns: 1fr; gap: 1.3rem; }
  .credential { align-items: center; }
  .about-grid, .experience-grid, .education-grid, .contact-inner { grid-template-columns: 1fr; gap: 2rem; }
  .contact-heading { grid-template-columns: 1fr; }
  .contact-copy { grid-column: 1; grid-row: auto; margin-top: 1rem; }
  .about-heading h2 { max-width: 36rem; }
  .experience-heading p { max-width: 40rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: .6rem; }
}
@media (max-width: 620px) {
  .nav-toggle { width: 44px; height: 44px; }
  .service-grid { grid-template-columns: 1fr; }
  .service-card { padding: 1.4rem; }
  .project-visual:has(.project-image-document) { padding: 1rem 1rem 0; }
  .working-style { grid-template-columns: 1fr; }
  .contact-details { grid-template-columns: 1fr; gap: 1.2rem; }
  .contact-actions .button { width: 100%; }
}
@media (min-width: 621px) and (max-width: 900px) { .contact-details { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 380px) {
  .wrap { width: calc(100% - 2rem); }
  .nav-toggle { width: 44px; height: 44px; }
  .nav-toggle svg { width: 22px; height: 22px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .button { width: 100%; }
  .service-card { flex-direction: column; }
}
.theme-changing { --theme-duration: .46s; --theme-delay: .1s; }
.theme-ready :where(body, .site-header, .nav, .nav-contact, .theme-toggle, .nav-toggle, .services, .contact, .project-card, .project-visual, .gallery-item, .gallery-placeholder, .gallery-image-link, .gallery-enlarge, .service-card, .contact-panel, .dialog-panel, .footer-inner) { transition: background-color var(--theme-duration) ease var(--theme-delay), border-color var(--theme-duration) ease var(--theme-delay), box-shadow .18s ease, transform .18s ease; }
/* Animate owned colors once; inherited heading/link colors follow their parent. */
.theme-ready :where(body, .hero, .button-gold, .button-outline, .theme-toggle, .nav-toggle, .button-navy, .button-light, .dialog-panel, .footer-inner, .project-placeholder, .gallery-placeholder, .gallery-enlarge) { transition: background-color var(--theme-duration) ease var(--theme-delay), color var(--theme-duration) ease var(--theme-delay), border-color var(--theme-duration) ease var(--theme-delay), box-shadow .18s ease, transform .18s ease; }
.theme-ready :where(.hero-role, .hero .intro, .about-body p, .section-heading > p:last-child, .service-card p, .contact-copy, .contact-row a, .contact-row p, .project-content > p, .gallery-item p, .dialog-panel > p, .text-link, .project-status) { transition: color var(--theme-duration) ease var(--theme-delay), border-color var(--theme-duration) ease var(--theme-delay); }
.theme-ready .hero-panel { transition: background-color var(--theme-duration) ease var(--theme-delay); }
.theme-ready .hero::after { transition: background-color var(--theme-duration) ease var(--theme-delay); }
.theme-ready .hero .button { transition: background-color var(--theme-duration) ease var(--theme-delay), color var(--theme-duration) ease var(--theme-delay), border-color var(--theme-duration) ease var(--theme-delay), outline-color var(--theme-duration) ease var(--theme-delay); }
/* Reveal matching text and panel colors together to preserve transition contrast. */
.hero.hero-theme-snapshot { position: absolute; inset: 0; z-index: 2; min-height: 100%; background: transparent; pointer-events: none; clip-path: inset(0); }
.hero-theme-snapshot::after { display: none; }
.theme-changing :is(.hero, .hero-panel, .hero-role, .hero .intro, .hero .button) { transition: none; }
@media (max-width: 960px) {
  .hero.hero-theme-snapshot { padding-top: var(--hero-photo-h); }
  .hero-theme-snapshot .hero-panel { inset: var(--hero-photo-h) 0 0; width: 100%; height: auto; -webkit-mask-image: none; mask-image: none; }
  .hero-theme-snapshot::before { content: ""; position: absolute; inset: calc(var(--hero-photo-h) - 6rem) 0 auto; height: 6rem; pointer-events: none; background: var(--hero-surface); -webkit-mask-image: var(--hero-fade); mask-image: var(--hero-fade); mask-mode: alpha; }
}
.theme-transition { position: fixed; inset: 0; z-index: 60; overflow: hidden; pointer-events: none; }
.theme-transition > span { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.theme-glow { background: radial-gradient(circle at var(--glow-x, 80%) var(--glow-y, 5%), rgb(var(--theme-glow-center) / .85), rgb(var(--theme-glow-edge) / .35) 20%, transparent 62%); }
.theme-dim { background: var(--theme-dim-color); }
.portfolio { border-bottom: 1px solid var(--line); }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.project-card { min-width: 0; border: 1px solid var(--card-border); border-radius: 8px; overflow: hidden; background: var(--paper); }
.project-visual { aspect-ratio: 16 / 10; background: var(--cream); border-bottom: 1px solid var(--line); overflow: hidden; }
.project-image { width: 100%; height: 100%; object-fit: cover; }
.project-visual:has(.project-image-document) { aspect-ratio: auto; padding: 1.5rem 1.5rem 0; }
.project-image-document { height: auto; aspect-ratio: 2.35 / 1; object-fit: cover; object-position: left top; background: #fff; border: 1px solid var(--line); border-bottom: 0; border-radius: 6px 6px 0 0; box-shadow: 0 -4px 24px rgb(7 28 48 / .07); }
.project-actions .button { gap: .5rem; }
.project-actions .button svg { width: 1.1rem; height: 1.1rem; }
.project-placeholder { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .7rem; height: 100%; padding: 1.25rem; color: var(--muted); text-align: center; }
.project-placeholder > svg { width: 2.4rem; height: 2.4rem; color: var(--gold-dark); }
.project-placeholder > span { font-size: 1rem; font-weight: 500; }
.project-placeholder small { font-size: .875rem; }
.placeholder-lines { display: grid; gap: .45rem; width: min(65%, 15rem); margin-top: .5rem; }
.placeholder-lines i { display: block; height: .4rem; border-radius: 2px; background: var(--line); }
.placeholder-lines i:nth-child(2) { width: 80%; }
.placeholder-lines i:nth-child(3) { width: 60%; }
.project-content { padding: 1.8rem; }
.project-content h3 { font-size: 1.35rem; line-height: 1.4; }
.project-content > p:last-of-type { color: var(--muted); margin-top: .9rem; }
.project-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin-top: 1.4rem; }
.project-status { font-size: .875rem; color: var(--muted); }
.text-link { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; font-size: .9375rem; font-weight: 600; color: var(--gold-dark); text-decoration: underline; text-underline-offset: .25em; }
.text-link svg { width: 1.1rem; height: 1.1rem; flex-shrink: 0; }
.achievement-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.gallery-item { min-width: 0; margin: 0; border: 1px solid var(--card-border); border-radius: 8px; overflow: hidden; background: var(--paper); }
.gallery-placeholder, .gallery-image-link { aspect-ratio: 3 / 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem; background: var(--cream); border-bottom: 1px solid var(--line); position: relative; }
.gallery-placeholder { color: var(--muted); font-size: .9375rem; padding: 1rem; }
.gallery-placeholder svg { width: 2rem; height: 2rem; color: var(--gold-dark); }
.gallery-image-link img { width: 100%; height: 100%; object-fit: cover; }
.gallery-item-album { grid-column: 1 / -1; }
.gallery-album-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.gallery-album-images .gallery-image-link { aspect-ratio: 4 / 3; border-bottom: 0; }
.gallery-album-images img { object-fit: contain; }
.gallery-enlarge { position: absolute; bottom: .7rem; right: .7rem; display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .6rem; background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 4px; font-size: .875rem; }
.gallery-enlarge svg { width: 1rem; height: 1rem; }
.gallery-item figcaption { padding: 1.25rem; }
.gallery-item h3 { font-size: 1.05rem; line-height: 1.45; }
.gallery-item p { margin-top: .5rem; color: var(--muted); font-size: .9375rem; }
.dialog-panel { width: min(32rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); padding: 2.25rem; margin: auto; background: var(--paper); color: var(--ink); border: 1px solid var(--card-border); border-radius: 12px; overflow: auto; box-shadow: var(--card-shadow); }
.dialog-panel::backdrop { background: rgb(7 28 48 / .65); backdrop-filter: blur(4px); }
.dialog-panel h2 { font-size: clamp(1.6rem, 4vw, 2rem); padding-right: .6rem; margin-top: .8rem; }
.dialog-panel > p { color: var(--muted); margin-top: 1rem; }
.dialog-close { display: grid; place-items: center; position: absolute; right: .45rem; top: .45rem; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 4px; color: var(--ink); background: transparent; cursor: pointer; }
.dialog-close:hover { background: var(--cream); }
.dialog-close svg { width: 20px; height: 20px; }
.dialog-actions { display: grid; gap: .75rem; margin-top: 1.6rem; }
.dialog-actions .button { gap: .65rem; }
.dialog-actions svg { width: 1.2rem; height: 1.2rem; flex-shrink: 0; }
.gallery-dialog { width: min(60rem, calc(100% - 2rem)); }
.gallery-dialog img { margin-top: 1.3rem; width: 100%; max-height: 65dvh; object-fit: contain; }
@media (hover: hover) and (pointer: fine) {
  .project-card:hover, .gallery-item:hover, .service-card:hover { transform: translateY(-3px); box-shadow: var(--card-shadow); border-color: var(--honor-border); }
  .text-link:hover svg { transform: translateX(3px); transition: transform .18s ease; }
}
@media (max-width: 760px) {
  .project-grid { grid-template-columns: 1fr; }
  .project-content { padding: 1.5rem; }
}
@media (max-width: 620px) {
  .achievement-grid { grid-template-columns: 1fr; }
  .gallery-album-images { grid-template-columns: 1fr; }
  .dialog-panel { padding: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .theme-toggle svg { transform: none !important; }
  .project-card:hover, .gallery-item:hover, .service-card:hover, .text-link:hover svg { transform: none; }
}

/* Breakpoint refinements: keep three service columns and the inline navigation on small laptops and landscape tablets. */
@media (max-width: 900px) { .service-grid { grid-template-columns: 1fr; } }
/* The award album and the milestone share one row, so all three photos render at the same size. */
@media (min-width: 901px) {
  .achievement-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .gallery-item-album { grid-column: auto; }
  .gallery-item { display: flex; flex-direction: column; }
  .gallery-item > .gallery-image-link { flex: 1 1 auto; aspect-ratio: auto; min-height: 14rem; }
  .gallery-item > .gallery-image-link img { position: absolute; inset: 0; }
}
@media (max-width: 620px) {
  .section-heading h2 br { display: none; }
  .hero-actions { flex-direction: column; }
  .hero-actions .button { width: 100%; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
#not-found-title { font-size: clamp(2.4rem, 5vw, 4rem); margin-bottom: 1.2rem; }
#not-found-title ~ p:last-child { margin-top: 2rem; }
