@font-face {
  font-family: "Smiley Subset";
  src: url("./fonts/smiley-subset.woff2") format("woff2");
  font-display: swap;
}

:root {
  --office: #d5d8dd;
  --suit: #2b2c32;
  --suit-soft: #4b4e58;
  --tabby: #c89a5b;
  --tie: #24406f;
  --midnight: #0e1730;
  --lens: #8fd0ff;
  --paper: #f4f6fa;
  --paper-soft: #c7d2e4;
  --gutter: clamp(1.25rem, 5vw, 5rem);
  --display: "Smiley Subset", "PingFang SC", "Microsoft YaHei", sans-serif;
  --body: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Microsoft YaHei", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--office);
}

body {
  margin: 0;
  color: var(--suit);
  background: var(--office);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.85;
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, figure, pre { margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.1; }
h2 { font-size: clamp(2.5rem, 6vw, 4.75rem); }
a { color: inherit; }

:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
  border-radius: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  z-index: 30;
  top: 0.75rem;
  left: var(--gutter);
  padding: 0.25rem 0.75rem;
  background: var(--suit);
  color: var(--paper);
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* 开场：办公室的灯闪两下后亮起 */
.lights { display: none; }
.lights-off .lights {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #05070f;
  pointer-events: none;
  animation: lights-on 1s linear forwards;
}
@keyframes lights-on {
  0%, 38% { opacity: 1; }
  44% { opacity: 0.3; }
  54% { opacity: 0.95; }
  70% { opacity: 0.12; }
  78% { opacity: 0.6; }
  100% { opacity: 0; visibility: hidden; }
}

.top {
  position: absolute;
  z-index: 20;
  inset: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.25rem 1.5rem;
  padding: 1.25rem var(--gutter);
}
.brand { font-family: var(--display); font-size: 1.375rem; text-decoration: none; }
.top nav { display: flex; gap: clamp(1rem, 2.5vw, 2rem); }
.top nav a { padding: 0.25rem 0; text-underline-offset: 0.3em; text-decoration-thickness: 1px; }
.top nav a:not(:hover) { text-decoration: none; }

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  padding: 7rem var(--gutter) 3rem;
  display: flex;
  align-items: center;
}
.hero-text { position: relative; z-index: 1; }
.hero h1 {
  font-size: min(13.6vw, 31vh);
  line-height: 1;
  letter-spacing: -0.015em;
  white-space: nowrap;
}
.role { margin-top: 1.5rem; font-size: clamp(1.125rem, 2vw, 1.5rem); line-height: 1.5; }
.motto { font-family: var(--display); }
.hero .motto { margin-top: 0.75rem; color: var(--suit-soft); font-size: clamp(1.25rem, 2.2vw, 1.75rem); }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.5rem 1.5rem;
  border: 2px solid var(--suit);
  border-radius: 3px;
  background: var(--suit);
  color: var(--paper);
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.button:hover { background: var(--tie); border-color: var(--tie); }
.button-quiet { background: transparent; color: var(--suit); }
.button-quiet:hover { background: var(--suit); border-color: var(--suit); color: var(--paper); }
.button-night { background: transparent; border-color: var(--paper-soft); color: var(--paper); }
.button-night:hover { background: var(--paper); border-color: var(--paper); color: var(--midnight); }

.hero-cat {
  position: absolute;
  z-index: 2;
  right: clamp(0.5rem, 4vw, 5rem);
  bottom: 2.5vh;
  width: calc(82svh * 546 / 892);
  max-width: 40vw;
  pointer-events: none;
}
.hero-cat::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 8%;
  right: 8%;
  bottom: -1.5%;
  height: 7%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(43, 44, 50, 0.38), transparent);
}

.about {
  display: grid;
  grid-template-columns: minmax(0, 34rem) minmax(0, 1fr);
  gap: clamp(2.5rem, 7vw, 7rem);
  align-items: end;
  padding: clamp(4rem, 10vw, 8rem) var(--gutter) clamp(3rem, 7vw, 5rem);
}
.about h2 { margin-bottom: 1.75rem; }
.about-text p + p { margin-top: 1.1rem; }
.about-text .lead { font-size: 1.25rem; line-height: 1.7; color: var(--suit); }
.about-text p:not(.lead):not(.motto) { color: var(--suit-soft); }
.about-text .motto { margin-top: 2.25rem; font-size: 1.75rem; line-height: 1.3; }

