:root {
  /* Wall colors match AppSettings.WallColor in the app. */
  --wall-black: #000000;
  --wall-charcoal: #262626;
  --wall-white: #ffffff;
  --wall-warmWhite: #f5f0e0;
  --wall-museumGreen: #21382e;
  --wall-darkNavy: #141f38;
  --wall-burgundy: #4d1a21;

  --plaster: #e9e7e1;
  --paper: #f7f6f2;
  --ink: #1d2320;
  --ink-soft: #4c5550;
  --rule: #cfccc3;
  --accent: #21382e;
  --focus: #c8962e;

  --wall: var(--wall-museumGreen);
  --on-wall: #f3efe4;
  --on-wall-soft: rgba(243, 239, 228, 0.72);

  --display: "Yellowtail", cursive;
  --body: "Hanken Grotesk", system-ui, sans-serif;

  --measure: 36rem;
  --gutter: clamp(1rem, 4vw, 3rem);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --plaster: #171a18;
    --paper: #1e2220;
    --ink: #ebe8e0;
    --ink-soft: #a9b0ab;
    --rule: #333a36;
    --accent: #9cc3ae;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --plaster: #171a18;
  --paper: #1e2220;
  --ink: #ebe8e0;
  --ink-soft: #a9b0ab;
  --rule: #333a36;
  --accent: #9cc3ae;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--plaster);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; text-wrap: balance; }

/* Script is reserved for large headings; it loses legibility at small sizes. */
h1, h2 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.05;
}
h3 { font-weight: 600; line-height: 1.3; letter-spacing: -0.005em; }

p { margin: 0; text-wrap: pretty; }

a { color: inherit; text-underline-offset: 0.18em; }

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

