/* =========================================================
   Harsh Kadyan — Resume & Portfolio
   Premium monochrome: black / gray / white
   Semantic colors ONLY for state (green/red/yellow)
   Pure-CSS animations (no JS) — zero SEO impact
   ========================================================= */

:root {
  --bg: #0a0a0b;
  --bg-soft: #0e0e10;
  --surface: #141417;
  --surface-2: #1b1b21;
  --surface-3: #26262d;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #ffffff;
  --text-2: rgba(255, 255, 255, 0.62);
  --text-3: rgba(255, 255, 255, 0.40);
  --silver: #a8a8b3;
  --accent: #f4f4f8;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --radius: 16px;
  --radius-sm: 11px;
  --max: 1080px;
  --max-wide: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-inter), 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

/* =========================================================
   Aurora background — soft drifting light
   ========================================================= */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.aurora::before,
.aurora::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  will-change: transform;
}
.aurora::before {
  top: -12%;
  left: 50%;
  width: 52vw;
  height: 52vw;
  max-width: 720px;
  max-height: 720px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(168, 168, 179, 0.13), transparent 70%);
  animation: drift-a 22s ease-in-out infinite;
}
.aurora::after {
  bottom: -14%;
  left: 15%;
  width: 44vw;
  height: 44vw;
  max-width: 580px;
  max-height: 580px;
  background: radial-gradient(circle, rgba(244, 244, 248, 0.07), transparent 70%);
  animation: drift-b 26s ease-in-out infinite;
}
@keyframes drift-a {
  0%, 100% { transform: translate(-54%, 0) scale(1); }
  50% { transform: translate(-46%, 5%) scale(1.1); }
}
@keyframes drift-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(15%, -5%) scale(1.08); }
}

/* =========================================================
   Sites bar (top)
   ========================================================= */
