/*
  styles.css
  Colours from the Trust Labyrinth spec (section 8), layout and component
  sizes from the approved mockups (trust-labyrinth-mockups.html). Same
  system font stack and component family as the checkups (buttons,
  cards, inputs, consent checkbox, italic footer). Mobile first: the base
  rules target a phone, the min-width query at the bottom widens the
  column for desktop.
*/

:root {
  --linen: #F3EEE4;
  --espresso: #3B2A20;
  --olive: #6B6B3A;
  --tan: #C4A47C;
  --olive-tint: #ECEBD9;
  --tan-tint: #EFE3D0;
  --muted: #8A7A66;
  --brown: #8A5F2E;
  --card: #FAF7F1;
  --soft-ink: #5A4636;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--linen);
  color: var(--espresso);
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 460px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 18px 20px 14px;
  display: flex;
  flex-direction: column;
}

/* ---------------------------------------------------------------- */
/* Language switch + footer (every page)                            */
/* ---------------------------------------------------------------- */

.lang-switch {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  font-size: 13px;
}

.lang-switch button {
  border: 0;
  background: none;
  font: inherit;
  color: var(--muted);
  padding: 4px 5px;
  cursor: pointer;
  border-radius: 6px;
}

.lang-switch button[aria-current="true"] {
  color: var(--espresso);
  font-weight: 500;
}

.lang-switch button:hover { color: var(--espresso); }

.footer {
  margin-top: auto;
  padding-top: 22px;
  font-size: 12px;
  font-style: italic;
  text-align: center;
}

.footer a {
  color: var(--muted);
  font-style: normal;
  margin-left: 6px;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 2px;
}

/* Headings get focus on each new slide (for screen readers); they are
   not interactive, so no focus ring. */
[tabindex="-1"]:focus { outline: none; }

/* ---------------------------------------------------------------- */
/* Buttons                                                          */
/* ---------------------------------------------------------------- */

.btn {
  display: block;
  width: 100%;
  border: 0;
  background: var(--olive);
  color: var(--linen);
  border-radius: 10px;
  padding: 13px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover { background: #5C5C30; }
.btn[disabled] { opacity: .6; cursor: default; }

/* Spec: Chinese has no capitals, buttons and labels stand out by
   weight and colour only. */
:lang(zh) .btn,
:lang(zh) .band-label,
:lang(zh) .lab { letter-spacing: .02em; }

.btn-text {
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  padding: 8px 4px;
  cursor: pointer;
}

.btn-text:hover { color: var(--espresso); }

/* ---------------------------------------------------------------- */
/* Photo circles with broken rings (opening + thank you)            */
/* ---------------------------------------------------------------- */

.ring-photo {
  position: relative;
  margin: 18px auto 6px;
}

.ring-photo svg { position: absolute; inset: 0; }

.ring-photo img {
  position: absolute;
  border-radius: 50%;
  border: 3px solid var(--card);
  object-fit: cover;
}

.ring-photo.opening { width: 200px; height: 200px; }
.ring-photo.opening img { left: 43px; top: 43px; width: 114px; height: 114px; }

.ring-photo.thanks { width: 210px; height: 210px; margin-top: 14px; }
.ring-photo.thanks img { left: 26px; top: 26px; width: 158px; height: 158px; }

.caption {
  font-size: 13px;
  font-style: italic;
  text-align: center;
}

/* ---------------------------------------------------------------- */
/* Opening slide                                                    */
/* ---------------------------------------------------------------- */

.title {
  font-size: 26px;
  font-weight: 500;
  text-align: center;
  margin: 18px 0 0;
  line-height: 1.25;
}

.based-on {
  border-top: 1px solid var(--tan);
  border-bottom: 1px solid var(--tan);
  margin: 18px 8px;
  padding: 12px 2px;
  font-size: 13px;
  font-style: italic;
  line-height: 1.5;
  text-align: center;
  color: var(--soft-ink);
}

.opening .btn { margin: 8px 0 0; }

/* ---------------------------------------------------------------- */
/* Labyrinth map                                                    */
/* ---------------------------------------------------------------- */

.map {
  display: block;
  width: 100%;
  max-width: 330px;
  height: auto;
  margin: 6px 0 0;
}

.map text {
  font-family: inherit;
  font-size: 9px;
  fill: var(--olive);
}

.map .draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw-path 1.6s ease-out .2s forwards;
}

@keyframes draw-path { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  .map .draw { animation: none; stroke-dashoffset: 0; }
}

.legend {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 14px;
}

.legend span { display: inline-flex; align-items: center; }

.legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 5px;
}

