:root {
  color-scheme: dark;
  --ink: #f7f1df;
  --paper: #d9d2bf;
  --black: #050505;
  --charcoal: #111;
  --stone: #b7b1a4;
  --stone-dark: #6e695e;
  --stone-light: #ece4d0;
  --blood: #b8422d;
  --moss: #81a987;
  --shadow: rgba(0, 0, 0, 0.72);
  --hairline: rgba(247, 241, 223, 0.58);
  font-family: Palatino, "Palatino Linotype", "Songti SC", "Noto Serif CJK SC", serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--black);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--black);
}

button,
a {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

#cosmos {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: #050505;
}

.paper-noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 31px 31px, 43px 43px;
  mix-blend-mode: screen;
}

.site-header {
  position: fixed;
  inset: 18px 18px auto;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}

.wordmark,
.language-switch {
  pointer-events: auto;
}

.wordmark {
  display: grid;
  gap: 2px;
  min-width: 144px;
  border: 1px solid var(--hairline);
  border-radius: 0;
  padding: 10px 12px;
  background: rgba(5, 5, 5, 0.72);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0;
}

.wordmark span:first-child {
  font-size: 15px;
  font-weight: 800;
}

.wordmark span:last-child {
  color: rgba(247, 241, 223, 0.74);
  font-size: 11px;
}

.language-switch {
  display: flex;
  border: 1px solid var(--hairline);
  background: rgba(5, 5, 5, 0.74);
}

.language-switch button {
  min-width: 58px;
  border: 0;
  border-left: 1px solid rgba(247, 241, 223, 0.22);
  padding: 11px 12px;
  background: transparent;
  color: rgba(247, 241, 223, 0.68);
}

.language-switch button:first-child {
  border-left: 0;
}

.language-switch button.is-active {
  background: var(--ink);
  color: var(--black);
}

main {
  position: relative;
  z-index: 2;
}

.landing {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 92px 24px 42px;
  cursor: pointer;
  opacity: 1;
  transform: scale(1);
  visibility: visible;
  transition: opacity 420ms ease, transform 700ms ease, visibility 0s linear 0s;
}

.landing-copy {
  position: absolute;
  top: auto;
  bottom: clamp(24px, 8vh, 76px);
  left: clamp(20px, 6vw, 88px);
  width: min(540px, calc(100vw - 40px));
  transform: rotate(-0.6deg);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--moss);
  font-family: Helvetica, Arial, "PingFang SC", sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
  line-height: 0.94;
  text-transform: uppercase;
}

h1 {
  max-width: 5.8em;
  font-size: clamp(48px, 8vw, 108px);
}

.home-statement {
  max-width: 34rem;
  margin: 0;
  color: rgba(247, 241, 223, 0.76);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.45;
}

.tombstone {
  position: relative;
  z-index: 3;
  display: grid;
  width: clamp(154px, 19vw, 230px);
  height: clamp(220px, 28vw, 318px);
  place-items: end center;
  border: 0;
  padding: 0;
  background: transparent;
  filter: drop-shadow(0 32px 30px rgba(0, 0, 0, 0.9));
  image-rendering: pixelated;
  transform: translate3d(9vw, 5vh, 0) rotate(4deg);
  animation: driftStone 9s steps(4, end) infinite;
}

.tombstone * {
  pointer-events: none;
}

.tombstone:focus-visible,
.epitaph-nav button:focus-visible,
.return-button:focus-visible,
.work-card button:focus-visible,
.work-filters button:focus-visible,
.dialog-close:focus-visible {
  outline: 2px solid var(--moss);
  outline-offset: 4px;
}

.stone-cap,
.stone-face,
.stone-base {
  position: absolute;
  display: block;
  border: 6px solid var(--charcoal);
  background: var(--stone);
  box-shadow:
    inset -10px -10px 0 rgba(0, 0, 0, 0.22),
    inset 10px 10px 0 rgba(255, 255, 255, 0.25);
}

