:root {
  color-scheme: light;
  --ink: #111;
  --ink-soft: #666;
  --paper: #ededed;
  --paper-bright: #fff;
  --line: rgba(17, 17, 17, .16);
  --line-light: rgba(255, 255, 255, .22);
  --display: "Arial Narrow", "Avenir Next Condensed", "PingFang SC", sans-serif;
  --body: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, monospace;
  --max: 1180px;
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

html[data-theme="dark"] { color-scheme: dark; --ink: #f2f2f2; --ink-soft: #aaa; --paper: #111; --paper-bright: #1b1b1b; --line: rgba(242, 242, 242, .17); --line-light: rgba(255, 255, 255, .22); }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; min-width: 320px; background: var(--paper); }
body { min-width: 320px; margin: 0; overflow-x: hidden; background: var(--paper); }
button, a { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.page-width { width: min(calc(100% - 48px), var(--max)); margin-inline: auto; }
.eyebrow { margin: 0 0 18px; color: var(--ink-soft); font: 700 11px/1.2 var(--mono); letter-spacing: .08em; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--display); letter-spacing: 0; }
h1, h2 { font-weight: 800; }
h2 { margin-bottom: 20px; font-size: clamp(38px, 5vw, 70px); line-height: .98; }
h3 { margin-bottom: 12px; font-size: 29px; line-height: 1; }
p { line-height: 1.7; }

.site-header { position: absolute; z-index: 10; top: 0; left: 0; right: 0; display: flex; align-items: center; width: min(calc(100% - 48px), var(--max)); height: 84px; margin: 0 auto; color: #fff; }
.wordmark { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.wordmark-mark { display: grid; place-items: center; width: 34px; height: 34px; overflow: hidden; color: #fff; background: transparent; }
.wordmark-mark img { width: 100%; height: 100%; object-fit: contain; filter: invert(1); }
.wordmark strong, .wordmark small { display: block; }
.wordmark strong { font: 800 17px/1 var(--display); }
.wordmark small { margin-top: 4px; color: rgba(255,255,255,.7); font: 700 9px/1 var(--mono); letter-spacing: .08em; }
.site-nav { display: flex; gap: 28px; margin-left: auto; }
.site-nav a, .theme-toggle, .menu-toggle { color: rgba(255,255,255,.76); border: 0; background: none; text-decoration: none; font-size: 13px; }
.site-nav a { position: relative; padding-block: 9px; }
.site-nav a::after { position: absolute; right: 0; bottom: 0; left: 0; height: 2px; content: ""; background: #fff; transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.site-nav a:hover, .site-nav a.is-active { color: #fff; }
.site-nav a.is-active::after { transform: scaleX(1); }
.theme-toggle { margin-left: 32px; padding: 9px 0 9px 20px; border-left: 1px solid rgba(255,255,255,.3); }
.menu-toggle { display: none; }

.hero { position: relative; min-height: min(780px, 92vh); overflow: hidden; color: #fff; background: #111; }
.hero-media { position: absolute; inset: 0; background-image: url("/assets/profile-portrait.jpg"); background-position: center 38%; background-size: cover; filter: grayscale(1) saturate(0) contrast(1.08); }
.hero-media::after { position: absolute; inset: 0; content: ""; background: rgba(0, 0, 0, .58); }
.hero-inner { position: relative; display: flex; flex-direction: column; justify-content: center; min-height: min(780px, 92vh); padding-top: 90px; padding-bottom: 54px; }
.hero-copy { width: min(520px, 100%); }
.hero .eyebrow { color: rgba(255,255,255,.72); }
.hero h1 { max-width: 520px; margin-bottom: 28px; font-size: clamp(48px, 5.6vw, 74px); line-height: .91; }
.hero-lede { max-width: 560px; margin-bottom: 32px; color: rgba(255,255,255,.79); font-size: clamp(16px, 1.8vw, 19px); }
.hero-actions { display: flex; align-items: center; gap: 26px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 13px; min-height: 48px; padding: 0 18px; border: 1px solid transparent; text-decoration: none; font-weight: 750; transition: transform .2s ease, background-color .2s ease, color .2s ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { color: #111; background: #fff; }
.button-primary:hover { background: #ddd; }
.light-link { color: #fff; }
.text-link { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 13px; font-weight: 750; text-underline-offset: 5px; }
.hero .light-link { color: #fff; }
.text-link:hover { color: #111; }
.light-link:hover { color: #fff; }
.hero-caption { display: flex; justify-content: space-between; width: min(100%, 830px); margin-top: auto; padding-top: 80px; color: rgba(255,255,255,.57); font: 10px/1.2 var(--mono); letter-spacing: .05em; text-transform: uppercase; }

.signal-band { color: #fff; border-bottom: 1px solid #333; background: #111; }
.signal-grid { display: grid; grid-template-columns: 2fr repeat(4, 1fr); align-items: center; min-height: 160px; }
.signal-label { margin: 0; color: #fff; font-size: 14px; font-weight: 700; line-height: 1.55; }
.signal-grid div { min-height: 76px; padding-left: 22px; border-left: 1px solid rgba(255,255,255,.28); }
.signal-grid strong, .signal-grid span { display: block; }
.signal-grid strong { margin-bottom: 18px; font: 700 11px/1 var(--mono); }
.signal-grid span { font: 700 14px/1.2 var(--display); }

.section { padding-top: 140px; padding-bottom: 140px; }
.section-heading { max-width: 660px; margin-bottom: 64px; }
.section-heading > p:last-child { max-width: 540px; margin-bottom: 0; color: var(--ink-soft); font-size: 16px; }
.project-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; align-items: stretch; }
.project-card { grid-column: span 4; display: flex; flex-direction: column; min-width: 0; border-top: 2px solid var(--ink); background: var(--paper-bright); }
.project-card-featured { grid-column: span 6; }
.project-card-mechanic, .project-card-bunny { background: var(--paper-bright); }
.project-card-mechanic .project-image { aspect-ratio: 2 / 1; }
.project-content { display: flex; flex: 1; flex-direction: column; align-items: flex-start; min-height: 320px; padding: 26px 26px 30px; }
.project-meta { display: flex; justify-content: space-between; width: 100%; margin-bottom: 48px; color: var(--ink-soft); font: 10px/1.2 var(--mono); text-transform: uppercase; }
.project-content p { max-width: 470px; margin-bottom: 26px; color: var(--ink-soft); font-size: 14px; }
.project-content .text-link { margin-top: auto; }
.project-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 28px; }
.project-tags span { padding: 5px 7px; color: var(--ink-soft); border: 1px solid var(--line); font: 9px/1 var(--mono); }
.project-image { aspect-ratio: 1.5; overflow: hidden; background: var(--ink); }
.project-image-sim { display: grid; place-items: center; padding: 20px; background: #ddd; }
.project-image img { width: 100%; height: 100%; object-fit: cover; }
.project-image-sim img { object-fit: contain; }
.section-portfolio { color: #fff; background: #111; }
.section-portfolio .eyebrow { color: #aaa; }
.section-portfolio .section-heading > p:last-child { color: #aaa; }
.portfolio-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.portfolio-card { grid-column: span 4; min-width: 0; border-top: 2px solid #fff; background: #1b1b1b; }
.portfolio-card-wide { grid-column: span 6; }
.portfolio-card-dark { background: #080808; }
.portfolio-image { aspect-ratio: 1.55; overflow: hidden; background: #222; }
.portfolio-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease, filter .35s ease; }
.portfolio-image-duo { display: grid; grid-template-columns: 1.35fr .65fr; gap: 2px; background: #111; }
.portfolio-image-duo img { min-width: 0; }
.portfolio-card:hover .portfolio-image img { filter: saturate(1.1) contrast(1.03); transform: scale(1.025); }
.portfolio-card-body { padding: 24px 24px 28px; }
.portfolio-card .project-meta { color: #999; }
.portfolio-card h3 { margin-bottom: 12px; }
.portfolio-card-body p { min-height: 94px; margin-bottom: 24px; color: #aaa; font-size: 14px; }
.portfolio-card .project-tags span { color: #aaa; border-color: rgba(255,255,255,.2); }
.systems-index { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; margin: 0 0 28px; border-top: 1px solid var(--line); }
.systems-index span { padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--ink-soft); font: 10px/1.2 var(--mono); }
.systems-index span:nth-child(even) { padding-left: 14px; border-left: 1px solid var(--line); }
.all-work { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 32px; padding-top: 19px; border-top: 1px solid var(--line); color: var(--ink-soft); font: 11px/1.3 var(--mono); }
.section-approach { border-block: 1px solid var(--line); background: var(--paper-bright); }
.approach-layout { display: grid; grid-template-columns: 5fr 7fr; gap: 80px; }
.section-heading-compact { margin-bottom: 0; }
.approach-list { border-top: 1px solid var(--line); }
.approach-list article { display: grid; grid-template-columns: 56px 1fr; gap: 20px; padding: 27px 0; border-bottom: 1px solid var(--line); }
.approach-list article > span { color: var(--ink-soft); font: 700 11px/1 var(--mono); }
.approach-list h3 { margin-bottom: 8px; font-size: 23px; }
.approach-list p { max-width: 470px; margin: 0; color: var(--ink-soft); font-size: 14px; }

.now-section { position: relative; }
.now-stamp { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 50px; color: var(--ink-soft); font: 10px/1 var(--mono); letter-spacing: .06em; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #777; box-shadow: 0 0 0 4px rgba(119,119,119,.14); }
.now-layout { display: grid; grid-template-columns: 5fr 7fr; gap: 80px; }
.now-copy { padding-top: 10px; }
.now-copy > p { max-width: 560px; margin-bottom: 28px; font-size: 20px; line-height: 1.5; }
.now-copy ul { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; color: var(--ink-soft); font-size: 14px; }
.now-copy li { display: flex; gap: 13px; }
.now-copy li::before { content: "↗"; color: #777; font-weight: 700; }

.contact-section { padding-block: 100px; color: #fff; background: #111; }
.contact-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: end; }
.contact-section h2 { max-width: 520px; margin-bottom: 22px; font-size: clamp(42px, 6vw, 76px); }
.contact-section p:not(.eyebrow) { max-width: 480px; margin: 0; color: rgba(255,255,255,.67); }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.button-light { color: #111; background: #fff; }
.copy-button { min-height: 48px; padding: 0 8px; color: #fff; border: 0; border-bottom: 1px solid rgba(255,255,255,.6); background: transparent; font-size: 13px; }
.copy-button:hover { color: #fff; border-color: #fff; }
.social-links { display: flex; gap: 18px; width: 100%; margin-top: 42px; padding-top: 19px; border-top: 1px solid var(--line-light); }
.social-links a { color: rgba(255,255,255,.64); font: 12px/1 var(--mono); text-decoration: none; }
.social-links a:hover { color: #fff; }
.site-footer { display: flex; justify-content: space-between; gap: 24px; padding-block: 25px; color: var(--ink-soft); font: 10px/1.4 var(--mono); }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: #111; }
.toast { position: fixed; z-index: 30; right: 24px; bottom: 24px; padding: 12px 15px; color: #111; background: #fff; font-size: 12px; opacity: 0; transform: translateY(14px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

:focus-visible { outline: 3px solid #777; outline-offset: 4px; }
@media (max-width: 820px) {
  .page-width { width: min(calc(100% - 36px), var(--max)); }
  .site-header { width: min(calc(100% - 36px), var(--max)); height: 72px; }
  .menu-toggle { display: block; margin-left: auto; padding: 10px 0; }
  .site-nav { position: absolute; top: 62px; right: 0; left: 0; display: none; flex-direction: column; gap: 0; padding: 10px 17px; border: 1px solid rgba(255,255,255,.25); background: rgba(17,17,17,.96); }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.15); }
  .site-nav a:last-child { border-bottom: 0; }
  .theme-toggle { margin-left: 20px; padding-left: 15px; }
  .hero, .hero-inner { min-height: 720px; }
  .hero h1 { font-size: clamp(58px, 14vw, 84px); }
  .hero-caption { padding-top: 55px; }
  .signal-grid { grid-template-columns: repeat(2, 1fr); gap: 0; padding-block: 26px; }
  .signal-label { grid-column: span 2; margin-bottom: 26px; }
  .signal-grid div { padding: 17px 14px 10px 0; border-top: 1px solid rgba(255,255,255,.28); border-left: 0; }
  .signal-grid div:nth-child(even) { padding-left: 14px; border-left: 1px solid rgba(255,255,255,.28); }
  .section { padding-block: 90px; }
  .project-card, .project-card-featured { grid-column: span 12; }
  .portfolio-card, .portfolio-card-wide { grid-column: span 12; }
  .approach-layout, .now-layout, .contact-layout { grid-template-columns: 1fr; gap: 45px; }
  .section-heading { margin-bottom: 45px; }
  .contact-section { padding-block: 80px; }
  .site-footer { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .page-width, .site-header { width: calc(100% - 28px); }
  .wordmark small { display: none; }
  .theme-toggle { max-width: 67px; padding-left: 12px; font-size: 11px; }
  .hero, .hero-inner { min-height: 670px; }
  .hero { background: #111; }
  .hero-media { background-position: 57% 36%; }
  .hero h1 { font-size: 46px; line-height: .9; }
  .hero-lede { font-size: 15px; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 18px; }
  .hero-caption { font-size: 9px; }
  h2 { font-size: 43px; }
  .project-meta { margin-bottom: 30px; }
  .all-work { align-items: flex-start; flex-direction: column; }
  .systems-index { grid-template-columns: 1fr; }
  .systems-index span:nth-child(even) { padding-left: 0; border-left: 0; }
  .contact-actions { align-items: flex-start; flex-direction: column; }
  .social-links { margin-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