.legend .passed { background: var(--olive); }
.legend .stuck { border: 2px solid var(--brown); }

/* ---------------------------------------------------------------- */
/* Dark header band                                                 */
/* ---------------------------------------------------------------- */

.band {
  background: var(--espresso);
  color: var(--linen);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 8px;
}

.band-label {
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--tan);
  text-transform: uppercase;
}

.band-title {
  font-size: 19px;
  font-weight: 500;
  margin: 2px 0 0;
  line-height: 1.3;
}

/* ---------------------------------------------------------------- */
/* Room page                                                        */
/* ---------------------------------------------------------------- */

.intro {
  font-size: 14px;
  line-height: 1.55;
  margin: 14px 0 0;
}

.key {
  font-size: 15px;
  line-height: 1.45;
  font-weight: 500;
  border-left: 3px solid var(--olive);
  padding-left: 9px;
  margin: 10px 0 0;
}

.muted { color: var(--muted); }

.note { font-size: 12px; margin: 6px 0 0; line-height: 1.4; }

.question {
  font-size: 15px;
  font-weight: 500;
  margin: 18px 0 0;
  line-height: 1.4;
}

.question-sub { font-size: 13px; margin: 3px 0 10px; }

.cards { display: flex; flex-direction: column; gap: 10px; }

.card {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  color: var(--espresso);
  background: var(--card);
  border: 1px solid var(--tan);
  border-radius: 10px;
  padding: 11px 12px;
  margin: 0;
  cursor: pointer;
}

.card:hover { border-color: var(--olive); }

/* Spec: selected card has a 1.5px olive border on light olive tint.
   The padding drops by .5px so the text does not shift on select. */
.card[aria-pressed="true"] {
  border: 1.5px solid var(--olive);
  background: var(--olive-tint);
  padding: 10.5px 11.5px;
}

.error {
  color: var(--brown);
  font-size: 13px;
  margin: 10px 0 0;
  line-height: 1.4;
}

.room-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.room-nav .btn { width: auto; padding: 11px 22px; }

.privacy-line {
  font-size: 12px;
  text-align: center;
  margin: 14px 0 0;
  line-height: 1.4;
}

/* ---------------------------------------------------------------- */
/* Insight card overlay                                             */
/* ---------------------------------------------------------------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(59, 42, 32, .42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  overflow-y: auto;
  z-index: 10;
  animation: fade-in .18s ease-out;
}

@keyframes fade-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .overlay { animation: none; }
}

.insight {
  width: 100%;
  max-width: 420px;
  max-height: 100%;
  overflow-y: auto;
  background: var(--linen);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(59, 42, 32, .25);
}

.insight-head {
  background: var(--espresso);
  color: var(--linen);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.insight-head img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 38px;
}

.insight-head h2 { font-size: 16px; font-weight: 500; margin: 0; }

.insight-body { padding: 20px 18px 22px; }

.block {
  border-radius: 10px;
  padding: 12px 13px;
}

.block + .block { margin-top: 12px; }

.block.olive { background: var(--olive-tint); }
.block.tan { background: var(--tan-tint); }

.lab {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.olive .lab, .lab.olive-text { color: var(--olive); }
.tan .lab { color: var(--brown); }

.block p {
  font-size: 14px;
  line-height: 1.5;
  margin: 5px 0 0;
}

strong, b { font-weight: 500; }

/* Chinese system fonts on Windows (Microsoft YaHei) have no medium
   weight, so 500 falls back to regular and emphasis disappears. Use
   semibold for every medium-weight element in Chinese. */
:lang(zh) strong, :lang(zh) b, :lang(zh) .key, :lang(zh) .question,
:lang(zh) .band-title, :lang(zh) .insight-head h2, :lang(zh) .lab,
:lang(zh) .btn, :lang(zh) .title, :lang(zh) .stuck-room, :lang(zh) .cta h2,
:lang(zh) .booking h2, :lang(zh) .thanks-title, :lang(zh) .confirm,
:lang(zh) .lang-switch [aria-current="true"] { font-weight: 600; }

