:root {
  color-scheme: dark;
  --bg-shadow: rgba(13, 9, 17, 0.78);
  --panel-shadow: rgba(0, 0, 0, 0.62);
  --ember: #ff7a2f;
  --ember-bright: #ffb35d;
  --gold: #b98742;
  --gold-bright: #f2cf8a;
  --paper: #f4e4c0;
  --blood: #7f1f28;
  --blood-dark: #411019;
  --violet: #7e2f8a;
  --violet-bright: #cb71dd;
  --steel: #221721;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: #070609;
}

body {
  font-family: Georgia, 'Times New Roman', serif;
  position: relative;
}

body.modal-open {
  overflow: hidden;
}

.background-frame {
  position: fixed;
  inset: 0;
  background-color: #120b16;
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  /* PNG fallback first; modern browsers use the ~11x smaller WebP. */
  background-image: url('/landing-assets/dcc-bg.png');
  background-image: -webkit-image-set(url('/landing-assets/dcc-bg.webp') 1x);
  background-image: image-set(url('/landing-assets/dcc-bg.webp') type('image/webp'), url('/landing-assets/dcc-bg.png') type('image/png'));
  transform: scale(1.02);
}

.background-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent;
}

.landing-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem 2rem 6rem;
}

.portal-column {
  --portal-width: min(66vw, 25.5rem);
  width: var(--portal-width);
  margin-top: 14vh;
  display: grid;
  gap: 1.5rem;
}

.portal-intro {
  text-align: center;
  color: var(--paper);
  margin-bottom: 0.2rem;
}

.portal-eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ember-bright);
  opacity: 0.92;
}

.portal-title {
  margin: 0 0 0.6rem;
  font-size: clamp(1.7rem, 4.5vw, 2.8rem);
  line-height: 1.04;
  letter-spacing: 0.01em;
  color: #f7eccf;
  text-shadow: 0 0.12rem 0 rgba(0, 0, 0, 0.4), 0 0 1.2rem rgba(255, 179, 93, 0.22);
}

.portal-tagline {
  margin: 0 auto;
  max-width: 36ch;
  font-size: clamp(0.95rem, 1.6vw, 1.08rem);
  line-height: 1.5;
  color: #e8dcc2;
  opacity: 0.92;
}

.portal-tagline a { color: var(--ember-bright); }

.landing-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 0.7rem 1rem 0.8rem;
  text-align: center;
  background: linear-gradient(0deg, rgba(7, 6, 9, 0.94) 30%, rgba(7, 6, 9, 0) 100%);
}

.landing-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.1rem;
  margin-bottom: 0.4rem;
}

.landing-footer__links a {
  color: #f0d9a0;
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.landing-footer__links a:hover,
.landing-footer__links a:focus-visible { color: #fff; }

.landing-footer__legal {
  margin: 0 auto;
  max-width: 74ch;
  font-size: 0.7rem;
  line-height: 1.45;
  color: #a99dab;
}

.landing-footer__legal a { color: #cda9c0; }

.portal-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 5.7rem;
  padding: 1.15rem 2.6rem;
  text-decoration: none;
  color: var(--paper);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 212, 127, 0.24) 0%, rgba(255, 212, 127, 0) 34%),
    linear-gradient(135deg, rgba(53, 17, 32, 0.97) 0%, rgba(104, 27, 47, 0.98) 46%, rgba(53, 16, 31, 0.98) 100%);
  border: 1px solid rgba(246, 212, 144, 0.86);
  border-radius: 1.8rem;
  box-shadow:
    0 1.5rem 3.2rem rgba(0, 0, 0, 0.54),
    0 0 0 0.22rem rgba(95, 34, 81, 0.2),
    0 0 2.4rem rgba(255, 125, 54, 0.2),
    inset 0 0.12rem 0 rgba(255, 239, 200, 0.34),
    inset 0 -0.95rem 1.25rem rgba(14, 6, 11, 0.46);
  isolation: isolate;
  overflow: hidden;
  animation: drift-wander var(--drift-duration, 8.8s) ease-in-out var(--drift-delay, 0s) infinite;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, filter 180ms ease;
}

