:root {
  color-scheme: light;
  --bg: #e2e6e9;
  --bg-bottom: #d3d9dd;
  --ink: #15191d;
  --muted: #535e66;
  --accent: #f7770f;
  --line: #c4cbd0;
  --surface: rgba(241,244,246,.66);
  --card: #f7f8f9;
  --edge: rgba(255,255,255,.86);
  --glow: rgba(246,142,56,.21);
  --well: rgba(48,60,68,.075);
  --active: #fff;
  --shadow: 0 9px 23px -14px rgba(33,47,56,.33), inset 0 1px 0 var(--edge);
  --paper: var(--bg);
  --tint: var(--surface);
  --sans: Inter,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  --mono: "SFMono-Regular",Consolas,"Liberation Mono",monospace;
  --measure: 1152px;
  --gutter: clamp(16px,3vw,32px);
  --shell-width: min(var(--measure), calc(100% - var(--gutter) * 2));
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1b2024;
  --bg-bottom: #131619;
  --ink: #f0f2f3;
  --muted: #afbbc3;
  --accent: #ff8a2b;
  --line: #414a51;
  --surface: rgba(43,49,55,.84);
  --card: #282e34;
  --edge: rgba(255,255,255,.135);
  --glow: rgba(202,93,21,.13);
  --well: rgba(0,0,0,.19);
  --active: #414a51;
  --shadow: 0 9px 23px -14px rgba(0,0,0,.75), inset 0 1px 0 var(--edge);
}
html { scroll-padding-top: 98px; background: var(--bg); }
body:is(.portfolio-page,.reading-page) {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(167deg,var(--bg),var(--bg-bottom)) fixed;
  color: var(--ink);
  font-family: var(--sans);
  position: relative;
  isolation: isolate;
}
body:is(.portfolio-page,.reading-page)::before,body:is(.portfolio-page,.reading-page)::after {
  position: fixed;
  content: ""; inset: 0; pointer-events: none; z-index: -1;
}
body:is(.portfolio-page,.reading-page)::before {
  background-image: linear-gradient(to right,var(--line) 1px,transparent 1px),linear-gradient(to bottom,var(--line) 1px,transparent 1px);
  background-size: 64px 64px; opacity: .29;
  -webkit-mask-image: radial-gradient(ellipse at 50% 14%,black 2%,transparent 80%);
  mask-image: radial-gradient(ellipse at 50% 14%,black 2%,transparent 80%);
}
body:is(.portfolio-page,.reading-page)::after {
  background: radial-gradient(ellipse 130px 150px at -32px 28%,var(--glow),transparent),
              radial-gradient(ellipse 110px 130px at calc(100% + 18px) 69%,var(--glow),transparent);
}
body .portfolio-skip { z-index: 150; color: var(--ink); background: var(--card); border-radius: 12px; }
:is(.portfolio-page,.reading-page) :focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
:is(.portfolio-page,.reading-page) ::selection { background: #ffc28a; color: #1e1712; }
.page-home > main { width: var(--shell-width); margin: 0 auto; }
.studio-bar,.studio-foot { box-sizing: border-box; width: var(--shell-width); margin-inline: auto; color: var(--ink); font: 500 15px/1.45 var(--sans); }
.studio-bar *, .studio-foot * { box-sizing: border-box; }
.studio-bar a,.studio-foot a { color: inherit; text-decoration: none; }
.studio-bar {
  margin-block: 12px 22px; z-index: 40; position: sticky; top: 10px;
  min-height: 64px; display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 16px; padding: 7px 11px 7px 14px;
}
.studio-bar::before,.studio-foot {
  border: 1px solid var(--edge); border-radius: 21px;
  background: var(--surface); box-shadow: var(--shadow);
}
.studio-bar::before { content: ""; position: absolute; inset: 0; z-index: -1; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.z-brand,.z-tools,.z-nav,.z-nav a,.z-foot-nav,.z-foot-nav a,.z-index summary,.z-theme,.z-up,.studio-foot,.z-sign { display: flex; align-items: center; }
.z-brand { gap: 12px; width: fit-content; white-space: nowrap; }
.z-brand > img { flex: none; width: 38px; height: 38px; border-radius: 50%; box-shadow: 0 3px 8px #12181c26; }
.z-brand > span { display: grid; gap: 3px; }
.z-brand b { font-size: 17px; letter-spacing: .01em; line-height: 1.05; font-weight: 760; }
.z-brand small,.z-sign span { font-size: 11px; line-height: 1.2; color: var(--muted); letter-spacing: .045em; }
.z-nav { padding: 4px; gap: 2px; justify-self: center; border-radius: 999px; background: var(--well); box-shadow: inset 0 1px 3px #10182013,0 1px 0 var(--edge); }
.z-nav a { justify-content: center; position: relative; white-space: nowrap; padding: 9px clamp(10px,1.27vw,19px); min-height: 38px; border-radius: 999px; font-size: 13px; color: var(--muted); font-weight: 560; }
.z-nav a + a::before,.z-foot-nav a + a::before { content: ""; height: 13px; border-left: 1px solid var(--line); position: absolute; left: -2px; top: 50%; translate: 0 -50%; }
.z-nav a[aria-current],.z-foot-nav a[aria-current] { color: var(--ink); background: var(--active); box-shadow: 0 2px 5px #0e171f14; }
.z-nav a[aria-current] span::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 7px #f7770f55; }
.z-nav a[aria-current]::before,.z-nav a[aria-current] + a::before,.z-foot-nav a[aria-current]::before,.z-foot-nav a[aria-current] + a::before { display: none; }
.z-nav .z-icon { display: none; }
.z-nav a:hover,.z-foot-nav a:hover,.z-index nav a:hover { color: var(--ink); background: var(--surface); }
.z-tools { justify-self: end; gap: 9px; }
.z-index { position: relative; }
.z-index > summary,.z-theme,.z-up {
  color: var(--ink); background: var(--card); border: 1px solid var(--edge);
  box-shadow: 0 3px 8px #161c2114,inset 0 1px 0 var(--edge); cursor: pointer;
  justify-content: center; border-radius: 999px; height: 42px;
}
.z-index summary { list-style: none; gap: 6px; padding-inline: 11px; font-size: 13px; }
.z-index summary::-webkit-details-marker { display: none; }
.z-tools .z-icon,.z-up .z-icon { width: 17px; height: 17px; }
.z-theme { width: 42px; padding: 0; }
.z-theme .i-sun,:root[data-theme=dark] .z-theme .i-moon { display: none; }
:root[data-theme=dark] .z-theme .i-sun { display: block; }
.z-index nav { position: absolute; inset: calc(100% + 10px) 0 auto auto; min-width: 158px; display: grid; padding: 6px; border-radius: 16px; border: 1px solid var(--edge); background: var(--card); box-shadow: 0 10px 25px #13171b26; }
.z-index nav a { padding: 10px 14px; border-radius: 10px; color: var(--muted); font-size: 14px; }
.studio-foot { gap: 20px; padding: 10px 16px; margin-block: 30px 20px; justify-content: space-between; }
.z-sign { gap: 8px; }
.z-sign b { font-size: 13px; }
.z-foot-nav { gap: 3px; background: var(--well); border-radius: 999px; padding: 3px; }
.z-foot-nav a { position: relative; gap: 5px; padding: 7px 10px; border-radius: 999px; font-size: 12px; color: var(--muted); }
.z-foot-nav svg { width: 16px; height: 16px; }
.z-up { width: 36px; height: 36px; }
@media (min-width:768px) and (max-width:930px) {
  .studio-bar { grid-template-columns: auto 1fr auto; gap: 5px; }
  .z-nav a { padding-inline: 9px; }
  .z-brand { gap: 7px; }
  .z-tools { gap: 5px; }
}
@media (max-width:767px) {
  html { scroll-padding-top: 14px; }
  .portfolio-page,.reading-page { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .studio-bar { position: relative; top: auto; margin-block: 12px 16px; min-height: 61px; display: flex; justify-content: space-between; }
  .z-nav {
    position: fixed; inset: auto 8px calc(8px + env(safe-area-inset-bottom)); z-index: 50;
    width: calc(100% - 16px); justify-self: stretch;
    justify-content: space-between; padding: 4px; gap: 0; border-radius: 24px;
    border: 1px solid var(--edge); background: var(--surface); box-shadow: 0 6px 20px #171c2336, inset 0 1px 0 var(--edge);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  }
  .z-nav a { flex: 1 0 auto; min-width: 0; min-height: 53px; flex-direction: column; gap: 4px; border-radius: 18px; padding: 4px 1px; font-size: 10.5px; line-height: 1.2; }
  .z-nav .z-icon { display: block; width: 17px; height: 17px; }
  .z-nav a[aria-current] .z-icon { color: var(--accent); }
  .z-nav a[aria-current] span::before { display: none; }
  .z-nav a + a::before { left: 0; }
  .studio-foot { padding: 12px; margin-top: 20px; border-radius: 16px; }
  .z-foot-nav { display: none; }
}
@media print {
  .studio-bar,.studio-foot { display: none; }
  body:is(.portfolio-page,.reading-page) { background: white; color: black; padding: 0; }
}
