:root {
  color-scheme: dark;
  --bg: #16120e;
  --bg-deep: #0f0d0a;
  --text: #f0e4d0;
  --muted: #c8b99f;
  --quiet: #9d9f68;
  --line: #4b3d2d;
  --line-soft: #33291f;
  --clay: #d79062;
  --max: 1040px;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Space Grotesk", "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --header-height: 76px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  --spotlight-x: 50vw;
  --spotlight-y: 50vh;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at top, rgba(111, 97, 66, 0.18), transparent 34rem),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(180deg, #1b1611 0%, var(--bg) 48%, var(--bg-deep) 100%);
  background-size: auto, 92px 92px, 92px 92px, auto;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0;
  isolation: isolate;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: 0;
  background:
    radial-gradient(
      640px circle at var(--spotlight-x) var(--spotlight-y),
      rgba(215, 144, 98, 0.18),
      rgba(157, 159, 104, 0.08) 34%,
      transparent 68%
    );
  opacity: 0.95;
  transition: opacity 220ms ease;
}

body::after {
  z-index: 1;
  background:
    radial-gradient(circle at center, transparent 0 42%, rgba(0, 0, 0, 0.46) 100%),
    linear-gradient(rgba(255, 255, 255, 0.025), transparent 18%);
}

.tap-ripple {
  position: fixed;
  z-index: 3;
  left: 0;
  top: 0;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(215, 144, 98, 0.4), rgba(157, 159, 104, 0.16) 45%, transparent 72%);
  opacity: 0.9;
  transform: scale(0.3);
  transition: transform 620ms cubic-bezier(0.22, 1, 0.36, 1), opacity 620ms ease-out;
  will-change: transform, opacity;
}

.tap-ripple.is-active {
  transform: scale(1);
  opacity: 0;
}

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

svg {
  display: block;
  fill: currentColor;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  height: var(--header-height);
  padding-inline: max(24px, calc((100vw - var(--max)) / 2));
  border-bottom: 1px solid var(--line-soft);
  background: rgba(18, 15, 12, 0.76);
  backdrop-filter: blur(18px);
}

.page {
  position: relative;
  z-index: 2;
}

