@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  color-scheme: light;
  --background: #ffffff;
  --surface: #f3f5f8;
  --text: #18232e;
  --secondary: #445468;
  --muted: #596779;
  --accent: #1958a6;
  --accent-hover: #103f7c;
  --line: #d5dce5;
  --control-border: #7b8799;
  --button: #183b63;
  --button-hover: #102c4d;
  --button-text: #ffffff;
  --danger: #ad273c;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --background: #151c24;
    --surface: #1d2834;
    --text: #eef2f7;
    --secondary: #c0cbd9;
    --muted: #a4b3c5;
    --accent: #92c2ff;
    --accent-hover: #c2ddff;
    --line: #3c4c60;
    --control-border: #70829a;
    --button: #acd0ff;
    --button-hover: #d2e6ff;
    --button-text: #14283f;
    --danger: #ffa5b0;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #151c24;
  --surface: #1d2834;
  --text: #eef2f7;
  --secondary: #c0cbd9;
  --muted: #a4b3c5;
  --accent: #92c2ff;
  --accent-hover: #c2ddff;
  --line: #3c4c60;
  --control-border: #70829a;
  --button: #acd0ff;
  --button-hover: #d2e6ff;
  --button-text: #14283f;
  --danger: #ffa5b0;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--background); scroll-padding-top: 2rem; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--background); color: var(--text); font: 1.0625rem/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 600; line-height: 1.2; }
