@font-face { font-family: "Doto"; font-weight: 900; src: url("/fonts/doto-900.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Doto"; font-weight: 700; src: url("/fonts/doto-700.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Space Mono"; font-weight: 400; src: url("/fonts/spacemono-400.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Space Mono"; font-weight: 700; src: url("/fonts/spacemono-700.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Homemade Apple"; font-weight: 400; src: url("/fonts/homemadeapple-400.ttf") format("truetype"); font-display: swap; }

:root {
  --navy: #0f1219; --paper: #151a26; --ink: #dfe6ff; --dim: #8b96b8; --green: #3ef08a; --green-dim: #1f8a52;
  --violet: #a99bff; --violet-deep: #6d5cff; --red: #ff6b8a; --line: rgba(62, 240, 138, .28);
  --mono: "Space Mono", ui-monospace, Menlo, Consolas, monospace; --display: "Doto", var(--mono); --hand: "Homemade Apple", cursive;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--navy); color: var(--ink); font-family: var(--mono); font-size: 16px; line-height: 1.45; font-synthesis: none; -webkit-text-size-adjust: 100%; }
button, input, a { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }
[hidden] { display: none !important; }
img { display: block; }

/* ---- the office: one 16:9 stage covering the viewport, everything placed in its own coordinates ---- */
.office { position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden; }
.stage { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(100vw, calc(100vh * 16 / 9)); height: calc(min(100vw, calc(100vh * 16 / 9)) * 9 / 16); }
.office::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, var(--navy) 0, transparent 6%, transparent 94%, var(--navy) 100%); }
.stage > * { z-index: 1; }
.scene { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scene-tall { display: none; }

.plaque { position: absolute; left: 35.6%; top: 6.7%; width: 28.8%; height: 11.2%; margin: 0; display: flex; align-items: center; justify-content: center; }
.name { font-family: var(--display); font-weight: 900; color: var(--green); font-size: calc(var(--stage-w, 1920px) * .044); letter-spacing: .04em; line-height: 1; text-shadow: 0 0 18px rgba(62, 240, 138, .35); }

.wall { position: absolute; left: 34.7%; top: 21.6%; width: 30.6%; height: 21.7%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.2%; }
.frame { position: relative; background: url("/img/diploma.webp") center / 100% 100% no-repeat; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20% 12% 18%; text-align: center; min-width: 0; }
.frame-name { font-family: var(--display); font-weight: 700; color: var(--green); font-size: clamp(11px, calc(var(--stage-w, 1920px) * .0085), 17px); line-height: 1.15; overflow-wrap: anywhere; }
.frame-num { color: var(--dim); font-size: clamp(10px, calc(var(--stage-w, 1920px) * .0065), 13px); margin-top: .35em; }
.frame.is-empty .frame-name { color: var(--dim); font-family: var(--mono); font-weight: 400; }

/* the therapist's business card, left on the couch cushion */
.bizcard { position: absolute; left: 30%; top: 56%; width: 27%; min-width: 320px; background: url("/img/card.webp") center / 100% 100% no-repeat; padding: 4.5% 6% 5%; display: flex; flex-direction: column; gap: .35em; font-size: clamp(12px, calc(var(--stage-w, 1920px) * .0078), 15px); filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .55)); }
.bc-head { display: flex; justify-content: space-between; align-items: baseline; gap: .8em; border-bottom: 1px solid var(--line); padding-bottom: .5em; margin-bottom: .2em; }
.bc-ticker { font-family: var(--display); font-weight: 900; color: var(--green); font-size: 1.7em; line-height: 1; }
.bc-practice { color: var(--dim); font-size: .8em; text-align: right; }
.bc-label { color: var(--violet); font-size: .8em; letter-spacing: .12em; text-transform: uppercase; }
.bc-ca-row { display: flex; gap: .6em; align-items: center; }
.bc-ca { flex: 1; min-width: 0; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; word-break: break-all; line-height: 1.3; user-select: all; }
.bc-ca.is-empty { color: var(--dim); font-weight: 400; user-select: text; }
.bc-row { display: flex; gap: .5em; align-items: stretch; margin-top: .3em; }
.bc-foot { color: var(--dim); font-size: .75em; margin-top: .2em; }

