/* Bookspire – colours and fonts as in the app (src/constants/theme.ts). */

@font-face {
  font-family: 'Fraunces';
  src: url('fonts/Fraunces-SoftSemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('fonts/Fraunces-SoftExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('fonts/Nunito-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('fonts/Nunito-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}

:root {
  --text: #3a3226;
  --text-secondary: #6e6253;
  --heading: #2f5d50;
  --background: #faf6ee;
  --card: #fffdf8;
  --surface: #f1e7d3;
  --shadow: #e6dcc8;
  --primary: #2f5d50;
  --on-primary: #fffdf8;
  --primary-shadow: #1f4036;
  /* Brass dark enough to read as text on the light background. */
  --brass-text: #7a5e10;
  --leaf: #7db46c;
  --brass: #c9a227;
  --placeholder: #f6e7b8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #f3ebdd;
    --text-secondary: #b9ae9c;
    --heading: #a9d4a0;
    --background: #1e2420;
    --card: #2a322c;
    --surface: #3a443c;
    --shadow: #141815;
    --primary: #7db46c;
    --on-primary: #1e2420;
    --primary-shadow: #4e7a44;
    --brass-text: #c9a227;
    --placeholder: #4a3f1c;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: 'Nunito', Verdana, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

a {
  color: var(--heading);
  font-weight: 800;
  text-underline-offset: 3px;
}

h1,
h2,
h3 {
  font-family: 'Fraunces', Georgia, serif;
  color: var(--heading);
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  font-weight: 800;
  font-size: clamp(2.2rem, 7vw, 3.4rem);
  margin: 0 0 0.75rem;
}

h2 {
  font-weight: 800;
  font-size: 1.6rem;
  margin: 2.5rem 0 0.75rem;
}

h3 {
  font-weight: 600;
  font-size: 1.2rem;
  margin: 1.75rem 0 0.5rem;
}

.wrap {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.narrow {
  max-width: 44rem;
}

/* Header and footer */

.site-header {
  padding: 1.25rem 0;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--heading);
}

.brand img {
  width: 2.5rem;
  height: 2.5rem;
}

/* The switch to the same page in the other language. */
.lang {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 3px 0 var(--shadow);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-footer {
  margin-top: 4rem;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--shadow);
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

/* Landing page */

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

.home main > section {
  margin-block: clamp(3rem, 9vw, 6rem);
}

.home main > section:first-child {
  margin-top: 1rem;
}

.button {
  display: inline-block;
  padding: 0.85rem 1.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 5px 0 var(--primary-shadow);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

/* Sinks into its shadow when pressed, like the buttons in the app. */
.button:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--primary-shadow);
}

.button:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Hero */

.hero {
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 52rem) {
  .hero {
    grid-template-columns: 1fr 1.05fr;
    gap: 3rem;
  }
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--brass-text);
  font-weight: 800;
  letter-spacing: 0.01em;
}

.lead {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin: 0 0 1.5rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.soon {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.hero-room {
  position: relative;
}

.room-video,
.room-card video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 640 / 592;
  border-radius: 1.75rem;
  background: var(--surface);
}

/* A few sparkles float over the room, as they do in the app. */
.sparkles span {
  position: absolute;
  z-index: 1;
  width: 14px;
  height: 14px;
  background: var(--brass);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  opacity: 0;
  pointer-events: none;
}

.sparkles span:nth-child(1) { top: 12%; left: 8%; }
.sparkles span:nth-child(2) { top: 6%; right: 18%; width: 10px; height: 10px; }
.sparkles span:nth-child(3) { top: 46%; right: 4%; }
.sparkles span:nth-child(4) { bottom: 14%; left: 14%; width: 10px; height: 10px; }
.sparkles span:nth-child(5) { bottom: 8%; right: 30%; width: 12px; height: 12px; }

/* Steps */

.steps h2,
.friends h2,
.faq h2 {
  text-align: center;
  margin-top: 0;
}

.steps ol {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  gap: 1rem;
}

@media (min-width: 46rem) {
  .steps ol {
    grid-template-columns: repeat(3, 1fr);
  }
}

.steps li {
  background: var(--card);
  border-radius: 1.25rem;
  padding: 1.25rem;
  box-shadow: 0 4px 0 var(--shadow);
}

.steps h3 {
  margin: 0.5rem 0 0.25rem;
}

.steps p {
  margin: 0;
  color: var(--text-secondary);
}

.step-number {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--brass);
  color: #3a3226;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 800;
}

/* Feature rows: text beside a phone with a clip from the app */

.feature {
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 52rem) {
  .feature {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }

  .feature-flip .feature-text {
    order: 2;
  }
}

.feature > * {
  min-width: 0;
}

.feature-text h2 {
  margin-top: 0;
}

.feature-text p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.phones {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1rem;
}

figure {
  margin: 0;
}

/* A plain phone drawn in CSS around a clip, in the wood of the shelves. */
.phone {
  justify-self: center;
  width: min(15rem, 62vw);
  padding: 0.5rem;
  border-radius: 2.25rem;
  background: #4a3a2a;
  box-shadow: 0 8px 0 var(--shadow), 0 18px 40px rgba(58, 50, 38, 0.18);
}

.phone video,
.phone img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 360 / 770;
  border-radius: 1.75rem;
  background: var(--surface);
}

/* Side by side, the pair must fit a phone screen together: at most 90% of its width. */
.phones .phone {
  width: min(15rem, 52vw);
}

.phone-small,
.phones .phone-small {
  width: min(11rem, 34vw);
}

.card-shot {
  width: min(12rem, 34vw);
}

.card-shot-small {
  width: min(10rem, 30vw);
}

/* A wide card from the app below a feature's text, such as the reading goal. */
.card-shot-wide {
  width: min(22rem, 100%);
  margin-top: 1.5rem;
}

.card-shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1.25rem;
  box-shadow: 0 6px 0 var(--shadow), 0 14px 30px rgba(58, 50, 38, 0.15);
}

