@font-face {
  font-family: "KellyRegular";
  src: url("/fonts/KellyRegular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "GorditaMedium";
  src: url("/fonts/GorditaMedium.otf") format("opentype");
  font-weight: 500;
  font-display: swap;
}

:root {
  --terracotta: #db805b;
  --amber: #f0b55f;
  --blue: #84a9c4;
  --taupe: #ddc8b8;
  --blush: #fad9c9;
  --cream: #f5f2ee;
  --black: #000000;
  --radius: 4px;
  --max: 1080px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--black);
  font-family: "GorditaMedium", sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}
[hidden] { display: none !important; }
a { color: inherit; text-decoration-color: var(--terracotta); text-underline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Type */
.display {
  font-family: "KellyRegular", serif;
  font-weight: normal;
  line-height: 1.1;
  margin: 0 0 .4em;
  font-size: clamp(2.2rem, 6vw, 3.8rem);
}
h2.display { font-size: clamp(1.8rem, 4.5vw, 2.8rem); }
.accent { color: var(--terracotta); }
.eyebrow {
  font-size: .75rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin: 0 0 .8rem;
}
.lede { font-size: 1.05rem; max-width: 40rem; margin: 0 auto 1.5rem; }

/* Brand shapes */
.shape { position: absolute; z-index: 0; pointer-events: none; }
.shape-semi { width: 220px; top: 78vh; left: -40px; fill: var(--terracotta); opacity: .9; }
.shape-grid { width: 110px; top: 18px; right: -30px; fill: none; stroke: var(--blue); stroke-width: 3; }
@media (max-width: 640px) {
  .shape-semi { width: 130px; left: -30px; }
  .shape-grid { width: 70px; right: -22px; }
}
.screen { position: relative; z-index: 1; }

/* Buttons */
.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--terracotta);
  color: #fff;
  font: inherit;
  padding: .85rem 1.6rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: wait; transform: none; }
