/* Theme readability, living sunset, night stars, animated logo, exercises. */

.brand.is-logo > span,
.footer-brand.is-logo > span {
  display: none !important;
}

.brand.is-logo,
.footer-brand.is-logo {
  gap: 0;
}

.brand-logo {
  width: 7rem;
  max-width: 100%;
  min-width: 0;
  height: auto;
  overflow: visible;
  flex: 0 1 auto;
  display: block;
}

@media (min-width: 640px) {
  .brand .brand-logo {
    width: 9rem;
  }
}

@media (min-width: 1024px) {
  .brand .brand-logo {
    width: 10rem;
  }
}

.footer-brand .brand-logo {
  width: 5.5rem;
}

.header-inner {
  padding: 0.35rem 0;
  min-width: 0;
}

.brand {
  min-width: 0;
}

@media (max-width: 979px) {
  .header-actions > a.btn {
    display: none;
  }

  .brand {
    flex: 0 1 7rem;
    min-width: 0;
    max-width: 7rem;
  }

  .brand .brand-logo {
    width: 100%;
    max-width: 100%;
  }
}

.hero,
.hero-grid,
.page-hero,
.wrap {
  max-width: 100%;
}

.site-footer,
main {
  position: relative;
  z-index: 1;
}

.eyebrow {
  color: var(--ink);
  background: color-mix(in srgb, var(--card) 90%, transparent);
  border-color: var(--line);
}

html[data-theme="night"] .eyebrow,
html[data-theme="sunset"] .eyebrow {
  color: #fff7ee;
  background: rgba(12, 8, 14, 0.62);
  border-color: rgba(255, 214, 170, 0.5);
}

html[data-theme="night"] .hero-lead,
html[data-theme="night"] .page-hero .lead,
html[data-theme="night"] .kicker,
html[data-theme="night"] .muted {
  color: #f6e4d4;
}

html[data-theme="night"] .hero h1,
html[data-theme="night"] .page-hero h1,
html[data-theme="night"] h2,
html[data-theme="night"] h3 {
  color: #fff8f2;
}

html[data-theme="cool"] .eyebrow {
  color: #0b1b2b;
  background: rgba(255, 255, 255, 0.88);
}

html[data-theme="warm"] .eyebrow {
  color: #3a241c;
  background: rgba(255, 250, 245, 0.9);
}