code {
  font: 0.92em ui-monospace, SFMono-Regular, Menlo, monospace;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

/* Top bar */

.topbar {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem var(--gutter);
  color: var(--on-wall);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font: 1.6rem/1 var(--display);
}
.brand img { border-radius: 5px; }
.topbar nav { display: flex; gap: 1.5rem; font-weight: 500; font-size: 0.95rem; }
.topbar nav a { text-decoration: none; opacity: 0.85; }
.topbar nav a:hover { opacity: 1; text-decoration: underline; }
@media (max-width: 720px) { .topbar nav { display: none; } }

/* Hero: a wall that takes on the app's wall colors */

.hero {
  --wall: var(--wall-museumGreen);
  background: var(--wall);
  color: var(--on-wall);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding: clamp(6rem, 12vh, 8rem) var(--gutter) clamp(3rem, 8vh, 6rem);
  min-height: min(100vh, 920px);
  transition: background-color 600ms ease, color 600ms ease;
}
.hero[data-wall="black"]       { --wall: var(--wall-black); }
.hero[data-wall="charcoal"]    { --wall: var(--wall-charcoal); }
.hero[data-wall="darkNavy"]    { --wall: var(--wall-darkNavy); }
.hero[data-wall="burgundy"]    { --wall: var(--wall-burgundy); }
.hero[data-wall="white"]       { --wall: var(--wall-white); }
.hero[data-wall="warmWhite"]   { --wall: var(--wall-warmWhite); }
.hero[data-wall="white"],
.hero[data-wall="warmWhite"] {
  --on-wall: #1d2320;
  --on-wall-soft: rgba(29, 35, 32, 0.7);
}
body:has(.hero[data-wall="white"]) .topbar,
body:has(.hero[data-wall="warmWhite"]) .topbar { color: #1d2320; }

.hero-copy { max-width: 34rem; }
.hero h1 { font-size: clamp(3rem, 6.6vw, 5.75rem); }
.lede {
  margin-top: 1.5rem;
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.55;
  color: var(--on-wall-soft);
  max-width: var(--measure);
}

.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
}
.btn-primary { background: var(--on-wall); color: var(--wall); transition: background-color 600ms ease, color 600ms ease; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-quiet { color: var(--on-wall); box-shadow: inset 0 0 0 1.5px var(--on-wall-soft); }
.btn-quiet:hover { box-shadow: inset 0 0 0 1.5px var(--on-wall); }

.wall-picker { border: 0; padding: 0; margin: 2.75rem 0 0; }
.wall-picker legend { padding: 0; font-size: 0.9rem; color: var(--on-wall-soft); margin-bottom: 0.6rem; }
.swatches { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.swatches button {
  --size: 2rem;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: var(--sw);
  box-shadow: inset 0 0 0 1px rgba(127, 127, 127, 0.45);
  font-size: 0;
  color: transparent;
  position: relative;
}
.swatches button[aria-checked="true"] {
  box-shadow: inset 0 0 0 1px rgba(127, 127, 127, 0.45), 0 0 0 2px var(--wall), 0 0 0 4px var(--on-wall);
}
.swatches button:hover::after,
.swatches button:focus-visible::after {
  content: attr(data-label);
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font: 500 0.8rem var(--body);
  color: var(--on-wall);
}

/* Gallery wall of framed "photos" with museum placards */

.gallery {
  position: relative;
  aspect-ratio: 1.1 / 1;
  width: 100%;
  max-width: 44rem;
  justify-self: end;
}
.frame {
  position: absolute;
  margin: 0;
  background: #fbfaf7;
  padding: clamp(6px, 1.1vw, 14px);
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.25),
    0 18px 30px -12px rgba(0, 0, 0, 0.55);
}
.frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.frame figcaption {
  position: absolute;
  top: calc(100% + 0.7rem);
  left: 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--on-wall-soft);
  white-space: nowrap;
}
.frame figcaption b { display: block; font-weight: 600; font-size: 0.78rem; color: var(--on-wall); }

.f1 { left: 0;    top: 6%;  width: 40%; height: 48%; }
.f2 { left: 45%;  top: 0;   width: 55%; height: 36%; }
.f3 { left: 45%;  top: 46%; width: 24%; height: 34%; }
.f4 { left: 74%;  top: 46%; width: 26%; height: 22%; }
.f5 { left: 6%;   top: 66%; width: 34%; height: 26%; }

.hero .frame {
  animation: hang 900ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.f2 { animation-delay: 90ms !important; }
.f3 { animation-delay: 180ms !important; }
.f4 { animation-delay: 270ms !important; }
.f5 { animation-delay: 360ms !important; }
@keyframes hang {
  from { opacity: 0; transform: translateY(-14px) rotate(-0.6deg); }
  to   { opacity: 1; transform: none; }
}

/* Sections */

.section {
  padding: clamp(4rem, 10vw, 7.5rem) var(--gutter);
  max-width: 76rem;
  margin: 0 auto;
}
.section-head { max-width: var(--measure); margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section-head h2 { font-size: clamp(2.6rem, 5vw, 3.75rem); }
.section-head p { margin-top: 0.9rem; color: var(--ink-soft); font-size: 1.125rem; }

/* Slide styles */

.style-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2.5rem);
}
.style-card h3 { font-size: 1.35rem; margin-top: 1.25rem; }
.style-card p { margin-top: 0.5rem; color: var(--ink-soft); max-width: var(--measure); }
.style-card-wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  grid-template-rows: auto auto auto 1fr;
  column-gap: clamp(1.5rem, 4vw, 3rem);
}
.style-card-wide .demo { grid-row: 1 / span 4; }
.style-card-wide h3 { margin-top: 0; }

.demo {
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 0 1px var(--rule);
}
/* Slideshow demos mirror the app: photo fit to screen over a blurred copy of itself. */
.demo-slideshow .slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 600ms ease;
}
.demo-slideshow .slide.is-visible { opacity: 1; }
.demo-slideshow .backdrop {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  object-fit: cover;
  filter: blur(22px) brightness(0.75);
}
.demo-slideshow .photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  will-change: transform;
}

