:root {
  --bg: #060708;
  --bg-2: #111316;
  --panel: rgba(20, 22, 25, 0.86);
  --panel-2: rgba(30, 32, 36, 0.94);
  --text: #f2f1ee;
  --muted: #b5b2ac;
  --soft: #d9d6cf;
  --accent: #8f1727;
  --accent-2: #c9c3ba;
  --platinum: #e7e2da;
  --line: rgba(231, 226, 218, 0.15);
  --line-strong: rgba(231, 226, 218, 0.36);
  --shadow: 0 26px 72px rgba(0, 0, 0, 0.46);
  --pointer-x: 18%;
  --pointer-y: 18%;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { scroll-behavior: smooth; }
html { background: #050607; }

body {
  position: relative;
  color: var(--text);
  background:
    radial-gradient(circle at 78% 8%, rgba(231, 226, 218, 0.045), transparent 26%),
    linear-gradient(120deg, rgba(143, 23, 39, 0.07), transparent 34%),
    linear-gradient(180deg, #101215 0%, #050607 100%);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at var(--pointer-x) var(--pointer-y), rgba(231, 226, 218, 0.085), transparent 17%),
    linear-gradient(135deg, rgba(143, 23, 39, 0.08), transparent 28%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 80px);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.035), transparent 14%, transparent 84%, rgba(0,0,0,0.28));
}

.ai-backdrop,
.scroll-progress {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.ai-backdrop { z-index: 0; opacity: 0.58; }
#ai-canvas { width: 100%; height: 100%; display: block; }
.ai-orb { display: none; }

.ai-grid {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(231, 226, 218, 0.052) 1px, transparent 1px),
    linear-gradient(90deg, rgba(231, 226, 218, 0.052) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(180deg, transparent, #000 14%, #000 76%, transparent);
}

.scroll-progress {
  z-index: 20;
  width: 4px;
  left: auto;
  right: 14px;
  top: 18px;
  bottom: 18px;
}

.scroll-progress span {
  display: block;
  width: 100%;
  height: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 22px rgba(231, 226, 218, 0.34);
}

a { color: #e9ded8; text-decoration: none; }
a:hover { color: #ffffff; text-decoration: underline; }

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 24px;
}

.top-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #e8e4dc;
  background: rgba(18, 19, 22, 0.76);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  backdrop-filter: blur(14px);
}

.top-nav a.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(143, 23, 39, 0.88), rgba(52, 55, 61, 0.96));
  border-color: rgba(231, 226, 218, 0.42);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
}

.hero {
  display: grid;
  grid-template-columns: 1.8fr 0.9fr;
  gap: 24px;
  align-items: stretch;
  padding: 30px;
  border: 1px solid rgba(227, 222, 216, 0.13);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(143, 23, 39, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(24, 26, 30, 0.94), rgba(7, 8, 10, 0.98));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 12px;
  color: #d7d1c9;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2.8rem, 5vw, 5.6rem);
  line-height: 0.9;
  letter-spacing: 0.01em;
  font-weight: 700;
}

h2 {
  max-width: 34ch;
  margin: 14px 0 0;
  color: var(--soft);
  font-size: clamp(1.02rem, 2vw, 1.45rem);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.lead {
  max-width: 70ch;
  margin: 20px 0 0;
  color: #d1ccc4;
  font-size: 1.03rem;
}

.hero-actions,
.section-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
}

.hero-actions { margin-top: 24px; }
.section-jump { margin-top: 16px; }
.compact-actions { margin-top: 16px; }

.section-jump a,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 800;
}

.section-jump a {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid rgba(231, 226, 218, 0.2);
  color: var(--platinum);
  background: rgba(255,255,255,0.04);
  font-size: 0.88rem;
}

.button {
  min-height: 44px;
  padding: 12px 18px;
  border: 1px solid transparent;
}

.button.primary {
  color: #fff;
  background: linear-gradient(135deg, #68121f, #34373d);
  border-color: rgba(231, 226, 218, 0.22);
  box-shadow: 0 15px 34px rgba(0, 0, 0, 0.34);
}

.button.secondary {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255,255,255,0.045);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.stats div,
.panel,
.hero-card,
.role-card,
.project-card,
.story-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(25, 25, 31, 0.84), rgba(10, 10, 13, 0.94));
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.stats div { padding: 16px; }
.stats strong { display: block; color: #fff; font-size: 1.04rem; }
.stats span { color: var(--muted); font-size: 0.9rem; }

.hero-card {
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(34, 36, 41, 0.92), rgba(12, 13, 15, 0.96)),
    linear-gradient(135deg, rgba(143, 23, 39, 0.08), transparent);
}

