/* The Loberati. Twilight sky, gold leaf, one very bright ball. */

@font-face {
  font-family: "Maguntia";
  src: url("fonts/unifrakturmaguntia-latin-400-normal.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Fell";
  src: url("fonts/im-fell-english-latin-400-normal.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Fell";
  font-style: italic;
  src: url("fonts/im-fell-english-latin-400-italic.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Fell SC";
  src: url("fonts/im-fell-english-sc-latin-400-normal.woff2") format("woff2");
  font-display: swap;
}

:root {
  --night: #17143a;
  --deep: #0e0c27;
  --dusk: #2c2358;
  --gold: #d8b25a;
  --ball: #d7f23c;
  --chalk: #f2ecdb;
  --clay: #d0623a;
  --tab-h: 60px;
}

* { box-sizing: border-box; }

html {
  background: var(--deep);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--night);
  color: var(--chalk);
  font-family: "Fell", Georgia, serif;
  font-size: 19px;
  line-height: 1.58;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

a { color: var(--ball); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--ball);
  outline-offset: 3px;
}

section, .page-head { max-width: 30rem; margin-left: auto; margin-right: auto; }

section { padding: 44px 24px 8px; }

h1, h2 {
  font-family: "Maguntia", "Fell", serif;
  font-weight: 400;
  color: var(--gold);
  margin: 0;
  line-height: 1;
}
h1 { font-size: clamp(68px, 23vw, 104px); text-align: center; }
h2 { font-size: 42px; margin-bottom: 16px; }
h3 {
  font-family: "Fell SC", "Fell", serif;
  font-weight: 400;
  font-size: 23px;
  line-height: 1.2;
  margin: 0 0 6px;
  color: var(--chalk);
}
p { margin: 0 0 16px; }
em { font-style: italic; }
.lede { font-size: 21px; }
.quiet { color: #b9b2cf; font-size: 17px; }

/* ---------- Hero ---------- */

.hero {
  padding: 18px 12px 30px;
  text-align: center;
  background: linear-gradient(180deg, var(--deep) 0%, var(--night) 55%, var(--dusk) 100%);
}
.hero svg { display: block; width: 100%; height: auto; max-width: 420px; margin: 0 auto; }
.hero .tagline {
  font-style: italic;
  font-size: 22px;
  line-height: 1.35;
  margin: 10px auto 0;
  max-width: 17em;
}
.hero .motto {
  font-family: "Fell SC", serif;
  color: var(--gold);
  font-size: 18px;
  letter-spacing: 0.08em;
  margin-top: 18px;
}

.inscription { font-family: "Fell SC", serif; letter-spacing: 0.14em; }

#iris { transition: transform 0.25s ease-out; }

/* ---------- Creed ---------- */

.tenets { list-style: none; margin: 0; padding: 0; }
.tenets li {
  position: relative;
  padding: 0 0 18px 30px;
  font-size: 21px;
  line-height: 1.4;
}
.tenets li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.42em;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--ball);
}

/* ---------- Grand Lobmaster ---------- */

.lobmaster { padding-left: 0; padding-right: 0; text-align: center; }
.lobmaster h2 { padding: 0 24px; }
.lobmaster svg { display: block; width: 100%; height: auto; }
.lobmaster figure { margin: 0; }
.lobmaster figcaption { padding: 0 24px; margin-top: -30px; position: relative; text-align: left; }
.lobmaster .title {
  font-family: "Fell SC", serif;
  font-size: 24px;
  color: var(--gold);
  text-align: center;
  margin-bottom: 12px;
}

/* ---------- Degrees ---------- */

.degrees { list-style: none; margin: 8px 0 0; padding: 0; position: relative; }
.degrees li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 37px;
  top: 54px;
  bottom: 6px;
  border-left: 2px dotted rgba(216, 178, 90, 0.55);
}
.degrees li {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 14px;
  padding-bottom: 22px;
  position: relative;
}
.degrees .deg {
  font-family: "Maguntia", serif;
  font-size: 40px;
  line-height: 1;
  color: var(--gold);
  background: var(--night);
  text-align: center;
  padding: 6px 0;
  align-self: start;
}
.degrees p { margin: 0; font-size: 18px; }

