:root {
  --bg: #fff;
  --bg-card: #fff;
  --text: #111;
  --text-soft: #666;
  --border: #e5e5e5;
  --font: "Inter", system-ui, sans-serif;
  --max: 1024px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111;
    --bg-card: #1a1a1a;
    --text: #e5e5e5;
    --text-soft: #999;
    --border: #2a2a2a;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border);
  transition: text-decoration-color 0.2s;
}

a:hover {
  text-decoration-color: var(--text);
}

.shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px 24px 64px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

.header-name {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.header-nav {
  display: flex;
  gap: 20px;
}

.header-nav a {
  font-size: 13px;
  color: var(--text-soft);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 48px;
  align-self: start;
}

.sidebar h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 10px;
}

.sidebar-intro {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.65;
  margin-bottom: 14px;
}

.sidebar-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 28px;
}

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  margin-bottom: 10px;
}

/* Education */
.edu-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.edu-school {
  font-weight: 600;
  font-size: 15px;
}

.edu-period {
  font-size: 13px;
  color: var(--text-soft);
}

.edu-detail {
  font-size: 14px;
  color: var(--text-soft);
}

/* Sidebar contact */
.sidebar .contact-row {
  display: flex;
  gap: 8px;
  font-size: 12px;
  padding: 4px 0;
  border: none;
}

.sidebar .contact-label {
  font-weight: 600;
  font-size: 11px;
  min-width: 56px;
}

/* Main content */
.main-content {
  min-width: 0;
}

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

.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}

/* Awards */
.award-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.award-row:last-child {
  border-bottom: none;
}

.award-main {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.award-title {
  font-weight: 500;
  font-size: 14px;
}

.award-event {
  font-size: 13px;
  color: var(--text-soft);
}

.award-date {
  font-size: 13px;
  color: var(--text-soft);
  white-space: nowrap;
}

/* Research */
.research-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.research-title {
  font-weight: 600;
  font-size: 15px;
}

.research-period {
  font-size: 13px;
  color: var(--text-soft);
}

.research-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.research-points li {
  font-size: 14px;
  color: var(--text-soft);
  padding-left: 16px;
  position: relative;
}

.research-points li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--border);
}

/* Projects */
.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.project-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  transition: border-color 0.2s;
}

.project-card:hover {
  border-color: var(--text-soft);
}

.project-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.project-head h3 {
  font-size: 15px;
  font-weight: 600;
}

.project-status {
  font-size: 12px;
  color: var(--text-soft);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.project-stack {
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 8px;
}

.project-summary {
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: 12px;
}

.project-links {
  display: flex;
  gap: 16px;
}

.project-links a {
  font-size: 13px;
  font-weight: 500;
}

/* About */
#about-content p {
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: 8px;
}

#about-content p:last-child {
  margin-bottom: 0;
}

/* Footer */
.footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-soft);
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 640px) {
  .shell {
    padding: 32px 16px 48px;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .header-nav {
    gap: 14px;
    flex-wrap: wrap;
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .sidebar {
    position: static;
  }

  .sidebar h1 {
    font-size: 26px;
  }

  .sidebar-intro {
    font-size: 14px;
  }

  .sidebar-meta {
    flex-direction: row;
    gap: 16px;
    font-size: 13px;
  }

  .edu-row,
  .research-header,
  .award-row,
  .project-head {
    flex-direction: column;
    gap: 4px;
  }

  .award-main {
    flex-direction: column;
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
