/* GitHub Pages–friendly personal site — system fonts, no build step */

:root {
  color-scheme: light dark;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #ffffff;
  --bg-alt: #f6f8fa;
  --bg-elevated: #ffffff;
  --text: #1f2328;
  --text-muted: #656d76;
  --border: #d0d7de;
  --accent: #0969da;
  --accent-hover: #0550ae;
  --accent-soft: #ddf4ff;
  --shadow: 0 1px 3px rgba(31, 35, 40, 0.12);
  --radius: 8px;
  --max-width: 1100px;
  --header-h: 56px;
}

[data-theme="dark"] {
  --bg: #0d1117;
  --bg-alt: #161b22;
  --bg-elevated: #21262d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --border: #30363d;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --accent-soft: #388bfd26;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117;
    --bg-alt: #161b22;
    --bg-elevated: #21262d;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --border: #30363d;
    --accent: #58a6ff;
    --accent-hover: #79c0ff;
    --accent-soft: #388bfd26;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

img {
  max-width: 100%;
  height: auto;
}

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

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

.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 200;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 1rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: var(--header-h);
}

.logo {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
  text-decoration: none;
}

.logo:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin-left: auto;
}

.nav a {
  color: var(--text-muted);
  font-size: 0.9375rem;
  text-decoration: none;
}

.nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

.theme-toggle {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

/* Hero */
.hero {
  padding: 3.5rem 0 4rem;
  background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  display: grid;
  gap: 2.5rem;
  align-items: start;
}

@media (min-width: 768px) {
  .hero-inner {
    grid-template-columns: 1fr minmax(260px, 320px);
  }
}

.hero-label {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.25rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero-summary {
  margin: 0 0 1.5rem;
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 52ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

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

.btn-outline {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hero-meta {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.hero-meta li + li {
  margin-top: 0.35rem;
}

.meta-label {
  display: inline-block;
  min-width: 2.5rem;
  font-weight: 600;
  color: var(--text);
}

.hero-card {
  padding: 1.25rem 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.info-list {
  margin: 0;
}

.info-list > div {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.info-list > div:last-child {
  border-bottom: none;
}

.info-list dt {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.info-list dd {
  margin: 0;
  font-size: 0.9375rem;
}

.info-list a {
  word-break: break-all;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
}

.section-title {
  margin: 0 0 2rem;
  font-size: 1.5rem;
  font-weight: 700;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.about-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .about-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.about-grid p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* Timeline */
.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-item {
  position: relative;
  padding-left: 2rem;
  padding-bottom: 2.5rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 0.4375rem;
  top: 0.5rem;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-marker {
  position: absolute;
  left: 0;
  top: 0.35rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-alt);
  box-shadow: 0 0 0 1px var(--accent);
}

.timeline-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}

.timeline-header h3 {
  margin: 0;
  font-size: 1.125rem;
}

.timeline-role {
  margin: 0.25rem 0 0;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9375rem;
}

.timeline-header time {
  font-size: 0.875rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.timeline-desc {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
}

.timeline-content ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.timeline-content li {
  margin-bottom: 0.35rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* Projects */
.project-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-featured {
    grid-column: 1 / -1;
  }
}

.project-card {
  padding: 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.project-featured {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--bg-elevated) 40%);
}

.project-badge {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
}

.project-card h3 {
  margin: 0;
  font-size: 1.125rem;
}

.project-card h3 a {
  color: var(--text);
}

.project-card h3 a:hover {
  color: var(--accent);
  text-decoration: none;
}

.project-meta {
  margin: 0.35rem 0 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.project-card p {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.project-card h4 {
  margin: 1rem 0 0.5rem;
  font-size: 0.875rem;
  color: var(--text);
}

.project-card ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.compact-list {
  margin-bottom: 1rem !important;
}

.project-note {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0.15em 0.35em;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
}

/* Tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
}

.tags span {
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
}

/* Skills */
.skills-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.skill-group {
  padding: 1.25rem 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.skill-group h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: var(--accent);
}

.skill-group ul {
  margin: 0;
  padding-left: 1.15rem;
}

.skill-group li {
  margin-bottom: 0.4rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.skill-group strong {
  color: var(--text);
}

/* Contact */
.contact-section {
  text-align: center;
}

.contact-inner > p {
  margin: -1rem 0 2rem;
  color: var(--text-muted);
}

.contact-links {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .contact-links {
    grid-template-columns: repeat(3, 1fr);
  }
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.contact-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
}

.contact-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
}

.footer-inner p {
  margin: 0;
}

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

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