:root {
  --bg: #1b1009;
  --bg-soft: #24170f;
  --card: #261910;
  --card-hover: #302016;
  --text: #f4eee6;
  --muted: #dac8b5;
  --muted-2: #a99784;
  --line: rgba(244, 238, 230, 0.12);
  --accent: #dfc7a4;
  --accent-soft: rgba(223, 199, 164, 0.16);
  --shadow: 0 24px 80px rgba(8, 4, 2, 0.30);
  --max: 1180px;
  --narrow: 860px;
  --radius: 24px;
  --header-height: 76px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 50% -8%, rgba(223, 199, 164, 0.09), transparent 34rem),
    linear-gradient(180deg, #24170f 0%, #1b1009 46%, #130b07 100%);
  color: var(--text);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

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

p:last-child {
  margin-bottom: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 1000;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  border-bottom: none;
  background: transparent;
  backdrop-filter: none;
}

.nav {
  width: min(var(--max), calc(100% - 2rem));
  height: var(--header-height);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-size: 0.96rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(0.75rem, 2vw, 2rem);
  color: var(--muted);
  font-size: 0.92rem;
}

.nav-links a,
.site-footer a {
  position: relative;
}

.nav-links a::after,
.site-footer a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.28rem;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after,
.site-footer a:hover::after,
.site-footer a:focus-visible::after {
  transform: scaleX(1);
}

.hero {
  min-height: 100svh;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: calc(var(--header-height) + 3.2rem) 1rem 4rem;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(circle at 50% 47%, rgba(255, 230, 190, 0.10) 0%, rgba(223, 199, 164, 0.075) 18%, rgba(140, 92, 54, 0.045) 38%, rgba(36, 23, 15, 0) 68%),
    linear-gradient(180deg, #24170f 0%, #1b1009 52%, #130b07 100%);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(255, 234, 204, 0.045) 0%, rgba(255, 234, 204, 0.02) 36%, rgba(255, 234, 204, 0) 74%),
    linear-gradient(90deg, rgba(19, 11, 7, 0.22), rgba(19, 11, 7, 0.03), rgba(19, 11, 7, 0.22));
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: transparent;
}

.hero-content {
  width: min(980px, 100%);
  text-align: center;
  animation: fade-in 0.9s ease both;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.32);
}

.eyebrow,
.section-kicker,
.project-number,
.timeline-item span,
.skill-item span {
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
}

.hero h1,
.hero-title {
  max-width: 1040px;
  margin: 0 auto clamp(2.6rem, 5vw, 3.9rem);
  font-size: clamp(4.8rem, 10vw, 8.8rem);
  line-height: 0.88;
  letter-spacing: -0.065em;
  font-weight: 560;
}

.hero-subtitle {
  margin: 0 auto clamp(1.4rem, 2.8vw, 2rem);
  color: var(--accent);
  line-height: 1.35;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
}

.hero-overline {
  text-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
}

.hero-lines {
  margin: 0 auto clamp(2.25rem, 4vw, 3rem);
  max-width: 1120px;
  color: var(--text);
  font-size: clamp(1.55rem, 3vw, 3rem);
  line-height: 1.18;
  letter-spacing: -0.045em;
  font-weight: 430;
}

.hero-lines p {
  margin-bottom: 0.22rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.95rem 1.3rem;
  border: 1px solid rgba(241, 238, 232, 0.22);
  border-radius: 999px;
  background: rgba(241, 238, 232, 0.08);
  color: var(--text);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  background: rgba(241, 238, 232, 0.14);
  border-color: rgba(241, 238, 232, 0.42);
}

.button-secondary {
  margin-top: 1.5rem;
}

.section {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(5rem, 9vw, 9rem) 0;
  scroll-margin-top: calc(var(--header-height) + 1rem);
}

.section-narrow {
  width: min(var(--narrow), calc(100% - 2rem));
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(18rem, 0.9fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: end;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.section h2 {
  margin: 0;
  font-size: clamp(2.7rem, 7vw, 5.6rem);
  line-height: 0.94;
  letter-spacing: -0.065em;
  font-weight: 520;
}

.section-intro,
.lead-text {
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.28rem);
}

.section-narrow h2 {
  margin-bottom: clamp(2.8rem, 6vw, 4.8rem);
}

.section-narrow .lead-text {
  margin-top: 0;
}

.text-stack {
  display: grid;
  gap: 1.65rem;
}

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

.project-card,
.timeline-item,
.skill-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--card);
  box-shadow: var(--shadow);
}

.project-card {
  min-height: 18rem;
  padding: clamp(1.25rem, 2.5vw, 2rem);
  transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    var(--card-hover);
  border-color: rgba(199, 184, 157, 0.28);
}

.project-card h3,
.timeline-item h3,
.skill-item h3 {
  margin: 0.8rem 0 0.45rem;
  font-size: clamp(1.55rem, 2.9vw, 2.35rem);
  line-height: 1;
  letter-spacing: -0.045em;
  font-weight: 520;
}

.project-tagline {
  color: var(--muted);
  max-width: 34rem;
}

details {
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
}

summary {
  cursor: pointer;
  width: fit-content;
  padding: 1rem 0 0;
  color: var(--accent);
  list-style: none;
  font-size: 0.95rem;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: " +";
}

details[open] summary::after {
  content: " –";
}

.project-detail {
  margin-top: 1rem;
  color: var(--muted);
}

.project-detail h4 {
  margin: 1.35rem 0 0.35rem;
  color: var(--text);
  font-size: 0.92rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.trace strong {
  color: var(--text);
  font-weight: 600;
}

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

.timeline-item {
  padding: clamp(1.25rem, 2.5vw, 2rem);
}

.timeline-item p,
.skill-item p {
  color: var(--muted);
}

.skill-list {
  display: grid;
  gap: 0.9rem;
}

.skill-item {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  gap: 1.25rem;
  padding: clamp(1.25rem, 2.2vw, 1.75rem);
  align-items: start;
}

.skill-item h3 {
  margin-top: 0;
}

.site-footer {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted-2);
  font-size: 0.92rem;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  :root {
    --header-height: 68px;
  }

  .nav {
    width: min(100% - 1rem, var(--max));
  }

  .nav-links {
    gap: 0.85rem;
    font-size: 0.84rem;
  }

  .section-heading {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

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

  .project-card {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  body {
    background: var(--bg);
  }

  .site-header {
    position: sticky;
    background: var(--bg);
  }

  .nav {
    height: auto;
    padding: 0.85rem 0;
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    row-gap: 0.45rem;
  }

  .hero {
    min-height: 92svh;
    padding-top: 3rem;
  }

  .hero h1,
  .hero-title {
    font-size: clamp(3.8rem, 22vw, 6.2rem);
    letter-spacing: -0.075em;
  }

  .hero-subtitle {
    margin-bottom: 1.75rem;
  }

  .hero-lines {
    max-width: 24rem;
    font-size: clamp(1.2rem, 7vw, 2rem);
  }

  .section {
    width: min(100% - 1.25rem, var(--max));
    padding: 4.5rem 0;
  }

  .project-card,
  .timeline-item,
  .skill-item {
    border-radius: 18px;
  }

  .skill-item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .site-footer {
    width: min(100% - 1.25rem, var(--max));
    flex-direction: column;
  }
}

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

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