/* Enchiridion Academy website. Night and gold, after City of God (Phase C, Concept D).
   Sections: 1 fonts and tokens · 2 base · 3 header and footer · 4 components · 5 paintings · 6 Home · 7 pages · 8 forms · 9 legal */

/* 1. Fonts and tokens */
@font-face { font-family: "EB Garamond"; src: url("/fonts/eb-garamond-400.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("/fonts/eb-garamond-500.woff") format("woff"); font-weight: 500 700; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("/fonts/eb-garamond-italic-400.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("/fonts/cormorant-600.woff") format("woff"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("/fonts/cormorant-italic.woff") format("woff"); font-weight: 400 600; font-style: italic; font-display: swap; }
:root {
  --ink: #0d0906; --night: #15100c; --night-2: #1d1610;
  --parchment: #f1e6cf; --parchment-dim: #d9c9a8;
  --gold: #d2a95a; --gold-soft: rgba(210, 169, 90, .55); --gold-faint: rgba(210, 169, 90, .18);
  --ember: #c4602d; --text: #f3e8d2; --text-dim: rgba(243, 232, 210, .76); --line: rgba(243, 232, 210, .16);
  --display: "Cormorant Garamond", Georgia, serif; --body: "EB Garamond", Georgia, serif;
  --gutter: clamp(16px, 5vw, 64px); --measure: 38rem; --ribbon: 0px;
}
body:has(.ribbon) { --ribbon: 34px; }

/* 2. Base */
* { box-sizing: border-box; }
html { background: var(--ink); color-scheme: dark; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ink); color: var(--text); font: 400 clamp(18px, 1.15vw + 13px, 21px)/1.6 var(--body); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--gold); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--parchment); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
main:focus { outline: none; }
h1, h2, h3, .h3 { font-family: var(--display); font-weight: 600; letter-spacing: .01em; line-height: 1.08; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; }
.la { font-style: italic; color: var(--gold); }
.skip { position: fixed; top: -6rem; left: 1rem; padding: 1rem; background: var(--night-2); color: var(--parchment); border: 1px solid var(--gold); z-index: 60; }
.skip:focus { top: 1rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: .28em; text-transform: uppercase; color: var(--gold); margin: 0 0 14px; }
.lede { font-size: 1.1em; color: var(--text-dim); max-width: var(--measure); }
.lede.after { margin-top: 34px; }
.credit { font-size: 13px; color: var(--text-dim); font-style: italic; margin: 10px 0 0; }