.sites-bar {
  background: #000;
  color: #888;
  font-size: 11px;
  text-align: center;
  padding: 7px 12px;
  border-bottom: 1px solid #1a1a1a;
  letter-spacing: 0.3px;
}
.sites-bar .sites-label {
  text-transform: uppercase;
  font-weight: 700;
  margin-right: 8px;
  color: #555;
  font-size: 10px;
}
.sites-bar a {
  color: #ccc;
  text-decoration: none;
  margin: 0 7px;
  white-space: nowrap;
  transition: color 0.2s var(--ease);
}
.sites-bar a:hover { color: #fff; }
.sites-bar a[aria-current='location'] {
  color: #fff;
  font-weight: 700;
}

/* =========================================================
   Header / Nav
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 11, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 13px 24px;
}
.brand {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: opacity 0.2s var(--ease);
}
.brand:hover { opacity: 0.85; }

/* Brand mark = logo as identity (CSS-only, no HTML change needed) */
.brand-dot {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background-image: url('/img/harsh-kadyan-logo.jpeg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid var(--border-strong);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 6px 16px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
  animation: brand-pulse 4s ease-in-out infinite;
}
@keyframes brand-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 6px 16px rgba(0, 0, 0, 0.35); }
  50% { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 6px 22px rgba(255, 255, 255, 0.10); }
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
.site-nav a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 8px;
  position: relative;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.site-nav a::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 1px;
  background: var(--silver);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.site-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.site-nav a:hover::after { transform: scaleX(1); }
.site-nav a[aria-current='page'] {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.site-nav a[aria-current='page']::after { transform: scaleX(1); }

/* =========================================================
   Layout
   ========================================================= */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}
main { padding: 48px 0 72px; }

/* =========================================================
   Breadcrumb
   ========================================================= */
.breadcrumb {
  font-size: 13px;
  color: var(--text-3);
  margin: 0 0 28px;
}
.breadcrumb a {
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.breadcrumb a:hover { color: #fff; }
.breadcrumb span { margin: 0 6px; }

/* =========================================================
   Typography
   ========================================================= */
h1 {
  font-size: clamp(30px, 6vw, 52px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin: 0 0 18px;
}
h2 {
  font-size: clamp(21px, 3.2vw, 28px);
  font-weight: 700;
  letter-spacing: -0.022em;
  margin: 48px 0 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border), transparent);
}
h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
p { color: var(--text-2); margin: 0 0 16px; }
p strong { color: #fff; font-weight: 600; }
a {
  color: var(--silver);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
a:hover { color: #fff; }

.lead {
  font-size: 18px;
  color: var(--text-2);
  line-height: 1.6;
  max-width: 720px;
  margin: 0 0 32px;
}

/* =========================================================
   Cards
   ========================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease),
    box-shadow 0.35s var(--ease);
}
.card-interactive:hover,
.card.h-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.45);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

/* =========================================================
   Chips / Tags
   ========================================================= */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.25s var(--ease);
}
.chip:hover {
  border-color: var(--silver);
  color: #fff;
  transform: translateY(-1px);
}

/* =========================================================
   Badges (semantic only)
   ========================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid;
}
.badge-success { background: rgba(52, 211, 153, 0.12); color: var(--success); border-color: rgba(52, 211, 153, 0.3); }
.badge-warning { background: rgba(251, 191, 36, 0.12); color: var(--warning); border-color: rgba(251, 191, 36, 0.3); }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease), filter 0.2s var(--ease),
    background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn-primary {
  background: linear-gradient(135deg, #ffffff, var(--silver));
  color: #0a0a0b;
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.10);
}
.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(255, 255, 255, 0.18);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-2px);
}
.btn:active { transform: scale(0.97); }

/* =========================================================
   Quick facts / DL
   ========================================================= */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0;
}
.facts dt {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--text-3);
  margin-top: 14px;
}
.facts dd {
  font-size: 15px;
  color: var(--text);
  margin: 2px 0 14px;
}
.facts a { color: var(--silver); }

/* =========================================================
   Timeline
   ========================================================= */
.timeline {
  position: relative;
  padding-left: 30px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(to bottom, var(--border-strong), var(--border));
}
.timeline-item {
  position: relative;
  margin-bottom: 38px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -30px;
  top: 5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 2px solid var(--silver);
  box-shadow: 0 0 0 4px var(--bg);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.timeline-item:hover::before {
  transform: scale(1.25);
  box-shadow: 0 0 0 4px var(--bg), 0 0 14px rgba(168, 168, 179, 0.5);
}
.timeline-item h3 { font-size: 17px; margin: 0 0 4px; }
.timeline-item .role { color: var(--silver); font-weight: 600; font-size: 14px; margin: 0 0 6px; }
.timeline-item .period { font-size: 13px; color: var(--text-3); margin: 0 0 10px; }
.timeline-item ul { list-style: none; padding: 0; }
.timeline-item li {
  color: var(--text-2);
  font-size: 14px;
  padding: 3px 0 3px 18px;
  position: relative;
}
.timeline-item li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-3);
}

/* =========================================================
   Project cards
   ========================================================= */
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease),
    box-shadow 0.35s var(--ease);
}
.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    600px circle at var(--mx, 50%) var(--my, 0%),
    rgba(255, 255, 255, 0.06),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
}
.project-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}
.project-card:hover::before { opacity: 1; }
.project-card h3 { font-size: 18px; margin: 0 0 6px; position: relative; }
.project-card h3 a { color: #fff; }
.project-card h3 a:hover { color: var(--silver); }
.project-type {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--text-3);
  margin: 0 0 12px;
}
.project-card p {
  font-size: 14px;
  color: var(--text-2);
  margin: 0 0 16px;
  flex: 1;
  position: relative;
}
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
}
.project-tags span {
  border: 1px solid var(--border-strong);
  padding: 3px 10px;
  border-radius: 16px;
  font-size: 12px;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.03);
}
.view-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  color: var(--silver);
  font-size: 14px;
  font-weight: 600;
  transition: gap 0.25s var(--ease), color 0.2s var(--ease);
  position: relative;
}
.view-link:hover { color: #fff; gap: 11px; }

/* =========================================================
   Gallery
   ========================================================= */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.gallery-grid figure {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.gallery-grid figure:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px) scale(1.01);
}
.gallery-grid img {
  width: 100%;
  height: 100%;
  display: block;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.5s var(--ease);
}
.gallery-grid figure:hover img { transform: scale(1.04); }
.gallery-grid figcaption {
  font-size: 11px;
  color: var(--text-3);
  padding: 8px 10px;
  line-height: 1.4;
}