/* ---------- Signs ---------- */

.signs { margin: 0; padding: 0; list-style: none; }
.signs li {
  padding: 12px 0;
  border-top: 1px dotted rgba(216, 178, 90, 0.5);
  font-style: italic;
}
.signs li:last-child { border-bottom: 1px dotted rgba(216, 178, 90, 0.5); }

/* ---------- Onward links ---------- */

.onward { text-align: center; padding-bottom: 12px; }
.btn {
  display: inline-block;
  font-family: "Fell SC", serif;
  font-size: 21px;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--deep);
  background: var(--ball);
  border: 0;
  border-radius: 999px;
  padding: 13px 28px;
  cursor: pointer;
}
.btn.ghost {
  background: transparent;
  color: var(--gold);
  box-shadow: inset 0 0 0 1.5px var(--gold);
}

/* ---------- Rites ---------- */

.page-head { text-align: center; padding: 34px 24px 0; }
.lost { padding-top: 12vh; text-align: center; }
.lost svg { width: 150px; height: auto; }
.lost p { font-size: 21px; }
.page-head h1 { font-size: clamp(54px, 17vw, 80px); }
.page-head p { font-style: italic; font-size: 21px; margin: 12px auto 0; max-width: 18em; }

.diagram svg { display: block; width: 100%; height: auto; }
.legend { list-style: none; margin: 10px 0 0; padding: 0; font-size: 18px; }
.legend li { display: grid; grid-template-columns: 30px 1fr; gap: 8px; padding: 5px 0; }
.legend b {
  font-family: "Fell SC", serif;
  font-weight: 400;
  color: var(--deep);
  background: var(--gold);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
  margin-top: 3px;
}

.rites { list-style: none; margin: 0; padding: 0; counter-reset: rite; }
.rites li {
  counter-increment: rite;
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  padding: 18px 0;
  border-top: 1px dotted rgba(216, 178, 90, 0.5);
}
.rites li::before {
  content: counter(rite, upper-roman);
  font-family: "Fell SC", serif;
  font-size: 30px;
  line-height: 1;
  color: var(--gold);
  text-align: center;
  padding-top: 2px;
}
.rites p { margin: 0; font-size: 18px; }

.procs { margin: 0; }
.procs div { padding: 16px 0; border-top: 1px dotted rgba(216, 178, 90, 0.5); }
.procs dt { font-family: "Fell SC", serif; font-size: 22px; line-height: 1.25; }
.procs dt span { color: var(--gold); display: block; font-size: 17px; letter-spacing: 0.06em; }
.procs dd { margin: 6px 0 0; font-size: 18px; }

