:root {
  /* Core palette and layout tokens shared across the portfolio. */
  --bg: #0b1120;
  --bg-elevated: rgba(15, 23, 42, 0.82);
  --bg-soft: rgba(15, 23, 42, 0.55);
  --surface: rgba(15, 23, 42, 0.75);
  --surface-strong: rgba(15, 23, 42, 0.92);
  --surface-border: rgba(148, 163, 184, 0.16);
  --text: #e5eefb;
  --text-muted: #94a3b8;
  --heading: #f8fafc;
  --accent: #60a5fa;
  --accent-strong: #3b82f6;
  --accent-soft: rgba(96, 165, 250, 0.16);
  --success: #34d399;
  --danger: #f87171;
  --shadow: 0 20px 45px rgba(2, 6, 23, 0.35);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --container: min(1120px, calc(100vw - 32px));
  --nav-height: 80px;
}

html[data-theme="light"] {
  --bg: #f4f7fb;
  --bg-elevated: rgba(255, 255, 255, 0.94);
  --bg-soft: rgba(255, 255, 255, 0.72);
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --surface-border: rgba(15, 23, 42, 0.08);
  --text: #1e293b;
  --text-muted: #475569;
  --heading: #0f172a;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --success: #059669;
  --danger: #dc2626;
  --shadow: 0 22px 40px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .site-header {
  background: rgba(244, 247, 251, 0.86);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: "Inter", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.14), transparent 32%),
    radial-gradient(circle at top right, rgba(52, 211, 153, 0.1), transparent 22%),
    linear-gradient(180deg, var(--bg) 0%, #050814 100%);
  color: var(--text);
  line-height: 1.65;
  transition: background-color 180ms ease, color 180ms ease;
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 32%),
    radial-gradient(circle at top right, rgba(52, 211, 153, 0.08), transparent 22%),
    linear-gradient(180deg, #f4f7fb 0%, #eef3f9 100%);
}

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

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

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-strong);
  color: white;
  z-index: 100;
  transition: top 150ms ease;
}

.skip-link:focus {
  top: 16px;
}

/* .site-shell {
  padding-bottom: 48px;
} */

.container {
  width: var(--container);
  margin: 0 auto;
}

.section {
  padding: 96px 0;
}

.section:first-of-type {
  padding-top: 64px;
}

.section-divider {
  width: min(260px, calc(100vw - 64px));
  height: 1px;
  margin: -4px auto;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(212, 175, 55, 0.18) 18%,
    rgba(212, 175, 55, 0.8) 50%,
    rgba(212, 175, 55, 0.18) 82%,
    transparent 100%
  );
}

.section-heading {
  max-width: 680px;
  margin-bottom: 40px;
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.section-heading h2,
.section-heading h1,
.hero-copy h1,
.page-intro h1 {
  margin: 16px 0 16px;
  color: var(--heading);
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0;
}

.section-heading h2,
.page-intro h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.section-heading p,
.page-intro p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.surface {
  border: 1px solid var(--surface-border);
  background: var(--surface);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

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

.button-primary {
  background: var(--accent-strong);
  color: #ffffff;
}

.button-primary:hover {
  background: var(--accent);
}

.button-secondary {
  border-color: var(--surface-border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--heading);
}

.button-secondary:hover {
  border-color: rgba(96, 165, 250, 0.32);
  background: var(--accent-soft);
}

.button-ghost {
  color: var(--text-muted);
}

.eyebrow-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 0.92rem;
}

.site-header {
  /* Sticky navigation stays readable against both themes. */
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(11, 17, 32, 0.8);
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.site-nav {
  min-height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: var(--heading);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.28), rgba(52, 211, 153, 0.18));
  border: 1px solid rgba(148, 163, 184, 0.16);
  overflow: hidden;
}

.brand-meta small {
  display: block;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-links,
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link,
.theme-toggle,
.menu-toggle {
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text-muted);
  background: transparent;
}

.theme-toggle {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.05rem;
}

.nav-link:hover,
.nav-link[aria-current="page"],
.theme-toggle:hover,
.menu-toggle:hover {
  color: var(--heading);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--surface-border);
}

.menu-toggle {
  display: none;
}

.mobile-nav {
  display: none;
  padding: 0 0 20px;
}

.mobile-nav-panel {
  border-radius: 22px;
  padding: 12px;
}

.mobile-nav-panel a,
.mobile-nav-panel button {
  width: 100%;
  display: block;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--text-muted);
}

.mobile-nav-panel a:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--heading);
}

.hero {
  position: relative;
  overflow: hidden;
}

.hero-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.hero-shape {
  position: absolute;
  border-radius: 9999px;
  opacity: 0.25;
}

