:root {
  --bg: #f8fafc;
  --bg-soft: #eef6ff;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --muted: #475569;
  --muted-2: #64748b;
  --border: #e2e8f0;
  --accent: #2563eb;
  --accent-2: #0ea5e9;
  --accent-soft: #dbeafe;
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 12px 40px rgba(15, 23, 42, 0.08);
  --ring: 0 0 0 3px rgba(37, 99, 235, 0.35);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --container: 1160px;
}

html[data-theme="dark"] {
  --bg: #08111f;
  --bg-soft: #0d1728;
  --surface: #101c2f;
  --surface-2: #0f1a2b;
  --text: #e5edf8;
  --muted: #a7b4c7;
  --muted-2: #8292aa;
  --border: #22314a;
  --accent: #60a5fa;
  --accent-2: #38bdf8;
  --accent-soft: rgba(96, 165, 250, 0.16);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 12px 40px rgba(0, 0, 0, 0.24);
  --ring: 0 0 0 3px rgba(96, 165, 250, 0.4);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

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

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

button,
input,
textarea,
select {
  font: inherit;
}

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 10px;
}

.container {
  width: min(100% - 40px, var(--container));
  margin-inline: auto;
}

.section {
  padding: 96px 0;
}

/* ----------------------------------------------------------
   Soft sections
   ---------------------------------------------------------- */
.section-soft {
  position: relative;
  background:
    linear-gradient(
      180deg,
      rgba(96, 165, 250, 0.085) 0%,
      rgba(96, 165, 250, 0.11) 50%,
      rgba(96, 165, 250, 0.01) 78%,
      transparent 100%
    ),
    var(--bg);
  border-block: 0;
}

.section-soft::before,
.section-soft::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 90px;
  pointer-events: none;
  z-index: 0;
}

.section-soft::before {
  top: 0;
  background: linear-gradient(180deg, var(--bg), transparent);
}

.section-soft::after {
  bottom: 0;
  background: linear-gradient(0deg, var(--bg), transparent);
}

.section-soft > .container {
  position: relative;
  z-index: 1;
}

html[data-theme="dark"] .section-soft {
  background:
    linear-gradient(
      180deg,
      rgba(96, 165, 250, 0.08) 0%,
      rgba(96, 165, 250, 0.04) 42%,
      rgba(96, 165, 250, 0.015) 74%,
      transparent 100%
    ),
    var(--bg);
}

/* ----------------------------------------------------------
   Skip link / sr-only
   ---------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 16px;
  z-index: 100;
  background: var(--accent);
  color: white;
  padding: 10px 14px;
  border-radius: 999px;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* ----------------------------------------------------------
   Scroll progress bar
   ---------------------------------------------------------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 60;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: transform 80ms linear;
}

/* ----------------------------------------------------------
   Header / nav
   ---------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248, 250, 252, 0.72);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  transition: box-shadow 220ms ease, background 220ms ease, border-color 220ms ease;
}

.site-header.is-scrolled {
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  border-bottom-color: var(--border);
}

html[data-theme="dark"] .site-header {
  background: rgba(8, 17, 31, 0.74);
  border-bottom-color: rgba(34, 49, 74, 0.6);
}

html[data-theme="dark"] .site-header.is-scrolled {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.nav {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-logo-card {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  padding: 6px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.brand:hover .brand-logo-card {
  transform: translateY(-1px) rotate(-2deg);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
}

.brand-logo-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

html[data-theme="dark"] .brand-logo-card {
  background: #f8fafc;
  border-color: rgba(226, 232, 240, 0.85);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

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

.nav-menu {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-menu a,
.theme-toggle {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}

.nav-menu a:hover,
.theme-toggle:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* active section indicator */
.nav-menu a.is-active {
  color: var(--text);
}

.nav-menu a.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.nav-lab {
  border: 1px solid var(--border);
  background: var(--surface) !important;
  color: var(--text) !important;
  box-shadow: var(--shadow-soft);
}

.nav-lab.is-active::after {
  display: none;
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  font-size: 1.05rem;
}

.theme-toggle .theme-icon {
  transition: transform 320ms ease;
}

.theme-toggle:hover .theme-icon {
  transform: rotate(180deg);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
}

.nav-toggle span:not(.sr-only) {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--text);
  border-radius: 999px;
}

/* ----------------------------------------------------------
   Hero
   ---------------------------------------------------------- */
.hero {
  position: relative;
  padding: 120px 0 150px;
  overflow: hidden;
}

/* ambient aurora behind the hero */
.hero-aurora {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 620px;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(40% 55% at 18% 22%, rgba(37, 99, 235, 0.28), transparent 60%),
    radial-gradient(38% 50% at 82% 12%, rgba(14, 165, 233, 0.24), transparent 62%),
    radial-gradient(45% 60% at 60% 80%, rgba(99, 102, 241, 0.16), transparent 65%);
  filter: blur(8px);
  opacity: 0.9;
  animation: auroraDrift 18s ease-in-out infinite alternate;
}