html[data-theme="night"] .hero h1 em,
html[data-theme="sunset"] .hero h1 em {
  background: linear-gradient(120deg, #ffe7a8 0%, #fff6ea 42%, #ffc1d0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.btn-gold,
.btn-gold:hover {
  color: #2a1a12 !important;
}

html[data-theme="night"] {
  color-scheme: dark;
}

html[data-theme="night"] body {
  background:
    radial-gradient(ellipse at 78% -8%, rgba(120, 64, 36, 0.42), transparent 46%),
    radial-gradient(ellipse at 6% 100%, rgba(48, 28, 72, 0.38), transparent 42%),
    #100e16;
}

html[data-theme="night"] .hero,
html[data-theme="night"] .page-hero {
  background: linear-gradient(180deg, rgba(16, 14, 22, 0.18), rgba(16, 14, 22, 0.62));
}

.night-sky {
  display: none;
}

html[data-theme="night"] .night-sky {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.night-sky .star {
  position: absolute;
  width: var(--s, 1.6px);
  height: var(--s, 1.6px);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 2px rgba(255, 248, 236, 0.35);
  opacity: var(--o, 0.55);
  transform: none;
  animation: star-twinkle var(--d, 7s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.night-sky .star::before,
.night-sky .star::after {
  content: none;
  display: none;
}

.night-sky .star.still {
  animation: none;
}

.night-sky .star.soft {
  animation-name: star-twinkle-soft;
}

.night-sky .star.warm {
  background: #ffe7bf;
}

.night-showers {
  display: none;
}

html[data-theme="night"] .night-showers {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.night-showers .meteor {
  position: absolute;
  width: 140px;
  height: var(--thick, 1.8px);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 236, 210, 0.28) 16%, rgba(255, 252, 246, 0.9) 58%, #fff 100%);
  box-shadow: 0 0 8px rgba(255, 248, 236, 0.72);
  transform-origin: 100% 50%;
  will-change: transform, opacity;
}

.night-showers .meteor::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: calc(var(--thick, 1.8px) * 2.2);
  height: calc(var(--thick, 1.8px) * 2.2);
  border-radius: 50%;
  background: #fff;
  transform: translate(25%, -50%);
  box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.8);
}

.footer-mail {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
}

.site-footer .footer-mail a {
  display: inline;
  padding: 0;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.site-footer .footer-mail a:hover {
  color: var(--cyan-bright);
}

@keyframes star-twinkle {
  0%,
  100% {
    opacity: 0.32;
    transform: none;
  }
  50% {
    opacity: 0.75;
    transform: none;
  }
}

@keyframes star-twinkle-soft {
  0%,
  100% {
    opacity: 0.4;
    transform: none;
  }
  50% {
    opacity: 0.6;
    transform: none;
  }
}

html[data-theme="sunset"] {
  color-scheme: dark;
  --cyan: #ffc48a;
  --cyan-bright: #ffe08a;
  --deep: #ffe3b5;
  --gold: #ffd36a;
  --ink: #fff8f1;
  --ink-soft: #f6dcc8;
  --mist: transparent;
  --white: rgba(52, 18, 28, 0.8);
  --card: rgba(48, 16, 28, 0.8);
  --line: rgba(255, 198, 140, 0.38);
  --shadow: 0 18px 50px rgba(40, 8, 16, 0.38);
  --header: rgba(28, 10, 22, 0.72);
  --nav-hover: rgba(255, 176, 96, 0.18);
  --band: rgba(36, 12, 24, 0.78);
  --band-fg: #fff6ea;
  --footer-bg: #1a0c16;
  --footer-fg: #ffe8d4;
  --bubble1: rgba(255, 196, 140, 0.22);
  --bubble2: rgba(255, 150, 110, 0.22);
  --bubble3: rgba(255, 120, 150, 0.2);
  --bubble4: rgba(255, 214, 120, 0.22);
  --try: linear-gradient(135deg, rgba(255, 176, 90, 0.22), rgba(255, 90, 70, 0.16));
  --grad: linear-gradient(120deg, #ffb15a 0%, #ff6a45 46%, #d64578 100%);
  --grad-soft: linear-gradient(160deg, rgba(255, 176, 90, 0.28), rgba(214, 69, 120, 0.16));
  --grad-hero: transparent;
}

html[data-theme="sunset"] body {
  background: transparent;
  color: var(--ink);
}

html[data-theme="sunset"]::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 55% at 50% 108%, rgba(255, 214, 120, 0.95) 0%, rgba(255, 112, 48, 0.55) 32%, transparent 64%),
    radial-gradient(ellipse 42% 32% at 6% 16%, rgba(255, 86, 42, 0.72), transparent 70%),
    radial-gradient(ellipse 38% 30% at 98% 6%, rgba(232, 64, 138, 0.66), transparent 72%),
    radial-gradient(ellipse 46% 36% at 78% 62%, rgba(255, 150, 60, 0.42), transparent 70%),
    radial-gradient(ellipse 34% 28% at 18% 74%, rgba(180, 40, 120, 0.4), transparent 72%),
    linear-gradient(180deg, #160818 0%, #4a1240 22%, #a42848 48%, #e85a28 72%, #ffb45a 100%);
  background-size: 140% 130%, 170% 170%, 160% 160%, 180% 180%, 170% 170%, 100% 150%;
  animation: sunset-shift 12s ease-in-out infinite alternate;
}

html[data-theme="sunset"]::after {
  content: "";
  position: fixed;
  z-index: -2;
  left: 58%;
  bottom: 2vh;
  width: min(34rem, 96vw);
  height: min(34rem, 96vw);
  translate: -50% 0;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, #fff8d4 0%, #ffd36a 16%, #ff7a32 40%, rgba(255, 70, 40, 0.45) 58%, transparent 72%);
  filter: blur(0.4px);
  animation: sunset-sun 9s ease-in-out infinite alternate;
}

html[data-theme="sunset"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(14, 4, 18, 0.42) 0%, rgba(22, 6, 16, 0.2) 46%, rgba(40, 10, 8, 0.08) 100%);
}

html[data-theme="sunset"] .hero,
html[data-theme="sunset"] .page-hero {
  background: transparent;
}

html[data-theme="sunset"] .hero-lead,
html[data-theme="sunset"] .page-hero .lead,
html[data-theme="sunset"] .kicker,
html[data-theme="sunset"] .muted,
html[data-theme="sunset"] .card p,
html[data-theme="sunset"] .prose p,
html[data-theme="sunset"] .prose li {
  color: #ffe8d6;
}

html[data-theme="sunset"] .hero h1,
html[data-theme="sunset"] .page-hero h1,
html[data-theme="sunset"] h2,
html[data-theme="sunset"] h3,
html[data-theme="sunset"] .card h3,
html[data-theme="sunset"] .prose strong {
  color: #fff8f1;
}

html[data-theme="sunset"] .nav-desktop a,
html[data-theme="sunset"] .brand {
  color: #fff1e4;
}

html[data-theme="sunset"] .nav-desktop a:hover,
html[data-theme="sunset"] .nav-desktop a[aria-current="page"] {
  color: #fff6d8;
}

html[data-theme="night"] .orbit,
html[data-theme="sunset"] .orbit {
  background:
    radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.16), transparent 55%),
    linear-gradient(145deg, rgba(255, 170, 90, 0.28), rgba(80, 20, 50, 0.28));
  border-color: rgba(255, 255, 255, 0.22);
}

@keyframes sunset-shift {
  0% {
    background-position: 0 8%, 0% 10%, 100% 0%, 70% 50%, 10% 80%, 0 0;
    filter: saturate(1) hue-rotate(0deg);
  }
  50% {
    background-position: 8% -6%, 22% 0%, 70% 12%, 40% 70%, 30% 50%, 0 22%;
    filter: saturate(1.35) hue-rotate(-18deg);
  }
  100% {
    background-position: -6% 16%, 8% 18%, 78% 4%, 90% 40%, 0% 66%, 0 42%;
    filter: saturate(1.2) hue-rotate(18deg);
  }
}

@keyframes sunset-sun {
  0% {
    transform: translateY(28px) scale(0.94);
    opacity: 0.88;
  }
  100% {
    transform: translateY(-72px) scale(1.14);
    opacity: 1;
  }
}

.bt-logo {
  overflow: visible;
}

.bt-logo .bt-mark {
  isolation: isolate;
  filter: drop-shadow(0 8px 14px rgba(14, 79, 166, 0.22));
}

html[data-theme="warm"] .bt-logo .bt-right,
html[data-theme="cool"] .bt-logo .bt-right {
  mix-blend-mode: multiply;
}

html[data-theme="night"] .bt-logo .bt-mark,
html[data-theme="sunset"] .bt-logo .bt-mark {
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35));
}