.hero-shape--1 {
  width: 240px;
  height: 240px;
  background: radial-gradient(circle at 30% 30%, var(--accent), transparent 70%);
  top: -60px;
  right: -40px;
  animation: hero-float 8s ease-in-out infinite;
}

.hero-shape--2 {
  width: 180px;
  height: 180px;
  background: radial-gradient(circle at 70% 30%, var(--success), transparent 70%);
  bottom: 10%;
  left: -50px;
  animation: hero-float 10s ease-in-out infinite reverse;
}

.hero-shape--3 {
  width: 120px;
  height: 120px;
  background: radial-gradient(circle at 50% 50%, var(--accent), transparent 70%);
  top: 40%;
  right: 15%;
  animation: hero-float 6s ease-in-out infinite 2s;
}

@keyframes hero-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-24px) scale(1.05); }
}

.hero-grid {
  display: grid;
  gap: 28px;
  align-items: center;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
}

.hero-copy h1 {
  font-size: clamp(1.75rem, 3.2vw, 2.75rem);
  max-width: none;
  width: 100%;
}

.hero-copy p {
  max-width: 62ch;
  color: var(--text-muted);
  font-size: 1.08rem;
}

.hero-card {
  /* wrapper — visual card styling lives on .hero-art */
}

.hero-note {
  margin-top: 20px;
  color: var(--text-muted);
}

.hero-art {
  position: relative;
  padding: 16px 16px 32px;
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-art img {
  width: 100%;
  max-width: 220px;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 9999px;
  object-fit: cover;
  display: block;
}

.hero-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 360px;
  margin: -52px auto 0;
  padding: 18px;
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.hero-overlay strong {
  display: block;
  margin-bottom: 6px;
  color: #ffffff;
  font-family: "Manrope", sans-serif;
  font-size: 1.15rem;
}

.hero-overlay span {
  color: rgba(226, 232, 240, 0.8);
  font-size: 0.95rem;
}

.stats-grid,
.skills-grid,
.projects-grid,
.proof-grid,
.article-grid,
.tech-grid {
  display: grid;
  gap: 18px;
}

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

.stat-card,
.skill-card,
.project-card,
.proof-card,
.article-card,
.timeline-card,
.contact-card,
.detail-card,
.empty-state {
  border-radius: var(--radius-md);
}

.stat-card {
  padding: 22px;
}

.stat-card strong {
  display: block;
  font-family: "Manrope", sans-serif;
  font-size: 2rem;
  color: var(--heading);
}

.stat-card span {
  color: var(--text-muted);
}

.about-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.content-card,
.principles-card {
  padding: 28px;
  border-radius: var(--radius-md);
}

.content-card p,
.principles-card p {
  margin: 0 0 16px;
}

.principles-list {
  display: grid;
  gap: 14px;
}

.principle {
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.principle strong {
  display: block;
  margin-bottom: 6px;
  color: var(--heading);
}

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

.skill-card {
  padding: 24px;
}

.skill-card h3,
.project-card h3,
.timeline-card h3,
.proof-card h3,
.article-card h3,
.detail-card h3,
.empty-state h3 {
  margin: 0 0 10px;
  color: var(--heading);
  font-family: "Manrope", sans-serif;
  font-size: 1.15rem;
}

.skill-card p,
.project-card p,
.timeline-card p,
.proof-card p,
.article-card p,
.detail-card p,
.empty-state p {
  margin: 0;
  color: var(--text-muted);
}

.skill-list,
.project-tags,
.meta-list,
.footer-links,
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-list span,
.skill-list a,
.project-tags span,
.meta-list span {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.1);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.skill-list a:hover,
.article-card h3 a:hover,
.tech-grid h3 a:hover {
  color: var(--heading);
}

.article-card h3 a,
.tech-grid h3 a {
  color: inherit;
}

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

.project-card {
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease;
}

.project-card:hover,
.article-card:hover,
.timeline-card:hover,
.skill-card:hover,
.proof-card:hover {
  transform: translateY(-4px);
  border-color: rgba(96, 165, 250, 0.24);
}

.project-visual {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.18), rgba(52, 211, 153, 0.12));
}

.project-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease;
}

.project-card:hover .project-visual img {
  transform: scale(1.02);
}

