:root {
    color-scheme: dark;
    --bg: #11181e;
    --ink: #edf4ef;
    --muted: #b4c5c1;
    --accent: #b8ebd6;
    --line: #dbf8ed32;
    --gutter: clamp(20px, 5vw, 64px);
    --scene: radial-gradient(ellipse 67% 530px at 80% 205px, #24474394, transparent),
        radial-gradient(ellipse 45% 485px at 98% 408px, #332b5199, transparent),
        linear-gradient(160deg, #172025, #11181e 74%);
    --toggle-face: #b8ebd613;
    --toggle-hover: #b8ebd628;
    font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--ink);
    background: var(--bg);
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg: #edf4f0;
    --ink: #19332c;
    --muted: #4b625a;
    --accent: #28614f;
    --line: #33594b37;
    --scene: radial-gradient(ellipse 69% 520px at 76% 205px, #b3d8cd9f, transparent),
        radial-gradient(ellipse 47% 490px at 100% 390px, #c9c9e371, transparent),
        linear-gradient(160deg, #f8faf5, #edf4f0 74%);
    --toggle-face: #f5fff579;
    --toggle-hover: #c3e3d3b0;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--scene);
}
a { color: inherit; text-underline-offset: .23em; }
button { color: inherit; font: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { background: #b8ebd6; color: #162923; }
.shell { width: min(100% - var(--gutter) * 2, 1168px); margin-inline: auto; }
.skip { position: absolute; z-index: 2; top: .75rem; left: var(--gutter); padding: .55rem .85rem; color: #edf4ef; background: #162923; transform: translateY(-160%); }
.skip:focus { transform: none; }

.masthead { display: flex; min-height: 84px; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.brand, .masthead-actions { display: flex; align-items: center; gap: 12px; }
.brand { font-size: 22px; font-weight: 720; letter-spacing: -.04em; text-decoration: none; }
.brand img { flex: none; }
.brand-dot { color: var(--accent); }
.brand-label { padding-left: 12px; border-left: 1px solid var(--line); font-size: 13px; font-weight: 550; letter-spacing: .02em; color: var(--muted); }
.masthead-actions { gap: clamp(10px, 2.2vw, 24px); }
.home { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; white-space: nowrap; text-decoration: none; }
.home:hover, .profile:hover, .footer a:hover { text-decoration: underline; color: var(--accent); }
.language:not([hidden]) { display: inline-flex; align-items: center; gap: 2px; }
.language button { border: 0; background: none; color: var(--muted); padding: 0; text-decoration: none; font-size: 13px; font-weight: 650; min-width: 34px; min-height: 44px; cursor: pointer; border-radius: 8px; }
.language button:hover, .language button[aria-pressed="true"] { color: var(--accent); text-decoration: underline; text-underline-offset: .35em; }
.theme-toggle:not([hidden]) { display: inline-grid; place-items: center; }
.theme-toggle {
    position: relative;
    flex: 0 0 44px;
    block-size: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--accent);
    cursor: pointer;
}
.theme-toggle::before {
    content: "";
    position: absolute;
    inset: 5px;
    border: 1px solid var(--line);
    background: var(--toggle-face);
    border-radius: inherit;
}
.theme-toggle:hover::before { background: var(--toggle-hover); }
.theme-toggle svg { position: relative; width: 17px; height: 17px; }
.theme-moon, [data-theme="light"] .theme-sun { display: none; }
[data-theme="light"] .theme-moon { display: block; }

.hero { display: grid; grid-template-columns: 1.08fr 1fr; align-items: center; gap: 16px; min-height: clamp(440px, 42vw, 546px); padding-block: 54px 62px; }
.eyebrow { display: flex; align-items: center; gap: 11px; color: var(--accent); font-size: 12px; font-weight: 720; letter-spacing: .18em; margin: 0 0 23px; }
.eyebrow > span:first-child { width: 7px; height: 7px; background: #9addc5; box-shadow: 0 0 14px #acffe494; border-radius: 50%; }
h1 { font-size: clamp(39px, 5.05vw, 73px); font-weight: 670; letter-spacing: -.065em; line-height: 1.13; margin: 0; }
h1 span { display: block; }
h1 span + span { color: var(--accent); }
.intro { font-size: 17px; line-height: 1.8; max-width: 37ch; margin: 23px 0 26px; color: var(--muted); }
.hero-links { display: flex; flex-wrap: wrap; gap: 12px 23px; align-items: center; }
.button { padding: 11px 18px; min-height: 46px; border-radius: 12px; color: #173127; background: linear-gradient(155deg, #e1f9eb, #a1d6c2); box-shadow: inset 0 1px 0 #fff9, 0 5px 22px #104f3b58; font-size: 15px; font-weight: 700; text-decoration: none; }
.button:hover { background: #e3fff0; }
.profile { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; font-size: 14px; text-decoration: none; color: var(--muted); }
.profile span { opacity: .7; }
.hero-art { min-width: 0; }
.hero-art svg { display: block; width: 100%; height: auto; }

.collection { scroll-margin-top: 28px; padding-block: 27px 60px; border-top: 1px solid var(--line); }
.collection-head { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 25px; }
.collection-head h2 { margin: 0; font-size: clamp(30px, 4vw, 42px); font-weight: 670; letter-spacing: -.045em; }
.collection-head p { margin: 6px 0 0; color: var(--muted); font-size: 16px; }
.diagram-note { color: var(--muted); font-size: 12px; white-space: nowrap; padding-bottom: 3px; }
.project-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }
.project {
    --tint: #a6deca;
    grid-column: span 2;
    display: grid;
    grid-template-rows: 128px 1fr;
    min-width: 0;
    isolation: isolate;
    border: 1px solid #dbf8ed28;
    border-top-color: #d4ebe342;
    border-radius: 20px;
    background: linear-gradient(136deg, #defff613, #c9e3fb04 70%), #202b31;
    box-shadow: 0 14px 34px #080d1044, inset 0 1px 1px #e8fff21a;
    overflow: hidden;
}
.project.wide { grid-column: span 3; grid-template-rows: 160px 1fr; }
.local { --tint: #c5c7fa; }
.components { --tint: #c0d8f3; }
.rss { --tint: #f3d4b1; }
.tokens { --tint: #a5e0c5; }
.project-copy { display: flex; flex-direction: column; align-items: flex-start; padding: 21px 24px 17px; }
.project-copy p { margin: 0; }
.project-copy .category { color: var(--tint); font-size: 12px; font-weight: 720; letter-spacing: .09em; }
.project-copy h3 { margin: 6px 0 9px; font-size: clamp(22px, 2.35vw, 29px); font-weight: 660; letter-spacing: -.025em; line-height: 1.2; }
.project-copy h3 + p { color: var(--muted); font-size: 16px; line-height: 1.6; margin-bottom: 8px; }
.availability, .project-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: auto; font-size: 14px; }
.availability { color: var(--muted); }
.project-link { color: var(--tint); font-weight: 650; }
.project-link:hover { color: var(--ink); }
.project-links { display: flex; flex-wrap: wrap; gap: 0 18px; margin-top: auto; }
.diagram {
    display: grid;
    place-items: center;
    position: relative;
    background:
        radial-gradient(ellipse at 50% 80%, #c1ffe72b, transparent 69%),
        repeating-linear-gradient(90deg, transparent 0 25px, #ebffff0c 25px 26px),
        repeating-linear-gradient(0deg, transparent 0 25px, #ebffff0c 25px 26px),
        linear-gradient(144deg, #355855, #26373b 80%);
    border-bottom: 1px solid #dbf8ed24;
}
.local-diagram { background-color: #31364c; background-image: radial-gradient(ellipse at 50% 93%, #8d88d255, transparent 80%), repeating-linear-gradient(90deg, transparent 0 25px, #ebffff0d 25px 26px), repeating-linear-gradient(0deg, transparent 0 25px, #ebffff0d 25px 26px); }
.component-diagram { background-color: #293943; }
.rss-diagram { background: radial-gradient(ellipse at 50% 70%, #78604c, #35312f 75%); }
.token-diagram { background: radial-gradient(ellipse at 50% 85%, #386254, #293839 74%); }
.asset-card, .nav-board, .component-board, .mail-stack > span, .token-board {
    border-radius: 11px;
    border: 1px solid #e4fff65e;
    background: linear-gradient(145deg, #e5fff33c, #bfe7fa0a 65%), #232f38bb;
    box-shadow: 0 13px 23px #10171a58, inset 0 1px 0 #eefff629;
}
.asset-card { grid-area: 1/1; width: min(50%, 226px); height: 103px; }
.asset-shadow { transform: translate(21px, -5px) rotate(9deg); opacity: .6; }
.asset-face { transform: translateX(-8px) rotate(-7deg); padding: 12px; }
.asset-face i, .asset-face span { display: block; background: var(--tint); height: 4px; margin-bottom: 6px; border-radius: 3px; opacity: .79; width: 32%; }
.asset-face i { height: 8px; width: 52%; }
.asset-face span:nth-child(3) { width: 23%; opacity: .38; }
.asset-face svg { display: block; width: 100%; max-height: 38px; stroke: var(--tint); stroke-width: 2; }
.nav-board { width: min(52%, 228px); padding: 10px 11px; transform: perspective(580px) rotateX(12deg) rotateY(-10deg); }
.board-top { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.board-top span { width: 4px; height: 4px; border-radius: 50%; background: var(--tint); }
.board-top i { display: block; margin-left: auto; width: 29%; height: 4px; border-radius: 4px; background: #dfe2ff66; }
.board-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.board-tiles span { height: 28px; border: 1px solid #e5e7ff36; border-radius: 5px; background: linear-gradient(145deg, #ded9ff4d, #7b8ce41b); }
.board-tiles span:nth-child(3n+2) { background: linear-gradient(145deg, #a7dfcc48, #89c4db15); }
.component-board { width: min(62%, 180px); padding: 7px 10px; transform: rotate(-6deg); }
.component-board span { display: grid; grid-template-columns: 10px 1fr 20px; align-items: center; gap: 8px; height: 22px; }
.component-board span + span { border-top: 1px solid #dfe9ff2c; }
.component-board i, .component-board b, .component-board em { height: 4px; border-radius: 3px; background: var(--tint); opacity: .62; }
.component-board i { height: 8px; }
.component-board b { width: 76%; }
.component-board em { opacity: .37; }
.mail-stack { width: min(62%, 170px); transform: rotate(-7deg); }
.mail-stack > span { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; border-color: #ffedda52; background-color: #493d37; }
.mail-stack > span + span { margin-top: -1px; }
.mail-stack > span:nth-child(2) { transform: translateX(6px); opacity: .8; }
.mail-stack > span:nth-child(3) { transform: translateX(12px); opacity: .6; }
.mail-stack i { width: 7px; height: 7px; background: var(--tint); border-radius: 50%; }
.mail-stack b { flex: 0 1 70%; height: 4px; border-radius: 3px; background: #f3d4b180; }
.token-board { width: min(61%, 173px); padding: 11px 12px; transform: rotate(6deg); }
.token-board div { display: flex; gap: 5px; align-items: end; height: 53px; border-bottom: 1px solid #e3fff84a; }
.token-board span { flex: 1; height: 37%; border-radius: 3px 3px 0 0; background: linear-gradient(var(--tint), #63a38c4d); }
.token-board span:nth-child(2n) { height: 56%; }
.token-board span:nth-child(4) { height: 79%; }
.token-board span:nth-child(5) { height: 66%; }
.token-board span:nth-child(7) { height: 94%; }

[data-theme="light"] .eyebrow > span:first-child { background: #458874; box-shadow: 0 0 11px #72ac97a0; }
[data-theme="light"] .button {
    color: #f7fffb;
    background: linear-gradient(155deg, #326e5d, #225445);
    box-shadow: inset 0 1px 0 #f1fff146, 0 5px 18px #295d4530;
}
[data-theme="light"] .button:hover { background: #204e41; }
[data-theme="light"] .lens-grid { stroke: #467d74; stroke-opacity: .26; }
[data-theme="light"] .lens-sparks { stroke: #427b6d; }
[data-theme="light"] #rim stop:nth-child(1) { stop-color: #fff; }
[data-theme="light"] #rim stop:nth-child(2) { stop-color: #5c8a83; stop-opacity: .52; }
[data-theme="light"] #rim stop:nth-child(3) { stop-color: #817eb0; stop-opacity: .65; }
[data-theme="light"] #rim stop:nth-child(4) { stop-color: #f9f5ff; }
[data-theme="light"] #pane stop:nth-child(3) { stop-color: #80b5a9; }
[data-theme="light"] #pane stop:nth-child(4) { stop-color: #aaa5d1; }
[data-theme="light"] #edge stop:nth-child(2) { stop-color: #458c7b; stop-opacity: .35; }
[data-theme="light"] #edge stop:nth-child(3) { stop-color: #7775a3; stop-opacity: .29; }
[data-theme="light"] #edge stop:nth-child(4) { stop-color: #8f86bd; }

[data-theme="light"] .project {
    --tint: #245f50;
    --panel-a: #eaf8f2;
    --panel-b: #beddd2;
    border-color: #486f642d;
    border-top-color: #ffffffed;
    background: linear-gradient(136deg, #fefffdec, #f2f8f5db 75%), #eef7f1;
    box-shadow: 0 13px 30px #315b4c15, inset 0 1px 1px #fff;
}
[data-theme="light"] .local { --tint: #544482; --panel-a: #f1eef9; --panel-b: #d4cce8; }
[data-theme="light"] .components { --tint: #355d78; --panel-a: #eaf5f8; --panel-b: #c6dce7; }
[data-theme="light"] .rss { --tint: #79502e; --panel-a: #f9f0e6; --panel-b: #e8d4bc; }
[data-theme="light"] .tokens { --tint: #245d48; --panel-a: #ebf8ee; --panel-b: #c4e0ce; }
[data-theme="light"] .diagram {
    background:
        radial-gradient(ellipse 50% 85% at 47% 66%, #fff9, transparent),
        repeating-linear-gradient(90deg, transparent 0 25px, #345e6011 25px 26px),
        repeating-linear-gradient(0deg, transparent 0 25px, #345e6011 25px 26px),
        linear-gradient(138deg, var(--panel-a), var(--panel-b));
    border-color: #486f642b;
}
[data-theme="light"] .diagram :is(.asset-card, .nav-board, .component-board, .mail-stack > span, .token-board) {
    border-color: #fffc;
    background: linear-gradient(146deg, #fffe, var(--panel-b));
    box-shadow: 0 10px 17px #27454326, inset 0 1px 0 #fff, inset 0 0 0 1px #3e5f5920;
}
[data-theme="light"] .board-top i { background: #54448266; }
[data-theme="light"] .board-tiles span { border-color: #54448236; background: linear-gradient(145deg, #f7f3ffb0, #7464a54d); }
[data-theme="light"] .board-tiles span:nth-child(3n+2) { background: linear-gradient(145deg, #e0f7ec, #69999150); }
[data-theme="light"] .component-board span + span { border-color: #355d7838; }
[data-theme="light"] .mail-stack b { background: #79502e6d; }
[data-theme="light"] .token-board div { border-color: #245d4848; }

.footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 76px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }

@media (max-width: 870px) {
    .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .project, .project.wide { grid-column: span 1; grid-template-rows: 131px 1fr; }
    .project-copy { padding-inline: 18px; }
}
@media (max-width: 650px) {
    .masthead { min-height: 65px; }
    .brand { font-size: 20px; gap: 8px; }
    .brand img { width: 29px; height: 29px; }
    .brand-label { padding-left: 8px; }
    .hero { grid-template-columns: 1fr; padding-block: 48px 22px; gap: 4px; }
    h1 { font-size: clamp(36px, 9.6vw, 57px); }
    .intro { margin-block: 18px; }
    .hero-art { width: min(100%, 420px); justify-self: center; }
    .project-grid { grid-template-columns: 1fr; gap: 14px; }
    .collection { padding-block: 23px 38px; }
    .collection-head { align-items: start; flex-direction: column; gap: 8px; margin-bottom: 18px; }
    .project, .project.wide { grid-template-rows: 120px 1fr; }
    .project-copy { padding: 17px 17px 12px; }
}
@media (max-width: 360px) {
    .masthead-actions { gap: 7px; }
    .language button { min-width: 29px; }
    .brand-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}
