:root {
  color-scheme: light;
  --paper: #f5f1e9;
  --ink: #22211f;
  --muted: #6e6a63;
  --line: #d8d2c8;
  font-family: "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 5px; }
::selection { color: var(--paper); background: #4e4b44; }
h1, h2, h3, h4, p, figure { margin: 0; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.wrap { width: min(1180px, calc(100% - 96px)); margin-inline: auto; }
section[id] { scroll-margin-top: 34px; }
.ui-icon { width: 19px; height: 19px; flex: none; vertical-align: middle; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; top: -100px; left: 20px; z-index: 20; padding: 12px 18px; background: var(--ink); color: var(--paper); }
.skip-link:focus { top: 16px; }

.site-header { display: flex; align-items: center; justify-content: space-between; gap: 28px; min-height: 96px; border-bottom: 1px solid var(--line); }
.wordmark { flex: none; font-size: 23px; line-height: 1.15; font-weight: 600; letter-spacing: -.9px; }
.wordmark small { display: block; margin-top: 7px; color: var(--muted); font-size: 9px; font-weight: 400; letter-spacing: 1.8px; }
.main-nav { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 22px; margin-left: auto; font-size: 12px; color: #56524d; }
.main-nav a { padding-block: 10px; }
.main-nav a:hover, .site-footer a:hover { text-decoration: underline; text-underline-offset: 5px; }
.header-tools { display: flex; align-items: center; gap: 17px; flex: none; }
.language-switch { display: inline-flex; align-items: center; gap: 4px; }
.language-switch a { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid transparent; border-radius: 6px; }
.language-switch img { width: 26px; height: 19px; object-fit: cover; border-radius: 2px; }
.language-switch a[aria-current="page"] { background: #ece6db; border-color: #c9bfae; }
.game-shortcut { display: inline-flex; align-items: center; justify-content: center; gap: 14px; padding: 12px 16px; border: 1px solid #bfb9ae; font-size: 12px; white-space: nowrap; }
.game-shortcut:hover { border-color: var(--ink); }
.game-shortcut span { font-size: 16px; }
.game-shortcut .game-label { font-size: inherit; }
.game-shortcut .game-label-short { display: none; }

.hero { min-height: calc(100svh - 96px); display: grid; grid-template-columns: minmax(0,1.12fr) minmax(0,1fr); align-items: center; gap: 2%; padding-block: 54px 64px; }
.hero h1 { font-size: clamp(58px, 6.9vw, 94px); font-weight: 500; line-height: 1.04; letter-spacing: -5px; }
.hero-word { white-space: nowrap; }
.hero-role { font-size: clamp(19px, 1.9vw, 25px); line-height: 1.5; letter-spacing: -.7px; margin-top: 27px; font-weight: 500; }
.hero-description { color: var(--muted); font-size: 17px; line-height: 1.8; max-width: 490px; margin-top: 21px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 25px; margin-top: 32px; }
.button-primary { display: inline-flex; align-items: center; justify-content: space-between; gap: 22px; padding: 16px 20px; background: var(--ink); color: var(--paper); font-size: 13px; min-height: 50px; }
.button-primary:hover { background: #48443d; }
.text-link { display: inline-flex; align-items: center; gap: 12px; padding-block: 9px; border-bottom: 1px solid #a39b8e; font-size: 13px; }
.text-link:hover { border-bottom-color: var(--ink); }
.hero-portrait { width: 100%; max-width: 550px; justify-self: end; perspective: 1000px; }
.hero-portrait img { width: 100%; height: auto; max-height: min(66svh, 590px); object-fit: contain; transform: translate3d(var(--portrait-x, 0px), var(--portrait-y, 0px), 0) rotateX(var(--portrait-rx, 0deg)) rotateY(var(--portrait-ry, 0deg)); }

.portfolio-section { display: grid; grid-template-columns: minmax(190px, .36fr) minmax(0,1fr); gap: 70px; padding-block: 83px; border-top: 1px solid var(--line); }
.section-heading { min-width: 0; }
.section-label { display: block; font-size: 9px; font-weight: 400; letter-spacing: 1.6px; color: var(--muted); line-height: 1.7; margin-bottom: 14px; }
.section-heading h2 { font-size: 30px; line-height: 1.15; letter-spacing: -.9px; font-weight: 500; }
.section-body { min-width: 0; }
.room-lead { color: var(--muted); font-size: 16px; line-height: 1.85; margin-bottom: 29px; max-width: 720px; }
.content-section p, .content-section li, .stack-explainer dd, .education-item p { color: #615d56; font-size: 15px; line-height: 1.85; }
.content-section p + p { margin-top: 16px; }
.content-kicker { display: block; font-size: 9px; letter-spacing: 1px; line-height: 1.8; color: var(--muted); margin-bottom: 11px; }
.content-section h3 { font-size: 23px; line-height: 1.4; letter-spacing: -.6px; font-weight: 500; margin-bottom: 16px; }
.content-section h4 { font-size: 12px; font-weight: 600; margin: 22px 0 10px; }
.room-list { padding-left: 19px; margin: 0; }
.room-list li { padding-left: 3px; margin: 8px 0; }
.room-list li::marker { color: #8d877b; }
.room-link { display: inline-flex; align-items: center; gap: 14px; margin-top: 18px; padding-block: 8px; border-bottom: 1px solid #a39b8e; font-size: 13px; line-height: 1.6; }
.room-link:hover { border-color: var(--ink); }
.room-link .ui-icon { width: 15px; height: 15px; }

.experience-content .content-section { padding-bottom: 31px; }
.experience-content .content-section + .content-section { border-top: 1px solid var(--line); padding-top: 31px; }
.experience-content > .room-link { margin-top: 0; }
.profile-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; margin-block: 30px; padding-block: 23px; border-block: 1px solid var(--line); }
.profile-facts > span { display: grid; grid-template-columns: 21px 1fr; gap: 6px 12px; }
.profile-facts .ui-icon { grid-row: 1 / 3; color: var(--muted); }
.profile-facts strong { font-size: 14px; font-weight: 500; }
.profile-facts small { grid-column: 2; color: var(--muted); font-size: 12px; line-height: 1.6; }
.about-content .content-section h3 { font-size: 21px; }
.language-strip { display: flex; flex-wrap: wrap; gap: 20px 40px; margin-top: 29px; padding-top: 24px; border-top: 1px solid var(--line); }
.language-strip > span { font-size: 13px; }
.language-strip strong { display: block; color: var(--muted); font-weight: 400; font-size: 11px; margin-top: 7px; }
.education-timeline { display: grid; gap: 28px; }
.education-item { position: relative; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.education-item:last-child { border: 0; padding-bottom: 0; }
.education-marker { display: none; }
.education-status { display: inline-block; color: #56664f; font-size: 9px; letter-spacing: 1px; margin-bottom: 12px; }
.education-item h3 { font-size: 20px; line-height: 1.5; font-weight: 500; letter-spacing: -.4px; margin-bottom: 10px; max-width: 620px; }
.education-item p { font-size: 14px; }

.projects-section { display: block; }
.projects-section .section-heading { margin-bottom: 29px; }
.projects-content > .room-lead { max-width: 720px; }
.project-detail { border-top: 1px solid var(--line); }
.project-detail:last-child { border-bottom: 1px solid var(--line); }
.project-detail > summary { display: grid; grid-template-columns: minmax(180px,.5fr) minmax(0,1fr) 20px; align-items: center; gap: 25px; padding-block: 27px; cursor: pointer; list-style: none; }
.project-detail > summary::-webkit-details-marker { display: none; }
.project-summary-title { font-size: 23px; font-weight: 500; letter-spacing: -.5px; }
.project-summary-description { color: var(--muted); font-size: 14px; line-height: 1.6; }
.project-summary-arrow { justify-self: end; font-size: 24px; font-weight: 300; }
.project-summary-arrow::before { content: '+'; }
.project-detail[open] .project-summary-arrow::before { content: '−'; }
.project-detail > summary:hover .project-summary-title { text-decoration: underline; text-underline-offset: 5px; }
.project-details { max-width: 810px; padding: 5px 0 35px; margin-left: auto; }
.project-details .case-heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.project-details .project-ribbon { display: none; }
.project-ribbon { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 11px; margin-bottom: 19px; }
.project-ribbon span + span::before { content: '·'; margin-right: 18px; }
.stack-explainer { margin: 20px 0 5px; }
.stack-explainer > div { display: grid; grid-template-columns: 95px 1fr; gap: 20px; padding: 12px 0; border-top: 1px solid var(--line); }
.stack-explainer dt { font-size: 13px; font-weight: 500; padding-top: 4px; }
.stack-explainer dd { margin: 0; font-size: 14px; }

.tech-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 25px; color: var(--muted); padding-block: 17px; border-block: 1px solid var(--line); font-size: 12px; }
.tech-summary strong { color: var(--ink); font-weight: 500; }
.tech-filters { display: flex; flex-wrap: wrap; gap: 5px 19px; padding-block: 19px 25px; }
.tech-filters button { border: 0; border-bottom: 1px solid transparent; background: transparent; color: var(--muted); padding: 8px 0; font-size: 11px; min-height: 36px; }
.tech-filters button[aria-pressed=true] { color: var(--ink); border-color: var(--ink); }
.tech-filters button:hover { color: var(--ink); }
.tech-filters .ui-icon { display: none; }
.tech-filters button > span { margin-left: 4px; font-size: 10px; }
#tech-catalog { display: grid; grid-template-columns: 1fr 1fr; gap: 32px 35px; }
.tech-category { padding-top: 16px; border-top: 1px solid var(--line); min-width: 0; }
.category-symbol, .category-count, .tech-mark { display: none; }
.tech-category h3 { font-size: 17px; font-weight: 500; letter-spacing: -.3px; line-height: 1.5; }
.tech-category header p { font-size: 11px; color: var(--muted); line-height: 1.7; margin: 6px 0 13px; }
.tech-grid { display: flex; flex-wrap: wrap; gap: 7px 15px; }
.tech-tile strong { display: block; font-size: 13px; font-weight: 400; line-height: 1.7; }
.note { padding-top: 22px; margin-top: 30px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.85; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 27px; }
.contact-card { display: flex; align-items: center; min-width: 0; gap: 13px; padding-block: 22px; border-top: 1px solid var(--line); }
.contact-icon { display: grid; place-items: center; color: #625e57; }
.contact-icon .ui-icon { width: 22px; height: 22px; }
.contact-card-copy { min-width: 0; }
.contact-card-copy strong { display: block; font-size: 17px; font-weight: 500; margin-bottom: 6px; }
.contact-card-copy small { display: block; font-size: 11px; color: var(--muted); line-height: 1.7; overflow-wrap: anywhere; }
.contact-arrow { margin-left: auto; width: 16px; height: 16px; }
.contact-card:hover .contact-card-copy strong { text-decoration: underline; text-underline-offset: 4px; }
.contact-footnote { color: var(--muted); font-size: 12px; margin-top: 24px; }
.site-footer { border-top: 1px solid var(--line); display: flex; align-items: center; flex-wrap: wrap; gap: 22px; padding-block: 29px; font-size: 11px; }
.site-footer > span { color: var(--muted); }
.site-footer > a:nth-last-child(2) { margin-left: auto; }
.site-footer > a:last-child { font-size: 18px; padding-inline: 5px; }

@media (max-width: 1100px) {
  .wrap { width: calc(100% - 64px); }
  .site-header { gap: 23px; }
  .wordmark { font-size: 21px; }
  .wordmark small { font-size: 8px; letter-spacing: 1.4px; }
  .main-nav { gap: 15px; font-size: 11px; }
  .game-shortcut { font-size: 11px; padding-inline: 12px; gap: 9px; }
  .hero h1 { letter-spacing: -3.7px; }
  .hero-description { font-size: 16px; }
  .hero-actions { gap: 19px; }
  .button-primary, .text-link { font-size: 12px; }
  .button-primary { padding-inline: 15px; gap: 15px; }
  .portfolio-section { gap: 44px; grid-template-columns: 190px minmax(0,1fr); }
  .section-heading h2 { font-size: 27px; }
}

@media (min-width: 701px) and (max-width: 900px) {
  .site-header { flex-wrap: wrap; justify-content: space-between; padding-top: 23px; gap: 15px; }
  .main-nav { order: 3; width: 100%; justify-content: space-between; padding-bottom: 9px; }
  .game-shortcut { margin-left: auto; }
  .header-tools { margin-left: auto; }
  .hero { min-height: 650px; padding-block: 65px; }
  .hero h1 { font-size: 62px; }
  .hero-role { font-size: 20px; }
  .hero-description { font-size: 15px; }
  .hero-actions { gap: 15px; }
  .portfolio-section { grid-template-columns: 155px minmax(0,1fr); gap: 35px; padding-block: 64px; }
  .contact-grid { grid-template-columns: 1fr; }
  .profile-facts { gap: 17px; }
  .profile-facts > span { display: block; }
  .profile-facts .ui-icon { margin-bottom: 10px; }
  .profile-facts strong, .profile-facts small { display: block; margin-bottom: 5px; }
}

@media (max-width: 700px) {
  .wrap { width: calc(100% - 40px); }
  .site-header { flex-wrap: wrap; gap: 17px 12px; padding-top: 22px; }
  .wordmark { font-size: 21px; }
  .wordmark small { font-size: 7px; letter-spacing: 1.3px; }
  .game-shortcut { margin-left: auto; font-size: 10px; padding: 10px 11px; gap: 8px; }
  .header-tools { margin-left: auto; gap: 10px; }
  .language-switch { gap: 2px; }
  .language-switch a { width: 30px; height: 34px; }
  .language-switch img { width: 23px; height: 17px; }
  .main-nav { order: 3; width: 100%; display: grid; grid-template-columns: repeat(6,auto); justify-content: space-between; gap: 0 8px; font-size: 10px; padding-bottom: 9px; }
  .main-nav a { padding-block: 9px; }
  .hero { min-height: 0; grid-template-columns: 1fr; padding-block: 44px 43px; gap: 28px; }
  .hero h1 { font-size: clamp(48px, 10.5vw, 66px); letter-spacing: -2.7px; line-height: 1.04; }
  .hero-role { font-size: 19px; letter-spacing: -.4px; margin-top: 21px; }
  .hero-description { font-size: 15px; line-height: 1.8; margin-top: 15px; max-width: 450px; }
  .hero-actions { margin-top: 23px; gap: 17px; }
  .button-primary { min-height: 45px; padding: 12px 14px; font-size: 11px; gap: 15px; }
  .text-link { font-size: 11px; gap: 9px; }
  .hero-portrait { justify-self: center; width: min(64%, 260px); }
  .hero-portrait img { max-height: none; }
  .portfolio-section { grid-template-columns: 1fr; gap: 27px; padding-block: 47px; }
  .section-label { font-size: 8px; margin-bottom: 11px; }
  .section-heading h2 { font-size: 29px; }
  .room-lead { font-size: 15px; line-height: 1.8; margin-bottom: 26px; }
  .content-section p, .content-section li { font-size: 14px; line-height: 1.85; }
  .content-kicker { font-size: 8px; letter-spacing: .8px; }
  .content-section h3 { font-size: 22px; line-height: 1.4; }
  .content-section h4 { font-size: 12px; }
  .room-link { font-size: 12px; gap: 12px; }
  .profile-facts { gap: 20px; }
  .profile-facts > span { grid-template-columns: 1fr; gap: 9px; }
  .profile-facts .ui-icon { grid-row: auto; }
  .profile-facts small { grid-column: 1; font-size: 11px; }
  .profile-facts strong { font-size: 13px; }
  .language-strip { justify-content: space-between; gap: 15px; }
  .language-strip > span { font-size: 12px; }
  .language-strip strong { font-size: 10px; }
  .education-item h3 { font-size: 20px; }
  .education-item p { font-size: 14px; }
  .projects-section .section-heading { margin-bottom: 27px; }
  .project-detail > summary { grid-template-columns: minmax(0,1fr) 20px; gap: 7px 17px; padding-block: 23px; }
  .project-summary-title { font-size: 22px; }
  .project-summary-description { grid-column: 1; font-size: 12px; }
  .project-summary-arrow { grid-column: 2; grid-row: 1 / 3; }
  .project-details { padding-block: 0 28px; }
  .stack-explainer > div { grid-template-columns: 72px 1fr; gap: 15px; }
  .stack-explainer dd { font-size: 13px; }
  .tech-summary { font-size: 11px; gap: 12px; justify-content: space-between; }
  .tech-filters { gap: 3px 15px; padding-bottom: 21px; }
  .tech-filters button { font-size: 10px; min-height: 39px; }
  #tech-catalog { gap: 27px 22px; }
  .tech-category h3 { font-size: 16px; }
  .tech-category header p { font-size: 10px; }
  .tech-tile strong { font-size: 12px; }
  .note { font-size: 11px; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-card { padding-block: 21px; }
  .contact-card-copy small { font-size: 11px; }
  .site-footer { font-size: 10px; gap: 14px 19px; padding-block: 24px; }
  .site-footer > a:nth-last-child(2) { margin-left: auto; }
  .site-footer > span { display: none; }
}

@media (max-width: 380px) {
  .wrap { width: calc(100% - 32px); }
  .wordmark { font-size: 19px; }
  .wordmark small { font-size: 6px; letter-spacing: 1.1px; }
  .game-shortcut { font-size: 9px; padding-inline: 10px; }
  .game-shortcut .game-label { display: none; }
  .game-shortcut .game-label-short { display: inline; font-size: inherit; }
  .main-nav { grid-template-columns: repeat(3,1fr); gap: 0 14px; }
  .hero-role { font-size: 18px; }
  .hero-actions { gap: 16px; }
  .button-primary { font-size: 10px; padding-inline: 12px; gap: 12px; }
  .text-link { font-size: 10px; gap: 7px; }
  #tech-catalog { grid-template-columns: 1fr; }
  .tech-tile strong { font-size: 13px; }
}

/* One gentle greeting, then movement responds only to a mouse interaction. */
@media (prefers-reduced-motion: no-preference) {
  .hero-portrait { animation: portrait-greeting 3.8s ease-in-out both; }
  .hero-portrait img { transition: transform 550ms cubic-bezier(.2,.7,.25,1); }
  .hero-letter { display: inline-block; transition: transform 330ms cubic-bezier(.2,.8,.2,1), color 330ms ease; }
  .main-nav a { position: relative; }
  .main-nav a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 4px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 230ms ease; }
  .button-primary, .game-shortcut, .language-switch a { transition: transform 230ms ease, background-color 230ms ease, border-color 230ms ease; }
  .hero-actions a > span, .game-shortcut > span:last-child, .contact-arrow, .project-summary-title, .contact-icon, .tech-tile { display: inline-block; transition: transform 250ms ease; }
}
@keyframes portrait-greeting {
  0% { opacity: 0; transform: translate3d(0, 10px, 0); }
  22% { opacity: 1; transform: translate3d(0, 0, 0); }
  62% { opacity: 1; transform: translate3d(0, -6px, 0); }
  100% { opacity: 1; transform: none; }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .hero-letter:hover { color: #756249; transform: translateY(-4px) rotate(-3deg); }
  .main-nav a:hover { text-decoration: none; }
  .main-nav a:hover::after, .main-nav a:focus-visible::after { transform: scaleX(1); }
  .button-primary:hover, .game-shortcut:hover, .language-switch a:hover { transform: translateY(-2px); }
  .language-switch a:hover { background: #ece6db; border-color: #c9bfae; }
  .hero-actions a:hover > span { transform: translate(2px, -2px); }
  .game-shortcut:hover > span:last-child, .contact-card:hover .contact-arrow { transform: translate(2px, -2px); }
  .project-detail > summary:hover .project-summary-title { transform: translateX(3px); }
  .contact-card:hover .contact-icon { transform: rotate(-4deg); }
  .tech-tile:hover { transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .hero-portrait img { transform: none; }
}

@media print {
  :root { color: #111; background: white; }
  .wrap { width: 100%; }
  .site-header, .hero-actions, .tech-filters, .site-footer { display: none !important; }
  .hero { min-height: 0; padding-block: 20px; }
  .hero h1 { font-size: 48px; letter-spacing: -2px; }
  .hero-portrait { max-width: 220px; }
  .hero-portrait img { max-height: 240px; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .portfolio-section { padding-block: 25px; gap: 30px; }
  .content-section, .education-item, .tech-category { break-inside: avoid; }
  .section-heading h2 { font-size: 24px; }
  .tech-category[hidden] { display: block !important; }
}