/* Photo Wall demo: two copies of the wall scroll upward in a seamless loop. */
.demo-wall {
  --g: 2cqw;
  --px: 3cqw;
  container-type: inline-size;
  background: var(--wall-museumGreen);
  transition: background-color 400ms ease;
}
.wall-track.is-scrolling { animation: wall-scroll 45s linear infinite; }
@keyframes wall-scroll {
  from { transform: translateY(0); }
  to   { transform: translateY(-50%); }
}
.wall-set {
  display: grid;
  aspect-ratio: 16 / 9;
  gap: var(--g);
  padding: calc(var(--g) / 2) var(--px);
}
.wall-set img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: cover;
  border-radius: 2px;
}

.demo-wall[data-layout="uniformGrid"] { --g: 2cqw; --px: 3cqw; }
.demo-wall[data-layout="uniformGrid"] .wall-set {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
}
.demo-wall[data-layout="uniformGrid"] img:nth-child(7) { grid-column: span 2; }

.demo-wall[data-layout="staggeredColumns"] { --g: 2cqw; --px: 3cqw; }
.demo-wall[data-layout="staggeredColumns"] .wall-set {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(6, 1fr);
}
.demo-wall[data-layout="staggeredColumns"] img:nth-child(1) { grid-row: 1 / 4; }
.demo-wall[data-layout="staggeredColumns"] img:nth-child(2) { grid-row: 4 / 7; }
.demo-wall[data-layout="staggeredColumns"] img:nth-child(3) { grid-row: 2 / 5; }
.demo-wall[data-layout="staggeredColumns"] img:nth-child(4) { grid-row: 1 / 3; }
.demo-wall[data-layout="staggeredColumns"] img:nth-child(5) { grid-row: 3 / 6; }
.demo-wall[data-layout="staggeredColumns"] img:nth-child(6) { grid-row: 1 / 4; grid-column: 4; }
.demo-wall[data-layout="staggeredColumns"] img:nth-child(7) { grid-row: 4 / 7; grid-column: 4; }

.demo-wall[data-layout="masonryMosaic"] { --g: 1.2cqw; --px: 1.2cqw; }
.demo-wall[data-layout="masonryMosaic"] .wall-set {
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(4, 1fr);
}
.demo-wall[data-layout="masonryMosaic"] img:nth-child(1) { grid-column: 1 / 4; grid-row: 1 / 3; }
.demo-wall[data-layout="masonryMosaic"] img:nth-child(2) { grid-column: 4 / 6; grid-row: 1 / 2; }
.demo-wall[data-layout="masonryMosaic"] img:nth-child(3) { grid-column: 6 / 7; grid-row: 1 / 3; }
.demo-wall[data-layout="masonryMosaic"] img:nth-child(4) { grid-column: 4 / 6; grid-row: 2 / 5; }
.demo-wall[data-layout="masonryMosaic"] img:nth-child(5) { grid-column: 1 / 2; grid-row: 3 / 5; }
.demo-wall[data-layout="masonryMosaic"] img:nth-child(6) { grid-column: 2 / 4; grid-row: 3 / 5; }
.demo-wall[data-layout="masonryMosaic"] img:nth-child(7) { grid-column: 6 / 7; grid-row: 3 / 5; }

/* Gallery Wall leaves empty grid cells, so its rhythm comes from padding, not gap. */
.demo-wall[data-layout="galleryWall"] { --g: 0px; --px: 5cqw; }
.demo-wall[data-layout="galleryWall"] .wall-set {
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(10, 1fr);
  padding-block: 2.5cqw;
}
.demo-wall[data-layout="galleryWall"] img { box-shadow: 0 0 0 3px #fbfaf7, 0 6px 12px -4px rgba(0, 0, 0, 0.6); }
.demo-wall[data-layout="galleryWall"] img:nth-child(1) { grid-column: 1 / 5;  grid-row: 2 / 7; }
.demo-wall[data-layout="galleryWall"] img:nth-child(2) { grid-column: 6 / 10; grid-row: 1 / 4; }
.demo-wall[data-layout="galleryWall"] img:nth-child(3) { grid-column: 11 / 13; grid-row: 1 / 5; }
.demo-wall[data-layout="galleryWall"] img:nth-child(4) { grid-column: 6 / 8;  grid-row: 5 / 8; }
.demo-wall[data-layout="galleryWall"] img:nth-child(5) { grid-column: 9 / 13; grid-row: 6 / 11; }
.demo-wall[data-layout="galleryWall"] img:nth-child(6) { grid-column: 2 / 5;  grid-row: 8 / 11; }
.demo-wall[data-layout="galleryWall"] img:nth-child(7) { grid-column: 6 / 8;  grid-row: 9 / 11; }

.layout-picker { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; align-content: start; }
.layout-picker button {
  font: 500 0.95rem var(--body);
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--rule);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  cursor: pointer;
}
.layout-picker button:hover { border-color: var(--ink-soft); }
.layout-picker button[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--paper); }

