:root {
  color-scheme: light;
  --paper: #fafafa;
  --ink: #0f172a;
  --muted: #626b79;
  --line: #e2e2e2;
  --blue: #0000ff;
  --green: #e5efdf;
  --lavender: #eee7f7;
  --yellow: #faf0cc;
  --peach: #f9e6dc;
  --blue-tint: #cfe0ff;
  --surface: #f0f0f0;
  --note: #eff3eb;
  --note-line: #e4eadf;
  --note-ink: #535e4d;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #11151d;
  --ink: #e4e9f2;
  --muted: #a0aabb;
  --line: #2b3341;
  --blue: #78a7ff;
  --green: #2d4135;
  --lavender: #3a324b;
  --yellow: #423e29;
  --peach: #46332f;
  --blue-tint: #28384e;
  --surface: #202734;
  --note: #202e27;
  --note-line: #35443b;
  --note-ink: #c1d0c0;
}

:root[data-theme="read"] {
  color-scheme: light;
  --paper: #f7f1e6;
  --ink: #302b24;
  --muted: #696052;
  --line: #ded5c5;
  --blue: #285bb5;
  --surface: #eee5d6;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 32px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 16px; line-height: 1.5; }
::selection { background: var(--blue); color: var(--paper); }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration-style: solid; text-decoration-color: var(--blue); text-decoration-thickness: 1.5px; text-underline-offset: 3px; transition: color 160ms, text-decoration-color 160ms; }
a:hover { color: var(--blue); text-decoration-color: var(--blue); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 2px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
p, h1, h2, h3 { margin: 0; }
p + p { margin-top: 17px; }
h1, h2, h3 { line-height: 1.35; font-weight: 700; }
h1 { font-size: 28px; letter-spacing: -.55px; }
h2 { font-size: 19.2px; letter-spacing: -.25px; }
h3 { font-size: 16px; letter-spacing: 0; }
mark { padding: 0 .12em .04em; background: var(--green); color: inherit; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
mark.lavender { background: var(--lavender); }
mark.yellow { background: var(--yellow); }
.shell { width: min(100% - 40px, 720px); margin-inline: auto; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 10; padding: 8px 16px; background: var(--paper); border: 2px solid var(--blue); }
.skip-link:focus { top: 12px; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 23px 0; border-bottom: 1px dashed var(--line); }
.identity { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; text-decoration: none; font-weight: 700; font-size: 17px; letter-spacing: -.25px; }
.theme-toggle { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--blue); transition: color 150ms; }
.theme-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.theme-toggle:hover { color: var(--ink); }
.theme-toggle:focus-visible { outline-offset: 2px; border-radius: 4px; }
.avatar { width: 39px; height: 39px; object-fit: cover; object-position: 54% 40%; border-radius: 50%; }
.site-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; font-size: 14px; }
.site-nav a { text-decoration: none; color: var(--ink); padding-block: 6px; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--ink); text-decoration-line: underline; text-decoration-color: var(--blue); text-decoration-thickness: 1.5px; text-underline-offset: 5px; }
.hero { padding: 39px 0 29px; }
.hero h1 { margin-bottom: 20px; }
.intro { font-size: 16px; line-height: 1.5; letter-spacing: 0; }
.intro p + p { margin-top: 18px; }
.location { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13px; color: var(--muted); margin-top: 26px; }
.location svg { width: 14px; height: 14px; }
.section { padding-block: 26px; border-top: 1px dashed var(--line); }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
.section-heading > a { flex-shrink: 0; font-size: 13px; text-decoration-thickness: 1.5px; }
.section-caption { color: var(--muted); font-size: 15px; margin-top: 10px; }
.project-list { list-style: none; padding: 0; margin: 0; }
.project-row { display: grid; grid-template-columns: 36px 1fr; gap: 16px; padding: 19px 0; }
.project-row + .project-row { border-top: 1px solid var(--line); }
.project-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 7px; background: var(--green); font-size: 15px; line-height: 1; font-weight: 650; }
.project-icon.lavender { background: var(--lavender); }
.project-icon.yellow { background: var(--yellow); }
.project-icon.peach { background: var(--peach); }
.project-icon.blue { background: var(--blue-tint); }
.project-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.project-title { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 2px; }
.project-title h3 { font-size: 16px; line-height: 1.5; }
.project-title a { text-decoration-color: var(--blue); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.project-title a:hover { text-decoration-color: var(--blue); }
.arrow { display: inline-block; color: var(--muted); font-size: .9em; text-decoration: none; margin-left: 4px; }
.tag { padding: 2px 7px; border-radius: 4px; background: var(--green); font-size: 10px; line-height: 1.7; font-weight: 550; letter-spacing: .1px; white-space: nowrap; }
.tag.lavender { background: var(--lavender); }
.tag.yellow { background: var(--yellow); }
.project-row p { max-width: 610px; margin-top: 7px; color: var(--muted); font-size: 14px; line-height: 1.75; }
.project-meta { display: block; margin-top: 10px; font-size: 12px; color: var(--muted); }
.note { padding: 19px 22px; margin: 4px 0 28px; background: var(--note); border: 1px solid var(--note-line); border-radius: 5px; }
.note p { font-size: 14px; line-height: 1.6; color: var(--note-ink); }
.current-work { margin: 0 0 27px; font-size: 15px; line-height: 1.6; }
.writing-list { list-style: none; padding: 0; margin: 6px 0 0; }
.writing-row { padding: 18px 0; }
.writing-row + .writing-row { border-top: 1px solid var(--line); }
.writing-row a { text-decoration: none; display: flex; justify-content: space-between; align-items: baseline; gap: 20px; }
.writing-row a span { text-decoration: underline; text-decoration-color: var(--blue); text-decoration-thickness: 1.5px; text-underline-offset: 3px; font-size: 15px; font-weight: 550; }
.writing-row a:hover span { text-decoration-color: var(--blue); }
.writing-row time { flex-shrink: 0; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 400; }
.writing-row p { color: var(--muted); font-size: 14px; margin-top: 9px; }
.site-footer { padding: 27px 0 30px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 13px; }
.newsletter { margin-bottom: 26px; }
.newsletter h2 { font-size: 16px; letter-spacing: 0; margin-bottom: 8px; color: var(--ink); }
.newsletter > p { font-size: 14px; margin: 0 0 13px; }
.newsletter-form { display: grid; grid-template-columns: .9fr 1.2fr auto; gap: 9px; }
.newsletter-form input { width: 100%; min-width: 0; padding: 11px 12px; color: var(--ink); border: 1px solid var(--line); border-radius: 4px; background: var(--paper); font-size: 14px; }
.newsletter-form input::placeholder { color: var(--muted); opacity: 1; }
.newsletter-form button { padding: 10px 16px; border: 1px solid var(--ink); border-radius: 4px; background: var(--ink); color: var(--paper); font-size: 14px; }
.newsletter-form button:hover { background: var(--blue); border-color: var(--blue); color: var(--paper); }
.newsletter .newsletter-help { font-size: 12px; margin-top: 9px; margin-bottom: 0; }
.newsletter-status { font-size: 12px; line-height: 1.6; }
.newsletter-status:empty { display: none; }
.social-links { display: flex; align-items: center; gap: 21px; margin: 22px 0; }
.social-links a { color: var(--ink); display: inline-flex; padding: 3px; }
.social-links a:hover { color: var(--blue); }
.social-links svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 17px; font-size: 13px; color: var(--ink); }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { text-decoration-line: underline; }
.footer-nav.secondary { font-size: 12px; color: var(--muted); gap: 10px 17px; margin-top: 13px; }
.site-stats { margin-top: 23px; line-height: 1.8; color: var(--ink); }
.site-stats p + p { margin-top: 0; }
.site-stats a { text-decoration: none; }
.site-stats a:hover { text-decoration-line: underline; }
.stats-separator { padding-inline: 7px; color: var(--muted); }
.year-progress { display: flex; align-items: center; gap: 9px; margin-top: 7px; font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; }
.year-progress progress { appearance: none; width: 170px; height: 10px; border: 0; border-radius: 0; background: var(--line); color: var(--blue); }
.year-progress progress::-webkit-progress-bar { background: var(--line); }
.year-progress progress::-webkit-progress-value { background: repeating-linear-gradient(90deg, var(--blue) 0 3px, transparent 3px 4px); }
.year-progress progress::-moz-progress-bar { background: repeating-linear-gradient(90deg, var(--blue) 0 3px, transparent 3px 4px); }
.visitor-count { display: flex; align-items: center; gap: 8px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.visitor-count svg { width: 17px; height: 17px; fill: none; stroke: var(--blue); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.visitor-count strong { color: var(--blue); font-variant-numeric: tabular-nums; }
.footer-copy { margin-top: 18px; font-size: 12px; }
.page-intro { padding: 38px 0 29px; }
.page-intro h1 { margin-bottom: 20px; }
.page-intro > p:last-child { max-width: 650px; font-size: 16px; color: var(--ink); line-height: 1.5; }
.jump-links { display: flex; flex-wrap: wrap; gap: 10px 24px; padding-bottom: 30px; font-size: 13px; }
.jump-links a { text-decoration-thickness: 1.5px; }
.project-section { padding-top: 31px; padding-bottom: 23px; border-top: 1px solid var(--line); }
.project-section h2 { margin-bottom: 8px; font-size: 20px; }
.prose { font-size: 16px; line-height: 1.65; }
.prose h2 { margin: 32px 0 16px; font-size: 20px; }
.prose h3 { margin: 25px 0 12px; }
.prose ul, .prose ol { padding-left: 23px; margin: 16px 0 23px; }
.prose li { padding-left: 4px; margin-bottom: 8px; }
.about-photo { width: 100%; max-height: 300px; object-fit: cover; object-position: center 32%; border-radius: 5px; margin: 3px 0 33px; }
.experience-list { padding: 0; margin: 0; list-style: none; }
.experience-section { margin-top: 38px; }
.experience-item { display: grid; grid-template-columns: 125px 1fr; gap: 24px; padding: 22px 0; }
.experience-item + .experience-item { border-top: 1px solid var(--line); }
.experience-date { color: var(--muted); font-size: 12px; padding-top: 4px; }
.experience-item h3 { font-size: 16px; margin-bottom: 6px; }
.experience-item p { color: var(--muted); font-size: 14px; line-height: 1.8; }
.skill-list { display: flex; flex-wrap: wrap; gap: 9px; padding: 0; margin: 21px 0 0; list-style: none; }
.skill-list li { padding: 4px 10px; font-size: 12px; background: var(--surface); border-radius: 4px; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; list-style: none; padding: 0; margin: 20px 0; }
.detail-list li { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.detail-list h3 { font-size: 15px; }
.detail-list p { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.contact-main { padding-bottom: 30px; }
.contact-options { margin-top: 12px; border-top: 1px solid var(--line); }
.contact-option { display: grid; grid-template-columns: 130px 1fr auto; align-items: baseline; gap: 18px; padding: 27px 0; border-bottom: 1px solid var(--line); }
.contact-option h2 { font-size: 15px; letter-spacing: 0; }
.contact-option p { color: var(--muted); font-size: 13px; margin-top: 7px; }
.contact-option > div > a { overflow-wrap: anywhere; font-size: 17px; }
.contact-option > .arrow { font-size: 20px; }
.contact-note { margin-top: 34px; }
.article-header { padding: 47px 0 31px; }
.back-link { font-size: 13px; text-decoration-thickness: 1.5px; }
.article-header h1 { margin: 27px 0 17px; font-size: clamp(25px, 4vw, 32px); letter-spacing: -.55px; }
.article-meta { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 12px; }
.article-body { padding-bottom: 38px; }
.article-footer { border-top: 1px solid var(--line); padding: 28px 0 44px; font-size: 14px; color: var(--muted); }
.article-footer p + p { margin-top: 8px; }
.writing-page { padding-bottom: 15px; }
.writing-page .writing-row { padding: 25px 0; }
.writing-page .writing-row a span { font-size: 16px; }

:root[data-theme="read"] main :is(p, .prose li) { font-family: Georgia, "Times New Roman", serif; font-size: 18px; line-height: 1.8; }

@media (max-width: 660px) {
  .site-header { flex-direction: column; align-items: flex-start; gap: 17px; padding: 21px 0 18px; }
  .identity { width: 100%; justify-content: flex-start; }
  .site-nav { justify-content: space-between; gap: 8px 12px; width: 100%; }
  .hero { padding-top: 30px; }
  .hero h1 { letter-spacing: -.55px; }
  .intro { font-size: 16px; }
  .page-intro { padding-top: 30px; }
  .writing-row a { flex-direction: column; gap: 7px; }
  .writing-row time { font-size: 11px; }
  .experience-item { grid-template-columns: 1fr; gap: 7px; }
  .detail-list { grid-template-columns: 1fr; }
  .contact-main { min-height: auto; padding-bottom: 22px; }
  .contact-option { grid-template-columns: 1fr auto; gap: 11px; }
  .contact-option h2 { grid-column: 1 / -1; }
  .contact-option > div > a { font-size: 16px; }
  .newsletter-form { grid-template-columns: 1fr; }
  .newsletter-form button { min-height: 43px; }
  .year-progress { flex-wrap: wrap; }
}

@media (max-width: 380px) {
  .shell { width: calc(100% - 36px); }
  .site-nav { column-gap: 8px; font-size: 13px; }
  h1 { font-size: 26px; }
  .project-row { grid-template-columns: 34px 1fr; gap: 12px; }
  .project-icon { width: 34px; height: 34px; border-radius: 8px; }
  .section-heading { gap: 12px; }
  .section-heading > a { font-size: 12px; }
  .note { padding: 20px; }
}

@media (pointer: coarse) {
  .theme-toggle { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  a, .theme-toggle { transition: none; }
}

@media print {
  body { background: white; color: black; font-size: 12pt; }
  .shell { width: 100%; }
  .site-nav, .skip-link, .jump-links, .theme-toggle, .newsletter, .year-progress { display: none; }
  .hero, .page-intro { padding-block: 24px; }
  .project-row, .experience-item { break-inside: avoid; }
  a { text-decoration-thickness: 1.5px; }
}
