:root {
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 14px 34px rgba(15, 23, 42, 0.14);
  --max-width: 1120px;
}

html[data-theme="dark"] {
  --bg: #0b1220;
  --bg-soft: #111827;
  --surface: #0f172a;
  --surface-2: #172033;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --line: #253247;
  --accent: #60a5fa;
  --accent-soft: rgba(96, 165, 250, 0.12);
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  --shadow-hover: 0 16px 38px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

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

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

.section {
  padding: 5rem 0;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.1;
  margin: 0 0 0.9rem;
  letter-spacing: -0.03em;
}

.section-intro {
  max-width: 700px;
  color: var(--muted);
  margin: 0 0 2rem;
}

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

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

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand {
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.nav a {
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

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

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.nav-toggle:hover {
  transform: translateY(-1px);
}

.nav-toggle .icon-close {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-menu {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-close {
  display: inline-flex;
}

.mobile-nav {
  display: none;
  gap: 0.4rem;
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}

.js .mobile-nav.is-open {
  display: grid;
}

.mobile-nav a {
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.btn-icon,
.theme-toggle-icon,
.nav-toggle-icon {
  width: 1.05rem;
  height: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-icon svg,
.theme-toggle-icon svg,
.nav-toggle-icon svg {
  width: 100%;
  height: 100%;
}

.theme-toggle .icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-toggle .icon-sun {
  display: inline-flex;
}

html[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

.theme-toggle:focus-visible,
.nav-toggle:focus-visible,
.btn:focus-visible,
.text-link:focus-visible,
.mobile-nav a:focus-visible,
.post-card-title a:focus-visible,
.read-more:focus-visible,
.prev-post:focus-visible,
.next-post:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, white 55%);
  outline-offset: 3px;
}

.no-js .theme-toggle {
  display: none;
}

.hero {
  padding: 5.5rem 0 4rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.95fr;
  gap: 2rem;
  align-items: center;
}

.hero-proof-strip {
  padding: 0 0 2.5rem;
}

.hero-proof-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.hero-proof-item {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow);
}

.hero-proof-value {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.25rem;
}

.hero-proof-label {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.hero h1 span {
  display: block;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--muted);
  max-width: 720px;
  margin: 1.25rem 0 1.8rem;
}

.hero-actions {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.95rem 1.2rem;
  border-radius: 14px;
  font-weight: 600;
  border: 1px solid var(--line);
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

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

.btn-secondary {
  background: var(--surface);
  color: var(--text);
}

.hero-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.hero-photo-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 1.4rem;
  justify-items: center;
  min-height: 100%;
  padding: 2rem;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 34%),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.14), transparent 38%),
    linear-gradient(160deg, var(--surface), var(--surface-2));
}

.hero-photo-card::before {
  content: "";
  position: absolute;
  inset: auto -3rem -3rem auto;
  width: 11rem;
  height: 11rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  filter: blur(10px);
  pointer-events: none;
}

.hero-photo-stage {
  position: relative;
  width: min(100%, 290px);
  padding-top: 0.6rem;
}

.hero-photo-link {
  display: block;
  width: 100%;
  transition: transform 0.28s ease;
}

.hero-photo-link:hover {
  transform: translateY(-4px) rotate(1deg);
}

.hero-photo-frame {
  display: block;
  padding: 0.75rem;
  border-radius: 32px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.34), rgba(14, 165, 233, 0.2), rgba(34, 197, 94, 0.16));
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.2);
  transform: rotate(-3deg);
}

.hero-photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  border-radius: 26px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
}

.hero-photo-badge {
  position: absolute;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--line) 80%, white 20%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero-photo-badge-top {
  top: 0;
  right: -0.4rem;
}

.hero-photo-badge-bottom {
  left: -0.4rem;
  bottom: 0.6rem;
}

.hero-photo-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.45rem;
  text-align: center;
  max-width: 20rem;
}

.hero-photo-eyebrow {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-photo-title {
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero-photo-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.hero-photo-cta {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.4rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--text);
  font-weight: 700;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.hero-photo-cta:hover,
.hero-photo-cta:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--surface);
}