.bt-logo .bt-left,
.bt-logo .bt-right,
.bt-logo .bt-bubble,
.bt-logo .bt-flash,
.bt-logo .bt-word {
  transform-box: fill-box;
  transform-origin: center;
}

.bt-logo-wait .bt-left,
.bt-logo-wait .bt-right,
.bt-logo-wait .bt-bubble,
.bt-logo-wait .bt-word,
.bt-logo-wait .bt-flash {
  opacity: 0;
}

.bt-logo-play .bt-left {
  animation: bt-arrive-left 0.78s cubic-bezier(0.22, 0.9, 0.28, 1) both;
}

.bt-logo-play .bt-right {
  animation: bt-arrive-right 0.78s cubic-bezier(0.22, 0.9, 0.28, 1) both;
}

.bt-logo-play .bt-flash {
  animation: bt-flash 0.42s 0.62s ease-out both;
}

.bt-logo-play .bt-bubble {
  animation: bt-pop 0.58s 0.72s cubic-bezier(0.18, 1.4, 0.28, 1) both;
}

.bt-logo-play .bt-word {
  animation: bt-fade-up 0.5s 1.08s ease both;
}

.bt-logo-static .bt-left,
.bt-logo-static .bt-right,
.bt-logo-static .bt-bubble,
.bt-logo-static .bt-word {
  opacity: 1;
}

