:root {
  --paper: #f6f5f1;
  --ink: #16181d;
  --muted: #5c616b;
  --line: #dcd9d1;
  --accent: #1f3fbf;
  --on-accent: #ffffff;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101216;
    --ink: #e9eaee;
    --muted: #9aa0ac;
    --line: #2a2e37;
    --accent: #7c93ff;
    --on-accent: #0b0d10;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -56px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  transition: top 0.2s var(--ease);
}

.skip:focus {
  top: 12px;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-inline: 28px;
}

/* nav */
.nav {
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
}

.nav-brand {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 22px;
}

.nav-links a {
  font-size: 14.5px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.nav-links a:hover {
  color: var(--accent);
}

/* hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 56px;
  align-items: center;
  padding-block: 84px 96px;
}

.hero > * {
  min-width: 0;
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(40px, 6vw, 68px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.025em;
}

.hero-sub {
  max-width: 24em;
  margin: 0;
  font-size: clamp(16px, 1.8vw, 19px);
  line-height: 1.75;
  color: var(--muted);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 24px;
  border: 1px solid var(--ink);
  border-radius: 0;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.22s var(--ease), color 0.22s var(--ease), border-color 0.22s var(--ease), transform 0.12s var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--ink);
  color: var(--paper);
}

/* portrait */
.portrait {
  margin: 0;
}

.portrait-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(31, 63, 191, 0.06);
  background: color-mix(in srgb, var(--accent) 6%, var(--paper));
}

.portrait-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait-mono {
  font-size: clamp(72px, 12vw, 140px);
  font-weight: 800;
  line-height: 1;
  color: rgba(31, 63, 191, 0.26);
  color: color-mix(in srgb, var(--accent) 26%, transparent);
  user-select: none;
}

.portrait.has-photo .portrait-mono {
  display: none;
}

.portrait figcaption {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* sections */
.section {
  position: relative;
  padding-block: 76px;
}

.section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 28px;
  right: 28px;
  height: 1px;
  background: var(--line);
}

.section h2 {
  margin: 0 0 30px;
  font-size: clamp(24px, 3vw, 31px);
  font-weight: 700;
  letter-spacing: -0.015em;
}

/* drawers */
.rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) auto auto;
  gap: 28px;
  align-items: center;
  padding: 26px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.24s var(--ease), color 0.24s var(--ease);
}

.rows li:first-child .row {
  border-top: 1px solid var(--line);
}

.row:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.row:hover .row-desc,
.row:hover .row-ref {
  color: rgba(255, 255, 255, 0.82);
  color: color-mix(in srgb, var(--on-accent) 82%, transparent);
}

.row:hover .row-arrow {
  color: var(--on-accent);
  transform: translateX(6px);
}

.row-name {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.row-desc {
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  transition: color 0.24s var(--ease);
}

.row-ref {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.24s var(--ease);
}

.row-arrow {
  font-size: 20px;
  color: var(--accent);
  transition: transform 0.24s var(--ease), color 0.24s var(--ease);
}

/* latest posts */
.posts {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.post {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 20px;
  align-items: baseline;
  padding: 14px 0;
}

.post-date {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}

.post-title {
  font-size: 17px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-color 0.2s var(--ease), color 0.2s var(--ease);
}

.post-title:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* about */
.about p {
  max-width: 62ch;
  margin: 0 0 16px;
  font-size: 16.5px;
  line-height: 1.85;
}

.about a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(31, 63, 191, 0.4);
  border-bottom-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.about a:hover {
  border-bottom-color: var(--accent);
}

/* footer */
.footer {
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 28px;
  padding-block: 30px 44px;
  font-size: 13.5px;
  color: var(--muted);
}

.footer a {
  color: var(--muted);
  text-decoration: none;
}

.footer a:hover {
  color: var(--accent);
}

/* motion */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.reveal {
  animation: rise 0.7s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 80ms);
}

/* responsive */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-block: 56px 64px;
  }

  .portrait-frame {
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 720px) {
  .wrap {
    padding-inline: 20px;
  }

  .nav-inner {
    gap: 12px;
  }

  .nav-brand {
    font-size: 14.5px;
  }

  .nav-links {
    gap: 12px;
  }

  .nav-links a {
    font-size: 13.5px;
  }

  .section {
    padding-block: 56px;
  }

  .section::before {
    left: 20px;
    right: 20px;
  }

  .row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name arrow"
      "desc arrow"
      "ref arrow";
    gap: 4px 16px;
    padding: 20px 4px;
  }

  .row-name {
    grid-area: name;
  }

  .row-desc {
    grid-area: desc;
  }

  .row-ref {
    grid-area: ref;
  }

  .row-arrow {
    grid-area: arrow;
    align-self: center;
  }

  .post {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
}
