/* —— Design tokens (reference-inspired) —— */
:root {
  --bg: #ffffff;
  --bg-alt: #f9fafb;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-soft: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --card-border: #e2e8f0;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --nav-h: 3.25rem;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
}

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

/* —— Top navigation —— */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-nav a:hover {
  color: var(--accent);
}

/* —— Hero —— */
.hero {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  padding: 3rem 1.5rem 4rem;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.07) 0%, transparent 45%),
    linear-gradient(var(--bg) 100%, var(--bg)),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 23px,
      rgba(15, 23, 42, 0.04) 23px,
      rgba(15, 23, 42, 0.04) 24px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 23px,
      rgba(15, 23, 42, 0.04) 23px,
      rgba(15, 23, 42, 0.04) 24px
    );
  background-color: #fff;
}

.hero-inner {
  max-width: 720px;
  margin: 0 auto;
}

.hero-greet {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.hero-title {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero-name {
  color: var(--accent);
}

.hero-sub {
  margin: 0 0 2rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-muted);
}

.hero-social {
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  color: var(--text-muted);
  border-radius: 50%;
  transition: color 0.15s ease, background 0.15s ease;
}

.hero-social a:hover {
  color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
}

/* —— Section layout (1/3 + 2/3) —— */
.section-block {
  padding: 0;
  scroll-margin-top: calc(var(--nav-h) + 0.75rem);
}

.section-alt {
  background: var(--bg-alt);
}

.section-inner {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: 2.5rem 3rem;
  align-items: start;
  max-width: 1080px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.section-head {
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
}

.section-title {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text);
}

.title-mark {
  border-bottom: 4px solid var(--accent);
  padding-bottom: 2px;
}

.section-body {
  min-width: 0;
}

.about-body p {
  margin: 0 0 1rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.75;
}

.about-body p:last-of-type {
  margin-bottom: 1.25rem;
}

.skill-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-pills span {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  background: #f1f5f9;
  border-radius: 999px;
}

/* —— Project cards —— */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

.section-alt .project-card {
  background: #fff;
}

.project-card-top {
  margin-bottom: 0.75rem;
}

.project-idx {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
}

.project-card-title {
  margin: 0 0 0.65rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.project-card-desc {
  margin: 0 0 1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.project-tags span {
  padding: 0.3rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: #fff;
  background: var(--text);
  border-radius: 4px;
}

/* —— Experience timeline —— */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 0.25rem;
  bottom: 0.25rem;
  width: 2px;
  background: #e2e8f0;
  border-radius: 1px;
}

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

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

.timeline-dot {
  position: absolute;
  left: 0.5rem;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  background: var(--accent);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #e2e8f0;
}

.exp-card {
  padding: 1.35rem 1.5rem;
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
  border-radius: 10px;
}

.section-alt .exp-card {
  background: #fff;
}

.exp-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.exp-role {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.exp-company {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent);
}

.exp-dates {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-soft);
  white-space: nowrap;
}

.exp-list {
  margin: 0;
  padding-left: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.exp-list li {
  margin-bottom: 0.45rem;
}

.exp-list li:last-child {
  margin-bottom: 0;
}

/* —— Education cards —— */
.edu-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

.section-alt .edu-card {
  background: #fff;
}

.edu-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.edu-degree {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  max-width: min(100%, 32rem);
}

.edu-dates {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-soft);
}

.edu-school {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
}

.edu-details {
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.75;
  color: var(--text-muted);
}

.edu-details li {
  position: relative;
  padding-left: 1rem;
  margin-bottom: 0.4rem;
}

.edu-details li::before {
  content: "*";
  position: absolute;
  left: 0;
  color: var(--text-soft);
}

.edu-details li:last-child {
  margin-bottom: 0;
}

/* —— Footer —— */
.site-footer {
  border-top: 1px solid var(--card-border);
  background: var(--bg-alt);
  padding: 2.5rem 1.5rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  max-width: 1080px;
  margin: 0 auto;
}

.footer-brand strong {
  display: block;
  font-size: 1rem;
  color: var(--text);
}

.footer-role {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-social {
  display: flex;
  gap: 0.75rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.footer-social a {
  display: flex;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

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

.footer-right {
  text-align: right;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}

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

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

.footer-copy {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-soft);
}

/* —— Links (global) —— */
a {
  color: inherit;
}

/* —— Responsive —— */
@media (max-width: 800px) {
  .section-inner {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 3rem 1.25rem;
  }

  .section-head {
    position: static;
  }

  .footer-inner {
    flex-direction: column;
  }

  .footer-right {
    text-align: left;
  }

  .footer-nav {
    justify-content: flex-start;
  }
}
