:root {
  color-scheme: light;
  --ink: #18181b;
  --body: #3f3f46;
  --muted: #71717a;
  --line: #d4d4d8;
  --paper: #f6f6f6;
  --card: #ffffff;
  --chip: #ececee;
  --hover: #e4e4e7;
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", system-ui, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f5f5f5;
  --body: #d4d4d8;
  --muted: #a1a1aa;
  --line: #3a3a3a;
  --paper: #111111;
  --card: #1c1c1c;
  --chip: #2a2a2a;
  --hover: #333333;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-new(root) {
  z-index: 9999;
}

::view-transition-old(root) {
  z-index: 1;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

html:not(.entered) .reveal {
  animation: rise-in 0.5s ease both;
}

html:not(.entered) .d1 { animation-delay: 0.05s; }
html:not(.entered) .d2 { animation-delay: 0.1s; }
html:not(.entered) .d3 { animation-delay: 0.15s; }
html:not(.entered) .d4 { animation-delay: 0.2s; }
html:not(.entered) .d5 { animation-delay: 0.25s; }
html:not(.entered) .d6 { animation-delay: 0.3s; }
html:not(.entered) .d7 { animation-delay: 0.35s; }
html:not(.entered) .d8 { animation-delay: 0.4s; }
html:not(.entered) .d9 { animation-delay: 0.45s; }
html:not(.entered) .d10 { animation-delay: 0.5s; }
html:not(.entered) .d11 { animation-delay: 0.55s; }
html:not(.entered) .d12 { animation-delay: 0.6s; }

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

a {
  color: inherit;
  text-decoration: none;
}

.page {
  width: min(680px, calc(100% - 48px));
  margin: 0 auto;
  padding: 56px 0 96px;
}

.site-header {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 560;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.theme-toggle {
  position: absolute;
  right: -10px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--ink);
  background: var(--hover);
}

.theme-toggle svg {
  position: absolute;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sun {
  opacity: 0;
}

:root[data-theme="dark"] .icon-moon {
  opacity: 0;
}

:root[data-theme="dark"] .icon-sun {
  opacity: 1;
}

.bio {
  display: flex;
  flex-direction: column;
  margin-top: 40px;
}

.bio p {
  margin: 0;
  color: var(--body);
  font-weight: 400;
}

.bio .lead {
  color: var(--ink);
  font-size: 18px;
  font-weight: 560;
  line-height: 1.6;
}

.bio strong {
  color: var(--ink);
  font-weight: 620;
}

.bio .lead + p {
  margin-top: 18px;
}

.bio-rest {
  display: grid;
  grid-template-rows: 1fr;
  margin-top: 22px;
  transition: grid-template-rows 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), margin-top 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bio.is-compact .bio-rest {
  grid-template-rows: 0fr;
  margin-top: 0;
}

.bio-rest-inner {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 22px;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.bio.is-compact .bio-rest-inner {
  opacity: 0;
}

.bio .motto {
  color: var(--ink);
  font-weight: 520;
}

.bio .motto span {
  color: var(--muted);
  font-weight: 400;
}

.contacts {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
}

.icon-link {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  color: var(--body);
}

.icon-link:hover {
  color: var(--ink);
  background: var(--hover);
}

.icon-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.email {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-left: 4px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}

.email:hover {
  background: var(--hover);
}

.wave {
  display: block;
  width: 100%;
  height: 14px;
  margin: 36px 0 32px;
  color: var(--line);
}

.featured h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 650;
  line-height: 1.3;
}

.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
}

.section-note {
  margin: 0;
  min-width: 0;
  color: var(--muted);
  font-size: 15px;
}

.projects {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 18px;
}

.project {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border-radius: 14px;
  background: var(--card);
}

.project:hover {
  background: var(--hover);
}

.project img {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 10px;
}

.project span {
  display: block;
}

.project-name {
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.project-desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.more-wrap {
  display: grid;
  grid-template-rows: 0fr;
  margin-top: 0;
  transition: grid-template-rows 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), margin-top 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.more-wrap.is-open {
  grid-template-rows: 1fr;
  margin-top: 14px;
}

.more-projects {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.more-projects .project {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.15s;
}

.more-wrap.is-open .more-projects .project {
  opacity: 1;
  transform: none;
}

.more-wrap.is-open .more-projects .project:nth-child(2) {
  transition-delay: 0.06s;
}

.more-wrap.is-open .more-projects .project:nth-child(3) {
  transition-delay: 0.12s;
}

.more-toggle {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 2px;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.more-toggle:hover {
  color: var(--ink);
}

.more-chevron {
  width: 16px;
  height: 16px;
  transition: transform 0.35s ease;
}

.more-toggle[aria-expanded="true"] .more-chevron {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
  .more-wrap,
  .more-projects .project,
  .more-chevron {
    transition: none;
  }

  html:not(.entered) .reveal,
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }

  .bio-rest,
  .bio-rest-inner {
    transition: none;
  }
}

@media (max-width: 639px) {
  .page {
    width: min(680px, calc(100% - 40px));
    padding-top: 28px;
  }
}