/* =========================================================
   FAQ accordion
   ========================================================= */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--surface);
  transition: border-color 0.25s var(--ease);
}
.faq-item:hover { border-color: var(--border-strong); }
.faq-item[open] { border-color: var(--border-strong); }
.faq-item summary {
  padding: 18px 20px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.2s var(--ease);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { background: rgba(255, 255, 255, 0.03); }
.faq-item summary::after {
  content: '+';
  font-size: 22px;
  font-weight: 400;
  color: var(--silver);
  transition: transform 0.3s var(--ease);
  line-height: 1;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p {
  padding: 0 20px 18px;
  margin: 0;
  animation: faq-open 0.3s var(--ease);
}
@keyframes faq-open {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   Contact
   ========================================================= */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.contact-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
}
.contact-card .icon { font-size: 28px; margin-bottom: 10px; }
.contact-card h3 { margin: 0 0 4px; font-size: 15px; }
.contact-card a { color: var(--silver); font-size: 14px; word-break: break-all; }

/* =========================================================
   Contact form
   ========================================================= */
.contact-form { margin-top: 4px; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.form-field {
  display: flex;
  flex-direction: column;
}
.form-field--wide { grid-column: 1 / -1; }
.form-field label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 7px;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  box-sizing: border-box;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease),
    background 0.2s var(--ease);
}
.contact-form textarea {
  min-height: 140px;
  resize: vertical;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: var(--text-3); }
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--silver);
  background: var(--surface-3);
  box-shadow: 0 0 0 3px rgba(168, 168, 179, 0.15);
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.form-status {
  font-size: 14px;
  color: var(--text-3);
  font-weight: 500;
  animation: fade-in 0.3s var(--ease-out) both;
}
.form-status--success { color: var(--success); }
.form-status--error { color: var(--danger); }
.form-status--cooldown { color: var(--warning); }
.is-disabled,
.is-disabled:hover {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  filter: none !important;
  box-shadow: none !important;
}

/* =========================================================
   Related nav
   ========================================================= */