.heresies { list-style: none; margin: 0; padding: 0; }
.heresies li { padding: 0 0 16px; }
.heresies s {
  font-family: "Fell SC", serif;
  font-size: 23px;
  text-decoration-color: var(--clay);
  text-decoration-thickness: 2px;
  display: block;
}
.heresies span { font-size: 18px; font-style: italic; color: #d9d2e6; }

/* ---------- Ascend ---------- */

.oath {
  font-style: italic;
  font-size: 21px;
  line-height: 1.5;
  border-left: 2px solid var(--gold);
  padding: 2px 0 2px 18px;
  margin: 0 0 8px;
}
.oath p:last-child { margin-bottom: 0; }

.field { display: block; margin: 0 0 6px; }
.field span { font-family: "Fell SC", serif; font-size: 20px; display: block; margin-bottom: 6px; }
.field input {
  width: 100%;
  font: inherit;
  font-size: 22px;
  color: var(--chalk);
  background: rgba(14, 12, 39, 0.6);
  border: 1.5px solid var(--gold);
  border-radius: 10px;
  padding: 12px 14px;
}
.field input::placeholder { color: #8f88a8; font-style: italic; }

.swear { text-align: center; padding-top: 26px; }
.hold {
  --p: 0;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: conic-gradient(var(--gold) calc(var(--p) * 1turn), rgba(242, 236, 219, 0.16) 0);
  display: inline-grid;
  place-items: center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.hold svg { width: 132px; height: 132px; display: block; pointer-events: none; }
.hold.pressing svg { transform: scale(0.96); }
@media (prefers-reduced-motion: no-preference) {
  .hold.launched { animation: launch 0.9s cubic-bezier(0.3, 0, 0.8, 0.4) forwards; }
}
@keyframes launch { to { transform: translateY(-120vh) scale(0.5); } }
.hold-label { font-family: "Fell SC", serif; font-size: 22px; margin: 14px 0 4px; }
.hint { min-height: 1.6em; font-style: italic; color: var(--gold); font-size: 18px; }

.certificate {
  background: var(--chalk);
  color: #1b173f;
  border-radius: 4px;
  padding: 26px 22px 32px;
  text-align: center;
  outline: 1.5px solid #a8842f;
  outline-offset: -8px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  transform: rotate(-1.2deg);
  margin: 6px 0 26px;
}
.certificate svg { width: 92px; height: auto; display: block; margin: 0 auto 6px; }
.certificate .cert-head { font-family: "Maguntia", serif; font-size: 34px; line-height: 1.05; color: #7a5a12; margin-bottom: 10px; }
.certificate .cert-name { font-family: "Fell SC", serif; font-size: 25px; line-height: 1.25; margin: 10px 0 12px; }
.certificate p { font-size: 17px; margin-bottom: 10px; }
.certificate dl { margin: 14px 0 0; text-align: left; font-size: 17px; border-top: 1px solid #c9bb93; }
.certificate dl div { display: grid; grid-template-columns: 7.2em 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid #c9bb93; }
.certificate dt { font-family: "Fell SC", serif; }
.certificate dd { margin: 0; }
.after { text-align: center; }
.after .btn { margin: 0 4px 12px; }
#result:focus { outline: none; }
[hidden] { display: none !important; }

/* ---------- Footer ---------- */

footer {
  max-width: 30rem;
  margin: 0 auto;
  padding: 34px 24px 28px;
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
  color: #a59ebe;
}
footer .inscription { color: var(--gold); font-size: 16px; display: block; margin-bottom: 10px; }

/* ---------- Tab bar ---------- */

.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(14, 12, 39, 0.96);
  border-top: 1px solid rgba(216, 178, 90, 0.6);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  height: var(--tab-h);
  display: grid;
  place-items: center;
  font-family: "Fell SC", serif;
  font-size: 19px;
  color: #c9c2dc;
  text-decoration: none;
  position: relative;
}
.tabs a[aria-current="page"] { color: var(--ball); }
.tabs a[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  width: 11px;
  height: 11px;
  margin-left: -5.5px;
  border-radius: 50%;
  background: var(--ball);
}

/* ---------- The lockout: no wide screens ---------- */

.lockout { display: none; }

@media (min-width: 820px) and (min-height: 520px) {
  body { padding: 0; }
  main, footer, .tabs { display: none; }
  .lockout {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px 40px;
    text-align: center;
    background: radial-gradient(circle at 50% 30%, var(--dusk), var(--deep) 70%);
  }
  .lockout .inner { max-width: 34rem; }
  .lockout svg.eye { width: 150px; height: auto; }
  .lockout h1 { font-size: 80px; margin: 4px 0 14px; }
  .lockout p { font-size: 22px; line-height: 1.45; margin-bottom: 10px; }
  .lockout .qr {
    display: inline-block;
    background: var(--chalk);
    padding: 12px;
    border-radius: 6px;
    margin: 12px 0 8px;
  }
  .lockout .qr svg { width: 132px; height: 132px; display: block; }
  .lockout .url { font-family: "Fell SC", serif; color: var(--gold); font-size: 26px; letter-spacing: 0.06em; }
}
