:root {
  color-scheme: light;
  --ink: #17191a;
  --night: #111516;
  --paper: #eef0ed;
  --white: #fff;
  --red: #d94b3d;
  --cyan: #69c4c3;
  --line: #cfd3cf;
  --muted: #616865;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
}

a { color: inherit; }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--cyan); outline-offset: 4px; }

.site-header {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 50%;
  width: min(1120px, calc(100% - 40px));
  min-height: 72px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--white);
  border-bottom: 1px solid rgb(255 255 255 / 24%);
}

.brand { font-family: Georgia, serif; font-size: 22px; font-weight: 700; text-decoration: none; }
nav { display: flex; gap: 28px; }
nav a { font-size: 14px; text-decoration: none; }
nav a:hover { color: var(--cyan); }

.hero {
  position: relative;
  min-height: min(760px, 88vh);
  overflow: hidden;
  display: grid;
  align-items: center;
  background: var(--night);
  color: var(--white);
}

#math-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.hero-content {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 112px 0 72px;
}

.kicker, .section-heading > p, .hero-index, .equation {
  font-family: "Courier New", monospace;
}

.kicker { margin: 0 0 12px; color: var(--cyan); font-size: 14px; }

h1 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(64px, 12vw, 156px);
  line-height: .9;
  letter-spacing: 0;
}

.intro { width: min(600px, 100%); margin: 30px 0; color: #e4e7e3; font-size: 18px; }
.command { display: inline-flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 2px solid var(--red); text-decoration: none; font-weight: 700; }
.hero-index { position: absolute; right: 28px; bottom: 22px; margin: 0; color: rgb(255 255 255 / 38%); font-size: 12px; writing-mode: vertical-rl; }

.posts, .mail, .about {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 96px 0;
}

.section-heading { display: grid; grid-template-columns: 180px 1fr; align-items: end; margin-bottom: 36px; }
.section-heading > p { margin: 0; color: var(--red); text-transform: uppercase; }
h2 { margin: 0; font-family: Georgia, serif; font-size: 42px; line-height: 1.15; letter-spacing: 0; }

.post-row { display: grid; grid-template-columns: 180px 1fr; padding: 34px 0; border-top: 1px solid var(--line); }
.post-row:last-child { border-bottom: 1px solid var(--line); }
.post-meta { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 13px; }
.post-body h3 { margin: 0 0 8px; font-size: 25px; letter-spacing: 0; }
.post-body > p { margin: 0; color: var(--muted); }
details { margin-top: 20px; }
summary { cursor: pointer; color: var(--red); font-weight: 700; }
.article-content { max-width: 720px; padding-top: 14px; }
blockquote { margin: 24px 0 0; padding-left: 18px; border-left: 3px solid var(--cyan); font-family: Georgia, serif; font-size: 22px; }

.mail { display: grid; grid-template-columns: 180px 1fr; column-gap: 0; color: var(--white); background: var(--night); box-shadow: 0 0 0 100vmax var(--night); clip-path: inset(0 -100vmax); }
.mail .section-heading { grid-column: 1 / -1; }
.mail-copy p { max-width: 600px; margin: 0 0 22px; color: #b9c1bd; }
.mail-address { color: var(--cyan); font-family: Georgia, serif; font-size: clamp(28px, 5vw, 54px); text-decoration-thickness: 2px; text-underline-offset: 8px; overflow-wrap: anywhere; }
.alias-list { margin: 0; border-top: 1px solid rgb(255 255 255 / 20%); }
.alias-list div { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 13px 0; border-bottom: 1px solid rgb(255 255 255 / 20%); }
.alias-list dt { color: var(--cyan); font-family: "Courier New", monospace; }
.alias-list dd { margin: 0; color: #b9c1bd; }

.about { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.about .section-heading { grid-column: 1 / -1; }
.about > p { margin: 0; color: var(--muted); }
.equation { align-self: end; justify-self: end; color: var(--red); }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px max(20px, calc((100% - 1120px) / 2)); background: var(--ink); color: #c7c9c6; font-size: 13px; }

@media (max-width: 700px) {
  .site-header { min-height: 62px; }
  nav { gap: 16px; }
  .hero { min-height: 620px; }
  .hero-index { display: none; }
  .section-heading, .post-row, .mail, .about { grid-template-columns: 1fr; }
  .section-heading { gap: 6px; }
  .post-row { gap: 14px; }
  .posts, .mail, .about { padding: 68px 0; }
  .mail-copy { margin-bottom: 44px; }
  .about .section-heading, .mail .section-heading { grid-column: auto; }
  .equation { justify-self: start; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
