:root {
  --paper: #f4efe6;
  --ink: #1b1a17;
  --muted: #7a7266;
  --gold: #a8874d;
  --wood: #5a3d22;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #15140f; --ink: #ece5d8; --muted: #8f877a; --gold: #c9a96a; --wood: #a37a52; }
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--paper);
  background-image: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,.06) 100%);
  color: var(--ink);
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  -webkit-font-smoothing: antialiased;
}
main { position: relative; z-index: 1; }
.crest { width: 112px; height: 112px; color: var(--wood); margin-bottom: 2.25rem; overflow: visible; }
h1 {
  font-weight: 400;
  font-size: clamp(2.6rem, 9vw, 5.5rem);
  letter-spacing: .32em;
  margin-right: -.32em; /* optically recenter tracked caps */
  text-transform: uppercase;
  line-height: 1;
}
.rule {
  display: flex; align-items: center; justify-content: center; gap: .9rem;
  color: var(--gold); font-size: .8rem; margin: 1.75rem auto 1.5rem;
}
.rule span { display: block; width: 64px; height: 1px; background: currentColor; opacity: .6; }
.motto { font-style: italic; font-size: clamp(1.2rem, 3vw, 1.5rem); color: var(--muted); }
.est {
  margin-top: .75rem; font-size: .8rem; letter-spacing: .4em; margin-right: -.4em;
  text-transform: uppercase; color: var(--muted);
}
a { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .3s, color .3s; }
a:hover { color: var(--gold); border-color: currentColor; }
footer {
  position: fixed; bottom: 1.75rem; font-size: .85rem; z-index: 1;
  letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
}

/* ---- home: title sequence ---- */
#terrain {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 50%, transparent 25%, #000 85%);
          mask-image: radial-gradient(ellipse 60% 55% at 50% 50%, transparent 25%, #000 85%);
  animation: fade 4s ease both .4s;
}
.ring { fill: none; stroke: currentColor; stroke-dasharray: 1.01; stroke-dashoffset: 1.01;
        transform: rotate(-90deg); transform-origin: center; transform-box: fill-box;
        animation: draw 1.8s cubic-bezier(.65,0,.35,1) forwards; }
.ring-outer { stroke-width: 1.1; animation-delay: .2s; }
.ring-inner { stroke-width: .6; animation-delay: .55s; opacity: .7; }
.letter { opacity: 0; transform-origin: center; transform-box: fill-box;
          animation: ink 1.4s cubic-bezier(.2,.7,.2,1) forwards 1.25s; }
.sheen { animation: sheen 5s ease-in-out infinite 3.4s; }

.home h1 { animation: track 2.8s cubic-bezier(.2,.7,.2,1) both .9s; }
.home h1 span { display: inline-block; opacity: 0;
  animation: letter 1.3s cubic-bezier(.2,.7,.2,1) forwards;
  animation-delay: calc(1s + var(--i) * 80ms); }
.home .rule { animation: fade 1s ease both 2s; }
.home .rule span:first-child { transform-origin: right; }
.home .rule span:last-child { transform-origin: left; }
.home .rule span { transform: scaleX(0); animation: grow 1.6s cubic-bezier(.65,0,.35,1) forwards 2.1s; }
.home .motto { animation: rise 1.4s cubic-bezier(.2,.7,.2,1) both 2.6s; }
.home .est { animation: rise 1.4s cubic-bezier(.2,.7,.2,1) both 2.9s; }
.home footer { animation: fade 2s ease both 3.4s; }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes ink { from { opacity: 0; transform: scale(.94); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes sheen { 0% { transform: translateX(0); } 30%, 100% { transform: translateX(200px); } }
@keyframes letter { from { opacity: 0; transform: translateY(.22em); filter: blur(10px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes track { from { letter-spacing: .5em; margin-right: -.5em; } to { letter-spacing: .32em; margin-right: -.32em; } }
@keyframes grow { to { transform: scaleX(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
  .sheen { display: none; }
}

/* history page */
.est a { border-bottom: 1px solid currentColor; padding-bottom: 2px; }
body.page { display: block; height: auto; min-height: 100%; text-align: left; padding: 4rem 1.5rem 8rem; }
.page article { max-width: 38rem; margin: 0 auto; animation: rise 1.2s cubic-bezier(.2,.7,.2,1) both; }
.page h1 { text-align: center; font-size: clamp(2.2rem, 7vw, 3.6rem); }
.page .sub { text-align: center; color: var(--gold); font-size: 1.5rem; margin-top: .6rem; }
.page .back { display: inline-block; margin-bottom: 3rem; font-size: .8rem; letter-spacing: .25em; text-transform: uppercase; color: var(--muted); }
.page h2 { font-weight: 500; font-size: 1.05rem; letter-spacing: .25em; text-transform: uppercase; color: var(--gold); margin: 2.6rem 0 .8rem; }
.page p { font-size: 1.28rem; line-height: 1.6; }
.page .lead { font-size: 1.5rem; font-style: italic; text-align: center; color: var(--muted); }