.related-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}
.related-nav a {
  border: 1px solid var(--border-strong);
  padding: 9px 16px;
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-2);
  transition: all 0.25s var(--ease);
}
.related-nav a:hover {
  border-color: var(--silver);
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

/* =========================================================
   Meta box (project pages)
   ========================================================= */
.meta-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 20px 0 28px;
}
.meta-box dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 20px;
  margin: 0;
}
.meta-box dt {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.meta-box dd { font-size: 15px; color: var(--text); margin: 0; }
.meta-box dd a { color: var(--silver); }

/* =========================================================
   Project pager
   ========================================================= */
.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 48px 0 20px;
  flex-wrap: wrap;
}
.pager a {
  flex: 1;
  min-width: 200px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-2);
  transition: all 0.25s var(--ease);
}
.pager a:hover {
  border-color: var(--border-strong);
  color: #fff;
  background: var(--surface-2);
  transform: translateY(-2px);
}
.pager a.next { text-align: right; }
.pager .label { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 2px; }

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  background: #060607;
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-3);
  font-size: 14px;
}
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: #fff; }
.site-footer p { margin: 6px 0; color: var(--text-3); }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin: 14px 0;
}
.footer-links a { font-size: 13px; color: var(--text-3); transition: color 0.2s var(--ease); }
.footer-links a:hover { color: #fff; }

/* =========================================================
   Featured photo / logo
   ========================================================= */
.featured-figures {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin: 28px 0;
}
.featured-figures figure {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.featured-figures figure:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
}
.featured-figures .profile-photo {
  width: 220px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.featured-figures .brand-logo {
  width: 160px;
  height: auto;
  padding: 16px;
  object-fit: contain;
  display: block;
}
.featured-figures figcaption {
  font-size: 12px;
  color: var(--text-3);
  padding: 10px 14px;
  text-align: center;
}
.about-images {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 20px 0 28px;
}
.about-images img {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  max-width: 100%;
  height: auto;
}

/* =========================================================
   Animations — pure CSS, zero SEO impact
   Content is visible by default; animations only enhance.
   ========================================================= */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Page-load reveal — staggered, runs once on load */
main > section {
  animation: fade-up 0.7s var(--ease-out) both;
}
main > section:nth-child(1) { animation-delay: 0.05s; }
main > section:nth-child(2) { animation-delay: 0.12s; }
main > section:nth-child(3) { animation-delay: 0.19s; }
main > section:nth-child(4) { animation-delay: 0.26s; }
main > section:nth-child(5) { animation-delay: 0.33s; }
main > section:nth-child(6) { animation-delay: 0.40s; }
main > section:nth-child(n + 7) { animation-delay: 0.45s; }

/* Progressive scroll-driven reveal (modern browsers only).
   Older browsers ignore unsupported properties and show content as-is. */
@supports (animation-timeline: view()) {
  main > section,
  .card,
  .project-card,
  .timeline-item,
  .faq-item,
  .contact-card,
  .gallery-grid figure,
  .related-nav a {
    animation: fade-up 0.7s var(--ease-out) both;
    animation-timeline: view();
    animation-range: entry 0% cover 22%;
  }
  /* Page-load stagger above is overridden for items inside scroll regions */
  main > section { animation-delay: 0s; }
}

/* =========================================================
   Scrollbar
   ========================================================= */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: #2c2c33;
  border-radius: 99px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: #3a3a44; }
::selection {
  background: rgba(244, 244, 248, 0.20);
  color: #fff;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 760px) {
  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 18px;
  }
  .site-nav {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { white-space: nowrap; }
  .container,
  .container-wide { padding: 0 18px; }
  .card-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .meta-box dl { grid-template-columns: 1fr; gap: 4px 0; }
  .meta-box dt { margin-top: 8px; }
  main { padding: 36px 0 56px; }
  h2 { margin-top: 36px; }
}
@media (max-width: 480px) {
  .sites-bar { font-size: 10px; padding: 6px 8px; }
  .sites-bar a { margin: 0 5px; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .featured-figures { flex-direction: column; }
  .featured-figures .profile-photo { width: 100%; max-width: 280px; margin: 0 auto; }
  .pager { flex-direction: column; }
  .pager a { text-align: center !important; }
}

/* =========================================================
   Print
   ========================================================= */
@media print {
  .sites-bar,
  .site-header,
  .site-footer,
  .related-nav,
  .pager,
  .aurora { display: none; }
  body { background: #fff; color: #000; }
  .card,
  .project-card {
    border: 1px solid #999;
    box-shadow: none;
  }
  @page { size: A4; margin: 0; }
}

/* =========================================================
   Reduced motion — accessibility
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* =========================================================
   Error pages
   ========================================================= */
.error-page {
  min-height: calc(100vh - 220px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px 80px;
  gap: 4px;
  animation: fade-in 0.6s var(--ease-out) both;
}
.error-code {
  font-size: clamp(80px, 18vw, 200px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #fff, var(--silver));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0 0 8px;
  animation: fade-up 0.6s var(--ease-out) both;
}
.error-title {
  font-size: clamp(22px, 3.5vw, 30px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: #fff;
}
.error-message {
  font-size: 17px;
  color: var(--text-2);
  max-width: 540px;
  margin: 0 0 28px;
  line-height: 1.6;
}
.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 0 0 20px;
}
.error-meta {
  font-size: 13px;
  color: var(--text-3);
  max-width: 480px;
  margin: 0 0 28px;
}
.error-meta a { color: var(--silver); }
.error-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.error-nav a {
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
  transition: all 0.2s var(--ease);
}
.error-nav a:hover {
  color: #fff;
  border-color: var(--border-strong);
}
@media (max-width: 760px) {
  .error-page { padding: 40px 18px 60px; }
}
@media (max-width: 480px) {
  .error-actions { flex-direction: column; }
  .error-actions .btn { width: 100%; }
}

/* Visually-hidden but crawlable/accessible content (e.g. primary navigation for
   screen readers and search engines). Kept in the DOM, never display:none. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
