/* learn.css — the Codex (LearnView).
 *
 * A book-like rules compendium that opens over the Covenant Gate: a chapter
 * rail on the left, a scrollable paper page on the right, real full-face
 * cards illustrating each chapter. Deep parchment tones with the gate's gold
 * chrome, so the menu and the codex read as one design.
 */

#learn {
  position: fixed;
  inset: 0;
  z-index: 88;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: clamp(18px, 3vh, 34px) clamp(22px, 4vw, 64px) 12px;
  overflow: hidden;
  color: #e2d5ae;
  background:
    radial-gradient(ellipse 80% 52% at 50% -12%, #3a301e 0%, rgba(28, 23, 16, 0) 62%),
    linear-gradient(180deg, #1b160f 0%, #100c08 60%, #080604 100%);
  isolation: isolate;
}
#learn[hidden] { display: none; }

.learn__backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(201, 168, 106, 0.016) 0 1px, transparent 1px 4px),
    radial-gradient(ellipse 60% 46% at 50% 42%, rgba(201, 168, 106, 0.05) 0%, transparent 70%);
}

/* ---------------- head ---------------- */

.learn__head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 0 2px 14px;
  border-bottom: 1px solid rgba(201, 168, 106, 0.16);
}
.learn__eyebrow {
  font-family: Verdana, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: #c9a86a;
  opacity: 0.85;
}
.learn__title {
  margin-top: 6px;
  font-family: 'Radley', Georgia, serif;
  font-weight: 400;
  font-size: clamp(26px, 3.4vh, 36px);
  letter-spacing: 0.04em;
  color: #f2e6c6;
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.75);
}
.learn__exit {
  flex: 0 0 auto;
  font-family: 'Radley', Georgia, serif;
  font-size: 17px;
  letter-spacing: 0.03em;
  color: #d9c48a;
  padding: 10px 20px;
  border: 1px solid rgba(201, 168, 106, 0.4);
  border-radius: 11px;
  cursor: pointer;
  background: rgba(30, 24, 14, 0.5);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.learn__exit:hover { border-color: rgba(232, 217, 176, 0.75); background: rgba(52, 42, 26, 0.6); transform: translateY(-1px); }

/* ---------------- body ---------------- */

.learn__body {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: 26px;
  min-height: 0;
  padding-top: 16px;
}
.learn__rail {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 168, 106, 0.35) transparent;
}
.learn__chapter {
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: baseline;
  gap: 10px;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #b3a37c;
  cursor: pointer;
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.learn__chapter:hover { background: rgba(201, 168, 106, 0.06); color: #e2d5ae; }
.learn__chapter--on {
  color: #f2e6c6;
  border-color: rgba(201, 168, 106, 0.3);
  background: linear-gradient(90deg, rgba(201, 168, 106, 0.13), rgba(201, 168, 106, 0.03));
}
.learn__chapter--on::before {
  content: '';
  position: absolute;
  left: 0;
  top: 16%;
  bottom: 16%;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, #f0dda6, #a8823e);
  box-shadow: 0 0 10px rgba(232, 201, 106, 0.6);
}
.learn__chapter:focus-visible { outline: 2px solid #f4e9c9; outline-offset: 2px; }
.learn__chapter-num {
  font-family: 'Radley', Georgia, serif;
  font-size: 17px;
  color: #c9a86a;
  text-align: right;
}
.learn__chapter-name {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 18px;
  line-height: 1.25;
}

/* ---------------- the page ---------------- */

.learn__page {
  min-height: 0;
  overflow-y: auto;
  padding: 4px 26px 40px 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 168, 106, 0.35) transparent;
}
.learn__page::-webkit-scrollbar,
.learn__rail::-webkit-scrollbar { width: 8px; }
.learn__page::-webkit-scrollbar-thumb,
.learn__rail::-webkit-scrollbar-thumb { background: rgba(201, 168, 106, 0.28); border-radius: 4px; }

.learn__page-head {
  max-width: 780px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(201, 168, 106, 0.14);
  animation: learn-page-in 0.4s ease;
}
@keyframes learn-page-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.learn__page-eyebrow {
  font-family: Verdana, sans-serif;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #a8894f;
}
.learn__page-title {
  margin-top: 6px;
  font-family: 'Radley', Georgia, serif;
  font-weight: 400;
  font-size: clamp(26px, 3.4vh, 34px);
  color: #f6ebcd;
}
.learn__page-lede {
  margin-top: 10px;
  font-family: 'EB Garamond', Georgia, serif;
  font-style: italic;
  font-size: 19px;
  line-height: 1.5;
  color: #b8a87e;
}
.learn__section { max-width: 720px; margin-top: 22px; }
.learn__h {
  font-family: 'Radley', Georgia, serif;
  font-weight: 400;
  font-size: 21px;
  color: #e8d9b0;
  margin-bottom: 8px;
}
.learn__p {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 18px;
  line-height: 1.62;
  color: #cbbd97;
  margin-top: 10px;
}
.learn__p + .learn__p { margin-top: 12px; }
.learn__p b, .learn__list b { color: #f0e2ba; font-weight: 600; }
.learn__p i { color: #dccd9f; }
.learn__list {
  max-width: 720px;
  margin-top: 18px;
  list-style: none;
}
.learn__list li {
  position: relative;
  padding: 7px 0 7px 26px;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 18px;
  line-height: 1.55;
  color: #cbbd97;
}
.learn__list li::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 16px;
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #e6cd8e, #a8823e);
  box-shadow: 0 0 6px rgba(232, 201, 106, 0.4);
}
.learn__list li b { color: #f0e2ba; font-weight: 600; }
.learn__callout {
  max-width: 700px;
  margin-top: 20px;
  padding: 14px 20px;
  border-left: 3px solid #c9a86a;
  border-radius: 0 10px 10px 0;
  background: linear-gradient(90deg, rgba(201, 168, 106, 0.1), rgba(201, 168, 106, 0.02));
  font-family: 'EB Garamond', Georgia, serif;
  font-style: italic;
  font-size: 17.5px;
  line-height: 1.55;
  color: #d8c99c;
}

/* ---------------- example cards ---------------- */

.learn__cards {
  display: flex;
  flex-wrap: wrap;
  gap: 26px 30px;
  margin-top: 26px;
}
.learn__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.learn__card .card {
  width: 172px;
  height: 241px;
  position: relative;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.learn__card:hover .card { transform: translateY(-8px) scale(1.03); }
.learn__card-note {
  max-width: 190px;
  text-align: center;
  font-family: 'EB Garamond', Georgia, serif;
  font-style: italic;
  font-size: 13.5px;
  line-height: 1.45;
  color: #9f9169;
}

/* ---------------- keywords ---------------- */

.learn__keywords {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
  max-width: 820px;
}
.learn__keyword {
  padding: 13px 16px 14px;
  border: 1px solid rgba(201, 168, 106, 0.16);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(52, 43, 29, 0.32), rgba(18, 13, 8, 0.44));
}
.learn__keyword-name {
  font-family: 'Radley', Georgia, serif;
  font-weight: 400;
  font-size: 17.5px;
  color: #e8d9b0;
  letter-spacing: 0.02em;
}
.learn__keyword-text {
  margin-top: 5px;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 15.5px;
  line-height: 1.5;
  color: #bcae88;
}
.learn__keyword-ex {
  display: block;
  margin-top: 7px;
  font-family: Verdana, sans-serif;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8d7f5d;
}

/* ---------------- foot ---------------- */

.learn__foot {
  position: relative;
  z-index: 1;
  padding-top: 10px;
  text-align: center;
  border-top: 1px solid rgba(201, 168, 106, 0.12);
  font-family: 'EB Garamond', Georgia, serif;
  font-style: italic;
  font-size: 13.5px;
  color: #7e7154;
}

/* ---------------- responsive ---------------- */

@media (max-width: 980px) {
  .learn__body { grid-template-columns: 200px minmax(0, 1fr); gap: 16px; }
  .learn__keywords { grid-template-columns: 1fr; }
}
@media (max-height: 700px) {
  .learn__title { font-size: 24px; }
  .learn__page-lede { font-size: 17px; }
  .learn__card .card { width: 150px; height: 210px; }
}
@media (prefers-reduced-motion: reduce) {
  .learn__page-head { animation: none; }
  .learn__card .card,
  .learn__chapter,
  .learn__exit { transition: none; }
}