/* 3. Header and footer */
.ribbon { position: relative; z-index: 30; height: 34px; line-height: 22px; background: #2a1d10; color: var(--parchment-dim); font-size: 14px; text-align: center; padding: 6px var(--gutter); border-bottom: 1px solid var(--gold-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) { .ribbon .long { display: none; } }
.head { position: absolute; top: var(--ribbon); left: 0; right: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px var(--gutter); }
.head.is-flow { position: relative; top: 0; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--parchment); text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: .26em; text-transform: uppercase; white-space: nowrap; min-height: 44px; }
.brand img { width: 34px; height: 34px; border-radius: 22.5%; }
.menu-btn { display: inline-flex; align-items: center; min-height: 44px; background: rgba(13, 9, 6, .55); color: var(--parchment); border: 1px solid var(--gold-soft); border-radius: 999px; padding: 8px 18px; font: 600 14px var(--display); letter-spacing: .2em; text-transform: uppercase; cursor: pointer; }
#nav { display: none; position: absolute; top: 100%; right: var(--gutter); background: rgba(13, 9, 6, .97); border: 1px solid var(--gold-faint); border-radius: 10px; padding: 10px 0; min-width: 230px; }
#nav.is-open { display: block; }
#nav a { display: block; padding: 11px 20px; color: var(--parchment); text-decoration: none; font-family: var(--display); font-size: 20px; }
#nav a:hover, #nav a[aria-current] { color: var(--gold); }
@media (min-width: 900px) {
  .menu-btn { display: none; }
  #nav { display: flex; position: static; background: none; border: 0; padding: 0; gap: 4px; min-width: 0; }
  #nav a { padding: 8px 12px; font-size: 18px; text-shadow: 0 1px 12px rgba(0, 0, 0, .8); }
}
.foot { border-top: 1px solid var(--line); padding: 44px var(--gutter) 56px; color: var(--text-dim); font-size: 16px; }
.foot .wrap { display: grid; gap: 14px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.foot nav a { color: var(--parchment-dim); text-decoration: none; padding: 6px 0; }
.foot nav a:hover { color: var(--gold); }
.foot .motto { font-family: var(--display); font-size: 24px; color: var(--parchment); margin: 0; }
.foot .small { font-size: 14px; margin: 0; }

/* 4. Components */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; min-height: 48px; font: 600 18px var(--display); letter-spacing: .06em; padding: 12px 26px; border-radius: 999px; text-decoration: none; background: linear-gradient(180deg, rgba(214, 170, 90, .97), rgba(170, 120, 52, .97)); color: #1b1209; border: 0; box-shadow: 0 6px 30px rgba(0, 0, 0, .45); cursor: pointer; }
.btn:hover { color: #1b1209; filter: brightness(1.08); }
.btn.ghost { background: rgba(20, 13, 8, .55); color: var(--text); border: 1px solid var(--gold-soft); box-shadow: none; }
.btn.ghost:hover { color: var(--gold); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.sec { padding: clamp(64px, 10vw, 128px) var(--gutter); }
.sec.alt { background: var(--night); }
.sec.first { padding-top: clamp(48px, 8vw, 96px); }
.wrap { max-width: 1180px; margin: 0 auto; }
.folio { max-width: 760px; margin: 0 auto; }
.sec h2 { font-size: clamp(34px, 4.6vw, 58px); margin-bottom: 18px; }
.sec h1 { font-size: clamp(44px, 6.4vw, 84px); margin-bottom: 18px; color: var(--parchment); }
.big { font-size: clamp(46px, 6vw, 80px); color: var(--parchment); margin-bottom: 18px; }
.quote { margin: 26px 0 0; max-width: 34rem; }
.quote p { font-family: var(--display); font-size: clamp(26px, 2.8vw, 36px); line-height: 1.25; color: var(--parchment); margin-bottom: 10px; }
.quote .la { display: block; font-family: var(--body); font-size: 18px; margin-bottom: 10px; }
.quote cite { font-style: normal; font-size: 15px; color: var(--text-dim); }
.facts { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.facts li { position: relative; padding-left: 27px; }
.facts li::before { content: "\2726"; color: var(--gold); font-size: 13px; position: absolute; left: 0; top: .45em; }
.ways { display: grid; gap: 28px; margin-top: 36px; }
@media (min-width: 760px) { .ways { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; } }
.way h3 { font-size: 27px; color: var(--parchment); margin: 6px 0 8px; }
.way .num { font-family: var(--display); color: var(--gold); font-size: 15px; letter-spacing: .2em; }
.way p { color: var(--text-dim); margin: 0; }
.toc { list-style: none; padding: 0; margin: 0 auto; max-width: 760px; counter-reset: toc; }
.toc li { display: flex; align-items: baseline; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: clamp(20px, 2vw, 24px); }
.toc li::before { counter-increment: toc; content: counter(toc, upper-roman) "."; font-family: var(--display); color: var(--gold); min-width: 2.4em; }
.toc a, .toc .lt { color: var(--parchment); text-decoration: none; font-family: var(--display); font-size: 1.15em; }
.toc a:hover { color: var(--gold); }
.toc .dots { flex: 1; border-bottom: 1px dotted var(--gold-faint); transform: translateY(-.3em); min-width: 12px; }
.toc .pg { color: var(--text-dim); font-size: 16px; font-style: italic; white-space: nowrap; }
.toc.lessons li::before { content: counter(toc) "."; }
.dropcap::first-letter { float: left; font-family: var(--display); font-size: 4.2em; line-height: .82; padding: .06em .1em 0 0; color: var(--gold); }
.fleuron { text-align: center; color: var(--gold); font-size: 22px; letter-spacing: 1em; margin: 0; padding: 10px 0; }
.split { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1.05fr .95fr; gap: 72px; } }
.parts { columns: 2; column-gap: 28px; padding: 0; list-style: none; margin: 18px 0 0; font-size: 17px; color: var(--text-dim); }
.parts li { break-inside: avoid; padding: 4px 0; border-bottom: 1px solid var(--line); }
figure { margin: 0; }

/* 5. Paintings: a still image, with the living picture drawn over it once ready */
.pic { position: relative; overflow: hidden; background: var(--night); }
.pic img { width: 100%; height: 100%; object-fit: cover; }
.pic canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.2s ease; }
.pic canvas.is-ready { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .pic canvas { transition: none; } }
.pic.bg { position: absolute; inset: 0; }
.pic.frame { aspect-ratio: 16 / 10; border-radius: 14px; border: 1px solid var(--gold-faint); box-shadow: 0 30px 80px rgba(0, 0, 0, .55); }
.pic.arch { aspect-ratio: 4 / 5; border-radius: 999px 999px 14px 14px; border: 1px solid var(--gold-soft); box-shadow: 0 0 0 10px rgba(210, 169, 90, .06), 0 40px 90px rgba(0, 0, 0, .6); max-height: 78vh; margin: 0 auto; width: min(100%, 520px); }
.hero-credit { position: absolute; z-index: 3; right: var(--gutter); bottom: 12px; text-align: right; max-width: 60%; }
@media (max-width: 700px) { .hero-credit { left: var(--gutter); right: auto; text-align: left; max-width: none; font-size: 12px; } }

/* 6. Home */
.hero { position: relative; min-height: calc(100svh - var(--ribbon)); overflow: hidden; display: grid; place-items: center; text-align: center; padding: 120px var(--gutter) 64px; }
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(85% 75% at 50% 40%, rgba(8, 5, 3, .22), rgba(8, 5, 3, .82)), linear-gradient(0deg, rgba(8, 5, 3, .55), transparent 40%); pointer-events: none; z-index: 1; }
.hero-inner { position: relative; z-index: 2; max-width: 1000px; width: 100%; min-width: 0; }
.hero h1 { font-size: clamp(52px, 8vw, 112px); color: var(--parchment); text-shadow: 0 4px 40px rgba(0, 0, 0, .8); }
.hero .la { font-size: clamp(19px, 2vw, 24px); display: block; margin-top: 8px; }
.hero .sub, .page-hero .sub { color: var(--parchment-dim); max-width: 34rem; margin: 18px auto 0; font-size: clamp(19px, 1.6vw, 23px); }
.hero .note { font-size: 15px; color: var(--text-dim); margin-top: 6px; }
.doors { display: flex; gap: 12px; justify-content: center; margin-top: 44px; overflow-x: auto; padding: 4px 4px 10px; scrollbar-width: none; }
.door { flex: 0 0 auto; width: clamp(86px, 12vw, 128px); aspect-ratio: 5 / 8; border-radius: 999px 999px 6px 6px; border: 1px solid var(--line); background: linear-gradient(180deg, #1a130d, #0b0805); position: relative; overflow: hidden; display: flex; align-items: flex-end; justify-content: center; text-decoration: none; color: var(--text-dim); }
.door span { position: relative; z-index: 2; font-family: var(--display); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; padding: 0 6px 14px; text-align: center; line-height: 1.25; }
.door:hover { border-color: var(--gold-soft); color: var(--parchment); }
.door.is-lit { width: clamp(118px, 17vw, 176px); border-color: var(--gold); box-shadow: 0 0 60px rgba(210, 169, 90, .35); color: var(--parchment); }
.door.is-lit canvas { position: absolute; inset: 0; width: 100%; height: 100%; background: url("/media/site/field-1200.webp") 24% 55% / cover; opacity: 1; }
.door.is-lit::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 50%, rgba(8, 5, 3, .9)); }
.door:not(.is-lit)::before { content: ""; position: absolute; left: 50%; top: 46%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--gold-faint); }
@media (max-width: 600px) {
  .doors { gap: 8px; justify-content: flex-start; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); padding-left: var(--gutter); padding-right: var(--gutter); }
  .door { width: 84px; } .door.is-lit { width: 116px; }
  .door span { padding: 0 3px 10px; }
}
.split-hero { display: grid; gap: 34px; padding: clamp(56px, 8vw, 110px) var(--gutter); max-width: 1280px; margin: 0 auto; align-items: center; }
@media (min-width: 960px) { .split-hero { grid-template-columns: 1fr 1fr; gap: 64px; } }
.split-hero figure .credit { text-align: center; }
.rooms { display: grid; gap: 14px; margin-top: 34px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .rooms { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.room { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 22px 20px; background: linear-gradient(180deg, rgba(29, 22, 16, .9), rgba(13, 9, 6, .9)); min-height: 190px; display: flex; flex-direction: column; gap: 4px; color: var(--text); text-decoration: none; }
.room h3, .room .h3 { font-size: 24px; color: var(--parchment-dim); overflow-wrap: anywhere; }
.room p, .room .about { margin: 4px 0 0; font-size: 15px; color: var(--text-dim); }
.room .emb { width: 52px; height: 52px; border-radius: 22.5%; margin-bottom: auto; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
.room .state { font-family: var(--display); font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); }
.room.is-lit { grid-column: 1 / -1; border-color: var(--gold-soft); min-height: 300px; overflow: hidden; padding: 0; }
.room.is-lit .room-pic { position: absolute; inset: 0; }
.room.is-lit .room-text { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 26px 24px; background: linear-gradient(transparent, rgba(8, 5, 3, .92) 40%); margin-top: auto; z-index: 2; }
.room.is-lit .emb { margin-bottom: 12px; }
.room.is-lit .h3 { color: var(--parchment); font-size: 34px; }
.room.is-lit:hover .h3 { color: var(--gold); }
@media (min-width: 760px) { .room.is-lit { grid-column: span 2; grid-row: span 2; min-height: 400px; } }
.tiers { display: grid; gap: 14px; margin-top: 30px; }
@media (min-width: 640px) { .tiers { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tier { border: 1px solid var(--line); border-radius: 12px; padding: 22px 20px; background: var(--night-2); }
.tier h3 { font-size: 26px; color: var(--parchment); }
.tier p { font-size: 16px; color: var(--text-dim); margin: 8px 0 0; }
.tier.is-free { border-color: var(--gold-soft); }

/* 7. Pages with a painting at the top */
.page-hero { position: relative; min-height: min(78svh, 760px); overflow: hidden; display: flex; align-items: flex-end; padding: 140px var(--gutter) clamp(56px, 8vw, 96px); }
.page-hero.tall { min-height: calc(100svh - var(--ribbon)); }
.page-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(8, 5, 3, .95) 0%, rgba(8, 5, 3, .55) 45%, rgba(8, 5, 3, .2) 80%); pointer-events: none; z-index: 1; }
.page-hero-inner { position: relative; z-index: 2; max-width: 760px; }
.page-hero h1 { font-size: clamp(50px, 7vw, 96px); color: var(--parchment); text-shadow: 0 4px 40px rgba(0, 0, 0, .7); }
.page-hero .sub { margin-left: 0; }
.page-hero .status { margin-top: 16px; font-size: 16px; color: var(--gold); font-style: italic; }

/* 8. The founding-members form */
.wait { border: 1px solid var(--gold-soft); border-radius: 16px; padding: clamp(24px, 4vw, 44px); background: radial-gradient(120% 140% at 0% 0%, rgba(210, 169, 90, .12), transparent 60%), var(--night-2); max-width: 760px; margin: 0 auto; }
.join { display: grid; gap: 14px; margin-top: 22px; }
.join label { display: grid; gap: 6px; font-size: 16px; color: var(--text-dim); }
.join input[type="text"], .join input[type="email"] { font: inherit; color: var(--text); background: rgba(13, 9, 6, .7); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; min-height: 48px; width: 100%; }
.join input:focus { border-color: var(--gold); outline: none; }
.join select, .join textarea { font: inherit; color: var(--text); background: rgba(13, 9, 6, .7); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; min-height: 48px; width: 100%; }   /* the tester request form */
.join select:focus, .join textarea:focus { border-color: var(--gold); outline: none; }
.join textarea { resize: vertical; }
.join fieldset { border: 0; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 10px 20px; }
.join legend { font-size: 16px; color: var(--text-dim); margin-bottom: 8px; padding: 0; }
.join .check { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; color: var(--text); min-height: 44px; }
.join .check input { width: 24px; height: 24px; margin: 0; accent-color: var(--gold); }
.join .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.join .note { font-size: 15px; color: var(--text-dim); margin: 0; }
.join .note.is-error { color: #f0a090; }
.wait > .note { font-size: 15px; color: var(--text-dim); margin: 16px 0 0; }   /* the Tolle Lege box's line under its buttons */
@media (min-width: 640px) { .join .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } }
@media (max-width: 639px) { .join .row { display: grid; gap: 14px; } }

/* 9. Legal pages */
.legal h2 { font-size: clamp(26px, 3vw, 34px); margin: 34px 0 10px; color: var(--parchment); }
/* Email links: wrap on narrow phones, and give them a full tap height. */
main a[href^="mailto:"] { display: inline-block; padding: 3px 0; overflow-wrap: anywhere; max-width: 100%; }
.hero .eyebrow .long { white-space: nowrap; }
@media (max-width: 600px) { .hero .eyebrow .long { display: none; } .doors { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); } }
/* Home hero legibility (Matt, Nov 15): tolle lege and the lines over the painting get a soft dark halo;
   door labels shrink to fit their door instead of being cut. */
.hero .la { color: #ecc87e; font-size: clamp(21px, 2.2vw, 27px); text-shadow: 0 0 2px rgba(0, 0, 0, .9), 0 2px 16px rgba(0, 0, 0, .95), 0 0 30px rgba(8, 5, 3, .9); }
.hero .sub, .hero .eyebrow, .hero .note { text-shadow: 0 0 2px rgba(0, 0, 0, .85), 0 2px 14px rgba(0, 0, 0, .9); }
.hero::after { background: radial-gradient(85% 75% at 50% 40%, rgba(8, 5, 3, .34), rgba(8, 5, 3, .84)), linear-gradient(0deg, rgba(8, 5, 3, .55), transparent 40%); }
.door { container-type: inline-size; }
.door span { font-size: min(13px, 9.2cqi); letter-spacing: .06em; padding: 0 4px 14px; white-space: nowrap; max-width: 100%; }
