/* The Benedict Society — light, mysterious, built for reading */

:root {
  --bg: #f6f1e7;
  --bg-warm: #efe6d4;
  --bg-raised: #fffdf8;
  --ink: #111111;
  --line: #111111;
  --gold: #6f5420;
  --gold-line: #6f5420;
  --oxblood: #7a1f24;
  --oxblood-lit: #92262c;
  --display: "Cinzel", "Times New Roman", Times, serif;
  --text: "Source Serif 4", "Source Serif Pro", "Palatino Linotype", Palatino, Georgia, serif;
  --wrap: min(60ch, calc(100% - 48px));
  --nav-h: 76px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
}

body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  text-align: left;
}

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

a {
  color: var(--ink);
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 16px;
  font-weight: 600;
  padding: 12px 16px;
  border: 2px solid var(--ink);
}

.skip:focus {
  top: 16px;
}

.wrap {
  width: var(--wrap);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ——— Nav ——— */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: rgba(246, 241, 231, 0.96);
  border-bottom: 1px solid rgba(17, 17, 17, 0.18);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ink);
}

.nav-brand img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
}

.nav-brand span {
  font-family: var(--text);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  list-style: none;
}

.nav-links a {
  font-family: var(--text);
  font-size: 16px;
  letter-spacing: 0;
  color: var(--ink);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  color: var(--ink);
  font-family: var(--text);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  cursor: pointer;
  padding: 10px 0;
}

/* ——— Hero ——— */

.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-h) + 40px) 0 0;
  position: relative;
  z-index: 1;
  overflow: hidden;
  background: var(--bg);
}

/* Mist stays at the far edges and does not cross the text column. */
.hero-mist {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(to right, rgba(196, 200, 204, 0.42), rgba(246, 241, 231, 0) 16%, rgba(246, 241, 231, 0) 84%, rgba(196, 200, 204, 0.42)),
    linear-gradient(to bottom, rgba(210, 212, 214, 0.22), rgba(246, 241, 231, 0) 72px);
}

.hero-mark {
  position: relative;
  z-index: 1;
  width: 260px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  padding-bottom: 0;
  z-index: 3;
}

.hero-watermark {
  position: absolute;
  inset: 0;
  width: 260px;
  height: 260px;
  opacity: 0.16;
  pointer-events: none;
  user-select: none;
}

.seal {
  position: relative;
  z-index: 1;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  display: block;
}

/* Hero type sits on the same ivory as the seal. Mist stays at the edges
   and under the nav, so no hard band cuts through the watermark. */
.hero-text {
  position: relative;
  z-index: 2;
  width: 100%;
  background: transparent;
  padding: 16px 24px 88px;
  display: flex;
  justify-content: center;
  flex: 1 0 auto;
}

.hero-text-inner {
  width: min(60ch, 100%);
  text-align: left;
  background: transparent;
}

.eyebrow {
  font-family: var(--text);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink);
  margin-bottom: 10px;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.25rem, 5.4vw, 3.25rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.15;
  color: var(--ink);
}

.motto {
  margin-top: 18px;
  font-size: 22px;
  line-height: 1.5;
  font-style: normal;
  color: var(--ink);
}

.keyhole {
  margin-top: 18px;
  color: var(--gold);
  line-height: 0;
}

.cryptic {
  margin-top: 16px;
  font-style: normal;
  font-size: 22px;
  line-height: 1.5;
  color: var(--ink);
}

.invite {
  margin-top: 24px;
  font-size: 22px;
  line-height: 1.6;
  color: var(--ink);
}

.invite a {
  display: inline-block;
  margin-top: 10px;
  font-family: var(--text);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink);
  border-bottom: 2px solid var(--ink);
  padding-bottom: 2px;
}

.invite a:hover {
  border-bottom-width: 3px;
}

.fade-in {
  opacity: 0;
  animation: fadeUp 1.15s ease forwards;
}

.fade-in.d2 { animation-delay: 0.22s; }
.fade-in.d3 { animation-delay: 0.44s; }
.fade-in.d4 { animation-delay: 0.66s; }
.fade-in.d5 { animation-delay: 0.88s; }
.fade-in.d6 { animation-delay: 1.12s; }

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

/* ——— Sections ——— */

section {
  padding: 88px 0;
  position: relative;
  z-index: 1;
}

.band {
  background: var(--bg-warm);
  border-top: 1px solid rgba(17, 17, 17, 0.12);
  border-bottom: 1px solid rgba(17, 17, 17, 0.12);
}

.cap {
  font-family: var(--text);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink);
  margin-bottom: 8px;
}

h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.85rem, 3.4vw, 2.35rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 0;
  line-height: 1.2;
}