.nav {
  grid-column: 2;
  display: flex;
  gap: clamp(30px, 5vw, 72px);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.nav a,
.socials a,
.contact-strip a,
.project-title a {
  transition: color 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.nav a:hover,
.nav a.is-active,
.socials a:hover,
.contact-strip a:hover,
.project-title a:hover {
  color: var(--clay);
}

.socials {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 28px;
  color: #e3bd9a;
}

.socials svg {
  width: 19px;
  height: 19px;
}

.page {
  width: min(var(--max), calc(100% - 48px));
  margin-inline: auto;
  padding: 0 0 58px;
}

.hero-stage {
  min-height: calc((100vh - var(--header-height)) * 1.72);
  border-bottom: 1px solid rgba(75, 61, 45, 0.72);
}

.hero {
  position: sticky;
  top: var(--header-height);
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(340px, 1.12fr);
  gap: clamp(38px, 6vw, 82px);
  align-items: center;
  min-height: calc(100vh - var(--header-height));
  padding: clamp(64px, 9vh, 96px) 0;
}

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

h1 {
  font-family: var(--serif);
  font-size: clamp(2.25rem, 4vw, 4.2rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0;
  text-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

.hero-identity {
  align-self: center;
}

.hero-role {
  margin-top: 14px;
  color: var(--clay);
  font-family: var(--sans);
  font-size: clamp(1rem, 1.8vw, 1.28rem);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.hero-line {
  max-width: 31rem;
  color: var(--quiet);
  font-family: var(--sans);
  font-size: 0.8125rem;
  line-height: 1.65;
}

.hero-line-switch {
  position: relative;
  min-height: 3.4em;
  margin-top: 14px;
}

.hero-line-switch .hero-line {
  position: absolute;
  inset: 0 auto auto 0;
  transition: opacity 260ms ease, transform 260ms ease;
}

.hero-line-stack {
  opacity: 0;
  transform: translateY(8px);
}

.hero-stage.is-stack-visible .hero-line-intro {
  opacity: 0;
  transform: translateY(-8px);
}

.hero-stage.is-stack-visible .hero-line-stack {
  opacity: 1;
  transform: translateY(0);
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 38px;
  margin-top: 10px;
  padding: 8px 16px;
  border: 1px solid rgba(215, 144, 98, 0.62);
  border-radius: 5px;
  background: rgba(215, 144, 98, 0.07);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease, transform 160ms ease;
}

.hero-cta:hover {
  border-color: var(--clay);
  background: var(--clay);
  color: var(--bg-deep);
  transform: translateY(-1px);
}

.hero-panels {
  position: relative;
  min-height: min(520px, calc(100vh - 210px));
}

.hero-panel {
  position: absolute;
  inset: 0;
  transition: opacity 300ms ease, transform 300ms ease, visibility 300ms ease;
}

.hero-intro {
  display: grid;
  gap: 16px;
  align-self: center;
}

.hero-stack {
  display: grid;
  align-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
}

.hero-stage.is-stack-visible .hero-intro {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-16px);
}

.hero-stage.is-stack-visible .hero-stack {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.hero-intro p {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.92rem;
  line-height: 1.78;
}

.hero-intro p:first-child {
  color: var(--text);
}

.hero-intro strong {
  color: var(--text);
  font-weight: 700;
  text-shadow: 0 0 18px rgba(215, 144, 98, 0.16);
}

.rule {
  width: 52px;
  height: 2px;
  margin-top: 28px;
  background: var(--clay);
  box-shadow: 0 0 20px rgba(215, 144, 98, 0.38);
}

.panel {
  margin-top: 34px;
}

.panel h2 {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--quiet);
  font-family: var(--sans);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.stack-group {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 13px 0;
  border-bottom: 1px solid rgba(75, 61, 45, 0.62);
}

.stack-group:last-child {
  border-bottom: 0;
}

.stack-group h2 {
  margin: 8px 0 0;
  padding: 0;
  border: 0;
  color: var(--quiet);
  font-family: var(--sans);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stack-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 10px 6px 8px;
  border: 1px solid rgba(157, 159, 104, 0.34);
  background: rgba(15, 13, 10, 0.34);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1;
  box-shadow: inset 0 0 18px rgba(215, 144, 98, 0.03);
}

.stack-item img,
.stack-glyph {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.stack-item img {
  object-fit: contain;
}

.stack-glyph {
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(215, 144, 98, 0.34);
  color: var(--quiet);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.project-title h3,
.experience-copy h3 {
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
}

.project-item p,
.experience-copy p,
.experience-copy li {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.86rem;
  line-height: 1.58;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  padding-top: 12px;
}

.project-item {
  display: grid;
  gap: 7px;
  min-height: 128px;
  padding: 18px 28px 20px 0;
  border-bottom: 1px dashed rgba(215, 144, 98, 0.18);
  --card-rx: 0deg;
  --card-ry: 0deg;
  --card-glow-x: 50%;
  --card-glow-y: 50%;
  transform: perspective(760px) rotateX(var(--card-rx)) rotateY(var(--card-ry));
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1), background 420ms ease;
  will-change: transform;
}

.project-item.is-tilting {
  background: radial-gradient(220px circle at var(--card-glow-x) var(--card-glow-y), rgba(215, 144, 98, 0.09), transparent 70%);
}

.project-item:nth-child(2n) {
  padding-left: 28px;
  padding-right: 0;
  border-left: 1px solid rgba(75, 61, 45, 0.48);
}

.project-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-title h3::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 12px 2px 3px;
  border-radius: 50%;
  background: var(--quiet);
}

.project-title a {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #e3bd9a;
}

.project-title svg {
  width: 16px;
  height: 16px;
}

.project-item em {
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-style: normal;
}

.experience-list {
  display: grid;
  gap: 0;
  margin-top: 18px;
}

.experience-item {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 48px;
  padding: 26px 0;
  border-bottom: 1px dashed rgba(215, 144, 98, 0.22);
}

.experience-item:first-child {
  padding-top: 4px;
}

.experience-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.experience-meta {
  display: grid;
  align-content: start;
  gap: 10px;
  padding-top: 2px;
  font-family: var(--sans);
}

.experience-meta time {
  color: var(--clay);
  font-size: 0.82rem;
}

.experience-meta span {
  color: var(--quiet);
  font-size: 0.75rem;
  line-height: 1.5;
}

.experience-copy {
  display: grid;
  gap: 12px;
}

.experience-copy h3 {
  font-size: 1.05rem;
}

.experience-stack {
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.55;
}

.experience-copy .experience-stack--rule {
  position: relative;
  padding-left: 16px;
  color: var(--text);
}

.experience-copy .experience-stack--rule::before {
  content: "";
  position: absolute;
  top: 0.28em;
  bottom: 0.28em;
  left: 0;
  width: 2px;
  background: var(--clay);
}

.experience-copy ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.experience-copy li {
  position: relative;
  padding-left: 18px;
}

.experience-copy li::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--quiet);
}

.contact-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  max-width: 760px;
  margin: 58px auto 0;
  color: var(--quiet);
}

.contact-strip a {
  display: grid;
  grid-template-columns: 22px 92px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 40px;
  border-right: 1px solid rgba(215, 144, 98, 0.5);
  font-family: var(--serif);
  font-size: 1.04rem;
}

.contact-strip a svg {
  justify-self: center;
}

.contact-strip a:last-child {
  border-right: 0;
}

.contact-strip svg {
  width: 19px;
  height: 19px;
}

@media (max-width: 820px) {
  :root {
    --header-height: 90px;
  }

  .site-header {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 76px;
    gap: 18px;
    padding-block: 18px;
  }

  .nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
    gap: 22px;
    width: 100%;
    order: 3;
    font-size: 0.7rem;
  }

  .socials {
    grid-column: 1 / -1;
    gap: 18px;
    justify-self: center;
  }

  .page {
    width: min(100% - 34px, var(--max));
    padding-top: 0;
  }

  h1 {
    font-size: clamp(2.25rem, 10vw, 4.2rem);
  }

  .hero-intro p {
    font-size: 0.82rem;
  }

  .project-list,
  .project-item,
  .experience-item {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .project-item,
  .project-item:nth-child(2n) {
    min-height: 0;
    padding: 16px 0;
    border-left: 0;
  }

  .experience-item {
    padding: 20px 0;
  }

  .contact-strip {
    grid-template-columns: 1fr;
    margin-top: 42px;
  }

  .contact-strip a {
    border-right: 0;
    border-bottom: 1px solid rgba(215, 144, 98, 0.28);
  }

  .contact-strip a:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 640px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 30px;
    min-height: calc(100vh - var(--header-height));
    padding: 46px 0 54px;
  }

  .hero-line {
    max-width: none;
  }

  .hero-panels {
    min-height: 510px;
  }

  .stack-group {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 0;
  }

  .stack-item {
    font-size: 0.7rem;
  }
}

@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
  body::before {
    background:
      radial-gradient(
        520px circle at 50% 12rem,
        rgba(215, 144, 98, 0.13),
        rgba(157, 159, 104, 0.06) 32%,
        transparent 72%
      );
    opacity: 0.8;
  }
}
