:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --text: #0f172a;
  --muted: #475569;
  --border: #dbe4f0;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.06);
}

:root[data-theme='dark'] {
  --bg: #020617;
  --surface: #0b1120;
  --surface-soft: #111b30;
  --text: #e5edf8;
  --muted: #9eb1ca;
  --border: #1e2a3f;
  --accent: #60a5fa;
  --accent-strong: #93c5fd;
  --accent-soft: rgba(96, 165, 250, 0.16);
  --shadow: 0 22px 48px rgba(2, 6, 23, 0.52);
  --shadow-soft: 0 12px 30px rgba(2, 6, 23, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, var(--surface-soft), var(--bg) 52%);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.65;
}

a {
  color: var(--accent);
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.6rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.72rem;
  text-decoration: none;
  color: inherit;
}

.brand-avatar {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid color-mix(in srgb, var(--accent) 30%, var(--border));
}

.logo {
  font-weight: 800;
  letter-spacing: 0.015em;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.95rem;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.nav-links a.active,
.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
  border-color: var(--accent);
}

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 0.45rem 0.76rem;
  cursor: pointer;
}

main {
  padding: 1.6rem 0 2.2rem;
}

section + section {
  margin-top: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  padding: 1.35rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.card.visible {
  opacity: 1;
  transform: translateY(0);
}

.hero {
  display: grid;
  gap: 1.2rem;
  align-items: center;
}

.hero-media {
  display: flex;
  justify-content: center;
}

.hero-photo {
  width: min(280px, 70vw);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 6px solid color-mix(in srgb, var(--accent) 20%, var(--surface));
  box-shadow: var(--shadow);
}

.about-photo {
  width: min(180px, 42vw);
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid color-mix(in srgb, var(--accent) 25%, var(--surface));
  box-shadow: var(--shadow-soft);
  margin: 0 auto 0.9rem;
}

.eyebrow {
  margin: 0 0 0.48rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.8rem;
}

h1,
h2,
h3 {
  margin-top: 0;
  line-height: 1.22;
}

h1 {
  font-size: clamp(2rem, 5.2vw, 3.1rem);
  margin-bottom: 0.4rem;
}

h2 {
  font-size: clamp(1.35rem, 3vw, 1.95rem);
  margin-bottom: 0.8rem;
}

.subtitle {
  color: var(--muted);
  font-size: 1.08rem;
  margin: 0 0 1rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.58rem;
}

.btn {
  display: inline-block;
  padding: 0.65rem 0.95rem;
  border-radius: 11px;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid var(--border);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  border-color: transparent;
}

.btn.ghost {
  color: var(--text);
  background: transparent;
}

.grid-2 {
  display: grid;
  gap: 1rem;
}

.project-grid,
.contact-grid,
.stack-grid {
  display: grid;
  gap: 1rem;
}

.project-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.project-card .btn-row {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
}

.chips li {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  border-radius: 999px;
  padding: 0.3rem 0.68rem;
  font-size: 0.87rem;
  font-weight: 650;
}

.role-meta {
  color: var(--muted);
  font-size: 0.93rem;
}

.timeline {
  border-left: 2px solid var(--accent-soft);
  padding-left: 0.92rem;
}

.timeline-item + .timeline-item {
  margin-top: 0.85rem;
}


.tech-label {
  margin: 0.4rem 0 0.52rem;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.experience-grid {
  display: block;
  border-left: 0;
  padding-left: 1.35rem;
}

.experience-grid .timeline-item {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 84%, var(--accent-soft));
  border-radius: 14px;
  padding: 1rem;
  position: relative;
}

.experience-grid .timeline-item::before {
  content: '';
  position: absolute;
  left: -1.2rem;
  top: 1.25rem;
  width: 0.64rem;
  height: 0.64rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.experience-grid .timeline-item h2 {
  margin-bottom: 0.35rem;
  font-size: clamp(1.18rem, 2.2vw, 1.5rem);
}

.experience-grid .chips {
  margin-top: 0.2rem;
}

.experience-grid .timeline-item + .timeline-item {
  margin-top: 1rem;
}

form {
  display: grid;
  gap: 0.68rem;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 0.64rem 0.75rem;
  font: inherit;
}

footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
  padding: 1rem 0 2rem;
  font-size: 0.9rem;
}

@media (min-width: 860px) {
  .card {
    padding: 1.6rem;
  }

  .hero {
    grid-template-columns: 1.35fr 1fr;
  }

  .grid-2,
  .project-grid,
  .contact-grid,
  .stack-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 920px) {
  .header-inner {
    flex-wrap: wrap;
    justify-content: center;
    padding: 0.72rem 0;
  }

  .experience-grid {
    padding-left: 0.92rem;
  }
}

.media-grid,
.tweet-list {
  display: grid;
  gap: 0.9rem;
}

.media-card {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: var(--surface-soft);
}

.media-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.tweet-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.95rem;
  background: color-mix(in srgb, var(--surface) 84%, var(--accent-soft));
}

.tweet-card h3 {
  margin-bottom: 0.45rem;
  font-size: 1.03rem;
}

.tweet-card p {
  margin: 0.25rem 0;
}

@media (min-width: 860px) {
  .media-grid,
  .tweet-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1080px) {
  .media-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tweet-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
