:root {
  color-scheme: light;
  --page: #f3f6f5;
  --surface: #fafcfb;
  --text: #172633;
  --muted: #485c61;
  --line: #cdd9d6;
  --accent: #145b60;
  --hover: #e5f0ed;
  --feature: #183a40;
  --feature-text: #f5fffb;
  --feature-muted: #d0e2df;
  --action: #c1e2d9;
  --action-text: #17383a;
  --focus: #147b77;
  font-family: "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #121e25;
  --surface: #192932;
  --text: #edf6f5;
  --muted: #aec4c8;
  --line: #3a5156;
  --accent: #a1ddd2;
  --hover: #22373e;
  --feature: #1e4348;
  --focus: #91ddd4;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--text); }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.wrap { width: min(100% - 3rem, 67rem); margin-inline: auto; }

.topbar {
  min-height: 4.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
}

.wordmark,
.topbar nav,
#theme-toggle {
  display: flex;
  align-items: center;
}

.wordmark {
  gap: .65rem;
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -.025em;
}

.mark {
  width: 1rem;
  height: 1rem;
  display: inline-block;
  border-radius: 4px;
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--page);
  border: 1px solid var(--accent);
  transform: rotate(-12deg);
}

.topbar nav { gap: 1.25rem; color: var(--muted); font-size: .92rem; white-space: nowrap; }
.topbar nav a { padding-block: .65rem; }
.topbar nav a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: .3em; }

#theme-toggle {
  gap: .45rem;
  min-height: 2.65rem;
  padding: 0 .8rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: .65rem;
  cursor: pointer;
}

#theme-toggle:hover { background: var(--hover); }
.theme-dot { width: .8em; height: .8em; border-radius: 50%; border: 1px solid currentColor; background: linear-gradient(90deg, currentColor 50%, transparent 50%); }

.intro { padding: clamp(3.2rem, 8vw, 6.6rem) 0 clamp(2.45rem, 5vw, 4rem); }
.intro h1 { margin: 0; font-size: clamp(2.2rem, 6.7vw, 5.35rem); line-height: 1.1; letter-spacing: -.045em; }
.intro h1 span { font-family: "Avenir Next", system-ui, sans-serif; color: var(--accent); font-weight: 800; letter-spacing: -.065em; }
.intro p { max-width: 30rem; margin: 1.15rem 0 0; color: var(--muted); line-height: 1.7; font-size: clamp(1rem, 2vw, 1.125rem); }
.projects { display: grid; gap: 3rem; }
.project h2 { margin: 0 0 1rem; font-size: 1.25rem; }

.featured {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: stretch;
  isolation: isolate;
  min-height: 15rem;
  overflow: hidden;
  border-radius: 1.15rem;
  background: var(--feature);
  color: var(--feature-text);
}

.feature-copy { z-index: 1; padding: clamp(1.6rem, 4vw, 2.7rem); }
.featured h3 { margin: 0; font-size: clamp(1.9rem, 4vw, 3.05rem); line-height: 1.15; letter-spacing: -.05em; }
.featured p { margin: .75rem 0 1.4rem; color: var(--feature-muted); line-height: 1.6; }
.action { display: inline-block; padding: .65rem 1.05rem; font-weight: 650; border-radius: .6rem; background: var(--action); color: var(--action-text); }
.featured:hover .action { background: var(--feature-text); }

.card-art {
  position: relative;
  background-image: linear-gradient(90deg, var(--feature), transparent 43%),
    repeating-linear-gradient(90deg, transparent 0 23px, #c1e2d915 23px 24px),
    repeating-linear-gradient(0deg, transparent 0 23px, #c1e2d915 23px 24px);
}

.art-card {
  position: absolute;
  top: 49%;
  left: 51%;
  width: clamp(5.2rem, 11vw, 8.65rem);
  aspect-ratio: 3 / 4;
  border: 1px solid #c1e2d992;
  border-radius: .75rem;
  background: #32626a;
  box-shadow: 0 .8rem 2rem #142a2e52;
}

.art-back { transform: translate(-88%, -39%) rotate(-21deg); background: #21454e; }
.art-middle { transform: translate(-25%, -43%) rotate(20deg); background: #518284; }
.art-front {
  transform: translate(-53%, -53%) rotate(-3deg);
  background:
    radial-gradient(circle at 68% 27%, #e5ae86 0 7%, transparent 7.5%),
    linear-gradient(139deg, transparent 56%, #7bb0a9 56.5% 60%, transparent 60.5%) 0 64% / 100% 58% no-repeat,
    linear-gradient(154deg, #365f65 42%, #7eb5aa 42.5% 43%, #294c52 43.5% 69%, #8ec1b2 69.5% 70%, #315962 70.5%);
}

.art-front::after { content: ""; position: absolute; inset: .55rem; border: 1px solid #c1e2d987; border-radius: .45rem; }

.tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0; margin: .9rem 0 0; gap: .9rem; list-style: none; }
.tools a { display: block; height: 100%; padding: 1.2rem; border: 1px solid var(--line); border-radius: .85rem; background: var(--surface); }
.tools a:hover { background: var(--hover); }
.tools h3 { margin: 0; color: var(--accent); font-size: 1.12rem; }
.tools p { margin: .4rem 0 0; color: var(--muted); line-height: 1.55; }
footer.wrap { margin-top: clamp(2.5rem, 6vw, 4.5rem); padding-block: 1.25rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }

@media (max-width: 40rem) {
  .wrap { width: calc(100% - 2rem); }
  .topbar { min-height: 4rem; }
  .topbar nav { gap: .75rem; }
  .featured { grid-template-columns: minmax(0, 1fr) 28%; min-height: 12.75rem; }
  .art-card { left: 58%; width: clamp(3.6rem, 17vw, 4.1rem); opacity: .8; }
  .tools { grid-template-columns: 1fr; gap: .55rem; }
  .tools a { padding: .85rem 1rem; }
}
