:root {
  color-scheme: light;
  --paper: #f7f6f2;
  --ink: #20201c;
  --muted: #595950;
  --line: #d8d7ce;
  --lime: #c4f53d;
  --lavender: #e5d9ff;
  --purple: #473689;
  --serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", SimSun, serif;
  --sans: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
img { display: block; width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 5px; }
::selection { background: var(--lavender); color: var(--ink); }
h1, h2, h3, p, figure { margin: 0; }
section[id] { scroll-margin-top: 2rem; }

.frame { width: min(calc(100% - 112px), 1328px); margin-inline: auto; }
.skip { position: fixed; top: 10px; left: 10px; z-index: 2; padding: 12px 18px; background: var(--lime); transform: translateY(-160%); }
.skip:focus { transform: none; }
.site-header, .site-footer { display: flex; justify-content: space-between; align-items: center; min-height: 83px; gap: 20px; }
.site-header { border-bottom: 1px solid var(--line); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 750; font-size: 16px; white-space: nowrap; }
.wordmark i { width: 11px; height: 11px; border-radius: 50%; background: var(--lime); border: 1px solid #596919; }
.wordmark span, .site-footer span span { color: var(--muted); font-weight: 500; font-size: 13px; }
.site-header nav { display: flex; align-items: center; gap: clamp(15px, 3vw, 44px); }
.site-header nav a, .site-footer a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; }
.site-header nav a:hover, .site-footer a:hover, .text-link:hover { color: var(--purple); text-decoration: underline; text-underline-offset: .25em; }

.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 38px; align-items: center; padding-block: 49px 92px; }
.hero-copy { padding-block: 16px; }
.hero h1, .case h1, .missing-page h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(42px, 5.25vw, 81px); line-height: 1.19; letter-spacing: -.073em; }
.hero h1 span { display: inline-block; margin-top: 4px; }
.hero-copy > p { max-width: 24em; margin-top: 26px; color: var(--muted); font-size: clamp(15px, 1.45vw, 19px); line-height: 1.8; }
.hero-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.pill { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 18px; gap: 11px; border: 1px solid transparent; border-radius: 50px; font-size: 14px; font-weight: 650; transition: background-color .2s, border-color .2s; }
.pill span { font-size: 16px; }
.primary { background: var(--lime); }
.primary:hover { background: #d5fc75; border-color: #73912a; }
.secondary { border-color: var(--line); }
.secondary:hover { background: #efede6; border-color: #b4b2a6; }
.hero-media { display: block; position: relative; aspect-ratio: 1.16; min-width: 0; isolation: isolate; overflow: hidden; border-radius: 11px; background: #ad9b86; }
.hero-media img, .work-photo img { height: 100%; object-fit: cover; transition: transform .65s cubic-bezier(.2,.75,.3,1); }
.hero-media:hover img, .work-photo:hover img { transform: scale(1.035); }
.media-label { position: absolute; bottom: 15px; left: 15px; right: 15px; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 11px 9px 15px; border-radius: 7px; background: var(--paper); font-size: 16px; font-weight: 750; }
.media-label small { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 7px; }
.media-arrow { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; background: var(--ink); color: var(--paper); transition: background .2s, color .2s; }
.hero-media:hover .media-arrow { background: var(--lime); color: var(--ink); }

.section { padding-block: 0 90px; }
.section-heading { border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-block: 23px 25px; }
.section-heading h2 { font-size: clamp(25px, 3vw, 43px); letter-spacing: -.065em; line-height: 1.2; }
.section-heading > span { font-size: 12px; color: var(--muted); }
.work { display: grid; grid-template-columns: 1.1fr .9fr; min-width: 0; border-radius: 11px; overflow: hidden; background: #eeebe4; }
.work-photo { min-height: 320px; overflow: hidden; }
.work-photo:focus-visible { outline-offset: -5px; }
.work-copy { align-self: center; padding: clamp(23px, 5vw, 70px); }
.caption { color: var(--muted); font-size: 13px; font-weight: 600; }
.work h3, .about h3 { font-family: var(--serif); font-size: clamp(27px, 3.2vw, 49px); line-height: 1.25; letter-spacing: -.055em; }
.work h3 { margin-block: 15px; }
.work-copy > p:not(.caption), .lab-controls > p, .about-copy p { color: var(--muted); font-size: 16px; line-height: 1.8; }
.text-link { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; font-weight: 650; }
.work .text-link { margin-top: 13px; }

.lab { border: 1px solid var(--line); border-radius: 11px; display: grid; grid-template-columns: .9fr 1.1fr; overflow: hidden; background: #fbfaf7; }
.lab-controls { padding: clamp(23px, 5vw, 65px); align-self: center; }
.lab-controls h3 { font-size: clamp(22px, 2.5vw, 34px); line-height: 1.3; letter-spacing: -.055em; margin-bottom: 13px; }
.lab-options { min-inline-size: 0; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 24px 0 13px; border: 0; }
.lab-options legend { padding: 0 0 9px; font-size: 13px; font-weight: 650; }
.lab-options label { position: relative; cursor: pointer; }
.lab-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.lab-options label span { display: grid; place-items: center; min-height: 44px; border-radius: 50px; padding: 7px 16px; border: 1px solid var(--line); font-size: 14px; }
.lab-options label:hover span { border-color: var(--ink); }
.lab-options input:checked + span { background: var(--ink); border-color: var(--ink); color: white; }
.lab-options input:focus-visible + span { outline: 2px solid var(--purple); outline-offset: 3px; }
.lab-controls small { color: var(--muted); font-size: 12px; }
.lab-stage { background: var(--lavender); display: grid; justify-items: center; align-content: center; gap: 27px; min-height: 345px; padding: 30px 18px 23px; text-align: center; transition: background .32s; }
.lab-stage[data-signal="uncertain"] { background: #f3e4c9; }
.lab-stage[data-signal="missing"] { background: #e9e9e2; }
.device { display: grid; place-items: center; width: 173px; height: 131px; border-radius: 48% 49% 45% 46%; background: radial-gradient(ellipse at 34% 15%, #fff, #e9e7db 50%, #c6c2b8 85%); box-shadow: inset 0 1px 3px #fff, 0 14px 28px #30254523; transform: rotate(7deg); transition: transform .42s; }
.device-face { width: 132px; height: 80px; display: flex; align-items: center; justify-content: center; gap: 19px; border-radius: 43%; background: #20221e; box-shadow: inset 0 2px 10px #0a0b08; }
.device-face span { width: 21px; height: 34px; border-radius: 50%; background: var(--lime); transform: translate(5px, -5px); transition: transform .42s, background .42s; }
[data-signal="uncertain"] .device { transform: rotate(-5deg); }
[data-signal="uncertain"] .device-face span { background: #ffe3a4; transform: translate(-5px, 0) scaleY(.8); }
[data-signal="missing"] .device { transform: translateY(6px); }
[data-signal="missing"] .device-face span { background: #c7cbb7; transform: translateY(5px) scaleY(.19); }
.lab-result strong { font-size: 19px; }
.lab-result p { margin-top: 6px; font-size: 14px; line-height: 1.6; min-height: 2.6em; }

.notes { border-top: 1px solid var(--line); }
.notes details { border-bottom: 1px solid var(--line); }
.notes summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 4px; font-size: clamp(16px, 2vw, 21px); font-weight: 650; }
.notes summary::-webkit-details-marker { display: none; }
.notes summary:hover { color: var(--purple); }
.expand { display: grid; place-items: center; flex: 0 0 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; }
.expand::before { content: "+"; }
.notes details[open] .expand::before { content: "−"; }
.notes details > p { max-width: 56ch; padding: 0 4px 23px; color: var(--muted); line-height: 1.8; }
.about-copy { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding-block: 10px 25px; }
.about-copy p { max-width: 33em; }
.site-footer { border-top: 1px solid var(--line); font-size: 13px; }
.site-footer span span { margin-left: 5px; }

.case { padding-block: 28px 92px; }
.case-header { max-width: 870px; padding-block: 28px 40px; }
.case h1 { font-size: clamp(40px, 6vw, 86px); margin-block: 12px 17px; }
.case-header > p:last-child { font-size: clamp(16px, 2vw, 22px); color: var(--muted); line-height: 1.65; }
.case-photo img { border-radius: 11px; aspect-ratio: 2; object-fit: cover; }
.case-photo figcaption { margin-top: 11px; color: var(--muted); font-size: 13px; }
.case-photo figcaption a { text-decoration: underline; text-underline-offset: 3px; }
.case-body { max-width: 960px; margin: 53px auto 32px; }
.case-body section { border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 2.7fr; gap: 25px; padding-block: 26px; }
.case-body h2 { font-size: 23px; letter-spacing: -.04em; }
.case-body p { color: var(--muted); line-height: 1.85; }
.case-next { max-width: 960px; margin-inline: auto; }
.missing-page { padding-block: 13vh; }
.missing-page h1 { margin-bottom: 35px; }

@media (max-width: 1050px) {
  .frame { width: calc(100% - 64px); }
  .hero { gap: 23px; padding-bottom: 70px; }
  .section { padding-bottom: 72px; }
}

@media (max-width: 730px) {
  .frame { width: calc(100% - 40px); }
  .site-header { align-items: flex-start; flex-direction: column; gap: 0; padding-top: 9px; min-height: auto; }
  .site-header nav { width: 100%; justify-content: space-between; }
  .site-header nav a { font-size: 13px; }
  .hero, .work, .lab, .about-copy { grid-template-columns: 1fr; }
  .hero { padding-block: 29px 52px; gap: 23px; }
  .hero-copy { padding-block: 3px 0; }
  .hero h1 { font-size: clamp(37px, 9.3vw, 65px); }
  .hero-copy > p { margin-top: 16px; }
  .hero-links { margin-top: 20px; }
  .hero-media { aspect-ratio: 1.19; }
  .media-label { inset: auto 11px 11px; }
  .section { padding-bottom: 52px; }
  .section-heading { padding-block: 17px 20px; }
  .work-photo { min-height: auto; aspect-ratio: 1.67; }
  .work-copy { padding: 25px 22px 21px; }
  .lab-stage { min-height: 270px; }
  .case { padding-block: 14px 60px; }
  .case-header { padding-block: 14px 27px; }
  .case-photo img { aspect-ratio: 1.24; }
  .case-body { margin-top: 36px; }
  .case-body section { grid-template-columns: 1fr; gap: 9px; padding-block: 19px; }
}

@media (max-width: 370px) {
  .frame { width: calc(100% - 32px); }
  .hero-links { gap: 7px; }
  .hero-links .pill { padding-inline: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