.stone-cap {
  top: 0;
  width: 78%;
  height: 28%;
  border-bottom: 0;
  clip-path: polygon(14% 100%, 14% 40%, 26% 18%, 42% 6%, 58% 6%, 74% 18%, 86% 40%, 86% 100%);
}

.stone-face {
  bottom: 34px;
  width: 78%;
  height: 72%;
  padding: 34% 14px 18px;
  text-align: center;
}

.stone-face::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 12px;
  background:
    linear-gradient(90deg, transparent 94%, rgba(0, 0, 0, 0.24) 94%),
    linear-gradient(transparent 94%, rgba(0, 0, 0, 0.2) 94%);
  background-size: 18px 18px;
  opacity: 0.34;
}

.stone-base {
  bottom: 0;
  width: 96%;
  height: 42px;
}

.stone-spark {
  position: absolute;
  top: 18%;
  left: 50%;
  z-index: 1;
  color: var(--blood);
  font-family: Helvetica, Arial, sans-serif;
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 900;
  transform: translateX(-50%);
}

.stone-name {
  position: relative;
  z-index: 1;
  display: block;
  color: var(--charcoal);
  font-family: Helvetica, Arial, "PingFang SC", sans-serif;
  font-size: clamp(25px, 3.7vw, 44px);
  font-weight: 900;
  line-height: 0.88;
}

.stone-line {
  position: relative;
  z-index: 1;
  display: block;
  width: 56%;
  height: 5px;
  margin: 15px auto 10px;
  background: var(--charcoal);
}

.stone-date {
  position: relative;
  z-index: 1;
  display: block;
  color: var(--charcoal);
  font-family: Helvetica, Arial, sans-serif;
  font-size: clamp(12px, 1.4vw, 15px);
  font-weight: 800;
}

.tombstone:hover {
  animation-play-state: paused;
  transform: translate3d(9vw, 4vh, 0) rotate(1deg) scale(1.04);
}

.epitaph-view {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(250px, 340px) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 54px);
  padding: clamp(82px, 10vh, 110px) clamp(18px, 5vw, 74px) 42px;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(5, 5, 5, 0.88);
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 480ms ease, transform 600ms ease;
}

body.is-entered {
  overflow: hidden;
}

body.is-entered .landing {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  transform: scale(1.22);
  transition: opacity 420ms ease, transform 700ms ease, visibility 0s linear 700ms;
}

body.is-landing-gone .landing {
  display: none;
}

body.is-entered .epitaph-view {
  opacity: 1;
  transform: scale(1);
}

.stone-menu {
  position: sticky;
  top: 92px;
  align-self: start;
  min-height: min(710px, calc(100vh - 122px));
  border: 7px solid var(--charcoal);
  padding: 24px 18px 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.26), transparent 38%),
    repeating-linear-gradient(0deg, transparent 0 17px, rgba(0, 0, 0, 0.08) 18px 20px),
    var(--stone);
  color: var(--charcoal);
  box-shadow:
    inset -14px -14px 0 rgba(0, 0, 0, 0.16),
    inset 10px 10px 0 rgba(255, 255, 255, 0.26),
    20px 22px 0 rgba(0, 0, 0, 0.52);
}

.stone-menu::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 12%;
  width: 76%;
  height: 42px;
  border: 7px solid var(--charcoal);
  border-bottom: 0;
  background: var(--stone);
  transform: translateY(-100%);
  clip-path: polygon(0 100%, 8% 34%, 24% 8%, 50% 0, 76% 8%, 92% 34%, 100% 100%);
}

.menu-top {
  position: relative;
  z-index: 1;
  margin-bottom: 20px;
}

.menu-top .eyebrow {
  color: var(--blood);
}

.menu-top h2 {
  font-size: clamp(30px, 4vw, 48px);
}

.epitaph-nav {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 11px;
}

