@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/ebgaramond-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/ebgaramond-greek.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/ebgaramond-latin-italic.woff2") format("woff2");
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/ebgaramond-greek-italic.woff2") format("woff2");
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}

:root {
  color-scheme: light;
  --ground: #c6c4bc;
  --ink: #1c1813;
  --ink-muted: #575045;
  --rubric: #8c3a22;
  --rule: #8d8677;
  --serif: "EB Garamond", "Iowan Old Style", Palatino, Georgia, serif;
  --measure: 34rem;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(2.5rem, 7vh, 5rem) clamp(1.25rem, 5vw, 2rem) clamp(1.5rem, 4vh, 2.5rem);
  background: var(--ground);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.leaf {
  flex: 1;
  width: 100%;
  max-width: var(--measure);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.75rem, 5vh, 3rem);
  animation: surface 1.4s ease-out both;
}

@keyframes surface {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.plate {
  position: relative;
  isolation: isolate;
  width: clamp(11rem, 44vw, 16.5rem);
  perspective: 1400px;
}

/* A cast shadow on the wall behind, kept as a separate layer: it has to stay
   put and spread as the leaf rises, which a shadow filtered onto the leaf
   itself cannot do. */
.plate::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: url("/art/fragment.webp") center / contain no-repeat;
  filter: brightness(0) blur(17px);
  transform: translateY(30px) scale(0.96);
  opacity: 0.3;
  animation: cast 16s ease-in-out infinite;
}

.fragment {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: 50% 60%;
  animation: drift 16s ease-in-out infinite;
}

@keyframes drift {
  0%, 100% { transform: translateY(0) rotateX(1.4deg) rotateZ(-0.35deg); }
  50%      { transform: translateY(-13px) rotateX(-0.9deg) rotateZ(0.35deg); }
}

@keyframes cast {
  0%, 100% { transform: translateY(30px) scale(0.96); opacity: 0.3; }
  50%      { transform: translateY(48px) scale(1.03); opacity: 0.17; }
}

.wordmark {
  margin: 0;
  font-size: clamp(2rem, 7vw, 2.9rem);
  font-weight: 500;
  letter-spacing: 0.015em;
  line-height: 1;
}

.marker {
  color: var(--rubric);
  font-size: 0.46em;
  vertical-align: 0.85em;
  margin-left: 0.12em;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.marker:hover,
.marker:focus-visible { text-decoration: underline; text-underline-offset: 0.25em; }

.masthead {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.epigraph {
  margin: 0;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-muted);
  letter-spacing: 0.01em;
}

.apparatus {
  width: 100%;
  max-width: var(--measure);
  margin-top: clamp(2.5rem, 8vh, 4.5rem);
  color: var(--ink-muted);
  font-size: 0.83rem;
  line-height: 1.7;
  text-align: left;
  text-wrap: pretty;
}

.apparatus p { margin: 0; }

.apparatus::before {
  content: "";
  display: block;
  width: 7rem;
  height: 1px;
  background: var(--rule);
  margin-bottom: 1rem;
}

.sigil { color: var(--rubric); }

a { color: inherit; }

a:focus-visible {
  outline: 1px solid var(--rubric);
  outline-offset: 3px;
}

.prose {
  width: 100%;
  max-width: var(--measure);
  flex: 1;
}

.prose h1 {
  margin: 0;
  font-size: clamp(1.6rem, 5vw, 1.95rem);
  font-weight: 500;
  line-height: 1.2;
  text-wrap: balance;
}

.prose h2 {
  margin: 2.25rem 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.prose p,
.prose li {
  color: var(--ink-muted);
  font-size: 0.97rem;
  line-height: 1.7;
}

.prose p { margin: 0 0 0.9rem; }

.prose ul {
  margin: 0 0 0.9rem;
  padding-left: 1.15rem;
}

.prose li { margin-bottom: 0.3rem; }

.prose .updated {
  margin: 0.4rem 0 1.75rem;
  font-style: italic;
  font-size: 0.85rem;
}

.prose a {
  color: var(--rubric);
  text-underline-offset: 0.2em;
}

@media (prefers-reduced-motion: reduce) {
  .leaf,
  .fragment,
  .plate::after { animation: none; }
}