.key { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 48px; min-width: 48px; padding: 0 1em; border: 1px solid var(--green); border-radius: 4px; background: rgba(15, 18, 25, .85); color: var(--green); text-decoration: none; transition: transform .08s; white-space: nowrap; }
.key:active { transform: translateY(2px); }
.key[aria-disabled="true"], .key:disabled { color: var(--dim); border-color: rgba(139, 150, 184, .45); cursor: not-allowed; pointer-events: none; }
.key[aria-disabled="true"] img, .key:disabled img { opacity: .4; }
.key-buy { flex: 1; }
.key-mark { padding: 0; }
.cta { display: inline-flex; align-items: center; justify-content: center; gap: .6em; min-height: 52px; padding: 0 1.4em; border: 0; border-radius: 4px; background: var(--green); color: #07130b; font-weight: 700; text-decoration: none; transition: transform .08s; }
.cta:active { transform: translateY(2px); }
.cta:disabled { background: var(--green-dim); color: #0a2a18; cursor: wait; }

/* X alone: the enamel plate on the couch's foot */
.plate { position: absolute; left: 19.5%; top: 76.5%; width: 7%; min-width: 108px; aspect-ratio: 600 / 266; background: url("/img/plate.webp") center / 100% 100% no-repeat; display: flex; align-items: center; justify-content: center; text-decoration: none; transition: transform .08s; }
.plate:active { transform: translateY(2px); }
.plate[aria-disabled="true"] { pointer-events: none; }
.plate[aria-disabled="true"] img { opacity: .35; }

/* ---- the notebook ---- */
.notebook { position: absolute; left: 66%; top: 6%; width: 31.5%; height: 88%; display: flex; }
.tabs { position: absolute; right: 100%; top: 56%; display: flex; flex-direction: column; gap: 6px; margin-right: -2px; }
.tab { min-height: 48px; padding: 0 .9em; border: 1px solid var(--green); border-right: 0; border-radius: 6px 0 0 6px; background: rgba(15, 18, 25, .92); color: var(--dim); font-size: 14px; letter-spacing: .04em; }
.tab.is-on { color: var(--navy); background: var(--green); }
.page { position: relative; flex: 1; min-width: 0; background: url("/img/notebook-page.webp") center / 100% 100% no-repeat; padding: 6% 7% 6% 13%; overflow-y: auto; overscroll-behavior: contain; box-shadow: 0 24px 60px rgba(0, 0, 0, .6); border-radius: 4px; }
.sheet { display: flex; flex-direction: column; gap: .5em; min-height: 100%; }

.line { margin: 0; padding: .35em 0; border-bottom: 1px solid var(--line); line-height: 1.5; overflow-wrap: anywhere; }
.line-label { color: var(--violet); }
.note { color: var(--dim); font-size: .85em; border-bottom: 0; }
.line-input { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--green); padding: .5em 0; color: var(--ink); font-weight: 700; min-height: 48px; }
.line-input::placeholder { color: var(--dim); font-weight: 400; }
.intake { display: flex; flex-direction: column; gap: .6em; }
.intake .cta { align-self: flex-start; margin-top: .4em; }
.said { display: grid; grid-template-columns: auto 1fr; gap: .8em; }
.said b { color: var(--violet); font-weight: 400; }
.said.you b { color: var(--green); }
.said.err { color: var(--red); }
.reply { display: flex; gap: .5em; align-items: flex-end; }
.reply .line-input { flex: 1; }
.typing::after { content: "▌"; color: var(--green); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.diag { display: flex; flex-direction: column; gap: .8em; margin-top: .6em; }
.tear { width: 100%; aspect-ratio: 16 / 9; border-radius: 3px; }
.card { position: relative; aspect-ratio: 16 / 9; background: url("/img/page.webp") center / cover no-repeat; padding: 4% 5% 4% 16%; display: flex; flex-direction: column; font-size: clamp(9px, calc(var(--nb-w, 600px) * .019), 13px); border-radius: 3px; }
.c-top { display: flex; justify-content: space-between; color: var(--dim); letter-spacing: .1em; font-size: .85em; }
.c-label { color: var(--violet); margin-top: .8em; }
.c-name { font-family: var(--display); font-weight: 900; color: var(--green); font-size: 2.9em; line-height: 1.05; }
.c-sum { margin: .5em 0 0; line-height: 1.35; }
.c-nums { display: flex; gap: 2.4em; margin-top: .9em; }
.c-nums div { display: flex; flex-direction: column; }
.c-nums small { color: var(--dim); letter-spacing: .1em; font-size: .75em; }
.c-nums strong { color: var(--green); font-size: 1.9em; line-height: 1.1; }
.c-nums strong.neg { color: var(--red); }
.c-worst { margin-top: .8em; }
.c-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; color: var(--dim); font-size: .75em; }
.c-sign { font-family: var(--hand); color: var(--violet); font-size: 1.9em; }
.actions { display: flex; flex-wrap: wrap; gap: .5em; }
.pay-form { display: flex; flex-direction: column; gap: .5em; margin-top: .4em; }

.wall-list, .rules { margin: 0; padding: 0 0 0 1.4em; }
.wall-list li, .rules li { padding: .4em 0; border-bottom: 1px solid var(--line); }
.wall-list b { font-family: var(--display); font-weight: 700; color: var(--green); font-size: 1.05em; }
.wall-list span { color: var(--dim); }

.toast { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--paper); border: 1px solid var(--green); color: var(--ink); padding: .7em 1.1em; border-radius: 4px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; max-width: min(90vw, 480px); text-align: center; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .typing::after { animation: none; }
  .scene { display: none; }
  .office::before { content: ""; position: absolute; inset: 0; background: url("/img/office-poster.jpg") center / cover no-repeat; }
}

