/* Labyrinth 2 site: shared by index.html, editor.html and terms.html. */

:root {
  --blue: #4d95ab;
  --blue-deep: #2f6f84;
  --cream: #fff9e9;      /* matches the cream baked into the board and iPad images */
  --cream-line: #eadfc4;
  --ink: #33433b;
  --heading: #2c4b3b;
  --muted: #61706a;
  --lime: #a6ca4c;
  --lime-deep: #8bb035;
  --orange: #e3a024;
  --stripe: rgba(255, 255, 255, 0.2);
  --radius: 18px;
  --shadow: 0 18px 40px -18px rgba(14, 52, 66, 0.55);
  --display: "Russo One", "Arial Black", system-ui, sans-serif;
  --text: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

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

/* "html" in the selectors below outranks the GWT theme (chrome.css) the editor injects. */
html body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font: 16px/1.55 var(--text);
  /* Two light diagonal stripes over the textured blue, like the original header art. */
  background:
    linear-gradient(135deg,
      transparent 0 180px, var(--stripe) 180px 300px,
      transparent 300px 420px, var(--stripe) 420px 540px,
      transparent 540px) top left / 900px 900px no-repeat,
    url(../images/bkg.jpg) var(--blue);
}

html body a, html body a:visited { color: var(--blue-deep); }
html body a:hover { color: var(--heading); }

:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
#main :focus-visible { outline: revert; outline-offset: revert; }

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

/* ---------- Header ---------- */

.site-header {
  padding: 28px 0 24px;
  min-height: 170px;
}