.lore-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 5.7rem;
  padding: 1.15rem 2.6rem;
  border-radius: 1.8rem;
  border: 1px solid rgba(138, 228, 255, 0.84);
  cursor: pointer;
  color: #daf9ff;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.08rem, 1.85vw, 1.7rem);
  font-weight: 700;
  background:
    radial-gradient(circle at 50% 0%, rgba(158, 239, 255, 0.24) 0%, rgba(158, 239, 255, 0) 34%),
    linear-gradient(135deg, rgba(11, 42, 58, 0.97) 0%, rgba(16, 65, 92, 0.98) 46%, rgba(17, 40, 73, 0.98) 100%);
  box-shadow:
    0 1.5rem 3.2rem rgba(2, 10, 18, 0.56),
    0 0 0 0.22rem rgba(64, 187, 221, 0.24),
    0 0 2.4rem rgba(87, 232, 255, 0.2),
    inset 0 0.12rem 0 rgba(210, 248, 255, 0.34),
    inset 0 -0.95rem 1.25rem rgba(2, 12, 20, 0.46);
  isolation: isolate;
  overflow: hidden;
  animation: drift-wander var(--drift-duration, 9.6s) ease-in-out var(--drift-delay, -1.2s) infinite;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, filter 180ms ease;
}

.lore-button:hover,
.lore-button:focus-visible {
  transform: translateY(-0.28rem) scale(1.02);
  border-color: rgba(182, 245, 255, 0.95);
  box-shadow:
    0 1.85rem 3.5rem rgba(2, 10, 18, 0.62),
    0 0 0 0.28rem rgba(70, 196, 231, 0.28),
    0 0 3rem rgba(87, 232, 255, 0.3),
    0 0 2.2rem rgba(106, 225, 255, 0.2),
    inset 0 0.12rem 0 rgba(230, 253, 255, 0.4),
    inset 0 -0.95rem 1.25rem rgba(2, 13, 22, 0.3);
  filter: saturate(1.1);
}

.lore-button:focus-visible {
  outline: none;
}

