/* Tiltsmith's page: the classic machine. The cabinet in the dark, brass trim, the lit wordmark in
   Cinzel (the store art's), and every section's name on the machine's dot-matrix display, in Archivo
   (the game's own face). In light mode the page around the art turns to the cream card stock of the
   tables' instruction cards; the cabinet, the art and the display stay lit as they are. */

:root {
  color-scheme: dark light;
  --cab: #0e0a07;
  --cab-2: #18110b;
  --wood: #2a1b10;
  --brass: #f2b54b;
  --brass-deep: #b8853f;
  --brass-line: #6e5230;
  --flare: #ff8a63;
  --dmd: #ff9b2f;
  --ink: #f1e6d2;
  --ink-dim: #c7b8a0;
  --page: var(--cab);
  --text: var(--ink);
  --muted: var(--ink-dim);
  --card: #1c140d;
  --card-line: #4a3721;
  --link: #ffc66d;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --page: #f3ead9;
    --text: #2b2118;
    --muted: #5e4d3a;
    --card: #fbf6ec;
    --card-line: #cdb48a;
    --link: #8a4a12;
  }
}

body {
  background: var(--page);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--font);
}

a {
  color: var(--link);
  text-underline-offset: 0.18em;
}

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

.tw-wrap {
  width: min(100% - 32px, 70rem);
  margin-inline: auto;
}

/* ---------- The hero: the machine in the dark ---------- */