.card-heading {
  margin-bottom: 14px;
  color: #d7d1c9;
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-card ul,
.plain-list {
  margin: 0;
  padding-left: 20px;
  color: #e7dfdc;
}

.hero-card li { margin: 10px 0; }

main {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}

.grid,
.subpage-grid {
  display: grid;
  gap: 20px;
}

.two-up,
.two-col,
.project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-up,
.experience-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.panel { padding: 22px; }
.panel h3 { margin: 0 0 10px; color: #fff; font-size: 1.16rem; }
.panel p { margin: 0; color: var(--muted); }
.plain-list,
.compact li,
.story-card p,
.stats span {
  color: #c9c3ba;
}

.panel.accent,
.project-card.accent {
  background:
    linear-gradient(135deg, rgba(143, 23, 39, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(31, 33, 37, 0.96), rgba(9, 10, 12, 0.96));
  border-color: rgba(231, 226, 218, 0.22);
}

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

.chips span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid rgba(231, 226, 218, 0.2);
  border-radius: 8px;
  color: #f1efeb;
  background: rgba(231, 226, 218, 0.075);
  font-size: 0.9rem;
  font-weight: 700;
}

.timeline-panel {
  background: linear-gradient(180deg, rgba(20, 22, 26, 0.96), rgba(14, 15, 18, 0.92));
}

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

.timeline div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.timeline div:first-child { border-top: 0; padding-top: 0; }
.timeline span {
  color: #d7d1c9;
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.role-card {
  padding: 18px;
  background: linear-gradient(180deg, rgba(26, 26, 33, 0.94), rgba(10, 10, 14, 0.98));
}

.role-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.role-top strong { color: #fff; font-size: 1rem; }
.role-top span {
  color: #d7d1c9;
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

.role-title {
  margin: 0 0 12px !important;
  color: #ede5e2 !important;
  font-weight: 800;
}

.compact {
  margin: 0;
  padding-left: 18px;
}

.compact li {
  margin: 0 0 8px;
  color: var(--muted);
}

.small-note {
  margin-top: 10px !important;
  font-size: 0.92rem;
}

.subpage-hero {
  padding: 24px 0 10px;
  margin-bottom: 8px;
}

.subpage-hero h1 { margin-top: 4px; }
.subpage-hero h2 { max-width: 840px; }
.project-card { min-height: 240px; }

.story-flow {
  display: grid;
  gap: 22px;
}

.story-card {
  position: relative;
  min-height: 56vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding: 28px;
}

.story-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(143, 23, 39, 0.13), transparent 40%),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 16px);
}

.story-card > div {
  position: relative;
  max-width: 60ch;
}

.story-card h3 {
  margin: 0 0 10px;
  font-size: clamp(1.9rem, 3vw, 3.1rem);
}

.story-card p {
  max-width: 48ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.75s ease, transform 0.75s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.reveal-on-scroll.visible {
  opacity: 1;
  transform: none;
}

.panel:hover,
.hero-card:hover,
.role-card:hover,
.project-card:hover,
.stats div:hover,
.story-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.34);
}

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

.blog-card h3 a {
  color: #fff;
}

.blog-card p {
  margin-bottom: 16px;
}

.blog-tags {
  margin-top: 16px;
}

.blog-layout {
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
}

.article-body {
  padding: clamp(22px, 4vw, 42px);
}

.article-body h1,
.article-body h2,
.article-body h3 {
  color: #fff;
  line-height: 1.16;
}

.article-body h1 {
  margin: 0 0 18px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.article-body h2 {
  max-width: none;
  margin: 32px 0 12px;
  color: #f6eeee;
  font-size: clamp(1.32rem, 2vw, 1.7rem);
}

.article-body h3 {
  margin: 26px 0 10px;
  font-size: 1.18rem;
}

.article-body p,
.article-body li {
  color: #d7cfd0;
  font-size: 1.03rem;
}

.article-body p {
  margin: 0 0 18px;
}

.article-body ul {
  margin: 0 0 20px;
  padding-left: 22px;
}

.article-body li {
  margin-bottom: 8px;
}

.article-body code {
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(255,255,255,0.08);
}

.article-body pre {
  overflow-x: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #08080b;
}

.article-footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

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

@media (max-width: 920px) {
  .hero,
  .two-up,
  .three-up,
  .stats,
  .experience-grid,
  .two-col,
  .project-grid,
  .blog-index {
    grid-template-columns: 1fr;
  }

  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 14px;
  }

  .hero {
    padding: 20px;
  }

  .story-card {
    min-height: 42vh;
  }

  .timeline div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .scroll-progress {
    right: 8px;
  }
}
