:root {
  --ink: #f2e6cd;
  --ink-soft: #c6ad85;
  --ink-faint: #9a8965;
  --gold: #d0a95f;
  --gold-deep: #e3bd7c;
  --hero-1: #17151300;
  --band: #2a2620;
  --field: #332d24;
  --line: #4f4634;
  --display: "Cormorant Garamond", "Iowan Old Style", Palatino, Georgia, serif;
  --celtic: "Uncial Antiqua", "Luminari", Georgia, serif;
  --serif: "EB Garamond", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--band);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---- hero ---- */

.hero {
  position: relative;
  padding: clamp(2.5rem, 7vh, 4.5rem) 1.25rem clamp(3.5rem, 9vh, 5.5rem);
  /* the wall, lit from the upper left. Anchored left-top so the shaft still
     enters at the corner when a wide viewport crops the square image. */
  background:
    radial-gradient(circle 34rem at 0% -4%, rgba(255, 200, 118, 0.32), rgba(255, 182, 98, 0.10) 38%, transparent 72%),
    #121110 url("wall.jpg") left top / cover no-repeat;
  overflow: hidden;
}

.rays { position: absolute; inset: 0; pointer-events: none; }

/* The beams radiate rather than run parallel: every one is the same box pinned
   to the same apex just off the top-left corner (left = -width/2 puts the
   pivot at x = 0), and only the angle differs, so they fan out from a single
   source the way sunlight does. CSS rotate() is clockwise, so the angles are
   negative — positive would swing them down-left, a forward slash. */
.rays i {
  position: absolute;
  top: -6%;
  left: -9%;
  width: 18%;
  height: 240%;
  transform-origin: 50% 0;
  background: linear-gradient(90deg,
    rgba(255, 199, 114, 0) 0%,
    rgba(255, 199, 114, 0.19) 42%,
    rgba(255, 199, 114, 0.19) 58%,
    rgba(255, 199, 114, 0) 100%);
  filter: blur(16px);
}

.rays i:nth-child(1) { transform: rotate(-14deg); opacity: 0.55; }
.rays i:nth-child(2) { transform: rotate(-27deg); opacity: 0.95; filter: blur(11px); }
.rays i:nth-child(3) { transform: rotate(-38deg); opacity: 0.75; }
.rays i:nth-child(4) { transform: rotate(-49deg); opacity: 1; filter: blur(9px); width: 12%; left: -6%; }
.rays i:nth-child(5) { transform: rotate(-62deg); opacity: 0.5; width: 26%; left: -13%; }

/* smoke in the dark: large soft blooms plus fine grain, both barely there */
.smoke { display: none; }

/* keeps the corners heavy, so the light reads as directional */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 68%, rgba(20, 19, 18, 0.85) 100%);
  z-index: 0;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 46rem;
  margin: 0 auto;
  text-align: center;
}

