/* Alan Zhu — zhu.nz */

:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #888888;
  --accent: #1a1a1a;
  --link-underline: #cccccc;
  --link-underline-hover: #1a1a1a;
  --border: #e5e5e5;
  --toggle-bg: #e5e5e5;
  --toggle-knob: #1a1a1a;
  --max-width: 680px;
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', 'PingFang SC', 'Microsoft YaHei', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --transition: all 0.3s ease;
}

.u-mode-invert {
  --bg: #111111;
  --text: #e8e8e8;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  --accent: #e8e8e8;
  --link-underline: #444444;
  --link-underline-hover: #e8e8e8;
  --border: #2a2a2a;
  --toggle-bg: #333333;
  --toggle-knob: #e8e8e8;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  transition: background 0.3s ease, color 0.3s ease;
}

::selection {
  background: rgba(0, 100, 255, 0.18);
  color: inherit;
}

::-moz-selection {
  background: rgba(0, 100, 255, 0.18);
  color: inherit;
}

/* Page wrapper */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  padding: 48px 0 32px;
}

.site-header .container {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}

.header-name-link {
  text-decoration: none;
  color: var(--text);
}

.header-name {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
  transition: color 0.3s ease;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-link {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.header-link:hover {
  color: var(--text);
}

.lang-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

/* Dark mode toggle */
.toggle-switch {
  position: relative;
  width: 36px;
  height: 20px;
}

.toggle-checkbox {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-label {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--toggle-bg);
  border-radius: 20px;
  transition: background-color 0.3s ease;
}

.toggle-label::before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: var(--toggle-knob);
  border-radius: 50%;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.toggle-checkbox:checked + .toggle-label::before {
  transform: translateX(16px);
}

/* Main */
.page-main {
  flex: 1;
  padding-bottom: 80px;
}

/* Profile photo */
.profile {
  margin-bottom: 32px;
}

.profile-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* Intro */
.intro {
  margin-bottom: 56px;
}

.intro p {
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.65;
  color: var(--text);
  transition: color 0.3s ease;
}

.intro a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--link-underline);
  text-underline-offset: 3px;
  transition: var(--transition);
}

.intro a:hover {
  text-decoration-color: var(--link-underline-hover);
}

.intro-period {
  color: var(--text);
}

.intro-ellipsis {
  color: var(--text-muted);
}

.intro-expand-link {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 2px;
  transition: var(--transition);
}

.intro-expand-link:hover {
  color: var(--text);
}

.intro-expand-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s ease, opacity 0.4s ease, margin 0.4s ease;
  margin-top: 0;
}

.intro-expand-content.is-expanded {
  max-height: 500px;
  opacity: 1;
  margin-top: 20px;
}

.intro-expand-content p {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Sections */
.section {
  margin-bottom: 56px;
}

.section-heading {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
  transition: color 0.3s ease;
}

/* Bullet list */
.bullet-list {
  list-style: none;
}

.bullet-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.3s ease;
}

.bullet-item:first-child {
  padding-top: 0;
}

.bullet-link {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--link-underline);
  padding-bottom: 1px;
  transition: var(--transition);
}

.bullet-link:hover {
  border-bottom-color: var(--link-underline-hover);
}

.bullet-text {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--text);
  transition: color 0.3s ease;
}

.bullet-meta {
  display: block;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
  transition: color 0.3s ease;
}

/* Footer */
.site-footer {
  padding: 32px 0 48px;
  border-top: 1px solid var(--border);
  transition: border-color 0.3s ease;
}

.site-footer p {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

/* Responsive */
@media (max-width: 600px) {
  body {
    font-size: 17px;
  }

  .site-header {
    padding: 32px 0 24px;
  }

  .header-name {
    font-size: 24px;
  }

  .intro p {
    font-size: 18px;
  }

  .intro-expand-content p {
    font-size: 17px;
  }

  .bullet-link,
  .bullet-text {
    font-size: 17px;
  }

  .section {
    margin-bottom: 44px;
  }
}

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