.lore-button::before,
.lore-button::after,
.lore-button__frame {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.lore-button::before {
  background:
    linear-gradient(180deg, rgba(226, 251, 255, 0.2) 0%, rgba(226, 251, 255, 0) 24%),
    linear-gradient(90deg, rgba(126, 232, 255, 0.14) 0%, rgba(126, 232, 255, 0) 20%, rgba(99, 194, 255, 0.1) 50%, rgba(126, 232, 255, 0) 80%, rgba(126, 232, 255, 0.14) 100%);
  opacity: 0.95;
}

.lore-button::after {
  inset: 0.3rem;
  border-radius: 1.45rem;
  border: 1px solid rgba(188, 241, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(7, 31, 51, 0.74);
}

.lore-button__frame {
  inset: 0.55rem 0.75rem;
  border-radius: 1.15rem;
  border: 1px solid rgba(174, 233, 255, 0.24);
  background:
    linear-gradient(90deg, rgba(126, 232, 255, 0.08) 0%, rgba(126, 232, 255, 0) 18%, rgba(99, 194, 255, 0.08) 50%, rgba(126, 232, 255, 0) 82%, rgba(126, 232, 255, 0.08) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(6, 25, 40, 0.52),
    inset 0 0 1.6rem rgba(87, 232, 255, 0.08);
}

.lore-button__glow {
  position: absolute;
  inset: -24% -10%;
  background:
    radial-gradient(circle at 50% 50%, rgba(117, 236, 255, 0.3) 0%, rgba(117, 236, 255, 0.13) 28%, rgba(99, 194, 255, 0.12) 52%, transparent 72%),
    linear-gradient(90deg, rgba(87, 232, 255, 0) 0%, rgba(87, 232, 255, 0.17) 22%, rgba(99, 194, 255, 0.18) 50%, rgba(87, 232, 255, 0.17) 78%, rgba(87, 232, 255, 0) 100%);
  animation: pulse-glow 3.1s ease-in-out infinite;
  opacity: 0.95;
  filter: blur(0.18rem);
}

.lore-button__label {
  position: relative;
  z-index: 1;
  max-width: 18ch;
  line-height: 1.08;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  text-shadow:
    0 0.14rem 0 rgba(0, 0, 0, 0.38),
    0 0 0.7rem rgba(117, 236, 255, 0.28),
    0 0 1rem rgba(99, 194, 255, 0.16);
  background: linear-gradient(180deg, #e8fcff 0%, #b8ecff 46%, #8fd6f7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(7, 7, 10, 0.18);
  backdrop-filter: none;
}

.scroll-modal {
  position: fixed;
  z-index: 30;
  top: 6vh;
  bottom: 6vh;
  left: 50%;
  width: min(92vw, 74ch);
  transform: translateX(-50%);
  border-radius: 1.6rem;
  overflow: hidden;
  border: 1px solid rgba(244, 213, 151, 0.6);
  box-shadow:
    0 2rem 4rem rgba(0, 0, 0, 0.66),
    0 0 0 0.22rem rgba(127, 44, 106, 0.24),
    0 0 2.7rem rgba(255, 146, 67, 0.2);
  background:
    radial-gradient(circle at 7% 0%, rgba(255, 181, 92, 0.12) 0%, rgba(255, 181, 92, 0) 34%),
    linear-gradient(160deg, rgba(19, 13, 23, 0.98) 0%, rgba(25, 17, 34, 0.98) 42%, rgba(18, 12, 22, 0.98) 100%);
}

.scroll-modal__chrome {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.scroll-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid rgba(245, 215, 158, 0.3);
  background: linear-gradient(180deg, rgba(41, 22, 44, 0.96), rgba(26, 14, 29, 0.88));
}

.scroll-modal__header h2 {
  margin: 0;
  color: #f6e5bf;
  font-size: clamp(1.02rem, 2vw, 1.4rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scroll-modal__close {
  border: 1px solid rgba(252, 212, 145, 0.8);
  background: linear-gradient(145deg, rgba(86, 28, 45, 0.96), rgba(53, 13, 27, 0.96));
  color: #ffe4bc;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.52rem 1rem;
  cursor: pointer;
  box-shadow: 0 0.45rem 1.1rem rgba(0, 0, 0, 0.42), inset 0 0.06rem 0 rgba(255, 224, 173, 0.34);
}

.scroll-modal__close:hover,
.scroll-modal__close:focus-visible {
  border-color: rgba(255, 228, 182, 0.98);
  background: linear-gradient(145deg, rgba(111, 35, 58, 0.98), rgba(69, 16, 34, 0.98));
}

.scroll-modal__close:focus-visible {
  outline: none;
}

.scroll-modal__content {
  flex: 1;
  overflow: auto;
  padding: 1.4rem 1.55rem 1.8rem;
  color: #f7edd4;
  line-height: 1.64;
  font-size: clamp(0.98rem, 1.25vw, 1.12rem);
  background:
    linear-gradient(180deg, rgba(12, 12, 16, 0.9), rgba(9, 9, 12, 0.92)),
    radial-gradient(circle at 90% 10%, rgba(78, 32, 87, 0.24), rgba(78, 32, 87, 0) 58%);
}

.scroll-modal__content p {
  margin: 0 0 1rem;
}

.lore-library {
  max-width: 100%;
  margin: 0;
  padding: 0.2rem 0.05rem 0.4rem;
}

.lore-library__kicker {
  margin: 0 0 0.5rem;
  color: #f2c987;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  font-size: 0.74rem;
}

.lore-library__title {
  margin: 0 0 1rem;
  color: #f7e7bf;
  font-size: clamp(1.2rem, 2.4vw, 1.65rem);
  letter-spacing: 0.01em;
}

.lore-library__list {
  display: grid;
  gap: 0.72rem;
}

.lore-library__item {
  width: 100%;
  text-align: left;
  border-radius: 0.9rem;
  border: 1px solid rgba(248, 209, 141, 0.48);
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 193, 112, 0.18), rgba(255, 193, 112, 0) 50%),
    linear-gradient(160deg, rgba(35, 20, 44, 0.94), rgba(20, 14, 30, 0.94));
  color: #f7edd6;
  padding: 0.8rem 0.88rem;
  cursor: pointer;
  box-shadow: 0 0.55rem 1.15rem rgba(0, 0, 0, 0.34);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.lore-library__item:hover,
.lore-library__item:focus-visible {
  transform: translateY(-0.1rem);
  border-color: rgba(255, 224, 165, 0.85);
  box-shadow: 0 0.85rem 1.4rem rgba(0, 0, 0, 0.42), 0 0 0 0.16rem rgba(163, 74, 148, 0.2);
}

.lore-library__item:focus-visible {
  outline: none;
}

.lore-library__item-title {
  display: block;
  font-size: clamp(1rem, 1.65vw, 1.15rem);
  font-weight: 700;
  color: #faeac9;
  margin-bottom: 0.2rem;
}

.lore-library__item-subtitle {
  display: block;
  font-size: clamp(0.85rem, 1.22vw, 0.96rem);
  color: #e3d5bb;
  opacity: 0.92;
}

.lore-library__item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.lore-library__item-time {
  flex: 0 0 auto;
  border: 1px solid rgba(244, 209, 147, 0.56);
  border-radius: 999px;
  padding: 0.22rem 0.56rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #f8ddb0;
  background: linear-gradient(135deg, rgba(86, 34, 43, 0.72), rgba(53, 24, 67, 0.74));
  box-shadow: inset 0 0.05rem 0 rgba(255, 235, 194, 0.23);
}

.lore-article-shell {
  width: 100%;
}

.lore-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  margin: 0 0 0.95rem;
  border: 1px solid rgba(252, 212, 145, 0.68);
  background: linear-gradient(145deg, rgba(74, 23, 39, 0.96), rgba(46, 11, 24, 0.96));
  color: #ffe5be;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.46rem 0.86rem;
  cursor: pointer;
}

.lore-back::before {
  content: '\2190';
  font-size: 0.95em;
}

.lore-back:hover,
.lore-back:focus-visible {
  border-color: rgba(255, 228, 182, 0.95);
  background: linear-gradient(145deg, rgba(102, 31, 52, 0.98), rgba(61, 15, 31, 0.98));
}

.lore-back:focus-visible {
  outline: none;
}

.ai-philosophy-doc {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.35rem 0.1rem 0.5rem;
}

.ai-philosophy-doc h1,
.ai-philosophy-doc h2,
.ai-philosophy-doc h3,
.ai-philosophy-doc h4 {
  margin: 0 0 0.9rem;
  color: #f7e7bf;
  line-height: 1.14;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.ai-philosophy-doc h1 {
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  text-shadow: 0 0.18rem 0 rgba(0, 0, 0, 0.34), 0 0 1.1rem rgba(255, 190, 98, 0.18);
}

.ai-philosophy-doc h2 {
  margin-top: 1.5rem;
  font-size: clamp(1.22rem, 2.25vw, 1.72rem);
}

.ai-philosophy-doc h3 {
  margin-top: 1.28rem;
  font-size: clamp(1.06rem, 2vw, 1.36rem);
}

.ai-philosophy-doc h4 {
  margin-top: 1.1rem;
  font-size: clamp(0.98rem, 1.65vw, 1.18rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f0d7a6;
}

.ai-philosophy-doc :is(h2, h3, h4):not(:first-child) {
  position: relative;
  padding-top: 1.18rem;
}

.ai-philosophy-doc :is(h2, h3, h4):not(:first-child)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background:
    radial-gradient(circle at 6% 50%, rgba(255, 207, 136, 0.9) 0 2px, transparent 3px),
    radial-gradient(circle at 94% 50%, rgba(255, 207, 136, 0.9) 0 2px, transparent 3px),
    linear-gradient(90deg, rgba(255, 207, 136, 0), rgba(255, 207, 136, 0.55) 22%, rgba(178, 98, 170, 0.58) 50%, rgba(255, 207, 136, 0.55) 78%, rgba(255, 207, 136, 0));
  opacity: 0.9;
}

.ai-philosophy-doc p,
.ai-philosophy-doc li {
  color: #f3e8d3;
  font-size: clamp(0.98rem, 1.22vw, 1.08rem);
  line-height: 1.72;
  text-wrap: pretty;
}

.ai-philosophy-doc > p:first-of-type {
  margin: 0 0 1.2rem;
  color: #f2cc93;
  font-size: clamp(1.02rem, 1.35vw, 1.18rem);
  font-style: italic;
  letter-spacing: 0.02em;
}

.ai-philosophy-doc p + p {
  margin-top: 0.15rem;
}

.ai-philosophy-doc :is(h1, h2, h3, h4) + p::first-letter {
  float: left;
  margin: 0.08rem 0.5rem 0 0;
  font-size: clamp(2.3rem, 4.2vw, 3.3rem);
  line-height: 0.78;
  font-weight: 700;
  color: #f6c681;
  text-shadow: 0 0.08rem 0 rgba(0, 0, 0, 0.4), 0 0 0.75rem rgba(255, 170, 78, 0.33);
}

.ai-philosophy-doc :is(h1, h2, h3, h4) + p {
  margin-top: 0.1rem;
}

.ai-philosophy-doc a {
  color: #ffcf8a;
  text-decoration-color: rgba(255, 207, 138, 0.5);
  text-underline-offset: 0.14em;
}

.ai-philosophy-doc strong {
  color: #ffe8bf;
}

.ai-philosophy-doc em {
  color: #ffd8ad;
}

.ai-philosophy-doc ul,
.ai-philosophy-doc ol {
  margin: 0.65rem 0 1.1rem 1.35rem;
}

.ai-philosophy-doc li {
  margin-bottom: 0.34rem;
}

.ai-philosophy-doc blockquote {
  margin: 1.2rem 0;
  padding: 0.85rem 1rem;
  border-left: 3px solid rgba(255, 198, 113, 0.65);
  border-radius: 0.35rem;
  color: #f7e7c8;
  background: linear-gradient(90deg, rgba(255, 177, 93, 0.12), rgba(255, 177, 93, 0.03));
}

.ai-philosophy-doc img {
  display: block;
  width: min(100%, 58rem);
  margin: 1.25rem auto 1.35rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(230, 193, 132, 0.58);
  box-shadow: 0 1rem 2.3rem rgba(0, 0, 0, 0.5), 0 0 0 0.2rem rgba(118, 43, 103, 0.2);
}

.ai-philosophy-doc hr {
  border: 0;
  height: 1px;
  margin: 1.25rem 0;
  background: linear-gradient(90deg, transparent, rgba(255, 197, 114, 0.55), transparent);
}

.ai-philosophy-doc--archive {
  color: #e8f0fa;
}

.ai-philosophy-doc--archive h1,
.ai-philosophy-doc--archive h2,
.ai-philosophy-doc--archive h3,
.ai-philosophy-doc--archive h4 {
  color: #d9ebff;
  text-shadow: 0 0.16rem 0 rgba(0, 0, 0, 0.34), 0 0 1.05rem rgba(114, 175, 255, 0.24);
}

.ai-philosophy-doc--archive :is(h2, h3, h4):not(:first-child)::before {
  background:
    radial-gradient(circle at 6% 50%, rgba(174, 213, 255, 0.9) 0 2px, transparent 3px),
    radial-gradient(circle at 94% 50%, rgba(174, 213, 255, 0.9) 0 2px, transparent 3px),
    linear-gradient(90deg, rgba(174, 213, 255, 0), rgba(174, 213, 255, 0.56) 22%, rgba(135, 119, 231, 0.64) 50%, rgba(174, 213, 255, 0.56) 78%, rgba(174, 213, 255, 0));
}

.ai-philosophy-doc--archive p,
.ai-philosophy-doc--archive li {
  color: #deebf7;
}

.ai-philosophy-doc--archive > p:first-of-type {
  color: #b9d6fb;
}

.ai-philosophy-doc--archive :is(h1, h2, h3, h4) + p::first-letter {
  color: #9ed3ff;
  text-shadow: 0 0.08rem 0 rgba(0, 0, 0, 0.4), 0 0 0.75rem rgba(98, 178, 255, 0.35);
}

.ai-philosophy-doc--archive em {
  color: #c9e2ff;
}

.ai-philosophy-doc--archive strong {
  color: #ecf4ff;
}

.ai-philosophy-doc--archive blockquote {
  border-left-color: rgba(158, 208, 255, 0.65);
  color: #e8f1fe;
  background: linear-gradient(90deg, rgba(119, 176, 255, 0.16), rgba(119, 176, 255, 0.03));
}

.ai-philosophy-doc--archive img {
  border-color: rgba(160, 203, 255, 0.58);
  box-shadow: 0 1rem 2.3rem rgba(0, 0, 0, 0.5), 0 0 0 0.2rem rgba(87, 102, 180, 0.26);
}

.ai-philosophy-doc--archive hr {
  background: linear-gradient(90deg, transparent, rgba(168, 208, 255, 0.65), transparent);
}

.scroll-modal__content img {
  display: block;
  max-width: min(100%, 58rem);
  width: 100%;
  margin: 1rem auto;
  border-radius: 0.9rem;
  border: 1px solid rgba(223, 184, 121, 0.48);
  box-shadow: 0 0.85rem 2.2rem rgba(0, 0, 0, 0.46);
}

.scroll-modal__loading {
  color: #f6e6bd;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.scroll-modal__content::-webkit-scrollbar {
  width: 13px;
}

.scroll-modal__content::-webkit-scrollbar-track {
  background: rgba(33, 22, 39, 0.72);
  border-left: 1px solid rgba(243, 210, 145, 0.2);
}

.scroll-modal__content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(234, 174, 91, 0.95), rgba(150, 59, 112, 0.95));
  border: 2px solid rgba(27, 18, 32, 0.88);
  border-radius: 999px;
}

.portal-button::before,
.portal-button::after,
.portal-button__frame {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.portal-button::before {
  background:
    linear-gradient(180deg, rgba(255, 243, 214, 0.18) 0%, rgba(255, 243, 214, 0) 24%),
    linear-gradient(90deg, rgba(255, 165, 89, 0.14) 0%, rgba(255, 165, 89, 0) 20%, rgba(208, 112, 222, 0.1) 50%, rgba(255, 165, 89, 0) 80%, rgba(255, 165, 89, 0.14) 100%);
  opacity: 0.95;
}

.portal-button::after {
  inset: 0.3rem;
  border-radius: 1.45rem;
  border: 1px solid rgba(248, 220, 160, 0.14);
  box-shadow: inset 0 0 0 1px rgba(54, 12, 26, 0.72);
}

.portal-button__frame {
  inset: 0.55rem 0.75rem;
  border-radius: 1.15rem;
  border: 1px solid rgba(255, 216, 146, 0.24);
  background:
    linear-gradient(90deg, rgba(255, 195, 104, 0.08) 0%, rgba(255, 195, 104, 0) 18%, rgba(210, 116, 221, 0.08) 50%, rgba(255, 195, 104, 0) 82%, rgba(255, 195, 104, 0.08) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(29, 8, 16, 0.5),
    inset 0 0 1.6rem rgba(255, 127, 60, 0.06);
}

.portal-button:hover,
.portal-button:focus-visible {
  transform: translateY(-0.28rem) scale(1.02);
  border-color: rgba(247, 219, 159, 0.98);
  box-shadow:
    0 1.85rem 3.5rem rgba(0, 0, 0, 0.62),
    0 0 0 0.28rem rgba(122, 43, 109, 0.26),
    0 0 3rem rgba(255, 122, 47, 0.34),
    0 0 2.2rem rgba(203, 113, 221, 0.22),
    inset 0 0.12rem 0 rgba(255, 241, 204, 0.4),
    inset 0 -0.95rem 1.25rem rgba(0, 0, 0, 0.3);
  filter: saturate(1.05);
}

.portal-button:focus-visible {
  outline: none;
}

.portal-button__glow {
  position: absolute;
  inset: -24% -10%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 186, 103, 0.28) 0%, rgba(255, 186, 103, 0.12) 28%, rgba(203, 113, 221, 0.12) 52%, transparent 72%),
    linear-gradient(90deg, rgba(255, 122, 47, 0) 0%, rgba(255, 122, 47, 0.16) 22%, rgba(203, 113, 221, 0.18) 50%, rgba(255, 122, 47, 0.16) 78%, rgba(255, 122, 47, 0) 100%);
  animation: pulse-glow 3.1s ease-in-out infinite;
  opacity: 0.95;
  filter: blur(0.18rem);
}

.portal-button__label {
  position: relative;
  z-index: 1;
  max-width: 18ch;
  font-size: clamp(1.08rem, 1.85vw, 1.7rem);
  line-height: 1.08;
  letter-spacing: 0.12em;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  text-shadow:
    0 0.14rem 0 rgba(0, 0, 0, 0.38),
    0 0 0.7rem rgba(255, 179, 93, 0.26),
    0 0 1rem rgba(203, 113, 221, 0.14);
}

.portal-button__label {
  background: linear-gradient(180deg, #fff7de 0%, #f5d59e 46%, #ddb36f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@keyframes rune-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes drift-wander {
  0% {
    transform: translate3d(var(--drift-x0, -0.08rem), var(--drift-y0, -0.16rem), 0);
  }

  20% {
    transform: translate3d(var(--drift-x1, 0.34rem), var(--drift-y1, -0.2rem), 0);
  }

  38% {
    transform: translate3d(var(--drift-x2, 0.14rem), var(--drift-y2, 0.3rem), 0);
  }

  56% {
    transform: translate3d(var(--drift-x3, -0.28rem), var(--drift-y3, 0.2rem), 0);
  }

  78% {
    transform: translate3d(var(--drift-x4, 0.2rem), var(--drift-y4, -0.32rem), 0);
  }

  100% {
    transform: translate3d(var(--drift-x0, -0.08rem), var(--drift-y0, -0.16rem), 0);
  }
}

@keyframes pulse-glow {
  0% {
    opacity: 0.78;
    transform: scale(0.985);
  }

  50% {
    opacity: 1;
    transform: scale(1.025);
  }

  100% {
    opacity: 0.78;
    transform: scale(0.985);
  }
}

@media (max-width: 700px) {
  .landing-shell {
    padding: 1rem 1rem 5.4rem;
  }

  .background-frame {
    transform: scale(1.08);
    background-position: center center;
    background-image: url('/landing-assets/dcc-bg.png');
    background-image: -webkit-image-set(url('/landing-assets/dcc-bg-960.webp') 1x);
    background-image: image-set(url('/landing-assets/dcc-bg-960.webp') type('image/webp'), url('/landing-assets/dcc-bg.png') type('image/png'));
  }

  .portal-column {
    --portal-width: min(84vw, 21rem);
    margin-top: 8vh;
    gap: 1.15rem;
  }

  .portal-button {
    min-height: 5rem;
    padding: 1rem 1.25rem;
  }

  .lore-button {
    min-height: 5rem;
    border-radius: 1.4rem;
    font-size: clamp(0.98rem, 4vw, 1.25rem);
    letter-spacing: 0.08em;
    padding: 1rem 1.25rem;
  }

  .scroll-modal {
    top: 3vh;
    right: 2.5vw;
    bottom: 3vh;
    left: 2.5vw;
    width: auto;
    max-width: none;
    transform: none;
    border-radius: 1.2rem;
  }

  .scroll-modal__content {
    padding: 1.1rem 1rem 1.25rem;
    line-height: 1.58;
  }

  .ai-philosophy-doc {
    max-width: 100%;
  }

  .lore-library__title {
    margin-bottom: 0.85rem;
  }

  .lore-library__item {
    border-radius: 0.82rem;
    padding: 0.72rem 0.74rem;
  }

  .lore-library__item-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.38rem;
  }

  .lore-library__item-time {
    font-size: 0.64rem;
    padding: 0.2rem 0.5rem;
  }

  .lore-back {
    margin-bottom: 0.82rem;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
  }

  .ai-philosophy-doc h1 {
    font-size: clamp(1.26rem, 5.2vw, 1.64rem);
  }

  .ai-philosophy-doc :is(h2, h3, h4):not(:first-child) {
    padding-top: 0.95rem;
  }

  .ai-philosophy-doc :is(h1, h2, h3, h4) + p::first-letter {
    margin-right: 0.35rem;
    font-size: clamp(1.82rem, 8.6vw, 2.45rem);
  }

  .ai-philosophy-doc p,
  .ai-philosophy-doc li {
    font-size: clamp(0.95rem, 3.6vw, 1.03rem);
    line-height: 1.64;
  }

  .portal-button:hover,
  .portal-button:focus-visible {
    transform: translateY(-0.18rem) scale(1.01);
  }

  .portal-button__label {
    max-width: 15ch;
    font-size: clamp(0.98rem, 4vw, 1.25rem);
    letter-spacing: 0.08em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-button,
  .portal-button__glow,
  .lore-button,
  .lore-button__glow {
    transition: none;
    animation: none;
  }
}

/* Recolor the lore button from cyan to the arcane violet family so both CTAs
   read as one dungeon portal (theme coherence). Overrides the base cyan rules. */
.lore-button {
  border-color: rgba(203, 113, 221, 0.84);
  color: #f3e2ff;
  background:
    radial-gradient(circle at 50% 0%, rgba(203, 113, 221, 0.24) 0%, rgba(203, 113, 221, 0) 34%),
    linear-gradient(135deg, rgba(42, 14, 58, 0.97) 0%, rgba(71, 28, 104, 0.98) 46%, rgba(40, 16, 73, 0.98) 100%);
  box-shadow:
    0 1.5rem 3.2rem rgba(18, 6, 24, 0.56),
    0 0 0 0.22rem rgba(126, 47, 138, 0.24),
    0 0 2.4rem rgba(203, 113, 221, 0.2),
    inset 0 0.12rem 0 rgba(240, 220, 255, 0.34),
    inset 0 -0.95rem 1.25rem rgba(14, 6, 20, 0.46);
}

.lore-button:hover,
.lore-button:focus-visible {
  border-color: rgba(224, 160, 240, 0.95);
  box-shadow:
    0 1.85rem 3.5rem rgba(18, 6, 24, 0.62),
    0 0 0 0.28rem rgba(150, 70, 170, 0.28),
    0 0 3rem rgba(203, 113, 221, 0.3),
    0 0 2.2rem rgba(180, 100, 220, 0.2),
    inset 0 0.12rem 0 rgba(245, 230, 255, 0.4),
    inset 0 -0.95rem 1.25rem rgba(16, 6, 26, 0.3);
}

.lore-button::before {
  background:
    linear-gradient(180deg, rgba(240, 220, 255, 0.2) 0%, rgba(240, 220, 255, 0) 24%),
    linear-gradient(90deg, rgba(203, 113, 221, 0.14) 0%, rgba(203, 113, 221, 0) 20%, rgba(170, 100, 220, 0.1) 50%, rgba(203, 113, 221, 0) 80%, rgba(203, 113, 221, 0.14) 100%);
}

.lore-button::after {
  border-color: rgba(220, 180, 240, 0.18);
  box-shadow: inset 0 0 0 1px rgba(31, 7, 41, 0.74);
}

.lore-button__frame {
  border-color: rgba(214, 170, 240, 0.24);
  background:
    linear-gradient(90deg, rgba(203, 113, 221, 0.08) 0%, rgba(203, 113, 221, 0) 18%, rgba(170, 100, 220, 0.08) 50%, rgba(203, 113, 221, 0) 82%, rgba(203, 113, 221, 0.08) 100%);
  box-shadow: inset 0 0 0 1px rgba(20, 6, 28, 0.52), inset 0 0 1.6rem rgba(203, 113, 221, 0.08);
}

.lore-button__glow {
  background:
    radial-gradient(circle at 50% 50%, rgba(203, 113, 221, 0.3) 0%, rgba(203, 113, 221, 0.13) 28%, rgba(170, 100, 220, 0.12) 52%, transparent 72%),
    linear-gradient(90deg, rgba(203, 113, 221, 0) 0%, rgba(203, 113, 221, 0.17) 22%, rgba(170, 100, 220, 0.18) 50%, rgba(203, 113, 221, 0.17) 78%, rgba(203, 113, 221, 0) 100%);
}

.lore-button__label {
  text-shadow:
    0 0.14rem 0 rgba(0, 0, 0, 0.38),
    0 0 0.7rem rgba(203, 113, 221, 0.28),
    0 0 1rem rgba(170, 100, 220, 0.16);
  background: linear-gradient(180deg, #fbeeff 0%, #e6c4ff 46%, #cf9af7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Real keyboard focus ring (the base rules set outline:none and relied on motion). */
.portal-button:focus-visible,
.lore-button:focus-visible,
.scroll-modal__close:focus-visible {
  outline: 3px solid #ffe4bc;
  outline-offset: 3px;
}

/* Windows High Contrast / forced-colors: restore solid label text and a visible ring. */
@media (forced-colors: active) {
  .portal-button__label,
  .lore-button__label {
    -webkit-text-fill-color: currentColor;
    color: ButtonText;
  }
  .portal-button:focus-visible,
  .lore-button:focus-visible,
  .scroll-modal__close:focus-visible {
    outline: 3px solid CanvasText;
  }
}