h1 { font-size: clamp(2.8rem, 6vw, 4.1rem); letter-spacing: -0.04em; }
h2 { font-size: 1.4rem; letter-spacing: -0.015em; }
h3 { font-size: 1.25rem; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .22em; }
a:hover { color: var(--accent-hover); }
button, input, select, textarea { font: inherit; }
button, select, .btn { touch-action: manipulation; }
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
::selection { background: var(--button); color: var(--button-text); }
.skip-link { position: absolute; left: 1rem; top: -6rem; z-index: 5; padding: .6rem 1rem; background: var(--background); }
.skip-link:focus { top: 1rem; }
.shell { max-width: 980px; padding: 2rem 2.5rem; margin: auto; min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1; }
.site-header { display: flex; align-items: center; gap: 2rem; padding-bottom: 1.6rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.wordmark { font: 500 1.2rem var(--mono); color: var(--text); text-decoration: none; margin-right: auto; }
.dot { color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.site-nav a { color: var(--secondary); text-decoration: none; font-size: .9375rem; padding: .45rem 0; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); text-decoration: underline; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; padding: 0; border: 1px solid transparent; border-radius: 50%; background: transparent; color: var(--secondary); cursor: pointer; }
.theme-toggle:hover { color: var(--text); background: var(--surface); border-color: var(--line); }
.theme-toggle svg { width: 1.1rem; height: 1.1rem; fill: currentColor; }
.theme-icon-dark, :root[data-theme="dark"] .theme-icon-light { display: none; }
:root[data-theme="dark"] .theme-icon-dark { display: block; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding-top: 3.5rem; }
.hero-id { min-width: 0; }
.eyebrow { color: var(--muted); font-size: .875rem; margin-bottom: .8rem; }
.role { margin-top: .85rem; font-size: clamp(1.1rem, 2.4vw, 1.4rem); color: var(--secondary); }
.location { margin-top: .6rem; font-size: .9375rem; color: var(--muted); }
.portrait { width: 128px; height: 128px; border-radius: 50%; object-fit: cover; flex: none; border: 1px solid var(--line); }
.intro { margin-top: 2rem; max-width: 65ch; }
.lead { font-size: 1.2rem; line-height: 1.6; color: var(--secondary); }
.work-section, .community-section { margin-top: 3.4rem; }
.section-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .65rem; padding-bottom: 1.2rem; }
.section-heading p { color: var(--muted); font-size: .875rem; }
.project { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 2.5rem; border-top: 1px solid var(--line); padding: 1.8rem 0; }
.project-type { font-size: .875rem; color: var(--muted); margin-top: .7rem; }
.project-copy { color: var(--secondary); }
.project-copy p + p { margin-top: 1rem; }
.more-projects { border-top: 1px solid var(--line); }
.more-projects > summary { display: flex; align-items: center; gap: .6rem; width: fit-content; min-height: 44px; padding: .8rem 0; color: var(--accent); cursor: pointer; list-style: none; font-size: .9375rem; text-underline-offset: .22em; }
.more-projects > summary::-webkit-details-marker { display: none; }
.more-projects > summary:hover { color: var(--accent-hover); text-decoration: underline; }
.more-projects > summary svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.5; }
.more-projects .when-open, .more-projects[open] .when-closed { display: none; }
.more-projects[open] .when-open { display: inline; }
.more-projects[open] > summary svg { transform: rotate(180deg); }
.about-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 2.5rem; margin-top: 3rem; padding: 2rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.about-copy { color: var(--secondary); }
.about-copy p + p { margin-top: 1rem; }
.contact-section { border-top: 1px solid var(--line); margin-top: 3rem; padding-top: 2rem; display: flex; gap: 1.5rem; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.contact-section h2 { font-size: 1.25rem; }
.contact-section p { color: var(--muted); margin-top: .5rem; }
.btn { display: inline-flex; justify-content: center; align-items: center; padding: .75rem 1.2rem; min-height: 44px; color: var(--button-text); background: var(--button); border: 1px solid var(--button); border-radius: 4px; font-weight: 500; text-decoration: none; cursor: pointer; }
.btn:hover { color: var(--button-text); background: var(--button-hover); }
.btn:disabled { opacity: .6; cursor: wait; }
.site-footer { margin-top: 3.5rem; border-top: 1px solid var(--line); padding-top: 1.25rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: .875rem; color: var(--muted); }
.site-footer a { color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.25rem; }

/* Keep the established contact form and backend contract. */
.contact-intro { margin-top: 3.5rem; max-width: 60ch; }
.contact-intro h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); }
.contact-intro .lead { margin-top: 1rem; }
.panel { margin-top: 2rem; max-width: 720px; }
.contact-form { display: grid; gap: 1.4rem; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.field { display: grid; gap: .45rem; min-width: 0; }
.field label { font-size: .9375rem; font-weight: 500; }
.req { color: var(--muted); margin-left: .2rem; }
.field input, .field textarea { width: 100%; min-width: 0; padding: .65rem .8rem; color: var(--text); background: var(--surface); border: 1px solid var(--control-border); border-radius: 4px; }
.field textarea { min-height: 180px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.attachment-shell { display: grid; gap: .6rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
.attachment-picker { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; }
.attachment-input { position: absolute; width: 1px !important; height: 1px; padding: 0 !important; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.attachment-button { padding: .5rem .75rem; border: 1px solid var(--control-border); border-radius: 4px; cursor: pointer; }
.attachment-input:focus-visible + .attachment-button { outline: 3px solid var(--accent); outline-offset: 3px; }
.attachment-summary, .attachment-list { font-size: .875rem; color: var(--muted); overflow-wrap: anywhere; }
.honeypot-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.submit-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.status-text { font-size: .9375rem; color: var(--secondary); min-height: 1.5em; }
.status-text.error { color: var(--danger); }

@media (max-width: 680px) {
  .shell { padding: 1.5rem; }
  .site-header { gap: .6rem 1rem; }
  .site-header { flex-wrap: nowrap; }
  .site-nav { gap: 1rem; flex-wrap: nowrap; }
  .hero { padding-top: 2.5rem; gap: 1rem; align-items: flex-start; }
  .portrait { width: 80px; height: 80px; }
  .eyebrow { max-width: 26ch; }
  .project, .about-section { grid-template-columns: minmax(0, 1fr); gap: .9rem; }
  .about-section { padding: 1.25rem; }
  .project-type { margin-top: .35rem; }
  .project { padding: 1.5rem 0; }
  .work-section, .community-section { margin-top: 2.5rem; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 390px) {
  .hero { flex-direction: column-reverse; }
}
@media print {
  :root, :root[data-theme] { color-scheme: light; --background: #fff; --surface: #f5f5f5; --text: #111; --secondary: #333; --muted: #444; --line: #bbb; --accent: #111; --button: #111; --button-text: #fff; }
  .shell { max-width: none; padding: 0; }
  .theme-toggle, .skip-link, .site-nav { display: none; }
  .project { break-inside: avoid; }
}
