@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/fraunces-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: 'Instrument Sans';
  src: url('/fonts/instrument-sans-latin-wght-normal.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

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

html {
  background-color: var(--background);
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  color: var(--foreground);
  font-family: 'Instrument Sans', system-ui, 'Noto Sans Arabic', Tahoma, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Soft light at the top of the page. */
body::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: 52rem;
  pointer-events: none;
  background-image:
    radial-gradient(46rem 32rem at 82% 18rem, var(--glow-start), transparent 70%),
    radial-gradient(40rem 26rem at 4% -4rem, var(--glow-end), transparent 70%);
  background-repeat: no-repeat;
}

h1,
h2,
h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 420;
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

a {
  color: var(--primary);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

/* One shared measure for the header, the content and the footer. */
.top,
main,
footer {
  width: min(100% - 2.5rem, 72rem);
  margin-inline: auto;
}

main {
  flex: 1;
}

/* Header */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  border-radius: 0.5rem;
  color: var(--foreground);
  text-decoration: none;
}

.mark {
  width: 1.75rem;
  height: 1.75rem;
}

/* The two halves of the logo mark, each a gradient. */
.logo-ink-from {
  stop-color: var(--logo-ink-from);
}

.logo-ink-to {
  stop-color: var(--logo-ink-to);
}

.logo-accent-from {
  stop-color: var(--logo-accent-from);
}

.logo-accent-to {
  stop-color: var(--logo-accent-to);
}

/* The name is set in the page's own typeface, Instrument Sans. */
.brand-name {
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.045em;
}

.top-end,
.top-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.top-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: 0.9rem;
  border-radius: 99rem;
  color: var(--muted-foreground);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
}

.top-nav a:hover {
  background: var(--muted);
  color: var(--foreground);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: 99rem;
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--muted);
}

.theme-toggle[hidden] {
  display: none;
}

.theme-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The icon is the theme now showing. */
.theme-toggle[data-active='light'] .moon,
.theme-toggle[data-active='dark'] .sun {
  display: none;
}

/* Shared text and buttons */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.lead {
  max-width: 32rem;
  color: var(--muted-foreground);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding-inline: 1.75rem;
  border: 1px solid transparent;
  border-radius: 99rem;
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 600;
  text-decoration: none;
  transition:
    translate 160ms ease,
    box-shadow 160ms ease;
}

.button:hover {
  translate: 0 -2px;
  box-shadow: 0 10px 24px var(--shadow);
}

.button.quiet {
  border-color: var(--border);
  background: var(--card);
  color: var(--foreground);
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: center;
  gap: 3rem;
  padding-block: clamp(2.5rem, 8vw, 7rem) clamp(4rem, 9vw, 8rem);
}

.hero-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
}

.hero h1 {
  font-size: clamp(2.75rem, 6.4vw, 5rem);
  font-weight: 380;
}

.accent-text {
  color: var(--primary);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* The mark, large, on a tile with rings around it. */
.emblem {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  width: min(100%, 26rem);
  justify-self: center;
}

.emblem::before,
.emblem::after {
  content: '';
  position: absolute;
  border: 1px solid var(--border);
  border-radius: 50%;
}

.emblem::before {
  inset: 0;
}

.emblem::after {
  inset: 11%;
}

.emblem svg {
  position: relative;
  z-index: 1;
  width: 62%;
  height: 62%;
  padding: 9%;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: 24%;
  background: var(--card);
  box-shadow:
    0 2px 4px var(--shadow),
    0 40px 80px -20px var(--shadow);
}

.hook {
  animation: 1100ms cubic-bezier(0.2, 0.8, 0.2, 1) 150ms both;
}

.upper {
  animation-name: lock-upper;
}

.lower {
  animation-name: lock-lower;
}

@keyframes lock-upper {
  from {
    opacity: 0;
    transform: translate(-7px, -7px);
  }
}

@keyframes lock-lower {
  from {
    opacity: 0;
    transform: translate(7px, 7px);
  }
}

/* Products */

.product {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  padding: clamp(1.5rem, 5vw, 4.5rem);
  border: 1px solid var(--border);
  border-radius: 2rem;
  scroll-margin-top: 1.5rem;
}

.product + .product {
  margin-top: 1.5rem;
}

.about {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.35rem;
}

.about h2 {
  font-size: clamp(2.1rem, 4vw, 3.15rem);
}

.about .button {
  margin-top: 0.5rem;
}

.show {
  display: grid;
  justify-items: center;
}

.stage {
  border-color: var(--stage-border);
  background:
    radial-gradient(38rem 30rem at 88% 8%, var(--stage-glow), transparent 70%), var(--stage);
  color: var(--stage-foreground);
}

.stage .eyebrow {
  color: var(--stage-primary);
}

.stage .lead,
.stage .points {
  color: var(--stage-muted-foreground);
}

.stage .button {
  background: var(--stage-primary);
  color: var(--stage-primary-foreground);
}

.stage a:focus-visible {
  outline-color: var(--stage-primary);
}

.badge {
  padding: 0.1rem 0.65rem;
  border: 1px solid var(--stage-border);
  border-radius: 99rem;
  color: var(--stage-muted-foreground);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
}

.points {
  width: 100%;
  list-style: none;
}

.points li {
  position: relative;
  padding: 0.7rem 0 0.7rem 1.6rem;
  border-top: 1px solid var(--stage-border);
}

/* A small slanted stroke, at the logo's 45 degrees. */
.points li::before {
  content: '';
  position: absolute;
  top: 1.4rem;
  left: 0.15rem;
  width: 0.85rem;
  height: 2px;
  background: var(--stage-primary);
  rotate: -45deg;
}

/* The booking window */

.window {
  width: min(100%, 28rem);
  padding: clamp(1rem, 3vw, 1.75rem);
  border: 1px solid var(--window-border);
  border-radius: 1.5rem;
  background: var(--window);
  box-shadow: 0 40px 70px -24px var(--shadow);
  color: var(--window-foreground);
  font-variant-numeric: tabular-nums;
}

.window-head {
  display: flex;
  flex-direction: column;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--window-border);
}