.epitaph-nav button,
.return-button,
.work-filters button,
.work-card button,
.dialog-link {
  border: 3px solid var(--charcoal);
  border-radius: 0;
  background: var(--stone-light);
  color: var(--charcoal);
  font-family: Helvetica, Arial, "PingFang SC", sans-serif;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.28);
}

.epitaph-nav button {
  min-height: 54px;
  padding: 12px 14px;
  text-align: left;
}

.epitaph-nav button:hover,
.epitaph-nav button.is-active {
  background: var(--blood);
  color: var(--ink);
  transform: translate(4px, 0);
}

.return-button {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 1;
  padding: 9px 12px;
  background: var(--charcoal);
  color: var(--ink);
}

.content-orbit {
  min-width: 0;
}

.content-panel {
  display: none;
  width: min(960px, 100%);
  min-height: min(650px, calc(100vh - 150px));
  border: 1px solid rgba(247, 241, 223, 0.36);
  padding: clamp(22px, 4vw, 44px);
  background: rgba(5, 5, 5, 0.72);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.64);
  backdrop-filter: blur(3px);
}

.content-panel.is-active {
  display: block;
  animation: panelIn 360ms ease both;
}

.content-panel h2 {
  margin-bottom: 24px;
  font-size: clamp(42px, 7vw, 86px);
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.45fr);
  gap: clamp(22px, 4vw, 46px);
}

.lead {
  margin-top: 0;
  color: var(--stone-light);
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.08;
}

.content-panel p {
  color: rgba(247, 241, 223, 0.76);
  font-size: 17px;
  line-height: 1.62;
}

.vitals {
  display: grid;
  gap: 13px;
  margin: 0;
}

.vitals div {
  border: 1px solid rgba(247, 241, 223, 0.28);
  padding: 14px;
  background: rgba(247, 241, 223, 0.05);
}

.vitals dt {
  color: var(--moss);
  font-family: Helvetica, Arial, "PingFang SC", sans-serif;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.vitals dd {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.36;
}

.work-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.work-filters button {
  min-height: 38px;
  padding: 7px 11px;
  background: rgba(247, 241, 223, 0.9);
  font-size: 12px;
}

.work-filters button.is-active {
  background: var(--moss);
}

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

.work-card {
  display: grid;
  min-height: 100%;
  border: 1px solid rgba(247, 241, 223, 0.28);
  background: rgba(247, 241, 223, 0.06);
}

.work-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  filter: saturate(0.86) contrast(1.04);
}