/* ---- narrow viewports: the office is the head of the page, the notebook follows, one scroll ---- */
@media (max-width: 999px), (max-aspect-ratio: 1 / 1) {
  .office { overflow: visible; min-height: 0; }
  .stage { position: relative; left: 0; top: 0; transform: none; width: 100%; height: auto; display: flex; flex-direction: column; }
  .scene, video.scene { display: none; }
  .office::before { display: none; }
  .scene-tall { display: block; position: relative; width: 100%; height: auto; aspect-ratio: 1080 / 1920; }
  .plaque { left: 28.2%; top: 55vw; width: 43.5%; height: 10.7vw; }
  .name { font-size: clamp(28px, 9.5vw, 52px); }
  .wall { left: 28.2%; top: 66.3vw; width: 43.5%; height: 19vw; gap: 3.5%; }
  .frame { padding: 0; }
  .frame-name, .frame-num { display: none; }
  .plate { left: 24%; top: 117vw; width: 26%; min-width: 108px; max-width: 150px; }
  .notebook, .bizcard { position: relative; left: auto; top: auto; width: auto; height: auto; min-width: 0; }
  .notebook { flex-direction: column; margin: -24% 16px 0; z-index: 2; order: 2; }
  .bizcard { order: 3; }
  .tabs { position: static; flex-direction: row; margin: 0; gap: 4px; }
  .tab { flex: 1; border-right: 1px solid var(--green); border-bottom: 0; border-radius: 6px 6px 0 0; padding: 0 .4em; }
  .page { background-size: cover; padding: 7% 6% 7% 12%; overflow: visible; min-height: 60vh; }
  .card { font-size: clamp(8px, 2.6vw, 12px); }
  .bizcard { margin: 18px 16px 32px; padding: 6% 6% 5%; font-size: 14px; }
  .bc-row { flex-wrap: wrap; }
}
@media (max-width: 380px) {
  .bizcard { font-size: 13px; }
  .key { padding: 0 .7em; }
  .tab { font-size: 13px; }
}