html[data-theme="dark"] .hero-aurora {
  opacity: 0.6;
}

@keyframes auroraDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(2%, 1.5%, 0) scale(1.05); }
  100% { transform: translate3d(-2%, -1%, 0) scale(1.02); }
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 140px;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(248, 250, 252, 0.55) 55%,
    var(--bg) 100%
  );
  z-index: 0;
}

.hero > .container {
  position: relative;
  z-index: 1;
}

html[data-theme="dark"] .hero::after {
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(8, 17, 31, 0.55) 55%,
    var(--bg) 100%
  );
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.75fr);
  gap: 56px;
  align-items: center;
}

.eyebrow {
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.9rem;
  margin: 0 0 14px;
}

/* availability badge */
.availability {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
  padding: 7px 14px 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--muted);
}

.availability .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.6rem, 5vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  margin-bottom: 24px;
  max-width: 10ch;
}

.hero-copy h1 {
  font-size: clamp(2.6rem, 5vw, 4.8rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
  max-width: 12ch;
  text-wrap: balance;
}

h2 {
  font-size: clamp(2.1rem, 4vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
  margin-bottom: 18px;
}

h3 {
  font-size: 1.22rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.hero-lede {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.16rem;
  margin-bottom: 30px;
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 750;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

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

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 22px 44px rgba(37, 99, 235, 0.34);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

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

.signal-row {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.signal-row span,
.tag-row span {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 650;
}

html[data-theme="dark"] .signal-row span,
html[data-theme="dark"] .tag-row span {
  background: rgba(255, 255, 255, 0.04);
}

/* ----------------------------------------------------------
   Hero card / terminal
   ---------------------------------------------------------- */
.hero-card {
  position: relative;
  padding: 18px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.52));
  box-shadow: var(--shadow);
  overflow: hidden;
}

html[data-theme="dark"] .hero-card {
  background: linear-gradient(180deg, rgba(16, 28, 47, 0.86), rgba(16, 28, 47, 0.56));
}

.card-glow {
  position: absolute;
  inset: -80px -80px auto auto;
  width: 220px;
  height: 220px;
  background: rgba(37, 99, 235, 0.2);
  filter: blur(30px);
  border-radius: 50%;
}

.mini-terminal {
  position: relative;
  border-radius: 22px;
  background: #07111f;
  color: #dbeafe;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.34);
}

.terminal-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-top span {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: #60a5fa;
}

.terminal-top span:nth-child(2) {
  background: #38bdf8;
}

.terminal-top span:nth-child(3) {
  background: #a78bfa;
}

.terminal-file {
  margin-left: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: rgba(219, 234, 254, 0.55);
}

pre {
  margin: 0;
  padding: 22px;
  overflow-x: auto;
}

code {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88rem;
}

/* terminal code: keep a stable height while typing so layout
   doesn't jump, and show a blinking caret */
.terminal-code {
  display: block;
  min-height: 11.5em;
  white-space: pre;
  line-height: 1.5;
}

.terminal-code.is-typing::after,
.terminal-code.is-done::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: #60a5fa;
  animation: caret 1s step-end infinite;
}

.terminal-code.is-done::after {
  opacity: 0.55;
}

@keyframes caret {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

.metrics-grid {
  position: relative;
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.metrics-grid div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  transition: transform 200ms ease, border-color 200ms ease;
}

.metrics-grid div:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.metrics-grid strong {
  display: block;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
}

.metrics-grid span {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ----------------------------------------------------------
   Section headings
   ---------------------------------------------------------- */
.section-heading {
  max-width: 760px;
  margin-bottom: 38px;
}

.section-heading p:not(.eyebrow),
.about-copy p,
.contact-card p {
  color: var(--muted);
  font-size: 1.04rem;
}

.row-heading {
  max-width: none;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

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

.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ----------------------------------------------------------
   Work / skills grids + cards
   ---------------------------------------------------------- */
.work-grid,
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.work-card,
.project-card,
.skill-group,
.quote-card,
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.work-card,
.skill-group {
  padding: 26px;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.work-card:hover,
.skill-group:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.work-card p,
.skill-group p,
.project-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.icon-box {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 900;
  font-family: "JetBrains Mono", monospace;
}

.skill-group h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.skill-group h3::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

/* ----------------------------------------------------------
   Projects
   ---------------------------------------------------------- */
.projects-section {
  background:
    linear-gradient(
      180deg,
      rgba(96, 165, 250, 0.02) 0%,
      rgba(37, 99, 235, 0.055) 52%,
      transparent 100%
    ),
    var(--bg);
}

/* filter chips */
.project-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}

.filter-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.filter-chip:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.filter-chip.is-active {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.project-card {
  padding: 24px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease, opacity 260ms ease;
}

.project-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.project-card.is-hidden {
  display: none;
}

.project-card.featured {
  grid-column: span 2;
  min-height: 440px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(133, 204, 236, 0.04)),
    var(--surface);
}

.project-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.project-kicker {
  margin: 0;
  color: var(--accent) !important;
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-top a {
  color: var(--muted);
  font-weight: 750;
  white-space: nowrap;
  transition: color 160ms ease;
}

.project-top a:hover {
  color: var(--accent);
}

.project-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 22px;
}

.project-meta {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.project-meta-grid .project-meta {
  margin-top: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-2);
}

.project-meta span {
  display: block;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.project-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 22px;
}

.cta-card {
  grid-column: 1 / -1;
  min-height: unset;
  height: auto;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(37, 99, 235, 0.06)),
    var(--surface);
}

.cta-card h3 {
  margin: 0;
}

.cta-card > p {
  margin: 0;
  max-width: 760px;
}

.cta-card .btn {
  margin-top: 8px;
  width: fit-content;
}

/* ----------------------------------------------------------
   About
   ---------------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 64px;
}

.about-copy {
  font-size: 1.08rem;
}

.quote-card {
  margin-top: 26px;
  padding: 26px 26px 26px 30px;
  border-left: 4px solid var(--accent);
  position: relative;
}

.quote-card p {
  margin: 0;
  color: var(--text);
  font-size: 1.12rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

/* ----------------------------------------------------------
   Contact
   ---------------------------------------------------------- */
.contact-section {
  padding-top: 60px;
}

.contact-card {
  padding: 42px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 32px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.16), transparent 36%),
    var(--surface);
}

/* ----------------------------------------------------------
   Footer
   ---------------------------------------------------------- */
.back-to-top {
  color: var(--muted);
  cursor: pointer;
}

.back-to-top:hover {
  color: var(--text);
}

.site-footer {
  padding: 28px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-grid p {
  margin: 0;
}

.footer-grid a:hover {
  color: var(--text);
}

/* ----------------------------------------------------------
   Scroll reveal
   ---------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 620ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* staggered children */
[data-reveal-stagger] > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 560ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 560ms cubic-bezier(0.22, 1, 0.36, 1);
}

[data-reveal-stagger].is-visible > * {
  opacity: 1;
  transform: none;
}

[data-reveal-stagger].is-visible > *:nth-child(1) { transition-delay: 0ms; }
[data-reveal-stagger].is-visible > *:nth-child(2) { transition-delay: 70ms; }
[data-reveal-stagger].is-visible > *:nth-child(3) { transition-delay: 140ms; }
[data-reveal-stagger].is-visible > *:nth-child(4) { transition-delay: 210ms; }
[data-reveal-stagger].is-visible > *:nth-child(5) { transition-delay: 280ms; }
[data-reveal-stagger].is-visible > *:nth-child(6) { transition-delay: 350ms; }

/* ----------------------------------------------------------
   Responsive
   ---------------------------------------------------------- */
@media (max-width: 960px) {
  .hero-grid,
  .about-grid,
  .contact-card {
    grid-template-columns: 1fr;
  }

  .project-grid,
  .work-grid,
  .skills-grid {
    grid-template-columns: 1fr 1fr;
  }

  .project-meta-grid {
    grid-template-columns: 1fr;
  }

  .project-card.featured {
    grid-column: span 2;
  }

  .contact-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .container {
    width: min(100% - 28px, var(--container));
  }

  .section {
    padding: 70px 0;
  }

  .hero {
    padding: 90px 0 70px;
  }

  h1 {
    font-size: clamp(2.4rem, 9vw, 3.7rem);
    line-height: 1.04;
    letter-spacing: -0.04em;
  }

  .hero-copy h1 {
    font-size: clamp(2.4rem, 9vw, 3.7rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
    max-width: 11ch;
  }

  .nav-toggle {
    display: inline-block;
  }

  .nav-menu {
    position: absolute;
    top: 76px;
    left: 14px;
    right: 14px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
  }

  .nav-menu.is-open {
    display: flex;
  }

  .nav-menu a,
  .theme-toggle {
    text-align: left;
    border-radius: 14px;
    width: 100%;
    justify-content: flex-start;
  }

  .nav-menu a.is-active::after {
    display: none;
  }

  .brand-logo-card {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    border-radius: 14px;
    padding: 6px;
  }

  .brand-text {
    font-size: 0.96rem;
  }

  .row-heading {
    display: block;
  }

  .row-heading .text-link {
    display: inline-block;
    margin-top: 12px;
  }

  .project-grid,
  .work-grid,
  .skills-grid,
  .metrics-grid,
  .project-meta-grid {
    grid-template-columns: 1fr;
  }

  .project-card.featured {
    grid-column: auto;
  }

  .cta-card {
    grid-column: auto;
  }

  .footer-grid {
    display: block;
  }

  .footer-grid a {
    display: inline-block;
    margin-top: 12px;
    margin-right: 14px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .btn:hover,
  .project-card:hover,
  .work-card:hover,
  .skill-group:hover {
    transform: none;
  }

  [data-reveal],
  [data-reveal-stagger] > * {
    opacity: 1;
    transform: none;
  }
}