.btn.alt { background: var(--black); }
.btn.ghost { background: transparent; color: var(--black); border: 2px solid var(--black); }
.link-btn {
  appearance: none; background: none; border: 0; padding: .25rem 0;
  font: inherit; font-size: .9rem; color: var(--black); cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--terracotta); text-underline-offset: 3px;
}
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* Login */
#login { min-height: 100vh; display: grid; place-items: center; padding: 2rem 16px; text-align: center; }
.login-card { max-width: 34rem; width: 100%; }
#login-form { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }
#login-form input {
  flex: 1 1 16rem;
  font: inherit;
  padding: .85rem 1rem;
  border: 2px solid var(--black);
  border-radius: 999px;
  background: var(--cream);
  min-width: 0;
  padding-left: 1.4rem;
}
#login-form input:-webkit-autofill,
#login-form input:-webkit-autofill:hover,
#login-form input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 100px var(--cream) inset;
  -webkit-text-fill-color: var(--black);
}
#login-form input:focus { outline: none; border-color: var(--terracotta); }
.msg { min-height: 1.5em; margin-top: 1rem; }
.msg.error { color: #a4472a; }

/* Portal layout */
#portal { max-width: var(--max); margin: 0 auto; padding: 0 16px 3rem; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 0; gap: 1rem; flex-wrap: wrap; }
.top .eyebrow { margin: 0; }
.hero { text-align: center; padding: 2rem 0 1rem; }

.video { position: relative; aspect-ratio: 16 / 9; background: var(--black); border-radius: 20px; overflow: hidden; isolation: isolate; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.welcome { max-width: 820px; margin: 0 auto 3rem; }

/* Free month banner */
.offer-banner {
  max-width: 820px; margin: 0 auto 1.5rem;
  background: var(--amber);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.offer-banner p { margin: 0; flex: 1 1 18rem; }
.offer-banner strong { font-family: "KellyRegular", serif; font-weight: normal; font-size: 1.3rem; display: block; line-height: 1.2; }

/* Progress */
.progress-wrap { text-align: center; margin-bottom: 1.5rem; }
.progress { display: flex; justify-content: center; gap: .6rem; }
.pip { width: 46px; height: 23px; border-radius: 46px 46px 0 0; background: var(--taupe); transition: background .3s ease; }
.pip.unlocked { background: var(--blush); }
.pip.escaped { background: var(--terracotta); }
.progress-label { margin: .6rem 0 0; font-size: .95rem; }

/* Doors */
.doors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
@media (max-width: 860px) { .doors { grid-template-columns: 1fr; max-width: 30rem; margin: 0 auto; } }

.door {
  --room: var(--terracotta);
  position: relative;
  background: var(--cream);
  border: 2px solid var(--black);
  border-radius: 120px 120px var(--radius) var(--radius);
  padding: 2.4rem 1.4rem 1.5rem;
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
  overflow: hidden;
}
.door[data-room="persuasion"] { --room: var(--amber); }
.door[data-room="loyalty"] { --room: var(--blue); }
.door::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: var(--room);
}
.door .num { font-size: .75rem; letter-spacing: .18em; text-transform: uppercase; margin: 0 0 .3rem; }
.door h3 { font-family: "KellyRegular", serif; font-weight: normal; font-size: 1.9rem; line-height: 1.1; margin: 0 0 .8rem; }
.door .formula { margin: 0 0 1.2rem; font-size: .95rem; flex: 1; }
.lock {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--room);
  display: grid; place-items: center; margin-bottom: 1rem;
}
.lock svg { width: 30px; height: 30px; stroke: var(--black); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.status { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 1rem; }
.door.escaped { background: var(--blush); }
.door.escaped .status { color: var(--terracotta); }

@keyframes wiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
.door .lock.wiggle { animation: wiggle .35s ease 2; }

/* Room page */
#room-view { padding-top: .5rem; }
.back { margin-bottom: 1rem; }
.room-head { text-align: center; margin-bottom: 1.5rem; }
.room-head .display { font-size: clamp(2rem, 5vw, 3.2rem); }
.room-head .formula-title { font-size: 1.15rem; max-width: 40rem; margin: 0 auto; }
.room-body { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2rem; align-items: start; }
@media (max-width: 860px) { .room-body { grid-template-columns: 1fr; } }
.room-desc p { margin: 0 0 1rem; }
.facts { list-style: none; padding: 0; margin: 1.25rem 0; display: grid; gap: .5rem; }
.facts li { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--taupe); padding-bottom: .5rem; font-size: .95rem; }
.facts span:first-child { letter-spacing: .12em; text-transform: uppercase; font-size: .75rem; color: var(--terracotta); padding-top: .2rem; }
.side { background: var(--cream); border: 2px solid var(--black); border-radius: var(--radius); padding: 1.4rem; }
.side h4 { font-size: .75rem; letter-spacing: .18em; text-transform: uppercase; color: var(--terracotta); margin: 0 0 .8rem; font-weight: 500; }
.resources { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .6rem; }
.resources a { display: block; padding: .7rem 1.2rem; border-radius: 999px !important; background: var(--blush); border-radius: var(--radius); text-decoration: none; }
.resources a:hover { background: var(--taupe); }
.resources a::after { content: " \2197"; }
.escape-box { text-align: center; }
.escape-box p { margin: 0 0 .9rem; font-size: .95rem; }
.escape-box .btn { width: 100%; justify-content: center; }
.escaped-note { background: var(--blush); border-radius: var(--radius); padding: 1rem; }
.escaped-note strong { font-family: "KellyRegular", serif; font-weight: normal; font-size: 1.5rem; display: block; }

/* Finale */
.finale { text-align: center; max-width: 40rem; margin: 3rem auto 0; padding: 2rem 1.5rem; background: var(--amber); border-radius: var(--radius); }
.finale .accent { color: var(--black); }
.finale p { margin: 0; }

.foot { text-align: center; margin-top: 4rem; font-size: .9rem; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20;
  background: var(--black); color: #fff; padding: .7rem 1.1rem; border-radius: var(--radius);
  font-size: .95rem; max-width: calc(100vw - 32px); text-align: center;
}

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

/* Inside the portal, keep the shapes out of the way of the content */
body.in-portal .shape-semi { display: none; }
@media (max-width: 640px) { body.in-portal .shape-grid { display: none; } }

/* Retention Lab link (non-members only) */
.lab-slot:empty { display: none; }
.lab-slot { max-width: 820px; margin: -.5rem auto 1.75rem; text-align: center; }
.lab-link { text-decoration-color: var(--terracotta); text-decoration-thickness: 2px; }
.lab-link:hover { color: var(--terracotta); }

/* Logo */
.login-logo { margin: 0 auto .5rem; }
.login-logo img { width: min(300px, 70vw); height: auto; display: block; margin: 0 auto; }
.top-logo img { width: 64px; height: auto; display: block; }
.help { font-size: .9rem; margin: .5rem 0 0; }