html .wordmark, html .wordmark:visited {
  display: inline-block;
  margin: 0 0 18px;
  font: 400 clamp(2.4rem, 6vw, 3.6rem)/1 var(--display);
  color: var(--cream);
  text-decoration: none;
  letter-spacing: 0.01em;
  text-shadow: 0 3px 0 rgba(20, 70, 86, 0.35);
}
html .wordmark:hover { color: #fff; }
.wordmark span { color: var(--lime); }

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

html .nav a,
html .nav a:visited,
.nav button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 249, 233, 0.9);
  color: var(--heading);
  font: 400 0.82rem/1 var(--display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.15s;
}
html .nav a:hover,
.nav button:hover { background: #fff; transform: translateY(-1px); }
html .nav a[aria-current="page"] { background: var(--lime); color: #1f3a2c; }
.nav .nav-help { background: var(--orange); color: #3b2604; }
.nav .nav-help:hover { background: #f0b445; }

/* ---------- Content card ---------- */

.card {
  position: relative;
  background: var(--cream);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-body { padding: clamp(20px, 4vw, 44px); }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  color: var(--heading);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

h2 { font-size: 1.15rem; margin: 0 0 16px; }

/* ---------- Home page ---------- */

/* The board image has the card's cream corner and the page blue baked in.
   Its cream area starts at (302, 150) in the 374×347 image, so it is placed with
   that point on the card's top-right corner, which is square for this reason. */
.card--home {
  --board: 374px;
  margin-right: calc(var(--board) * 72 / 374);
  border-top-right-radius: 0;
}

.board {
  position: absolute;
  top: calc(var(--board) * -150 / 374);
  right: calc(var(--board) * -72 / 374);
  width: var(--board);
  height: auto;
  pointer-events: none;
  -webkit-mask: url(board-mask.svg) 0 0 / 100% 100% no-repeat;
  mask: url(board-mask.svg) 0 0 / 100% 100% no-repeat;
}

.hero {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-right: calc(var(--board) * 302 / 374 - 44px);
  min-height: calc(var(--board) * 197 / 374 - 20px);
}

/* Shows only the iPad from txt_labyrinth_info_img_ipad.jpg; its headline is real text below. */
.hero-device {
  flex: none;
  width: 222px;
  aspect-ratio: 222 / 182;
  overflow: hidden;
}
.hero-device img { display: block; width: calc(100% * 468 / 222); height: auto; }

.hero h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  line-height: 1.12;
}
.hero h1 span { display: block; color: #6f7f86; }

.overview {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 32px;
  margin-top: 32px;
}

.video {
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #11262e;
}
.video iframe { display: block; width: 100%; height: 100%; border: 0; }

.features { margin: 0; padding: 0; list-style: none; }
.features li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
  font-size: 0.92rem;
  line-height: 1.45;
}
.features li::before {
  content: "";
  width: 40px;
  height: 40px;
  background: url(../images/icons_home.jpg) no-repeat 0 calc(var(--i) * -40px);
}
.features b { color: var(--heading); }

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 32px;
}
html .store, html .store:visited {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--heading);
  font: 400 0.75rem/1 var(--display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}
/* The black App Store badge from iPhone/iPad_AppStore.jpg, without its title bar. */
.store span.badge {
  display: block;
  width: 117px;
  height: 38px;
  overflow: hidden;
  border-radius: 6px;
  transition: transform 0.15s;
}
.store img { display: block; margin-top: -29px; }
.store:hover span.badge { transform: translateY(-2px); }

.screenshots { margin-top: 40px; }
.shots {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.shots img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 6px 16px -8px rgba(30, 40, 30, 0.6);
}

/* ---------- Editor page ---------- */

/* The GWT editor draws a fixed-size panel (845 px wide on iPhone, 1101 px on iPad)
   into #main, so the page is as wide as that panel. */
.page-editor .wrap { width: max-content; min-width: min(100% - 32px, 1060px); }
.page-editor .card { width: max-content; }
#main { position: relative; min-width: 845px; min-height: 845px; }
#main .boundarypanel { border-radius: var(--radius); }
/* The editor sizes its widgets in pixels for content-box. */
#main, #main *, #main *::before, #main *::after { box-sizing: content-box; }
#main { line-height: normal; font-size: medium; }
.noscript { padding: 40px; }

/* ---------- Instructions dialog ---------- */

.instructions {
  width: min(100% - 32px, 620px);
  max-height: min(100% - 48px, 760px);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(10, 40, 50, 0.7);
}
.instructions::backdrop { background: rgba(22, 62, 76, 0.55); backdrop-filter: blur(2px); }

.instructions header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: var(--blue);
  color: var(--cream);
}
.instructions header h2 { margin: 0; color: var(--cream); }
.instructions .close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 249, 233, 0.2);
  color: var(--cream);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.instructions .close:hover { background: rgba(255, 249, 233, 0.35); }

.instructions section { padding: 20px 24px 4px; }
.instructions section + section { border-top: 1px solid var(--cream-line); }
.instructions h3 { margin: 0 0 10px; font-size: 0.95rem; }
.instructions p { margin: 0 0 14px; font-size: 0.95rem; }
.instructions .last { padding-bottom: 20px; }

.keys {
  width: 100%;
  margin: 4px 0 14px;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.keys th {
  padding: 10px 0 4px;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: left;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.keys td { padding: 4px 0; vertical-align: top; font: inherit; }
.keys td:first-child { width: 150px; }

kbd {
  display: inline-block;
  min-width: 26px;
  padding: 2px 7px;
  border: 1px solid #d6cbb0;
  border-bottom-width: 3px;
  border-radius: 6px;
  background: #fff;
  font: 600 0.8rem/1.4 var(--text);
  text-align: center;
  color: var(--heading);
}

/* ---------- Text pages (terms) ---------- */

.prose { max-width: 680px; }
.prose h1 { margin-top: 0; font-size: 1.6rem; }

/* ---------- Footer ---------- */

.site-footer {
  margin-top: auto;
  padding: 32px 0 40px;
  text-align: center;
}
html .site-footer a, html .site-footer a:visited {
  color: var(--cream);
  font-weight: 600;
  text-decoration: none;
  opacity: 0.85;
}
html .site-footer a:hover { opacity: 1; text-decoration: underline; }

/* ---------- Small screens ---------- */

@media (max-width: 900px) {
  .card--home { --board: 260px; }
  .hero { flex-direction: column; align-items: flex-start; padding-right: calc(var(--board) * 302 / 374 - 32px); }
  .overview { grid-template-columns: 1fr; }
  .shots { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
  .site-header { min-height: 0; }
  .card--home { margin-right: 0; border-top-right-radius: var(--radius); }
  .board { display: none; }
  .hero { padding-right: 0; min-height: 0; }
  .hero-device { width: 170px; }
  .shots { grid-template-columns: repeat(2, 1fr); }
  .keys td:first-child { width: 120px; }
}

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