.bt-logo-static .bt-flash {
  opacity: 0;
}

.bt-bubble-shake {
  animation: bt-bubble-shake 1.85s ease-in-out infinite;
}

.bt-logo-play .bt-bubble.bt-bubble-shake {
  animation:
    bt-pop 0.58s 0.72s cubic-bezier(0.18, 1.4, 0.28, 1) both,
    bt-bubble-shake 1.85s 1.4s ease-in-out infinite;
}

@keyframes bt-bubble-shake {
  0%,
  100% {
    transform: rotate(0deg) translate(0, 0);
  }
  18% {
    transform: rotate(-8deg) translate(-1.5px, 1px);
  }
  36% {
    transform: rotate(7deg) translate(1.5px, -1px);
  }
  54% {
    transform: rotate(-6deg) translate(1px, 1.5px);
  }
  72% {
    transform: rotate(5deg) translate(-1px, 0);
  }
}

@keyframes bt-arrive-left {
  0% {
    transform: translateX(-62px);
    opacity: 0;
  }
  58% {
    transform: translateX(7px);
    opacity: 1;
  }
  72% {
    transform: translateX(-2px) scale(0.9, 1.1);
  }
  100% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

@keyframes bt-arrive-right {
  0% {
    transform: translateX(62px);
    opacity: 0;
  }
  58% {
    transform: translateX(-7px);
    opacity: 1;
  }
  72% {
    transform: translateX(2px) scale(0.9, 1.1);
  }
  100% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

@keyframes bt-flash {
  0% {
    opacity: 0;
    transform: scale(0.2);
  }
  35% {
    opacity: 0.85;
    transform: scale(1.15);
  }
  100% {
    opacity: 0;
    transform: scale(2.4);
  }
}

@keyframes bt-pop {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.15);
  }
  68% {
    opacity: 1;
    transform: translateY(-5px) scale(1.14);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes bt-fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.play-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 800px) {
  .play-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.play-card h3 {
  margin: 0 0 0.35rem;
}

.play-card .play-kicker {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.choice-row,
.play-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.9rem;
}

.choice,
.play-actions button,
.play-card button {
  font: inherit;
  cursor: pointer;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font-size: 0.88rem;
  font-weight: 650;
}

.choice[aria-pressed="true"],
.play-card button.primary {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
}

.play-card textarea,
.play-card input[type="text"] {
  width: 100%;
  margin-top: 0.75rem;
  font: inherit;
  color: var(--ink);
  background: color-mix(in srgb, var(--card) 70%, #000 8%);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
}

.play-out {
  margin-top: 0.9rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: var(--try);
  border: 1px solid var(--line);
  color: var(--ink);
}

.play-out[hidden] {
  display: none;
}

.flow-time {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin: 0.6rem 0 0.2rem;
}

.pause-orb {
  width: 92px;
  height: 92px;
  margin: 0.8rem 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--ink);
  background:
    radial-gradient(circle at 40% 35%, rgba(255, 255, 255, 0.35), transparent 46%),
    var(--grad);
  box-shadow: var(--shadow);
}

.pause-orb span {
  color: #fff;
}

.spark-board p {
  margin: 0.35rem 0;
}

@media (prefers-reduced-motion: reduce) {
  .night-sky .star,
  html[data-theme="sunset"]::before,
  html[data-theme="sunset"]::after,
  .bt-logo-play .bt-left,
  .bt-logo-play .bt-right,
  .bt-logo-play .bt-bubble,
  .bt-logo-play .bt-word,
  .bt-logo-play .bt-flash,
  .bt-bubble-shake {
    animation: none !important;
  }
}