.work-card-copy {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.work-card h3 {
  font-size: clamp(24px, 3vw, 34px);
}

.work-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.work-card .meta {
  color: var(--moss);
  font-family: Helvetica, Arial, "PingFang SC", sans-serif;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.work-card button {
  justify-self: start;
  min-height: 38px;
  padding: 7px 11px;
  font-size: 12px;
}

.writing-list,
.press-list {
  display: grid;
  gap: 14px;
}

.writing-item,
.press-item {
  border-left: 6px solid var(--blood);
  padding: 18px 18px 18px 20px;
  background: rgba(247, 241, 223, 0.06);
}

.writing-item h3,
.press-item h3 {
  font-size: clamp(26px, 4vw, 44px);
}

.writing-item p,
.press-item p {
  margin: 9px 0 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.contact-grid a {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(247, 241, 223, 0.32);
  padding: 22px;
  background: rgba(247, 241, 223, 0.06);
  text-decoration: none;
}

.contact-grid a:hover {
  border-color: var(--moss);
  background: rgba(129, 169, 135, 0.14);
}

.contact-grid span {
  color: var(--moss);
  font-family: Helvetica, Arial, "PingFang SC", sans-serif;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.contact-grid strong {
  font-size: clamp(18px, 2.5vw, 30px);
  line-height: 1.05;
}

.contact-note {
  max-width: 680px;
  margin-top: 24px;
}

.work-dialog {
  width: min(980px, calc(100vw - 28px));
  border: 1px solid rgba(247, 241, 223, 0.44);
  padding: 0;
  background: rgba(5, 5, 5, 0.96);
  color: var(--ink);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.84);
}

.work-dialog::backdrop {
  background: rgba(0, 0, 0, 0.78);
}

.work-dialog[open] {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.72fr);
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 1px solid var(--hairline);
  background: var(--black);
  color: var(--ink);
  font-family: Helvetica, Arial, sans-serif;
  font-size: 28px;
  line-height: 1;
}

.dialog-image-wrap {
  min-height: 430px;
  background: #111;
}

.dialog-image-wrap img {
  width: 100%;
  height: 100%;
  max-height: 72vh;
  object-fit: contain;
}

.dialog-copy {
  padding: clamp(24px, 4vw, 42px);
}

.dialog-copy h3 {
  margin-bottom: 18px;
  font-size: clamp(34px, 5vw, 62px);
}

.dialog-copy p:not(.eyebrow) {
  color: rgba(247, 241, 223, 0.78);
  line-height: 1.6;
}

.dialog-link {
  display: inline-block;
  margin-top: 18px;
  padding: 10px 13px;
  background: var(--stone-light);
}

.dialog-link[hidden] {
  display: none;
}

.dialog-gallery {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  border-top: 1px solid rgba(247, 241, 223, 0.24);
  padding: 12px;
  background: rgba(247, 241, 223, 0.04);
}

.gallery-thumb {
  flex: 0 0 auto;
  border: 0;
  padding: 0;
  background: transparent;
}

.gallery-thumb img {
  width: 164px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid rgba(247, 241, 223, 0.34);
}

@keyframes driftStone {
  0% {
    transform: translate3d(9vw, 5vh, 0) rotate(4deg);
  }
  25% {
    transform: translate3d(10vw, 3vh, 0) rotate(2deg);
  }
  50% {
    transform: translate3d(8vw, 4vh, 0) rotate(5deg);
  }
  75% {
    transform: translate3d(7vw, 6vh, 0) rotate(1deg);
  }
  100% {
    transform: translate3d(9vw, 5vh, 0) rotate(4deg);
  }
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .site-header {
    inset: 12px 12px auto;
  }

  .wordmark {
    min-width: 116px;
    padding: 9px;
  }

  .wordmark span:last-child {
    display: none;
  }

  .language-switch button {
    min-width: 48px;
    padding: 10px 9px;
  }

  .landing {
    align-items: end;
    padding-bottom: 16vh;
  }

  .landing-copy {
    top: auto;
    bottom: 26px;
    left: 18px;
  }

  .tombstone {
    transform: translate3d(0, 7vh, 0) rotate(3deg);
  }

  .epitaph-view {
    grid-template-columns: 1fr;
    padding: 112px 14px 32px;
  }

  .stone-menu {
    position: relative;
    top: auto;
    width: calc(100vw - 34px);
    max-width: calc(100vw - 34px);
    min-height: auto;
    padding-bottom: 70px;
    box-shadow:
      inset -14px -14px 0 rgba(0, 0, 0, 0.16),
      inset 10px 10px 0 rgba(255, 255, 255, 0.26),
      10px 12px 0 rgba(0, 0, 0, 0.52);
  }

  .epitaph-nav {
    grid-template-columns: 1fr;
  }

  .epitaph-nav button {
    min-height: 48px;
    padding: 9px 10px;
    font-size: 13px;
  }

  .about-grid,
  .works-grid,
  .contact-grid,
  .work-dialog[open] {
    grid-template-columns: 1fr;
  }

  .content-panel {
    width: calc(100vw - 34px);
    max-width: calc(100vw - 34px);
    padding: 20px 14px;
  }

  .return-button {
    position: static;
    width: 100%;
    margin-top: 14px;
  }

  .work-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-filters button {
    width: 100%;
  }

  .dialog-image-wrap {
    min-height: 280px;
  }
}

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