
:root {
  --paper: #f6f8f7;
  --surface: #fff;
  --ink: #171918;
  --muted: #59645e;
  --line: #d9dfdc;
  --dark: #171a18;
  --lime: #c9f45a;
  --cyan: #58d7d0;
  --header-height: 68px;
  --radius: 0.5rem;
  color-scheme: light;
}

* { box-sizing: border-box; letter-spacing: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 20px); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 "Segoe UI", Arial, Helvetica, sans-serif; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid #168b90; outline-offset: 5px; }
p, h1, h2, h3, dd { overflow-wrap: anywhere; }
.page-shell { width: min(1040px, calc(100% - 64px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 30; top: 8px; left: 16px; padding: 10px 16px; transform: translateY(-160%); background: var(--lime); color: var(--ink); }
.skip-link:focus { transform: none; }

.site-header { position: fixed; z-index: 20; top: 0; left: 0; width: 100%; height: var(--header-height); border-bottom: 1px solid #39423b; background: var(--dark); color: #fff; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 14px; }
.brand span { display: grid; flex: 0 0 32px; height: 32px; place-items: center; border: 1px solid #68746a; border-radius: 50%; color: var(--lime); font: 700 12px/1 ui-monospace, Consolas, monospace; }
.brand strong { font-weight: 600; overflow-wrap: anywhere; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; }
.site-header nav a { display: inline-flex; align-items: center; min-height: 40px; color: #d1d9d3; }
.site-header nav a:hover { color: var(--lime); }
main { padding-top: var(--header-height); }

.intro { padding: 38px 0 34px; background: var(--dark); color: #fff; }
.identity { display: flex; align-items: center; gap: 26px; }
.identity > div { min-width: 0; }
.portrait { display: block; flex: 0 0 112px; width: 112px; height: 112px; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.portrait-trigger { display: block; flex: 0 0 auto; margin: 0; padding: 0; border: 0; border-radius: 6px; background: transparent; cursor: zoom-in; }
.portrait-trigger:focus-visible { outline: 2px solid var(--cyan); outline-offset: 5px; }
.portrait-trigger:hover { outline: 2px solid var(--cyan); outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.photo-viewer { position: fixed; z-index: 100; inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: calc(72px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px)); border: 0; border-radius: 0; background: rgb(8 12 10 / 96%); color: #fff; transform: none; box-shadow: none; overflow: auto; overscroll-behavior: contain; animation: none; }
.photo-viewer[open], .photo-viewer[data-slot="dialog-content"] { display: grid; place-items: center; gap: 0; }
.photo-viewer::backdrop { background: #080c0a; }
.photo-full { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100dvh - 96px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); object-fit: contain; }
.photo-close { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: calc(16px + env(safe-area-inset-right, 0px)); display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid #65736a; border-radius: 6px; background: #202a23; color: #fff; cursor: pointer; }
.photo-close:hover { background: #344238; }
.photo-close:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.role { margin: 0 0 8px; color: var(--lime); font-size: 18px; font-weight: 600; }
h1 { margin: 0; font-size: 44px; line-height: 1.15; font-weight: 650; }
.intro-lead { max-width: 780px; margin: 22px 0 12px; color: #d1d9d3; font-size: 18px; line-height: 1.55; }
.primary-stack { margin: 0; color: var(--cyan); font: 14px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; }
.contact-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 14px; color: var(--lime); font-weight: 600; text-decoration: underline; text-underline-offset: 5px; }
.contact-link:hover { color: #fff; }

.section-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 24px; padding: 30px 0 22px; }
h2 { margin: 0; font-size: 24px; line-height: 1.3; font-weight: 650; }
.section-heading > span { color: var(--muted); font-size: 14px; }
.project-case { display: grid; grid-template-columns: minmax(0, 235px) minmax(0, 1fr); gap: 36px; padding: 26px 0; border-top: 1px solid var(--line); }
.project-heading { min-width: 0; }
.project-number { display: block; margin-bottom: 8px; color: #087e78; font: 13px/1.5 ui-monospace, Consolas, monospace; }
.accent-lime .project-number { color: #557600; }
.accent-orange .project-number { color: #9e560e; }
h3 { margin: 0; font-size: 24px; line-height: 1.25; font-weight: 650; }
.project-role { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.project-status { margin: 12px 0 0; padding-left: 10px; border-left: 3px solid #c28635; color: #815012; font-size: 14px; font-weight: 600; }
.project-body { min-width: 0; }
.project-description { margin: 0 0 14px; font-weight: 600; }
.project-details { display: grid; gap: 12px; margin: 0; }
.project-details > div { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 14px; }
.project-details dt { color: var(--muted); font-size: 14px; line-height: 1.7; }
.project-details dd { margin: 0; }
.project-stack { margin: 16px 0 0; color: #17716c; font: 13px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; }
.projects { padding-bottom: 14px; }

.experience { border-block: 1px solid var(--line); background: var(--surface); padding: 30px 0; }
.experience-grid { display: grid; grid-template-columns: minmax(0, 235px) minmax(0, 1fr); gap: 36px; }
.experience p { margin: 0; }
.experience .freelance { margin-top: 12px; color: var(--muted); }
.freelance strong { color: var(--ink); font-weight: 600; }

footer { background: #101512; color: #fff; padding: 8px 0 24px; }
footer .section-heading > span { color: #aebdb3; }
.contact-list { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, .9fr); gap: 24px; margin: 0; font-style: normal; }
.contact-list > div { min-width: 0; }
.contact-list span { display: block; margin-bottom: 6px; color: #aebdb3; font-size: 14px; }
.contact-list a { display: block; padding-block: 6px; overflow-wrap: anywhere; }
.contact-list a:hover { color: var(--lime); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; margin-top: 26px; padding-top: 18px; border-top: 1px solid #36453c; color: #aebdb3; font-size: 13px; }
.footer-bottom a { display: inline-flex; align-items: center; min-height: 36px; }

@media (max-width: 760px) {
  .page-shell { width: calc(100% - 40px); }
  .project-case, .experience-grid { grid-template-columns: minmax(0, 190px) minmax(0, 1fr); gap: 24px; }
  .project-details > div { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .contact-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { font-size: 38px; }
}

@media (max-width: 560px) {
  :root { --header-height: 104px; }
  .page-shell { width: calc(100% - 36px); }
  .header-inner { flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; }
  .site-header nav { gap: 8px 24px; }
  .intro { padding: 24px 0; }
  .identity { gap: 16px; align-items: flex-start; }
  .portrait { flex-basis: 76px; width: 76px; height: 76px; }
  .role { font-size: 16px; margin-bottom: 6px; }
  h1 { font-size: 30px; line-height: 1.1; }
  .intro-lead { font-size: 16px; margin-top: 18px; }
  .primary-stack { font-size: 13px; }
  .section-heading { padding-top: 24px; padding-bottom: 18px; }
  .section-heading > span { flex-basis: 100%; }
  .project-case { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-block: 24px; }
  .project-heading { position: relative; padding-left: 34px; }
  .project-number { position: absolute; top: 4px; left: 0; margin: 0; }
  h3 { font-size: 23px; }
  .project-role { margin-top: 6px; }
  .project-description { margin-bottom: 12px; }
  .project-details { gap: 12px; }
  .experience-grid, .contact-list { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .experience { padding-block: 26px; }
  .contact-list a { padding-block: 8px; }
  .footer-bottom { align-items: flex-start; flex-direction: column; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  .photo-viewer { display: none !important; }
  .site-header, .skip-link, .contact-link, .footer-bottom a { display: none; }
  main { padding-top: 0; }
  .page-shell { width: 100%; }
  .intro, footer, .experience { background: #fff; color: #171918; }
  .intro { padding-top: 0; }
  .role, .intro-lead, .primary-stack, footer .section-heading > span, .contact-list span, .footer-bottom { color: #333; }
  .project-case { break-inside: avoid; }
}