.tw-hero {
  color: var(--ink);
  background:
    radial-gradient(70% 90% at 78% 40%, rgb(255 120 40 / 0.18), transparent 70%),
    linear-gradient(180deg, #120c08, #0b0806);
  border-bottom: 6px solid #000;
  box-shadow: inset 0 -2px 0 var(--brass-line);
}

.tw-hero__in {
  display: grid;
  grid-template-areas: "mark" "art" "copy";
  gap: 0 40px;
  padding: 28px 0 32px;
}

@media (min-width: 900px) {
  .tw-hero__in {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "mark art" "copy art";
    align-items: end;
    padding: 48px 0 40px;
  }
}

.tw-hero__mark {
  grid-area: mark;
}

.tw-hero__copy {
  grid-area: copy;
  align-self: start;
}

.tw-hero__art {
  grid-area: art;
  margin: 18px -16px 18px;
}

@media (min-width: 900px) {
  .tw-hero__art {
    margin: 0;
    align-self: center;
  }
}

.tw-hero__art img {
  display: block;
  width: 100%;
  border-radius: 4px;
  -webkit-mask-image: radial-gradient(ellipse 70% 72% at 56% 50%, #000 58%, transparent 100%);
  mask-image: radial-gradient(ellipse 70% 72% at 56% 50%, #000 58%, transparent 100%);
}

.tw-icon {
  display: block;
  width: 72px;
  height: 72px;
  margin-bottom: 18px;
  border-radius: 18px;
  box-shadow: 0 0 0 2px var(--brass-deep), 0 0 28px rgb(255 140 40 / 0.45);
}

.tw-wordmark {
  margin: 0;
  font-family: "Cinzel", Georgia, serif;
  font-weight: 900;
  font-size: clamp(2.6rem, 1.6rem + 5vw, 4.6rem);
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--brass);
  background: linear-gradient(180deg, #fff3cf 0%, #f6c66a 42%, #c98a2c 72%, #8a5a1c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 18px rgb(255 150 50 / 0.35));
}

.tw-sub {
  margin: 12px 0 18px;
  font-weight: 800;
  font-stretch: 112%;
  font-size: clamp(0.85rem, 0.7rem + 0.8vw, 1.1rem);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #f4e3c4;
}

.tw-lede {
  margin: 0 0 18px;
  font-size: 1.15rem;
  color: var(--ink);
  max-width: 34rem;
}

.tw-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.tw-facts li {
  margin: 0;
  padding: 4px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #f4e3c4;
  border: 1px solid var(--brass-line);
  border-radius: 999px;
  background: rgb(255 200 120 / 0.06);
}

.tw-get {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 0;
}

.tw-badge {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  font-weight: 800;
  font-stretch: 108%;
  letter-spacing: 0.04em;
  color: #2a1606;
  background: linear-gradient(#ffd27a, var(--brass));
  border-radius: 10px;
  box-shadow: inset 0 -3px 0 rgb(120 70 10 / 0.45), 0 0 0 2px #000, 0 0 0 3px var(--brass-deep);
}

.tw-hero .tw-get a {
  color: #ffc66d;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* ---------- The dot-matrix display: every section's name ---------- */

.tw-section {
  padding: 40px 0 8px;
}

.tw-dmd {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 22px;
  padding: 12px 16px 11px;
  font-weight: 900;
  font-stretch: 118%;
  font-size: clamp(1.2rem, 0.95rem + 1.4vw, 1.8rem);
  line-height: 1.15;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffb04a;
  background: #140a03;
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px #000, inset 0 0 24px rgb(255 120 20 / 0.12), 0 0 0 3px #2b2b2b, 0 0 0 4px #000;
  text-shadow: 0 0 5px rgb(255 160 50 / 0.85), 0 0 14px rgb(255 120 20 / 0.4);
  overflow: hidden;
}

/* the dots: a fine grid of dark gaps over the lit letters */
.tw-dmd::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, transparent 0 1px, rgb(20 10 3 / 0.72) 1.4px) 0 0 / 3px 3px;
  pointer-events: none;
}

.tw-dmd small {
  font-size: 0.6em;
  letter-spacing: 0.14em;
  opacity: 0.8;
}

.tw-intro {
  max-width: 44rem;
  font-size: 1.1rem;
}

/* ---------- Instruction cards (the aprons') ---------- */

.tw-cards {
  display: grid;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .tw-cards {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

.tw-cards > li {
  margin: 0;
}

.tw-card {
  height: 100%;
  margin: 0;
  padding: 14px 14px 16px;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 10px;
}

.tw-card img {
  display: block;
  width: 100%;
  margin-bottom: 14px;
  border-radius: 8px;
  border: 2px solid #000;
  box-shadow: 0 0 0 1px var(--brass-line), 0 10px 24px rgb(0 0 0 / 0.35);
}

.tw-card h3 {
  margin: 0 0 6px;
  font-family: "Cinzel", Georgia, serif;
  font-weight: 900;
  font-size: 1.3rem;
  letter-spacing: 0.03em;
  color: var(--brass);
}

@media (prefers-color-scheme: light) {
  .tw-card h3 {
    color: #8a5414;
  }
}

.tw-card .tw-step {
  display: block;
  margin-bottom: 4px;
  font-size: 0.8rem;
  font-weight: 800;
  font-stretch: 115%;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--flare);
}

@media (prefers-color-scheme: light) {
  .tw-card .tw-step {
    color: #b0431c;
  }
}

.tw-card p {
  margin: 0;
  color: var(--muted);
}

/* the phone screenshots stand side by side; on a phone, two to a row */
.tw-tables {
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 900px) {
  .tw-tables {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 639px) {
  .tw-tables .tw-card {
    padding: 8px 8px 12px;
  }

  .tw-tables .tw-card h3 {
    font-size: 1.05rem;
  }

  .tw-tables .tw-card p {
    font-size: 0.92rem;
    line-height: 1.45;
  }
}

/* ---------- The three tables, as the store shows them ---------- */

.tw-lineup {
  margin: 0 0 24px;
  border-radius: 10px;
  overflow: hidden;
  border: 3px solid #000;
  box-shadow: 0 0 0 1px var(--brass-line), 0 18px 40px rgb(0 0 0 / 0.35);
}

.tw-lineup img {
  display: block;
  width: 100%;
}

/* ---------- Lists, the press kit ---------- */

.tw-list {
  max-width: 46rem;
  padding-left: 1.2rem;
}

.tw-list li {
  margin: 0 0 0.6rem;
}

.tw-list li::marker {
  color: var(--brass-deep);
}

.tw-list strong {
  color: var(--text);
}

.tw-press {
  display: grid;
  gap: 8px 48px;
}

@media (min-width: 860px) {
  .tw-press {
    grid-template-columns: 1fr 1fr;
  }
}

.tw-press h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tw-facts-sheet {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 18px;
  margin: 0 0 20px;
}

.tw-facts-sheet dt {
  font-weight: 700;
}

.tw-facts-sheet dd {
  margin: 0;
  color: var(--muted);
}

.tw-files {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.tw-files li {
  margin: 0;
}

.tw-files a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--card-line);
  text-decoration: none;
}

.tw-files a:hover span:first-child {
  text-decoration: underline;
}

.tw-files .size {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.tw-privacy {
  margin: 8px 0 56px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 10px;
}

.tw-privacy p {
  margin: 0;
}

/* ---------- The policy page ---------- */

.tw-policy {
  padding: 28px 0 56px;
}

.tw-policy .tw-wrap {
  width: min(100% - 32px, 44rem);
}

.tw-policy h1 {
  margin: 0 0 8px;
  font-family: "Cinzel", Georgia, serif;
  font-weight: 900;
  font-size: clamp(1.8rem, 1.4rem + 2vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: var(--brass);
}

@media (prefers-color-scheme: light) {
  .tw-policy h1 {
    color: #8a5414;
  }
}

.tw-policy h2 {
  margin: 2.2rem 0 0.6rem;
  font-size: 1.15rem;
  font-weight: 800;
  font-stretch: 108%;
  letter-spacing: 0.02em;
}

.tw-policy .meta {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.tw-policy .back {
  margin: 0 0 18px;
}

.tw-policy .back a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  font-weight: 600;
}

.tw-policy .lede {
  font-size: 1.12rem;
}

.tw-policy ul {
  padding-left: 1.2rem;
}

.tw-policy li + li {
  margin-top: 0.4rem;
}

.tw-policy .summary {
  margin: 1.6rem 0 0.5rem;
  padding: 1rem 1.2rem 0.2rem;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-left: 4px solid var(--brass);
  border-radius: 10px;
}

.tw-policy .summary h2 {
  margin: 0 0 0.5rem;
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .tw-policy .back {
    display: none;
  }

  .tw-policy a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
  }
}

/* ---------- Depth: lit from behind, a rail for the screens on a phone ---------- */

.tw-hero__art {
  position: relative;
  isolation: isolate;
}

.tw-hero__art::before {
  content: "";
  position: absolute;
  inset: 10% 8% 0;
  z-index: -1;
  background: radial-gradient(closest-side, rgb(255 140 40 / 0.35), transparent);
  filter: blur(30px);
  animation: tw-lamp 5s ease-in-out infinite alternate;
}

.tw-hero__art img {
  animation: tw-settle 1200ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes tw-settle {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
}

@keyframes tw-lamp {
  to { opacity: 0.6; }
}

.tw-card {
  transition: transform 350ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (hover: hover) {
  .tw-card:hover {
    transform: translateY(-6px);
  }
}

@media (max-width: 899px) {
  .tw-cards {
    grid-auto-flow: column;
    grid-auto-columns: 78%;
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0 16px 8px;
    margin-inline: -16px;
    scrollbar-width: none;
  }
  .tw-cards > li {
    scroll-snap-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tw-hero__art::before,
  .tw-hero__art img { animation: none; }
  .tw-card { transition: none; }
}