h1 {
  margin: 0;
  font-family: var(--celtic);
  font-weight: 400;
  font-size: clamp(1.75rem, 4.2vw, 2.95rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.15;
  text-indent: 0.22em;
  color: #fbeed0;
}

.tagline {
  /* uncial too, and larger — but kept well below the wordmark */
  margin: 0.85rem 0 0;
  font-family: var(--celtic);
  font-size: clamp(1rem, 2vw, 1.45rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #dcbb7c;
  text-indent: 0.42em;
}

.rule {
  display: block;
  width: 4.5rem;
  height: 1px;
  margin: 1.4rem auto 0;
  background: linear-gradient(90deg, transparent, var(--gold-deep), transparent);
  opacity: 0.95;
}

/* ---- quote ---- */

.quote { margin: 1.9rem auto 0; max-width: 40rem; }

.quote blockquote { position: relative; margin: 0; }

.quote blockquote p {
  margin: 0;
  font-size: clamp(1.02rem, 1.7vw, 1.22rem);
  line-height: 1.55;
  color: #f6e8cb;
}

.mark {
  position: absolute;
  font-family: var(--display);
  font-size: 3.2rem;
  line-height: 1;
  color: var(--gold);
  opacity: 0.6;
}

.mark.open { left: -0.6rem; top: -1.1rem; }
.mark.close { right: -0.2rem; bottom: -1.6rem; }

.cite {
  margin: 1.35rem 0 0;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.credit {
  margin: 0.5rem auto 0;
  max-width: 34rem;
  font-family: var(--sans);
  font-size: 0.62rem;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: help;
}

.credit:empty { display: none; }

/* ---- translation select ---- */

.select-wrap {
  position: relative;
  width: min(34rem, 100%);
  margin: 1.9rem auto 0;
}

#translation {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 0.85rem 2.75rem 0.85rem 1.1rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #4a443c;
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

#translation:hover { border-color: var(--gold); background: rgba(255, 255, 255, 0.06); }
#translation option { background: #201e1b; color: var(--ink); }
#translation option:disabled { color: #857a66; }

/* the group headings — styled explicitly, since the browser otherwise paints
   them on white and the gold label becomes unreadable */
#translation optgroup {
  background: #16140f;
  color: #e8c98c;
  font-weight: 600;
  font-style: normal;
}

.chev {
  position: absolute;
  right: 1.15rem;
  top: 50%;
  width: 0.6rem;
  height: 0.6rem;
  margin-top: -0.42rem;
  border-right: 1.5px solid var(--ink-soft);
  border-bottom: 1.5px solid var(--ink-soft);
  transform: rotate(45deg);
  pointer-events: none;
}

.hero { border-bottom: 1px solid rgba(255, 255, 255, 0.06); }

/* ---- contact ---- */

.contact {
  position: relative;
  padding: clamp(2.25rem, 6vh, 3.5rem) 1.25rem clamp(1.5rem, 4vh, 2.5rem);
  background:
    radial-gradient(ellipse 70% 60% at 18% 0%, rgba(255, 220, 152, 0.09), transparent 70%),
    var(--band);
}

/* fine grain, so the band is a surface rather than a flat fill */
.contact::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.75;
  mix-blend-mode: overlay;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
}

.contact-inner, .contact footer { position: relative; z-index: 1; }

.contact-inner { max-width: 49rem; margin: 0 auto; }

h2 {
  margin: 0 0 1.6rem;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #efe8dd;
}

.field { margin-bottom: 1.1rem; }

label {
  display: block;
  margin-bottom: 0.45rem;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 3px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

input::placeholder, textarea::placeholder { color: #6f675c; }

textarea { resize: vertical; min-height: 6.5rem; }

input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-color: var(--gold);
}

input:user-invalid, textarea:user-invalid { border-color: #b4544a; }

button[type="submit"] {
  margin-top: 0.5rem;
  padding: 0.85rem 1.6rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #1b1815;
  background: #c79b52;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

button[type="submit"]:hover { background: var(--gold-deep); }
button[disabled] { opacity: 0.6; cursor: default; }

.form-status { margin: 0.85rem 0 0; font-family: var(--sans); font-size: 0.85rem; color: var(--ink-soft); }
.form-status.error { color: #d08a80; }

.gotcha { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

footer {
  margin-top: clamp(1.75rem, 5vh, 3rem);
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--ink-faint);
  text-align: center;
}

@media (max-width: 40rem) {
  .mark { font-size: 2.4rem; }
  .mark.open { left: -0.1rem; top: -1rem; }
  .mark.close { right: 0; bottom: -1.9rem; }
  .credit { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* the caret, while the verse is being written */
#verse-text.typing::after {
  content: "";
  display: inline-block;
  width: 0.06em;
  height: 1.05em;
  margin-left: 0.06em;
  vertical-align: -0.16em;
  background: var(--gold-deep);
  animation: caret 0.9s steps(1) infinite;
}

@keyframes caret {
  0%, 45% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  #verse-text.typing::after { display: none; }
}