/* What plays */

.plays { border-top: 1px solid var(--rule); }
.plays-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem clamp(1.5rem, 3vw, 3rem);
  margin: 0;
}
.plays-list dt { font-weight: 600; font-size: 1.1rem; }
.plays-list dd { margin: 0.45rem 0 0; color: var(--ink-soft); }

/* Remote */

.remote { border-top: 1px solid var(--rule); }
.remote-tables {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
}
.remote table { width: 100%; border-collapse: collapse; }
.remote caption {
  text-align: left;
  font-weight: 600;
  font-size: 1.1rem;
  padding-bottom: 0.75rem;
}
.remote th, .remote td {
  text-align: left;
  padding: 0.7rem 0;
  border-top: 1px solid var(--rule);
  vertical-align: top;
}
.remote th { font-weight: 600; width: 9.5rem; padding-right: 1rem; }
.remote td { color: var(--ink-soft); }

/* Setup: a real sequence, so it's numbered */

.setup { border-top: 1px solid var(--rule); }
.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 3rem);
}
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: block;
  font: 700 3rem/1 var(--body);
  letter-spacing: -0.03em;
  color: var(--accent);
  margin-bottom: 1rem;
}
.steps h3 { font-size: 1.2rem; }
.steps p { margin-top: 0.5rem; color: var(--ink-soft); }

/* Privacy */

.privacy {
  max-width: none;
  background: var(--wall-museumGreen);
  color: #f3efe4;
}
.privacy-inner { max-width: 76rem; margin: 0 auto; }
.privacy h2 { font-size: clamp(2.6rem, 5vw, 3.75rem); max-width: 20ch; }
.privacy p { margin-top: 1.25rem; max-width: var(--measure); font-size: 1.15rem; color: rgba(243, 239, 228, 0.8); }

/* FAQ */

.faq-list { max-width: 48rem; border-bottom: 1px solid var(--rule); }
.faq details { border-top: 1px solid var(--rule); }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 1.15rem 2.5rem 1.15rem 0;
  font-weight: 600;
  font-size: 1.1rem;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  font: 400 1.6rem var(--body);
  color: var(--ink-soft);
  transition: transform 200ms ease;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding: 0 0 1.25rem; color: var(--ink-soft); max-width: var(--measure); }

/* Footer */

.footer {
  background: var(--paper);
  border-top: 1px solid var(--rule);
  padding: 3rem var(--gutter) 2.5rem;
}
.footer > * { max-width: 76rem; margin-left: auto; margin-right: auto; }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.footer-top p { color: var(--ink-soft); }
.legal { margin-top: 1.5rem; font-size: 0.85rem; color: var(--ink-soft); max-width: 76rem; }
.legal + .legal { margin-top: 0.5rem; }

/* Responsive */

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .gallery { justify-self: stretch; max-width: 36rem; margin: 0 auto 2.5rem; }
  .style-card-wide { grid-template-columns: 1fr; }
  .style-card-wide .demo { grid-row: auto; }
  .style-card-wide h3 { margin-top: 1.25rem; }
  .plays-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .style-grid,
  .plays-list,
  .remote-tables,
  .steps { grid-template-columns: 1fr; }
  .frame figcaption { display: none; }
  .gallery { margin-bottom: 0; }
  .remote th { width: 7.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
