:root {
  --bg: #0c0e11;
  --ink: #f4efe6;
  --muted: rgba(244, 239, 230, 0.68);
  --faint: rgba(244, 239, 230, 0.42);
  --line: rgba(244, 239, 230, 0.14);
  --accent: #d7a07f;
  --paper: #ece4d8;
  --paper-ink: #111318;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-y: scroll;
  scrollbar-width: thin;
  scrollbar-color: rgba(244, 239, 230, 0.14) transparent;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(244, 239, 230, 0.14);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(244, 239, 230, 0.24);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.7;
}

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

button {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 clamp(18px, 5vw, 72px);
  color: var(--ink);
  background: linear-gradient(180deg, rgba(12, 14, 17, 0.86), rgba(12, 14, 17, 0));
  backdrop-filter: blur(14px);
}

.brand {
  font-size: 0.95rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

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

.nav-group {
  position: relative;
}

.nav-trigger {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    color 180ms ease,
    background 180ms ease;
}

.nav-trigger::after {
  content: "";
  display: inline-block;
  width: 0.42em;
  height: 0.42em;
  margin-left: 0.5em;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-0.18em) rotate(45deg);
}

.nav-group.is-open .nav-trigger {
  background: rgba(244, 239, 230, 0.08);
  color: var(--ink);
}

.nav-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 200px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(18, 21, 25, 0.97);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(244, 239, 230, 0.04) inset;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px) scale(0.96);
  transform-origin: top right;
  transition:
    opacity 200ms ease,
    transform 200ms ease;
}

.nav-menu::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 18px;
  width: 10px;
  height: 10px;
  background: rgba(18, 21, 25, 0.97);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  transform: rotate(45deg);
}

.nav-group.is-open .nav-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.nav-menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
  transition:
    color 140ms ease,
    background 140ms ease;
}

.nav-menu a:hover,
.nav-menu a:focus-visible {
  background: rgba(244, 239, 230, 0.07);
  color: var(--ink);
}

.nav-menu a + a {
  margin-top: 2px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

.home-page {
  height: 100svh;
  overflow: hidden;
}

.home-shell {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

.home-photo {
  position: absolute;
  inset: -24px;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(12, 14, 17, 0.12), rgba(12, 14, 17, 0.22)),
    url("/assets/home-wallpaper.jpg")
      center / cover;
  filter: blur(4px) saturate(0.88) brightness(0.95);
  transform: scale(1.035);
  animation: photoDrift 18s ease-in-out infinite alternate;
}

.home-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(12, 14, 17, 0.94), rgba(12, 14, 17, 0.72) 46%, rgba(12, 14, 17, 0.28)),
    linear-gradient(0deg, rgba(12, 14, 17, 0.92), rgba(12, 14, 17, 0.14) 58%);
}

.home-content {
  position: relative;
  z-index: 2;
  width: min(800px, calc(100% - 40px));
  padding: clamp(118px, 17vh, 190px) 0 72px clamp(20px, 7vw, 104px);
}

.home-content h1 {
  margin-bottom: 20px;
  font-size: clamp(4rem, 13vw, 11rem);
  line-height: 0.84;
  letter-spacing: 0;
}

.home-name {
  margin-bottom: 18px;
  font-size: clamp(2rem, 5vw, 5rem);
  font-weight: 850;
  line-height: 1;
}

.home-copy {
  max-width: 600px;
  margin-bottom: clamp(28px, 5vh, 46px);
  color: rgba(244, 239, 230, 0.82);
  font-size: clamp(1.02rem, 1.8vw, 1.28rem);
  line-height: 1.85;
}

.home-links {
  display: grid;
  width: min(700px, 100%);
  border-top: 1px solid var(--line);
}

.home-links a {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 54px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  transition:
    color 160ms ease,
    padding-left 160ms ease;
}

.home-links a:hover {
  color: var(--ink);
  padding-left: 8px;
}

