/* ===============================================
   RESET
   =============================================== */

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

* {
  margin: 0;
  padding: 0;
}

* {
  min-width: 0;
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'JetBrains Mono', monospace;
}

html {
  overscroll-behavior: contain;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-smooth: always;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.1;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
}

img, picture, video, canvas, svg, embed, iframe, object, audio {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

ul, ol {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* ===============================================
   FONTS
   =============================================== */

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../Source/Font/JetBrainsMono-2.304/fonts/webfonts/JetBrainsMono-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../Source/Font/JetBrainsMono-2.304/fonts/webfonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ===============================================
   HEADER / FOOTER BREAKPOINT SWITCH
   =============================================== */

.header-d-wrap,
.header-p-wrap,
.footer-d-wrap,
.footer-p-wrap {
  width: 100%;
  flex-shrink: 0;
}

.header-p-wrap,
.footer-p-wrap {
  display: none;
}

.headerc-d-logo img,
.headerc-p-logo img {
  max-width: none;
  height: 148%;
}

/* ===============================================
   LAYOUT
   =============================================== */

html, body {
  height: 100%;
}

body {
  background: #090909;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100vh;
  height: 100svh;
}

.kd-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 32px;
  padding: 36px 150px;
  box-sizing: border-box;
  overflow: hidden;
}

.kd-page-title {
  flex-shrink: 0;
  width: 100%;
  font-weight: 700;
  font-size: 40px;
  color: #3d0018;
  text-shadow: 0px 1px 1px rgba(0, 255, 146, 0.5);
}

/* Desktop: the page holds the sentence and the 3 / 6 switch, centred as one group.
   (The scroll wrapper only really scrolls on a phone - see the media query.) */
.kd-scroll-outer {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  position: relative;
}

.kd-scroll-inner {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  height: 100%;
}

.kd-scroll-wrap {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.kd-scroll-wrap::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.kd-scroll-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 90px;
  min-height: 100%;
  width: 100%;
}

.kd-scrollbar-track {
  display: none;
}

.kd-subtitle-d {
  width: 100%;
  font-weight: 400;
  font-size: 30px;
  color: #cdcdcd;
}

.kd-subtitle-p {
  display: none;
  width: 100%;
  flex-direction: column;
  text-align: center;
  font-weight: 400;
  font-size: 20px;
  color: #cdcdcd;
}

.kd-subtitle-p span {
  display: block;
}

.kd-subtitle-p span:first-child {
  margin-bottom: 3px;
  letter-spacing: 4.8px;
}

/* ===============================================
   3 / 6 CHOICES SWITCH
   =============================================== */

.kd-pick {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.kd-choice {
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 50px;
}

.kd-opt {
  font-family: inherit;
  font-weight: 700;
  font-size: 30px;
  line-height: 1.1;
  white-space: nowrap;
  color: #cdcdcd;
  opacity: 0.5;
  transition: opacity 0.2s ease, text-shadow 0.2s ease;
}

.kd-opt.is-active {
  opacity: 1;
  text-shadow: 0px 2px 2px #00ff92;
}

.kd-switch:focus-visible,
.kd-next:focus-visible {
  outline: 2px solid #00ff92;
  outline-offset: 6px;
}

/* Black box 2:1, green square with an equal gap (1/6 of the height) all round. */
.kd-switch {
  position: relative;
  flex-shrink: 0;
  width: 120px;
  height: 60px;
  padding: 0;
  background: #000000;
  border: none;
  box-shadow: 0px 5px 5px rgba(0, 255, 146, 0.25);
  cursor: pointer;
}

.kd-knob {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 40px;
  height: 40px;
  background: #00ff92;
  transition: transform 0.2s ease;
}

/* 6 choices selected: the green box slides to the other end. */
.kd-switch[aria-checked="false"] .kd-knob {
  transform: translateX(60px);
}

.kd-next {
  font-family: inherit;
  font-weight: 700;
  font-size: 40px;
  line-height: 1.1;
  text-decoration: none;
  color: #00ff92;
  text-shadow: 2px 2px 2px #cdcdcd;
}

@media (prefers-reduced-motion: reduce) {
  .kd-knob,
  .kd-opt {
    transition: none;
  }
}

/* ===============================================
   RESPONSIVE - PHONE (max-width: 768px)
   =============================================== */
@media (max-width: 768px) {

  .header-d-wrap,
  .footer-d-wrap {
    display: none;
  }

  .header-p-wrap,
  .footer-p-wrap {
    display: block;
  }

  .kd-body {
    gap: 46px;
    padding: 36px 20px;
  }

  .kd-page-title {
    font-size: 30px;
  }

  .kd-scroll-inner {
    gap: 6px;
  }

  /* No scrolling on a phone: the sentence and the switch fit on the screen. */
  .kd-scroll-wrap {
    overflow-y: hidden;
  }

  .kd-scroll-col {
    justify-content: center;
    gap: 40px;
    padding: 0;
    box-sizing: border-box;
  }

  /* Same guide-text style as Knight Card: 16px, left-aligned, wraps. */
  .kd-subtitle-d {
    font-size: 16px;
    line-height: 1.3;
    text-align: left;
  }

  /* Same row as on desktop, a little smaller. */
  .kd-pick {
    gap: 30px;
  }

  .kd-choice {
    gap: 12px;
  }

  .kd-opt {
    font-size: clamp(13px, 4.8vw, 20px);
  }

  .kd-switch {
    width: 80px;
    height: 40px;
  }

  .kd-knob {
    top: 6.67px;
    left: 6.67px;
    width: 26.67px;
    height: 26.67px;
  }

  .kd-switch[aria-checked="false"] .kd-knob {
    transform: translateX(40px);
  }

  .kd-next {
    font-size: 30px;
  }
}