.bridge {
  font-size: 14px;
  line-height: 1.55;
  margin: 18px 0 0;
}

.insight .key { margin-top: 16px; }

.insight .btn { margin-top: 24px; }

.countdown {
  font-size: 12px;
  text-align: center;
  margin: 8px 0 0;
}

/* ---------------------------------------------------------------- */
/* Result page                                                      */
/* ---------------------------------------------------------------- */

.result .map { margin-top: 14px; }

.result .block p { margin-top: 7px; }
.result .block p + p { margin-top: 6px; }

.stuck-room {
  font-size: 15px;
  font-weight: 500;
  margin: 6px 0 0;
}

.result .block .stuck-text { margin-top: 3px; }

.result .block .stuck-summary {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(196, 164, 124, .55);
}

/* ---------------------------------------------------------------- */
/* Privacy notice overlay                                           */
/* ---------------------------------------------------------------- */

.privacy-overlay {
  z-index: 20;
  align-items: flex-start;
}

.privacy-panel {
  width: 100%;
  max-width: 560px;
  margin: auto 0;
  background: var(--card);
  border: 1px solid var(--tan);
  border-radius: 14px;
  padding: 10px 20px 22px;
  box-shadow: 0 10px 30px rgba(59, 42, 32, .25);
  line-height: 1.6;
}

.privacy-back { padding-left: 0; color: var(--olive); }

.privacy-body h1 { font-size: 21px; font-weight: 500; margin: 6px 0 4px; }
.privacy-body h2 { font-size: 15.5px; font-weight: 500; margin: 22px 0 4px; color: var(--olive); }
.privacy-body p, .privacy-body li { font-size: 14px; }
.privacy-body p { margin: 6px 0; }
.privacy-body ul { margin: 6px 0; padding-left: 20px; }
.privacy-body a { color: var(--olive); }

.privacy-panel .btn { margin-top: 24px; }

:lang(zh) .privacy-body h1, :lang(zh) .privacy-body h2 { font-weight: 600; }

.cta {
  border-top: 1px solid var(--tan);
  margin-top: 18px;
  padding-top: 16px;
}

.cta h2 {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.35;
  margin: 0;
}

.cta > p {
  font-size: 14px;
  line-height: 1.5;
  margin: 7px 0 0;
}

.field {
  display: block;
  width: 100%;
  margin-top: 8px;
  background: var(--card);
  border: 1px solid var(--tan);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--espresso);
}

.field::placeholder { color: #9A8B78; }
.field:focus { outline: none; border-color: var(--olive); box-shadow: 0 0 0 1px var(--olive); }
.field[aria-invalid="true"] { border-color: var(--brown); }

textarea.field { min-height: 64px; resize: vertical; line-height: 1.45; }

.field-error { margin: 5px 0 0; font-size: 12.5px; }

.consent {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--soft-ink);
  cursor: pointer;
}

.consent input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--olive);
}

.cta .btn { margin-top: 14px; }

/* ---------------------------------------------------------------- */
/* Thank you slide                                                  */
/* ---------------------------------------------------------------- */

.thanks-label {
  text-align: center;
  margin-top: 20px;
  letter-spacing: .1em;
}

.thanks-title {
  font-size: 28px;
  font-weight: 500;
  text-align: center;
  margin: 4px 0 0;
}

.confirm {
  background: var(--olive-tint);
  border-radius: 12px;
  padding: 13px 14px;
  margin-top: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
}

.confirm svg { flex: 0 0 22px; }

.booking {
  background: var(--tan-tint);
  border: 1px solid var(--tan);
  border-radius: 12px;
  padding: 15px 14px 14px;
  margin-top: 12px;
}

.booking h2 { font-size: 15px; font-weight: 500; margin: 0; }

.booking p {
  font-size: 13px;
  line-height: 1.45;
  margin: 5px 0 0;
  color: var(--soft-ink);
}

.booking .btn { margin-top: 12px; }

.website {
  display: block;
  font-size: 13px;
  text-align: center;
  margin-top: 16px;
  color: var(--olive);
}

/* ---------------------------------------------------------------- */
/* Desktop                                                          */
/* ---------------------------------------------------------------- */

@media (min-width: 720px) {
  .page { padding-top: 32px; }
  .map { max-width: 360px; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
