:root {
  --paper: #f8f7f2;
  --surface: #fffefa;
  --ink: #233330;
  --muted: #586862;
  --link: #236451;
  --line: #d9ded6;
  --line-strong: #a9b7ad;
  --soft: #edf1e9;
}
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); font-family: "Segoe UI", system-ui, -apple-system, sans-serif; font-size: 16px; line-height: 1.7; scroll-behavior: smooth; }
body { margin: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: var(--link); text-underline-offset: .22em; text-decoration-thickness: 1px; overflow-wrap: anywhere; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 4px; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; letter-spacing: -.035em; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 4.6vw, 4rem); line-height: 1.12; margin: 12px 0 20px; }
h2 { font-size: clamp(2.25rem, 4vw, 3.4rem); line-height: 1.15; }
h3 { line-height: 1.4; text-wrap: pretty; }
ul { margin: 0; padding-left: 1.25rem; }
li + li { margin-top: 9px; }
.shell { width: min(1200px, calc(100% - 80px)); margin-inline: auto; }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 100; padding: 12px 20px; background: var(--surface); }
.skip-link:focus { top: 12px; }
.topbar { min-height: 76px; display: flex; justify-content: space-between; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); font-size: .88rem; }
.topbar strong { font-weight: 650; letter-spacing: .02em; }
.topbar a { text-decoration: none; font-weight: 600; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 310px); gap: 36px 64px; align-items: center; padding: 56px 0 36px; border-bottom: 1px solid var(--line); }
.hero-copy { min-width: 0; }
.kicker { color: var(--link); font-size: .73rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.role { max-width: 38em; font-size: clamp(1.1rem, 1.65vw, 1.3rem); line-height: 1.55; font-weight: 450; }
.summary { max-width: 64ch; margin-top: 16px; color: var(--muted); font-size: .97rem; line-height: 1.75; }
.contact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 22px; margin: 28px 0 0; padding: 0; list-style: none; }
.contact li { margin: 0; min-width: 0; }
.contact a { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 9px; align-content: start; text-decoration: none; min-height: 46px; }
.contact-icon { grid-row: span 2; padding-top: 6px; color: var(--link); }
.contact-svg { display: block; width: 17px; height: 17px; }
.contact-label { color: var(--muted); font-size: .72rem; line-height: 1.5; }
.contact-value { font-size: .83rem; line-height: 1.6; min-width: 0; }
.contact a:hover .contact-value { text-decoration: underline; }
.quick-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 30px; }
.action-button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 19px; border: 1px solid var(--line-strong); border-radius: 5px; background: transparent; color: var(--ink); text-decoration: none; font-size: .88rem; font-weight: 600; line-height: 1.5; }
.action-button:hover { background: var(--soft); text-decoration: none; }
.action-button.primary { background: var(--link); color: white; border-color: var(--link); }
.action-button.primary:hover { background: #194f40; }
.action-link { border: 0; padding-inline: 6px; color: var(--link); }
.portrait-panel { margin: 0; align-self: center; }
.portrait { margin: 0; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 6px; background: #e5e4db; }
.portrait img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 24%; transform: scale(1.2); transform-origin: 50% 26%; }
.portrait-caption { display: grid; gap: 4px; margin-top: 18px; padding-left: 14px; border-left: 2px solid var(--line-strong); font-size: .79rem; line-height: 1.55; color: var(--muted); }
.portrait-caption span:first-child { color: var(--ink); font-weight: 600; }
.identity-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 28px; margin-top: 6px; }
.identity-item { padding: 0 24px; border-left: 1px solid var(--line); }
.identity-item:first-child { padding-left: 0; border: 0; }
.identity-item strong { display: block; margin-bottom: 6px; font: 400 2rem/1.2 Georgia, serif; letter-spacing: -.03em; }
.identity-item span { display: block; color: var(--muted); font-size: .81rem; line-height: 1.55; }
.portfolio { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 56px; padding: 48px 0 64px; scroll-margin-top: 24px; }
.tabs { display: grid; gap: 5px; position: sticky; top: 24px; align-self: start; max-height: calc(100vh - 48px); overflow-y: auto; }
.tab { appearance: none; width: 100%; min-height: 45px; display: grid; grid-template-columns: 25px 1fr; gap: 9px; align-items: center; border: 1px solid transparent; border-radius: 4px; padding: 9px 12px; background: transparent; color: var(--muted); text-align: left; }
.tab b { font-size: .67rem; font-weight: 500; opacity: .8; }
.tab span { font-size: .9rem; font-weight: 500; }
.tab[aria-selected="true"] { background: var(--soft); border-color: var(--line); color: var(--link); }
.tab[aria-selected="true"] span { font-weight: 650; }
.tab:hover { background: var(--soft); }
main { min-width: 0; }
.panel { display: none; min-height: 360px; }
.panel.active { display: block; }
.section-head { display: grid; gap: 14px; padding-bottom: 28px; margin-bottom: 4px; }
.section-note { max-width: 66ch; font-size: .95rem; color: var(--muted); line-height: 1.75; }
.entry-list { counter-reset: entry; border-top: 1px solid var(--line); }
.entry { counter-increment: entry; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px 20px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.entry::before { content: counter(entry, decimal-leading-zero); color: var(--muted); font: 400 1.1rem/1.6 Georgia, serif; }
.entry h3 { grid-column: 2; font-size: 1.12rem; font-weight: 650; max-width: 66ch; }
.entry-body { grid-column: 2; min-width: 0; max-width: 72ch; color: var(--muted); font-size: .97rem; }
.entry-body p + p, .entry-body p + ul { margin-top: 12px; }
.meta { color: var(--link); font-size: .84rem; line-height: 1.65; }
.tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tile { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.tile strong { display: block; margin-bottom: 10px; line-height: 1.45; font-size: 1rem; font-weight: 650; }
.tile span { color: var(--muted); font-size: .9rem; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.project-card { padding: 28px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); min-width: 0; }
.project-card.featured { grid-column: 1 / -1; border-color: var(--line-strong); background: var(--soft); }
.project-main { display: flex; flex-direction: column; justify-content: space-between; height: 100%; gap: 24px; min-width: 0; }
.project-card.featured .project-main { height: auto; }
.project-number, .award-number { font-size: .76rem; color: var(--muted); letter-spacing: .06em; }
.project-card h3, .award-card h3 { font-family: Georgia, serif; font-size: clamp(1.4rem, 2.4vw, 2rem); font-weight: 400; line-height: 1.22; letter-spacing: -.025em; margin: 14px 0; }
.project-card.featured h3 { font-size: clamp(2rem, 3vw, 2.6rem); }
.project-description { font-size: .94rem; line-height: 1.75; color: var(--muted); max-width: 68ch; }
.project-meta-panel { display: grid; gap: 18px; margin-top: 24px; }
.project-main .project-meta-panel { margin-top: 0; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; list-style: none; }
.tag-list li { margin: 0; padding: 4px 9px; font-size: .72rem; background: var(--paper); border: 1px solid var(--line); border-radius: 3px; color: var(--muted); }
.url-row { display: grid; gap: 6px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .85rem; }
.url-row span { color: var(--muted); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; }
.award-showcase { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.award-card { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.award-card.major { grid-column: 1 / -1; }
.award-card img { display: block; width: 100%; max-height: 280px; object-fit: contain; border: 1px solid var(--line); margin-bottom: 20px; background: var(--paper); }
.award-card p { font-size: .94rem; color: var(--muted); }
.award-card p + p { margin-top: 12px; }
.skills { display: grid; grid-template-columns: 160px minmax(0, 1fr); margin: 0; border-top: 1px solid var(--line); }
.skills dt, .skills dd { padding: 22px 0; margin: 0; border-bottom: 1px solid var(--line); font-size: .94rem; }
.skills dt { padding-right: 24px; font-weight: 650; }
.skills dd { color: var(--muted); }
.cv-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 24px; }
.cv-meta { color: var(--muted); font-size: .82rem; margin-right: auto; }
.cv-pages { display: grid; gap: 28px; padding: 24px; border: 1px solid var(--line); border-radius: 6px; background: #e9ece6; }
.cv-page { margin: 0; }
.cv-page a { display: block; }
.cv-page img { width: 100%; height: auto; display: block; background: white; box-shadow: 0 3px 14px #23333012; }
.cv-page figcaption { margin-top: 10px; text-align: center; color: var(--muted); font-size: .76rem; }
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding: 24px 0 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.lightbox-modal { display: none; position: fixed; inset: 0; z-index: 100; padding: 65px 24px 24px; background: #14201ff2; justify-content: center; align-items: center; }
.lightbox-modal.active { display: flex; }
.lightbox-content-wrapper { position: relative; max-width: 100%; max-height: 100%; text-align: center; }
.lightbox-content { max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain; }
.lightbox-caption { margin-top: 10px; color: white; font-size: .85rem; }
.lightbox-close { position: absolute; top: -48px; right: 0; padding: 6px 16px; border: 1px solid #ffffff80; border-radius: 4px; color: white; background: transparent; }
@media (max-width: 1050px) {
  .shell { width: calc(100% - 56px); }
  .hero { gap: 32px; grid-template-columns: minmax(0, 1fr) 260px; }
  .portfolio { gap: 32px; grid-template-columns: 170px minmax(0, 1fr); }
  .contact { grid-template-columns: 1fr; gap: 12px; }
  .contact a { grid-template-columns: 24px 64px minmax(0, 1fr); align-items: center; min-height: 28px; }
  .contact-icon { grid-row: auto; padding-top: 0; }
  .contact-value { font-size: .83rem; }
}
@media (max-width: 800px) {
  .hero { grid-template-columns: minmax(0, 1fr) 210px; }
  .hero-copy { grid-column: 1; }
  .portrait-panel { align-self: start; margin-top: 36px; }
  .contact { grid-template-columns: 1fr; }
  .contact a { grid-template-columns: 22px minmax(0, 1fr); }
  .contact-icon { grid-row: span 2; padding-top: 6px; }
  .portfolio { grid-template-columns: 1fr; gap: 28px; padding-top: 20px; scroll-margin-top: 0; }
  .tabs { position: sticky; top: 0; z-index: 10; display: flex; overflow-x: auto; gap: 6px; padding: 10px 0; max-height: none; background: var(--paper); border-bottom: 1px solid var(--line); scrollbar-width: thin; }
  .tab { width: auto; flex: 0 0 auto; grid-template-columns: 18px auto; padding: 10px 13px; }
}
@media (max-width: 600px) {
  .shell { width: calc(100% - 40px); }
  .topbar { min-height: 64px; font-size: .78rem; }
  .hero { grid-template-columns: 1fr; padding-top: 32px; gap: 30px; }
  .hero-copy { grid-column: auto; }
  h1 { font-size: clamp(2.35rem, 10.8vw, 3.4rem); margin-bottom: 18px; }
  .role { font-size: 1.08rem; }
  .summary { font-size: .92rem; }
  .contact { grid-template-columns: 1fr; gap: 12px; }
  .contact a { column-gap: 8px; grid-template-columns: 18px 52px minmax(0, 1fr); align-items: center; min-height: 30px; }
  .contact-icon { grid-row: auto; padding-top: 0; }
  .contact-value { font-size: .79rem; }
  .contact-svg { width: 15px; height: 15px; }
  .quick-actions { gap: 10px; }
  .action-button { padding: 10px 16px; }
  .portrait-panel { margin: 0; display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 22px; align-items: center; }
  .portrait-caption { margin: 0; border: 0; padding: 0; font-size: .81rem; }
  .identity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 0; }
  .identity-item { padding: 0 0 0 20px; }
  .identity-item:nth-child(odd) { padding-left: 0; border: 0; }
  .identity-item strong { font-size: 1.8rem; }
  .identity-item span { max-width: 18ch; font-size: .78rem; }
  .section-head { padding-bottom: 24px; }
  .entry { grid-template-columns: 22px minmax(0, 1fr); gap: 12px; padding: 24px 0; }
  .entry h3 { font-size: 1.04rem; }
  .entry-body { font-size: .92rem; }
  .tile-grid, .project-grid, .award-showcase { grid-template-columns: 1fr; }
  .tile, .project-card, .award-card { padding: 22px; }
  .skills { grid-template-columns: 1fr; }
  .skills dt { border: 0; padding: 20px 0 6px; }
  .skills dd { padding: 0 0 20px; }
  .cv-pages { padding: 10px; gap: 20px; }
  .cv-meta { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  .topbar, .tabs, .quick-actions, .portrait-panel, .site-footer, .lightbox-modal, #cv { display: none !important; }
  .shell { width: 100%; }
  .hero, .portfolio { display: block; padding: 20px 0; }
  .panel { display: block; min-height: auto; margin-top: 28px; }
  .entry, .project-card, .award-card { break-inside: avoid; }
}