.window-head strong {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 500;
}

.window-head span {
  color: var(--window-muted-foreground);
  font-size: 0.85rem;
}

.picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4.5rem;
  gap: 1rem;
  padding-block: 1rem;
}

.picker p {
  margin-bottom: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.15rem;
  text-align: center;
}

.weekday,
.day {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 50%;
  font-size: 0.78rem;
}

.weekday,
.closed {
  color: var(--window-muted-foreground);
}

.free {
  background: var(--window-muted);
  font-weight: 600;
}

.times {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.times p {
  margin-bottom: 0.25rem;
}

.slot {
  padding-block: 0.35rem;
  border: 1px solid var(--window-border);
  border-radius: 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

.day.picked,
.slot.picked,
.confirm {
  border-color: var(--window-primary);
  background: var(--window-primary);
  color: var(--window-primary-foreground);
  font-weight: 700;
}

.confirm {
  padding-block: 0.75rem;
  border-radius: 99rem;
  font-size: 0.9rem;
  text-align: center;
}

/* Games */

.play {
  background: var(--card);
}

.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
  width: min(100%, 22rem);
}

.tile {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 24%;
  box-shadow: inset 0 -3px 0 var(--shadow);
  font-size: clamp(1.1rem, 3vw, 1.7rem);
  font-weight: 700;
}

.empty {
  border: 2px solid var(--border);
  box-shadow: none;
}

.correct {
  background: var(--correct);
  color: var(--correct-foreground);
}

.present {
  background: var(--present);
  color: var(--present-foreground);
}

.absent {
  background: var(--absent);
  color: var(--absent-foreground);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
}

.tags li {
  padding: 0.2rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 99rem;
  font-size: 0.875rem;
}

/* Principles */

.principles {
  padding-block: clamp(4rem, 9vw, 7.5rem) clamp(1rem, 4vw, 3rem);
}

.principles h2 {
  font-size: clamp(1.9rem, 3.5vw, 2.6rem);
}

.principles ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 2rem;
  margin-top: 2.5rem;
  list-style: none;
}

.principles li {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.principles h3 {
  font-size: 1.3rem;
  font-weight: 500;
}

.principles p {
  margin-top: 0.6rem;
  color: var(--muted-foreground);
}

/* Footer */

footer {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 4rem;
  padding-block: 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 0.9rem;
}

.foot-name .brand-name {
  color: var(--foreground);
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1.5rem;
}

footer a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: inherit;
  text-decoration: none;
}

footer a:hover {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

/* Privacy and not-found pages */

main.legal {
  max-width: 42rem;
  padding-block: 2rem;
}

.legal h1 {
  font-size: clamp(2.25rem, 6vw, 3rem);
}

.legal h2 {
  margin-top: 2.25rem;
  font-size: 1.4rem;
}

.legal p,
.legal ul {
  margin-top: 0.75rem;
}

.legal ul {
  padding-inline-start: 1.25rem;
}

.legal .updated {
  margin-top: 0.4rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.lost {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  text-align: center;
}

.lost h1 {
  font-size: clamp(2.25rem, 7vw, 3.5rem);
}

@media (max-width: 56rem) {
  .hero,
  .product {
    grid-template-columns: minmax(0, 1fr);
  }

  .emblem {
    width: min(100%, 18rem);
  }

  /* The words come first on a narrow screen, then the picture. */
  .play .show {
    order: 1;
  }
}

@media (max-width: 30rem) {
  .top-nav {
    display: none;
  }

  .picker {
    grid-template-columns: minmax(0, 1fr);
  }

  .times {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .times p {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hook {
    animation: none;
  }

  .button {
    transition: none;
  }

  .button:hover {
    translate: none;
  }
}