.hero-card-label {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.stat-list {
  display: grid;
  gap: 1rem;
}

.stat-item {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1rem 1.1rem;
  background: var(--surface);
}

.stat-value {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.3rem;
}

.stat-text {
  color: var(--muted);
  font-size: 0.95rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 1.4rem;
  box-shadow: var(--shadow);
}

.skill-card h3,
.project-card h3,
.blog-card h3,
.timeline-card h3 {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.card p,
.card li {
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.tag {
  padding: 0.5rem 0.8rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--muted);
}

.project-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

.project-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.blog-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.65rem;
}

.blog-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.text-link {
  color: var(--accent);
  font-weight: 600;
}

.timeline {
  display: grid;
  gap: 1rem;
}

.timeline-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1rem;
  align-items: start;
}

.timeline-date {
  font-weight: 700;
  color: var(--text);
}

.timeline-role {
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.timeline-company {
  color: var(--muted);
  margin-bottom: 0.55rem;
}

.contact-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.5rem;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.contact-title {
  margin: 0 0 0.4rem;
}

.contact-text {
  margin: 0;
  color: var(--muted);
}

.contact-actions {
  margin: 0;
}

.footer {
  padding: 2rem 0 3rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  font-weight: 600;
  transition: color 0.2s ease;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--accent);
}

.legal-section {
  padding-top: 4.5rem;
}

.legal-page {
  max-width: 820px;
  margin: 0 auto;
}

.legal-page h2 {
  margin: 2rem 0 0.7rem;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.legal-page p {
  margin: 0 0 1rem;
}

@media (max-width: 920px) {
  .hero-grid,
  .grid-3,
  .grid-2,
  .timeline-card {
    grid-template-columns: 1fr;
  }

  .js .nav {
    display: none;
  }

  .js .nav-toggle {
    display: inline-flex;
  }

  .no-js .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 0.9rem 0;
  }

  .no-js .nav {
    width: 100%;
    justify-content: space-between;
    gap: 0.75rem 1rem;
  }

  .no-js .mobile-nav {
    display: none;
  }

  .hero {
    padding-top: 4rem;
  }

  .hero-proof-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-photo-stage {
    width: min(100%, 260px);
  }
}

@media (max-width: 640px) {
  .section {
    padding: 4rem 0;
  }

  .container {
    width: min(var(--max-width), calc(100% - 1.2rem));
  }

  .hero-actions,
  .hero-meta,
  .project-links,
  .footer-meta,
  .footer-links,
  .footer-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .btn,
  .theme-toggle {
    width: 100%;
  }

  .topbar-actions .theme-toggle,
  .topbar-actions .nav-toggle {
    width: auto;
  }

  .no-js .topbar-actions {
    display: none;
  }

  .theme-toggle-text {
    display: none;
  }

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

  .hero-photo-card {
    padding: 1.4rem;
  }

  .hero-photo-badge-top {
    right: 0;
  }

  .hero-photo-badge-bottom {
    left: 0;
  }

  .hero-photo-cta {
    width: 100%;
    justify-content: center;
  }
}

/* Blog Styles */
.post {
  max-width: 800px;
  margin: 0 auto;
}

.post-header {
  margin-bottom: 2rem;
}

.post-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.95rem;
}

.post-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.post-content {
  line-height: 1.7;
  margin-bottom: 2rem;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.post-content p {
  margin-bottom: 1.5rem;
}

.post-content code {
  background: var(--bg-soft);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
}

.post-content pre {
  background: var(--bg-soft);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.post-content pre code {
  background: none;
  padding: 0;
}

.post-footer {
  border-top: 1px solid var(--line);
  padding-top: 2rem;
  margin-top: 3rem;
}

.post-navigation {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.prev-post,
.next-post {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  padding: 0.5rem 0;
}

.prev-post:hover,
.next-post:hover {
  text-decoration: underline;
}

/* Blog listing styles */
.blog-posts {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
}

.blog-post-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.post-card-header {
  margin-bottom: 1rem;
}

.post-card-title {
  font-size: 1.2rem;
  line-height: 1.3;
  margin: 0 0 0.5rem;
}

.post-card-title a {
  color: var(--text);
  text-decoration: none;
}

.post-card-title a:hover {
  color: var(--accent);
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.post-card-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.post-card-excerpt {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.post-card-footer {
  margin-top: 1rem;
}

.read-more {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.read-more:hover {
  text-decoration: underline;
}