.project-body,
.article-body,
.detail-card,
.contact-card,
.timeline-card,
.proof-card {
  padding: 24px;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.project-actions a,
.article-card a,
.inline-link,
.timeline-link {
  color: var(--accent);
  font-weight: 600;
}

.project-actions a:hover,
.article-card a:hover,
.inline-link:hover,
.timeline-link:hover {
  color: var(--accent-strong);
}

.timeline {
  display: grid;
  gap: 16px;
}

.timeline-card {
  /* The timeline keeps dense experience readable without resorting to giant cards. */
  position: relative;
  padding-left: 68px;
}

.timeline-card::before {
  content: "";
  position: absolute;
  left: 28px;
  top: 28px;
  bottom: 28px;
  width: 1px;
  background: rgba(148, 163, 184, 0.18);
}

.timeline-card::after {
  content: "";
  position: absolute;
  left: 22px;
  top: 28px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 8px rgba(96, 165, 250, 0.14);
}

.timeline-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.timeline-role {
  color: var(--heading);
  font-weight: 600;
}

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

.timeline-points {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
}

.timeline-points li + li {
  margin-top: 8px;
}

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

.proof-card {
  padding: 22px;
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-item {
  overflow: hidden;
  border-radius: var(--radius-md);
}

.faq-item summary {
  list-style: none;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  color: var(--heading);
  font-weight: 600;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.2rem;
}

.faq-item[open] summary::after {
  content: "-";
}

.faq-answer {
  padding: 0 24px 22px;
  color: var(--text-muted);
}

.contact-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.contact-card h3 {
  margin-bottom: 12px;
}

.contact-methods {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.contact-method {
  display: grid;
  gap: 3px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.contact-method strong {
  color: var(--heading);
}

.contact-form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--heading);
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-muted);
}

.field textarea {
  min-height: 150px;
  resize: vertical;
}

.messages {
  padding-top: 16px;
}

.message {
  padding: 14px 16px;
  border-radius: 16px;
  margin-bottom: 12px;
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.message-success {
  background: rgba(52, 211, 153, 0.12);
  color: var(--heading);
}

.message-error {
  background: rgba(248, 113, 113, 0.12);
  color: var(--heading);
}

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

.article-card,
.detail-card,
.empty-state {
  overflow: hidden;
}

.article-media {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.14), rgba(52, 211, 153, 0.1));
}

.article-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-intro {
  padding-top: calc(var(--nav-height) + 24px);
  padding-bottom: 28px;
}

.page-intro .button-row {
  margin-top: 20px;
}

.breadcrumbs {
  margin-bottom: 18px;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  color: rgba(148, 163, 184, 0.8);
}

.breadcrumbs a:hover {
  color: var(--heading);
}

.detail-layout {
  display: grid;
  gap: 24px;
}

.detail-card img {
  margin-top: 18px;
  border-radius: 18px;
}

.prose {
  color: var(--text);
}

.prose h1,
.prose h2,
.prose h3 {
  color: var(--heading);
  font-family: "Manrope", sans-serif;
}

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

.prose img {
  border-radius: 18px;
}

.prose ul,
.prose ol {
  padding-left: 20px;
}

.site-footer {
  margin-top: 32px;
  padding: 24px 0 0;
}

.footer-shell {
  width: 100%;
  display: block;
  padding: 32px 0;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
}

.footer-shell .container {
  display: grid;
  gap: 20px;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
}

.footer-brand strong {
  display: block;
  color: var(--heading);
  font-family: "Manrope", sans-serif;
  font-size: 1.1rem;
}

.footer-brand span,
.footer-note {
  color: var(--text-muted);
}

.footer-links a,
.social-links a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--text-muted);
}

.footer-links a:hover,
.social-links a:hover {
  color: var(--heading);
  background: rgba(255, 255, 255, 0.04);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
}

.empty-state {
  padding: 28px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 500ms ease, transform 500ms ease;
}

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

@media (max-width: 1023px) {
  .hero-grid,
  .about-grid,
  .contact-grid,
  .skills-grid,
  .projects-grid,
  .proof-grid,
  .article-grid,
  .tech-grid {
    grid-template-columns: 1fr;
  }

  .hero-art {
    padding: 12px 12px 28px;
  }

  .hero-art img {
  max-width: 220px;
  }

  .timeline-card {
    padding-left: 56px;
  }

  .timeline-card::before {
    left: 24px;
  }

  .timeline-card::after {
    left: 18px;
  }
}

@media (max-width: 767px) {
  :root {
    --container: min(100vw - 48px, 1120px);
    --nav-height: 72px;
  }

  .section {
    padding: 72px 0;
  }

  .section-divider {
    width: min(180px, calc(100vw - 48px));
  }

  .site-nav {
    min-height: var(--nav-height);
  }

  .nav-links,
  .nav-actions .button,
  .nav-actions .theme-toggle {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .mobile-nav.is-open {
    display: block;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    max-width: none;
  }

  .hero-copy p {
    font-size: 1rem;
  }

  .content-card,
  .principles-card,
  .project-body,
  .contact-card,
  .article-body,
  .detail-card,
  .footer-shell .container {
    padding: 20px;
  }

  .timeline-card {
    padding-left: 24px;
  }

  .timeline-card::before,
  .timeline-card::after {
    display: none;
  }
}
