/*
 * minisaga.tv: the "Premiere night" look of the Mini Saga app (apps/mobile/src/constants/theme.ts).
 * Velvet curtain, ivory type, gilt for links and the one call to action; Bodoni Moda for titles.
 * Fonts are self-hosted: the site loads nothing from other companies (see the Privacy Policy).
 */

@font-face {
  font-family: 'Bodoni Moda';
  src: url('/fonts/BodoniModa-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Bodoni Moda';
  src: url('/fonts/BodoniModa-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --curtain: #160a0f;
  --velvet: #22101a;
  --plush: #331824;
  --ivory: #f5ece1;
  --ivory-soft: rgb(245 236 225 / 86%);
  --dust: #b7a39c;
  --gilt: #e2b866;
  --hairline: rgb(245 236 225 / 14%);
  --display: 'Bodoni Moda', 'Bodoni 72', Didot, Georgia, serif;
  --text:
    -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, 'Segoe UI', Roboto, sans-serif;
  --gutter: clamp(16px, 5vw, 48px);
}

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

html {
  background: var(--curtain);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background: var(--curtain);
  color: var(--ivory);
  font: 17px/1.65 var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
.logline,
.pitch {
  text-wrap: balance;
}

a {
  color: var(--gilt);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--gilt);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Inner pages: a slim masthead with the wordmark, and a colophon. */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 18px var(--gutter);
  border-bottom: 1px solid var(--hairline);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ivory);
  font: italic 400 1.55rem/1.3 var(--display);
  text-decoration: none;
}

/* The logo is an app icon: iOS-style rounded square with a hairline edge. */
.brand img,
.app-icon {
  border-radius: 22.5%;
  box-shadow: 0 0 0 1px var(--hairline);
}

.masthead nav,
.colophon nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.masthead nav a,
.colophon a {
  color: var(--dust);
  font-size: 0.95rem;
  text-decoration: none;
}

.masthead nav a:hover,
.colophon a:hover,
.masthead nav a[aria-current='page'] {
  color: var(--ivory);
}

.masthead nav a[aria-current='page'] {
  text-decoration: underline;
  text-decoration-color: var(--gilt);
}

/* Phones: keep the logo, wordmark and links on one line. */
@media (max-width: 430px) {
  .masthead {
    column-gap: 16px;
  }

  .brand {
    gap: 10px;
    font-size: 1.35rem;
  }

  .brand img {
    width: 28px;
    height: 28px;
  }

  .masthead nav {
    column-gap: 14px;
  }
}

.colophon {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 28px var(--gutter) 36px;
  border-top: 1px solid var(--hairline);
  color: var(--dust);
  font-size: 0.9rem;
}

.colophon p {
  margin: 0;
}

/* Long-form documents: Terms, Privacy, Support. */

.doc {
  flex: 1;
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  padding: 48px var(--gutter) 88px;
}

.doc h1 {
  margin: 0 0 8px;
  font: 700 clamp(2.25rem, 7vw, 3.1rem) / 1.22 var(--display);
  letter-spacing: -0.01em;
}

.doc h2 {
  margin: 56px 0 12px;
  font: 700 1.45rem/1.32 var(--display);
  scroll-margin-top: 24px;
}

.doc h3 {
  margin: 32px 0 8px;
  font-size: 1.05rem;
  font-weight: 600;
}

.doc p,
.doc li {
  color: var(--ivory-soft);
}

.doc strong {
  color: var(--ivory);
}

.doc ul,
.doc ol {
  padding-left: 1.3rem;
}

.doc li + li {
  margin-top: 6px;
}

.doc a {
  overflow-wrap: anywhere;
}

.meta {
  margin: 0 0 36px;
  color: var(--dust);
  font-size: 0.95rem;
}

.doc .lead {
  color: var(--ivory);
  font-size: 1.15rem;
}

.doc .in-short {
  color: var(--dust);
  font-style: italic;
}

/* Disclaimers must be conspicuous: set apart with weight and a gilt rule instead of capitals. */
.doc .caps {
  padding-left: 16px;
  border-left: 2px solid var(--gilt);
  color: var(--ivory);
  font-weight: 600;
}

.table-wrap {
  margin: 16px 0;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  padding: 10px;
  border: 1px solid var(--hairline);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--dust);
  font-weight: 600;
}

address {
  color: var(--dust);
  font-style: normal;
}

/*
 * Landing: a premiere marquee. Curtain folds and a spotlight from above; the spotlight coming up
 * and the title settling in are the page's one moment of motion.
 */

.premiere {
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  background: linear-gradient(180deg, var(--plush) 0%, var(--velvet) 40%, var(--curtain) 100%);
}

.premiere::before,
.premiere::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.premiere::before {
  background: repeating-linear-gradient(
    90deg,
    rgb(0 0 0 / 0%) 0,
    rgb(0 0 0 / 30%) 2.6rem,
    rgb(245 236 225 / 3%) 4.4rem,
    rgb(0 0 0 / 0%) 5.6rem
  );
  mask-image: linear-gradient(180deg, #000 0%, transparent 75%);
}

.premiere::after {
  background: radial-gradient(
    ellipse 62% 58% at 50% -8%,
    rgb(226 184 102 / 26%) 0%,
    rgb(226 184 102 / 8%) 45%,
    transparent 72%
  );
  animation: spotlight 1.8s ease-out both;
}

.marquee {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px var(--gutter) 64px;
  text-align: center;
}

.app-icon {
  width: clamp(88px, 24vw, 112px);
  height: auto;
  margin-bottom: 28px;
  box-shadow:
    0 0 0 1px var(--hairline),
    0 18px 48px rgb(0 0 0 / 50%),
    0 0 64px rgb(226 184 102 / 12%);
  animation: rise 1.1s 0.15s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.wordmark {
  margin: 0;
  font: 700 clamp(3.6rem, 17vw, 8.75rem) / 1.16 var(--display);
  letter-spacing: -0.025em;
  animation: settle 1.4s 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.wordmark::after {
  content: '';
  display: block;
  width: 56px;
  height: 1px;
  margin: 20px auto 24px;
  background: var(--gilt);
}

.logline {
  margin: 0 0 16px;
  font: italic 400 clamp(1.35rem, 4.6vw, 1.85rem) / 1.35 var(--display);
}

.pitch {
  max-width: 30rem;
  margin: 0 0 36px;
  color: var(--dust);
  font-size: 1.05rem;
}

/* Until the app is live this is a notice, not a link; then it becomes Apple's official badge. */
.release {
  margin: 0;
  padding: 12px 24px;
  border: 1px solid rgb(226 184 102 / 55%);
  border-radius: 999px;
  color: var(--gilt);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.also {
  margin: 20px 0 0;
  color: var(--dust);
  font-size: 0.92rem;
}

.premiere .colophon {
  border-top-color: transparent;
}

@keyframes spotlight {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@keyframes settle {
  from {
    opacity: 0;
    letter-spacing: 0.04em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .premiere::after,
  .app-icon,
  .wordmark {
    animation: none;
  }
}
