@font-face {
  font-family: "Black Mango";
  src: url("fonts/BlackMango-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --sandlight: #e3cba0;
  --featherdust: #ffebf0;
  --horizon-glow: #f09515;
  --near-black: #1d1d1d;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 4vw, 3rem);
  padding-top: max(clamp(1.25rem, 4vw, 3rem), env(safe-area-inset-top));
  padding-bottom: max(clamp(1.25rem, 4vw, 3rem), env(safe-area-inset-bottom));
  position: relative;
  font-family: "Raleway", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--featherdust);
  background: linear-gradient(135deg, #1d1d1d 0%, #49329b 26%, #78142c 50%, #ba5b2c 72%, #49329b 88%, #1d1d1d 100%);
  background-size: 300% 300%;
  animation: drift 20s ease-in-out infinite;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--featherdust);
  outline-offset: 4px;
}

@keyframes drift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.orb {
  position: fixed;
  width: 42vmin;
  height: 42vmin;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

.orb1 { top: -10vmin; left: -8vmin; animation: orb1 17s ease-in-out infinite; }
.orb2 { top: -6vmin; right: -10vmin; animation: orb2 21s ease-in-out infinite; }
.orb3 { bottom: -12vmin; left: -6vmin; animation: orb3 23s ease-in-out infinite; }
.orb4 { bottom: -8vmin; right: -8vmin; animation: orb4 19s ease-in-out infinite; }

@keyframes orb1 {
  0%, 100% { transform: translate(0, 0) scale(1); background: #49329b; }
  33% { transform: translate(7vw, 5vh) scale(1.2); background: #78142c; }
  66% { transform: translate(3vw, -4vh) scale(0.9); background: #ba5b2c; }
}

@keyframes orb2 {
  0%, 100% { transform: translate(0, 0) scale(1); background: #ba5b2c; }
  33% { transform: translate(-6vw, 6vh) scale(1.15); background: #f09515; }
  66% { transform: translate(-2vw, -5vh) scale(0.95); background: #78142c; }
}

@keyframes orb3 {
  0%, 100% { transform: translate(0, 0) scale(1); background: #78142c; }
  33% { transform: translate(5vw, -5vh) scale(1.1); background: #49329b; }
  66% { transform: translate(-3vw, 3vh) scale(1.25); background: #f09515; }
}

@keyframes orb4 {
  0%, 100% { transform: translate(0, 0) scale(1); background: #f09515; }
  33% { transform: translate(-5vw, -4vh) scale(0.9); background: #ba5b2c; }
  66% { transform: translate(-2vw, 5vh) scale(1.2); background: #49329b; }
}

.stage {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1080px, 100%);
  height: 100%;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "text" "img";
  gap: clamp(0.75rem, 2vh, 1.75rem);
  align-items: center;
  text-align: center;
}

.cover {
  grid-area: img;
  min-height: 0;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cover-art {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 460px);
  max-height: 100%;
  aspect-ratio: 1035 / 1600;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

.outline-base,
.outline-mask {
  fill: none;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: none;
}

.outline-base {
  stroke: rgba(29, 29, 29, 0.45);
  stroke-width: 8;
}

.outline-mask {
  stroke: #fff;
  stroke-width: 5;
}

@property --outline-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.outline-gradient {
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: repeating-conic-gradient(
    from var(--outline-angle),
    #f09515 0deg,
    #ffebf0 12deg,
    #49329b 24deg,
    #e3cba0 36deg,
    #ba5b2c 48deg,
    #f09515 60deg
  );
  animation: outline-orbit 8s linear infinite;
  animation-delay: var(--orbit-delay);
}

@keyframes outline-orbit {
  from { --outline-angle: 0deg; }
  to { --outline-angle: 360deg; }
}

@media (max-width: 360px) {
  .outline-base {
    stroke-width: 11;
  }

  .outline-mask {
    stroke-width: 7.5;
  }
}

.fragment {
  fill: transparent;
  stroke: transparent;
  stroke-width: 1;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  pointer-events: all;
  cursor: pointer;
  outline: none;
  transition: fill 180ms ease, stroke 180ms ease;
}

.fragment:focus-visible {
  fill: rgba(240, 149, 21, 0.16);
  stroke: var(--featherdust);
  stroke-width: 2.5;
}

/* Touch browsers can retain :hover after a tap; only mouse-like pointers use it. */
@media (hover: hover) and (pointer: fine) {
  .fragment:hover {
    fill: rgba(240, 149, 21, 0.1);
  }
}

.text {
  grid-area: text;
  min-width: 0;
}

.headline {
  font-family: "Black Mango", Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(2rem, 6vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: 0.01em;
  margin-bottom: clamp(0.7rem, 2vh, 1.15rem);
  background: linear-gradient(90deg, #f09515 0%, #e3cba0 55%, #ffebf0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.text p {
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  line-height: 1.55;
  max-width: 44ch;
  margin: 0 auto 0.55rem;
}

.text p:last-of-type {
  color: var(--sandlight);
  margin-bottom: 0;
}

.newsletter-link {
  display: inline-block;
  font-weight: 600;
  font-size: 0.9em;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--featherdust);
  text-decoration: none;
  padding: 0.4em 0.95em;
  border-radius: 999px;
  background: linear-gradient(135deg, #f09515 0%, #ba5b2c 55%, #78142c 100%);
  box-shadow: 0 6px 16px rgba(120, 20, 44, 0.4);
}

.fragment-dialog {
  width: min(40rem, calc(100% - 2rem));
  max-width: none;
  max-height: calc(100% - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  border: 1px solid rgba(227, 203, 160, 0.45);
  border-radius: 16px;
  background: var(--near-black);
  color: var(--featherdust);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.fragment-dialog[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fragment-dialog::backdrop {
  background: rgba(10, 8, 17, 0.82);
}

.dialog-navigation {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  flex-shrink: 0;
  padding: 0.75rem clamp(0.75rem, 3vw, 1.5rem);
  border-bottom: 1px solid rgba(227, 203, 160, 0.2);
}

.navigation-button,
.close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  min-width: 44px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--sandlight);
}

.navigation-button {
  padding: 0.5rem;
  font-size: 0.875rem;
}

#previous-fragment { justify-self: start; }
#next-fragment { justify-self: end; }

.navigation-button:hover,
.close-button:hover {
  background: rgba(227, 203, 160, 0.1);
  color: var(--featherdust);
}

.dialog-content {
  min-height: 0;
  padding: clamp(1.5rem, 5vw, 3rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--sandlight) var(--near-black);
}

.dialog-content h2 {
  font-family: "Black Mango", Georgia, "Times New Roman", serif;
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  font-weight: 400;
  line-height: 1.1;
  color: var(--sandlight);
  margin-bottom: 1.25rem;
}

.dialog-content h2:focus {
  outline: none;
}

.dialog-content p {
  font-size: 1rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.dialog-content .demo-note {
  margin-top: 1.75rem;
  font-size: 0.8125rem;
  color: var(--sandlight);
}

.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
  padding: 1rem clamp(1.5rem, 5vw, 3rem);
  border-top: 1px solid rgba(227, 203, 160, 0.2);
}

.fragment-count {
  flex-shrink: 0;
  color: var(--sandlight);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.dialog-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 44px;
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  background: var(--sandlight);
  color: var(--near-black);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.dialog-link:hover {
  background: var(--featherdust);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 820px), (min-width: 600px) and (orientation: landscape) {
  .stage {
    width: min(1360px, 100%);
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "img text";
    gap: clamp(1.5rem, 5vw, 5.5rem);
    text-align: left;
  }

  .cover {
    justify-content: flex-start;
  }

  .cover-art {
    max-width: min(100%, 620px);
  }

  .text p {
    margin-left: 0;
    margin-right: 0;
  }

}

@media (prefers-reduced-motion: reduce) {
  body,
  .orb {
    animation: none;
  }

  .fragment {
    transition: none;
  }
}