.room-card {
  flex: 1;
  min-width: 0;
  max-width: 26rem;
}

/* Mystery: only the egg, nothing that hatches */

.mystery {
  background: var(--primary);
  color: var(--on-primary);
  padding-block: clamp(2.5rem, 7vw, 4rem);
}

.mystery h2 {
  color: var(--on-primary);
  margin-top: 0;
}

.mystery p {
  margin: 0.5rem 0;
  font-size: 1.1rem;
}

.mystery .whisper {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  color: var(--placeholder);
}

@media (prefers-color-scheme: dark) {
  .mystery .whisper {
    color: var(--brass);
  }
}

.mystery-inner {
  display: grid;
  gap: 1.5rem;
  align-items: center;
  justify-items: center;
  text-align: center;
}

@media (min-width: 46rem) {
  .mystery-inner {
    grid-template-columns: auto 1fr;
    justify-items: start;
    text-align: left;
    gap: 3rem;
  }
}

.egg {
  width: 8rem;
  height: auto;
  overflow: visible;
}

.egg-body {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

/* Book tracker: the feature row, then its cards */

.tracker .features {
  margin-top: clamp(2rem, 6vw, 3.5rem);
}

/* Friends */

.features {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (min-width: 40rem) {
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 60rem) {
  .features {
    grid-template-columns: repeat(4, 1fr);
  }
}

.feature-card {
  background: var(--card);
  border-radius: 1.25rem;
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: 0 4px 0 var(--shadow);
}

.feature-card h3 {
  margin-top: 0;
}

.feature-card p {
  margin: 0;
  color: var(--text-secondary);
}

/* FAQ */

.faq details {
  background: var(--card);
  border-radius: 1rem;
  padding: 0.9rem 1.2rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 3px 0 var(--shadow);
}

.faq summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--heading);
}

.faq details p {
  margin: 0.6rem 0 0.2rem;
  color: var(--text-secondary);
}

/* Waitlist */

.home main > .waitlist {
  margin-bottom: 0;
  background: var(--surface);
  padding-block: clamp(2.5rem, 7vw, 4rem);
  text-align: center;
}

.waitlist h2 {
  margin-top: 0;
}

.waitlist-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.5rem 0 1rem;
}

.waitlist-form input[type='email'] {
  flex: 1 1 16rem;
  max-width: 22rem;
  min-height: 3.2rem;
  padding: 0 1.1rem;
  border: 2px solid var(--shadow);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font: inherit;
}

.waitlist-form input[type='email']:focus-visible {
  outline: none;
  border-color: var(--primary);
}

/* The field for bots stays out of sight and out of the way. */
.waitlist-form .trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.fine {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.form-status {
  min-height: 1.6em;
  font-weight: 800;
  color: var(--heading);
}

.home .site-footer {
  margin-top: 0;
}

/* Motion: only transform and opacity, and only for those who want it */

@media (prefers-reduced-motion: no-preference) {
  .sparkles span {
    animation: twinkle 3.2s ease-in-out infinite;
  }
  .sparkles span:nth-child(2) { animation-delay: 0.7s; }
  .sparkles span:nth-child(3) { animation-delay: 1.5s; }
  .sparkles span:nth-child(4) { animation-delay: 2.1s; }
  .sparkles span:nth-child(5) { animation-delay: 2.7s; }

  .egg-body {
    animation: wobble 4.5s ease-in-out infinite;
  }

  /* The headline and lead stay put: they are what the page is judged by while it loads. */
  .hero-text .eyebrow,
  .hero-text .cta-row {
    animation: rise 0.7s ease-out both;
  }
  .hero-text .cta-row { animation-delay: 0.15s; }

  /* Rows fade up as they scroll in; browsers without scroll timelines just show them. */
  @supports (animation-timeline: view()) {
    .reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
    }
  }
}

@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.4) rotate(0deg); }
  50% { opacity: 0.9; transform: scale(1) rotate(45deg); }
}

/* A shiver now and then, as if something inside were moving. */
@keyframes wobble {
  0%, 70%, 100% { transform: rotate(0deg); }
  74% { transform: rotate(-6deg); }
  78% { transform: rotate(5deg); }
  82% { transform: rotate(-3deg); }
  86% { transform: rotate(2deg); }
  90% { transform: rotate(0deg); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(1.5rem); }
  to { opacity: 1; transform: translateY(0); }
}

/* Legal pages */

/* Small enough on a phone that "Datenschutzerklärung" fits in one line. */
.legal h1 {
  font-size: clamp(1.6rem, 7vw, 2.8rem);
  hyphens: auto;
  overflow-wrap: break-word;
}

.legal .updated {
  color: var(--text-secondary);
  margin-top: 0;
}

/* That a translation is only for convenience. */
.legal .note {
  background: var(--surface);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
}

.legal ul {
  padding-left: 1.25rem;
}

.legal li {
  margin-bottom: 0.35rem;
}

.legal address {
  font-style: normal;
}

/* Something the owner still has to fill in before going live. */
.todo {
  background: var(--placeholder);
  border-radius: 0.3rem;
  padding: 0 0.3rem;
}