.rule {
  width: 48px;
  height: 2px;
  border: 0;
  background: var(--gold);
  margin: 20px 0 28px;
}

.prose {
  color: var(--ink);
  font-size: 1em;
  font-style: normal;
  line-height: 1.7;
  margin-bottom: 1em;
  max-width: 60ch;
}

.prose:last-child {
  margin-bottom: 0;
}

.standout {
  font-weight: 600;
  font-style: normal;
}

blockquote {
  margin: 32px 0 0;
  padding: 0 0 0 20px;
  border-top: 0;
  border-left: 3px solid var(--gold);
}

blockquote p {
  font-style: normal;
  font-size: 22px;
  line-height: 1.55;
  color: var(--ink);
}

blockquote cite {
  display: block;
  margin-top: 12px;
  font-family: var(--text);
  font-style: normal;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink);
}

/* ——— The Code and stages ——— */

.code,
.stages {
  list-style: disc;
  margin: 8px 0 0 1.15em;
  max-width: 60ch;
}

.stages {
  list-style: decimal;
  margin-top: 32px;
}

.code li,
.stages li {
  padding: 8px 0;
  color: var(--ink);
  font-size: 1em;
  line-height: 1.6;
}

.code strong,
.stages strong {
  font-weight: 600;
  color: var(--ink);
}

.note {
  margin-top: 16px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
}

/* ——— Form ——— */

form {
  margin-top: 32px;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.field {
  margin-bottom: 22px;
}

label {
  display: block;
  font-family: var(--text);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink);
  margin-bottom: 8px;
}

input,
textarea {
  width: 100%;
  background: var(--bg-raised);
  border: 2px solid var(--ink);
  color: var(--ink);
  font-family: var(--text);
  font-size: 18px;
  line-height: 1.5;
  padding: 12px 14px;
  outline: none;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}

input:focus,
textarea:focus {
  border-width: 3px;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

button[type="submit"] {
  font-family: var(--text);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
  background: var(--oxblood);
  color: #ffffff;
  border: 2px solid #5a1519;
  padding: 14px 24px;
  min-height: 52px;
  cursor: pointer;
  margin-top: 4px;
}

button[type="submit"]:hover {
  background: var(--oxblood-lit);
}

.form-status {
  margin-top: 20px;
  padding: 16px 18px;
  border: 2px solid var(--ink);
  background: var(--bg-raised);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.6;
}

.form-status[hidden] {
  display: none;
}

/* ——— Footer ——— */

.site-footer {
  position: relative;
  z-index: 1;
  text-align: left;
  padding: 56px 0 72px;
  border-top: 1px solid rgba(17, 17, 17, 0.18);
  background: var(--bg);
}

.site-footer .seal-footer {
  width: 88px;
  height: 88px;
  margin: 0 0 20px;
  border-radius: 50%;
  display: block;
}

.site-footer .identity {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.site-footer p {
  font-family: var(--text);
  font-size: 16px;
  letter-spacing: 0;
  color: var(--ink);
  line-height: 1.5;
}

.site-footer .pax {
  margin-top: 16px;
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
}

.site-footer .credit {
  margin: 20px 0 0;
  max-width: 60ch;
  font-size: 16px;
  font-style: normal;
  color: var(--ink);
  line-height: 1.6;
}

/* ——— 404 ——— */

.page-404 .hero {
  min-height: 80vh;
}

/* ——— Responsive ——— */

@media (max-width: 900px) {
  .nav-links a {
    font-size: 15px;
  }
}

@media (max-width: 800px) {
  :root {
    --wrap: min(60ch, calc(100% - 40px));
    --nav-h: 68px;
  }

  body {
    font-size: 19px;
  }

  .motto,
  .cryptic,
  .invite,
  blockquote p {
    font-size: 19px;
  }

  .site-nav {
    padding: 0 16px;
  }

  .nav-toggle {
    display: inline-block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 20px 24px;
    background: #f6f1e7;
    border-bottom: 1px solid rgba(17, 17, 17, 0.18);
  }

  .site-nav.is-open .nav-links {
    display: flex;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 14px 0;
    font-size: 18px;
  }

  .row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .hero {
    padding: calc(var(--nav-h) + 28px) 0 0;
  }

  .hero-text {
    padding: 12px 20px 64px;
  }

  .hero-mark {
    width: 210px;
    height: 210px;
  }

  .hero-watermark {
    width: 210px;
    height: 210px;
  }

  .seal {
    width: 160px;
    height: 160px;
  }

  section {
    padding: 64px 0;
  }
}

@media (max-width: 420px) {
  .nav-brand span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .fade-in,
  .fade-in.d2,
  .fade-in.d3,
  .fade-in.d4,
  .fade-in.d5,
  .fade-in.d6 {
    opacity: 1;
    animation: none;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