.code {
  min-width: 0;
  background: var(--suit);
  color: var(--paper);
  border-radius: 3px;
  overflow: hidden;
}
.code figcaption {
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid rgba(244, 246, 250, 0.16);
  color: var(--paper-soft);
  font-family: var(--mono);
  font-size: 0.8125rem;
}
.code pre {
  padding: 1.25rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.8;
}
.code b { color: var(--lens); font-weight: 400; }
.code i { color: #e7c592; font-style: normal; }
.code em { color: #aab3c2; font-style: normal; }

.dusk {
  height: clamp(9rem, 28vh, 18rem);
  background: linear-gradient(var(--office), #8996ad 48%, var(--tie));
}

.night {
  color: var(--paper);
  background: linear-gradient(var(--tie), var(--midnight) 72%);
}
.section-note { margin-top: 1rem; max-width: 34em; color: var(--paper-soft); }

.skills, .stats { padding: clamp(3rem, 8vw, 6rem) var(--gutter); }

.skill-rows { margin-top: clamp(2.5rem, 5vw, 4rem); border-bottom: 1px solid rgba(244, 246, 250, 0.25); }
.skill-rows article {
  display: grid;
  grid-template-columns: minmax(12rem, 5fr) minmax(0, 7fr);
  gap: 0.75rem 2rem;
  padding: clamp(1.5rem, 3vw, 2.25rem) 0;
  border-top: 1px solid rgba(244, 246, 250, 0.25);
}
.skill-rows h3 { font-size: clamp(1.75rem, 3.6vw, 3rem); }
.skill-rows p { color: var(--paper-soft); }
.skill-rows ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 1.25rem;
  margin-top: 0.5rem;
  padding: 0;
  list-style: none;
  font-weight: 600;
}

.stats-line {
  margin-top: clamp(2rem, 4vw, 3rem);
  max-width: 24em;
  font-family: var(--display);
  font-size: clamp(1.75rem, 4vw, 3.25rem);
  line-height: 1.35;
}
.stats-line strong { color: #efc98f; font-weight: 400; }
.text-link { display: inline-block; margin-top: 1rem; padding: 0.25rem 0; text-underline-offset: 0.3em; }
.stats .motto { margin-top: clamp(2.5rem, 5vw, 4rem); font-size: 1.75rem; line-height: 1.3; }

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 30vw);
  gap: 2rem;
  align-items: end;
  padding: clamp(3rem, 8vw, 6rem) var(--gutter) 0;
}
.email {
  display: inline-block;
  margin-top: 2rem;
  color: var(--lens);
  font-family: var(--display);
  font-size: clamp(1.25rem, 3.6vw, 3rem);
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-shadow: 0 0 1.1em rgba(143, 208, 255, 0.55);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}
.contact .motto {
  margin: clamp(2.5rem, 5vw, 4rem) 0 clamp(3rem, 6vw, 5rem);
  font-size: 1.75rem;
  line-height: 1.3;
}

.night-cat { position: relative; aspect-ratio: 846 / 1192; }
.night-cat img { position: absolute; inset: 0; width: 100%; height: 100%; }
.js .night-glow { opacity: 0; }
.js .lit .night-glow { animation: lens-on 0.9s linear forwards; }
@keyframes lens-on {
  0%, 15% { opacity: 0; }
  25% { opacity: 0.75; }
  40% { opacity: 0.15; }
  100% { opacity: 1; }
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 2rem;
  padding: 1.25rem var(--gutter);
  border-top: 1px solid rgba(244, 246, 250, 0.2);
  color: var(--paper-soft);
  font-size: 0.875rem;
}

@media (max-width: 760px) {
  .hero {
    display: block;
    min-height: 0;
    padding-top: 6.5rem;
    padding-bottom: 0;
  }
  .hero h1 { font-size: 18.5vw; }
  .hero-cat {
    position: relative;
    right: auto;
    bottom: auto;
    width: min(68vw, 19rem);
    max-width: none;
    margin: 2.5rem auto 1rem;
  }
  .about, .contact { grid-template-columns: minmax(0, 1fr); }
  .skill-rows article { grid-template-columns: minmax(0, 1fr); }
  .night-cat { width: min(72vw, 20rem); margin: 0 auto; }
  .contact .motto { margin-bottom: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .lights-off .lights { display: none; }
  .js .night-glow, .js .lit .night-glow { opacity: 1; animation: none; }
}
