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

:root {
  --bg: #f8f8fb;
  --text: #1a1a1c;
  --text-secondary: #6b6b75;
  --text-muted: #9595a0;
  --accent: #5b5fa8;
  --accent-hover: #4a4e94;
  --border: rgba(0, 0, 0, 0.07);
  --font: 'JetBrains Mono', 'Noto Sans SC', 'Microsoft YaHei', monospace;
}

[data-theme="dark"] {
  --bg: #0d0d0f;
  --text: #e8e8ed;
  --text-secondary: #9e9ea8;
  --text-muted: #6b6b75;
  --accent: #8b8fd8;
  --accent-hover: #a5a8ee;
  --border: rgba(255, 255, 255, 0.07);
}

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: color 0.3s;
}

/* ── Top Bar ─────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
}

.topbar-logo {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: color 0.2s;
}
.topbar-logo:hover { color: var(--accent); }

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  transition: color 0.3s, transform 0.3s;
}
.theme-toggle:hover {
  color: var(--accent);
  transform: rotate(180deg);
}

/* ── Home Main ───────────────────────────────── */
.home {
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.home-line {
  position: absolute;
  left: 28%;
  top: 20%;
  bottom: 20%;
  width: 1px;
  background: var(--accent);
  opacity: 0.4;
}

.home-content {
  padding: 80px 32px 80px calc(28% + 48px);
}

/* ── Name Block ──────────────────────────────── */
.name {
  line-height: 1.08;
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.name-mark {
  position: absolute;
  top: 0.15em; left: -0.55em;
  width: 0.35em; height: 0.35em;
  background: linear-gradient(135deg, #6b6fbf, #4a4d94);
  border-radius: 50%;
  flex-shrink: 0;
}

[data-theme="dark"] .name-mark {
  background: linear-gradient(135deg, #8b8fd8, #6b6fa8);
}

.name-line {
  display: block;
  letter-spacing: -0.03em;
}

.name-main {
  font-size: clamp(4rem, 9vw, 8rem);
  font-weight: 200;
}

.name-sub {
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 200;
  padding-left: clamp(1rem, 3vw, 3rem);
}

/* ── Name Rule ───────────────────────────────── */
.name-rule {
  width: 60vw;
  margin-left: calc(-8vw - 48px);
  height: 6px;
  border-top: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  opacity: 0;
  margin-bottom: 28px;
}

/* ── Tagline ─────────────────────────────────── */
.tagline {
  font-size: 1.05rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 48px;
  line-height: 1.8;
}

/* ── Home Nav Links ──────────────────────────── */
.home-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.home-nav a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s, transform 0.25s;
  display: inline-block;
  width: fit-content;
  padding: 2px 0;
}
.home-nav a:hover {
  color: var(--accent);
  transform: translateX(6px);
}

/* ── View Transitions ────────────────────────── */
::view-transition-old(root) {
  animation: 0.3s ease both vt-fade-out;
}
::view-transition-new(root) {
  animation: 0.3s ease both vt-fade-in;
}
@keyframes vt-fade-out {
  to { opacity: 0; transform: translateY(-12px); }
}
@keyframes vt-fade-in {
  from { opacity: 0; transform: translateY(12px); }
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 768px) {
  .topbar { padding: 16px 20px; }

  .home-line {
    left: 20px;
    top: 12%;
    bottom: 12%;
    opacity: 0.4;
  }

  .home-content {
    padding: 60px 20px 60px 48px;
  }

  .tagline { font-size: 0.88rem; }
  .home-nav a { font-size: 0.85rem; }

  .name-mark {
    left: -0.45em;
    width: 0.28em; height: 0.28em;
  }
  .name-sub { padding-left: clamp(0.5rem, 2vw, 1.5rem); }

  .name-rule {
    width: calc(80vw - 20px);
    margin-left: -28px;
    opacity: 0.25;
  }
}