.home-links span {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.home-links strong {
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.home-footer {
  position: absolute;
  left: clamp(20px, 7vw, 104px);
  right: clamp(20px, 7vw, 104px);
  bottom: 26px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--faint);
  font-size: 0.94rem;
}

.home-footer a {
  color: var(--accent);
}

.project-page {
  min-height: 100svh;
}

.project-shell {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 120px clamp(20px, 6vw, 72px) 72px;
}

.back-link {
  display: inline-flex;
  margin-bottom: clamp(44px, 8vw, 96px);
  color: var(--muted);
  font-size: 0.94rem;
}

.back-link:hover {
  color: var(--ink);
}

.project-hero {
  margin-bottom: clamp(36px, 7vw, 80px);
}

.project-hero h1 {
  max-width: 1040px;
  margin: 0 0 18px;
  font-size: clamp(4rem, 13vw, 11rem);
  line-height: 0.84;
  letter-spacing: 0;
}

.project-subtitle {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.48rem);
  line-height: 1.5;
}

.project-media {
  margin-bottom: clamp(34px, 6vw, 72px);
}

.project-media img {
  width: 100%;
  border: 1px solid var(--line);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.24);
}

.project-media figcaption {
  margin-top: 12px;
  color: var(--faint);
  font-size: 0.92rem;
  line-height: 1.5;
}

.project-note-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.55fr);
  gap: clamp(28px, 6vw, 88px);
  margin-bottom: clamp(56px, 8vw, 104px);
}

.project-lead p {
  max-width: 760px;
  color: rgba(244, 239, 230, 0.84);
  font-size: clamp(1.18rem, 2vw, 1.72rem);
  line-height: 1.65;
}

.fact-list {
  border-top: 1px solid var(--line);
}

.fact-list div {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.fact-list dt {
  margin-bottom: 6px;
  color: var(--faint);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.fact-list dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.fact-list a {
  border-bottom: 1px solid currentColor;
  color: var(--accent);
  font-weight: 800;
}

.compact-project .project-hero {
  max-width: 980px;
}

.compact-project .project-hero h1 {
  font-size: clamp(3.1rem, 9vw, 8.4rem);
}

.text-panel {
  max-width: 900px;
  margin-bottom: clamp(56px, 8vw, 104px);
  border-top: 1px solid var(--line);
  padding-top: clamp(26px, 4vw, 42px);
}

.text-panel p,
.text-panel li {
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.16rem);
  line-height: 1.9;
}

.text-panel ul {
  padding-left: 1.2em;
}

.project-next {
  display: flex;
  flex-wrap: wrap;
  gap: 14px clamp(22px, 4vw, 42px);
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.project-next a {
  color: var(--accent);
  font-weight: 800;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 620ms ease,
    transform 620ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes photoDrift {
  from {
    transform: scale(1.035) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.065) translate3d(-1.2%, -1%, 0);
  }
}

@media (max-width: 900px) {
  .project-note-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .site-header {
    min-height: 62px;
    padding-inline: 18px;
  }

  .nav {
    gap: 2px;
  }

  .nav-trigger {
    padding-inline: 9px;
    font-size: 0.9rem;
  }

  .nav-menu {
    right: auto;
    left: 50%;
    min-width: 180px;
    transform: translate(-50%, -4px) scale(0.96);
    transform-origin: top center;
  }

  .nav-group.is-open .nav-menu {
    transform: translate(-50%, 0) scale(1);
  }

  .nav-menu::before {
    right: auto;
    left: 50%;
    margin-left: -5px;
  }

  .home-content {
    width: calc(100% - 36px);
    padding: 104px 0 72px 18px;
  }

  .home-content h1 {
    font-size: clamp(3.8rem, 18vw, 6.8rem);
  }

  .home-name {
    font-size: clamp(2rem, 10vw, 3.4rem);
  }

  .home-copy {
    margin-bottom: 26px;
  }

  .home-links a {
    min-height: 48px;
  }

  .home-footer {
    left: 18px;
    right: 18px;
    bottom: 18px;
    flex-direction: column;
  }

  .project-shell {
    padding: 100px 18px 56px;
  }

  .project-hero h1 {
    font-size: clamp(4rem, 22vw, 6.4rem);
  }

  .compact-project .project-hero h1 {
    font-size: clamp(3rem, 15vw, 5.4rem);
  }

  .project-media img {
    width: calc(100% + 36px);
    max-width: none;
    margin-left: -18px;
    border-inline: 0;
  }
}

@media (max-height: 720px) {
  .home-content {
    padding-top: 96px;
  }

  .home-content h1 {
    font-size: clamp(3.6rem, 11vw, 8rem);
  }

  .home-name {
    font-size: clamp(1.8rem, 4vw, 3.6rem);
  }
}

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