/* Extra pages inside the app: menu + detail views */

/* ------------------------------------------------ extra pages inside the app */
.pages { position: absolute; left: 0; right: 0; bottom: 0; top: 3.2em; background: var(--void); opacity: 0; pointer-events: none; transition: opacity .5s ease; z-index: 3; }

.pages.on { opacity: 1; pointer-events: auto; }

.pg-menu, .pg-detail { position: absolute; inset: 0; display: none; flex-direction: column; }

.pg-menu.on, .pg-detail.on { display: flex; animation: rise .35s ease both; }

.pg-head { padding: 1.4em 1.4em .6em; display: flex; flex-direction: column; gap: .35em; }

.pg-head b { font-family: var(--display); font-weight: 600; font-size: 1.7em; }

.pg-head span { color: var(--muted); font-size: .9em; }

.pg-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(13em, 1fr)); align-content: start; gap: .7em; padding: .6em 1.4em 1.4em; }

.menu-btn { position: relative; text-align: left; cursor: pointer; font: inherit; color: var(--beige); background: rgba(167, 139, 250, .12); border: 1px solid var(--line); border-radius: .85em; padding: .9em 2.4em .9em 1em; display: flex; flex-direction: column; gap: .3em; transition: border-color .2s, background .2s, box-shadow .35s ease; }

.menu-btn b { font-family: var(--display); font-weight: 600; font-size: 1.05em; }

.menu-btn span { font-family: var(--mono); font-size: .7em; letter-spacing: .04em; color: var(--muted); }

.menu-btn::after { content: "→"; position: absolute; right: .9em; top: 50%; transform: translateY(-50%); color: var(--accent-strong); transition: transform .2s; }

.menu-btn:hover { border-color: var(--accent-deep); background: rgba(167, 139, 250, .2); }

.menu-btn:hover::after { transform: translate(.2em, -50%); }

/* Pointer-reactive 3D tilt, same mechanic as lyrapp.to's own feature
   cards: wired up in pages.js on mousemove/mouseleave, which sets this
   transform every frame the cursor moves. These cards live inside the
   laptop device's own scaled-down 3D rig (mount() + the laptop's own
   transform: scale(k)); the actual bug that made this look broken on
   real hardware was the lid itself never resting perfectly flat (see
   devices/laptop.js pose()), projecting the whole screen's hit-testing
   AND rendering through a tilted 3D quad. Now that the lid snaps to
   0deg once open and idle, this card-level tilt is measuring a genuinely
   flat box again. */
.tilt-3d { transform-style: preserve-3d; will-change: transform; transition: transform .15s ease-out, box-shadow .35s ease; }
.tilt-3d:hover { box-shadow: 0 24px 60px rgba(0, 0, 0, .38); }

.pg-bar { display: flex; align-items: center; gap: 1em; padding: .7em 1.2em; border-bottom: 1px solid var(--line); }

.pg-back { display: inline-flex; align-items: center; gap: .4em; cursor: pointer; font-family: var(--mono); font-size: .75em; letter-spacing: .06em; text-transform: uppercase; color: var(--beige); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: .5em 1em .5em .7em; transition: border-color .2s, background .2s; }

.pg-back:hover { border-color: var(--accent); background: rgba(167, 139, 250, .14); }

.pg-crumb { font-family: var(--mono); font-size: .72em; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.pg-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 1em 1.4em 1.6em; scrollbar-width: thin; scrollbar-color: #4a3690 transparent; }

.pg-intro { display: flex; gap: .7em; align-items: flex-start; margin-bottom: 1em; }

.pg-intro p { margin: 0; line-height: 1.5; padding-top: .25em; }

.pg-body { animation: rise .45s ease both; }

.pg-h { margin: 0 0 .3em; font-family: var(--display); font-weight: 600; font-size: 1.3em; line-height: 1.2; }

.pg-lead { margin: 0 0 1em; color: var(--muted); font-size: .9em; line-height: 1.6; }

.pg-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15em, 1fr)); gap: .7em; }

.pg-card { background: rgba(167, 139, 250, .1); border: 1px solid var(--line); border-radius: .8em; padding: .85em .95em; display: flex; flex-direction: column; gap: .4em; }

.pg-ct { display: flex; justify-content: space-between; align-items: baseline; gap: .6em; }

.pg-ct b { font-family: var(--display); font-weight: 600; font-size: 1em; }

.pg-ct i { font-style: normal; font-family: var(--mono); font-size: .62em; letter-spacing: .06em; color: var(--accent-strong); text-align: right; }

.pg-card p { margin: 0; font-size: .82em; line-height: 1.55; color: var(--beige); opacity: .88; }

.pg-ck { margin-top: auto; padding-top: .3em; font-family: var(--mono); font-size: .66em; color: #6EE7B7; }

.pg-note { margin-top: .9em; border-left: 3px solid var(--accent); background: rgba(167, 139, 250, .1); border-radius: .3em .7em .7em .3em; padding: .7em .9em; font-size: .8em; line-height: 1.55; color: var(--beige); }

.pg-gh { margin: 1.2em 0 .5em; font-family: var(--mono); font-size: .68em; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-strong); }

.pg-gh:first-child { margin-top: 0; }

.pg-q { border: 1px solid var(--line); border-radius: .75em; background: rgba(167, 139, 250, .08); margin-bottom: .45em; overflow: hidden; }

.pg-qb { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 1em; text-align: left; cursor: pointer; font: inherit; font-size: .88em; font-weight: 500; color: var(--beige); background: transparent; border: 0; padding: .7em .9em; }

.pg-qb i { flex: none; font-style: normal; color: var(--accent-strong); transition: transform .25s; }

.pg-qa { display: none; padding: 0 .9em .8em; }

.pg-qa p { margin: 0; font-size: .8em; line-height: 1.6; color: var(--muted); }

.pg-q.open .pg-qa { display: block; }

.pg-q.open .pg-qb i { transform: rotate(45deg); }

.pg-ask { display: flex; flex-wrap: wrap; gap: .5em; margin-top: .3em; }

.pg-ask span { font-family: var(--mono); font-size: .72em; padding: .45em .8em; border: 1px solid var(--line); border-radius: 999px; background: #150e20; }

.pg-form { display: flex; flex-direction: column; gap: .6em; max-width: 34em; }

.pg-form label { font-family: var(--mono); font-size: .66em; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.pg-form input, .pg-form select, .pg-form textarea { font: inherit; font-size: .88em; color: var(--beige); background: #120b1c; border: 1px solid var(--line); border-radius: .6em; padding: .55em .8em; width: 100%; }

.pg-form textarea { min-height: 5em; resize: vertical; }

.pg-form input:focus, .pg-form select:focus, .pg-form textarea:focus { outline: none; border-color: var(--accent); }

.pg-send { align-self: flex-start; cursor: pointer; font-family: var(--mono); font-weight: 600; font-size: .75em; letter-spacing: .06em; text-transform: uppercase; color: #150E20; background: var(--accent); border: 0; border-radius: 999px; padding: .75em 1.4em; }

.pg-send:disabled { opacity: .6; cursor: default; }

.pg-status { font-family: var(--mono); font-size: .7em; color: var(--muted); }

.pg-status.ok { color: #6EE7B7; }

.pg-status.err { color: #ff8a8a; }

.pg-links { display: flex; gap: 1.2em; margin-top: 1em; font-family: var(--mono); font-size: .72em; letter-spacing: .08em; text-transform: uppercase; }

.pg-links a { color: var(--accent-strong); }

/* menu page: compact buttons that all fit, no scrollbars */
.pg-grid { grid-template-columns: repeat(auto-fit, minmax(9.5em, 1fr)); gap: .55em; padding: .4em 1.4em 1em; overflow: hidden; align-content: start; }

.pg-head { padding: 1em 1.4em .4em; }

.pg-head b { font-size: 1.4em; }

.pg-head span { font-size: .8em; }

.menu-btn { padding: .7em 2em .7em .9em; border-radius: .7em; }

.menu-btn b { font-size: .92em; }

.menu-btn span { display: none; }

.menu-btn::after { right: .7em; font-size: .9em; }

.pg-scroll, .pg-grid { scrollbar-width: none; -ms-overflow-style: none; }

.pg-scroll::-webkit-scrollbar, .pg-grid::-webkit-scrollbar { display: none; }

.pg-menu.on { justify-content: center; }

.pg-grid { flex: 0 0 auto; }

/* menu page: symmetric grid that fills the screen */
.pg-menu.on { justify-content: flex-start; }

.pg-head { align-items: center; text-align: center; padding: 1.1em 1.4em .5em; }

/* minmax(0, 1fr), not bare 1fr: bare 1fr still respects each row's own
   content-driven minimum height as a floor, so on a wide-but-short real
   screen (a laptop device rendered at some aspect ratios) 2 rows of 8
   buttons could need more height than actually available and overflow
   past this grid's own box -- silently unclickable since .pg-grid also
   sets overflow:hidden. minmax(0, ...) lets rows actually shrink to fit,
   so the whole menu always stays fully on-screen and clickable.
   Shrink-to-fit still isn't a hard guarantee on every real window size
   (a real user reported the bottom row unreachable on their own laptop,
   not reproducible here), so overflow-y: auto is the actual safety net:
   whenever the two rows genuinely don't fit, the grid scrolls instead of
   silently clipping the bottom row past an invisible, unclickable edge.
   Both .pg-scroll and .pg-grid already hide their scrollbar by design
   (see the scrollbar-width/::-webkit-scrollbar rules above), so this
   changes nothing visually in the common case where everything fits. */
.pg-grid { flex: 1 1 auto; min-height: 0; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(0, 1fr); align-content: stretch; gap: .8em; padding: .6em 1.4em 1.4em; overflow-y: auto; }

.menu-btn { align-items: center; justify-content: center; text-align: center; padding: .6em 1.6em; }

.menu-btn b { font-size: 1.1em; }

.menu-btn::after { right: .8em; }

/* portrait phones: two columns */
.stage[data-device$="-portrait"] .pg-grid { grid-template-columns: repeat(2, 1fr); }
.stage[data-device$="-portrait"] .pg-grid { grid-template-rows: repeat(4, minmax(0, 1fr)); gap: .6em; padding-bottom: 1em; }
.stage[data-device$="-portrait"] .menu-btn { min-height: 0; padding: .3em 1.5em .3em .5em; }
.stage[data-device$="-portrait"] .menu-btn b { font-size: .9em; line-height: 1.15; }
.stage[data-device^="phone"] .menu-btn { padding: .4em 1.9em .4em .7em; }
.stage[data-device^="phone"] .menu-btn::after { right: .6em; }

/* menu buttons: title lifted, a down chevron at the bottom centre (final override) */
/* min-height: 0 is required here, not just on .pg-grid's own grid-auto-rows
   (minmax(0, 1fr) above): a grid ITEM's automatic minimum height defaults
   to its content size regardless of how small its track is allowed to go,
   so without this the button still refused to shrink below its natural
   content height on a genuinely short real window -- overflowing past
   .pg-grid's own overflow:hidden box and making the bottom row silently
   unclickable, same failure mode as before but one CSS layer deeper. */
.menu-btn, .stage[data-device$="-portrait"] .menu-btn, .stage[data-device^="phone"] .menu-btn { padding: .5em .6em; justify-content: center; min-height: 0; }
.menu-btn b { transform: none; }
.menu-btn::after, .stage[data-device^="phone"] .menu-btn::after {
  content: ""; right: auto; left: 50%; top: auto; bottom: 1.35em; width: .55em; height: .55em;
  border-right: 2px solid var(--accent-strong); border-bottom: 2px solid var(--accent-strong);
  transform: translateX(-50%) rotate(45deg); transition: transform .2s;
}
.menu-btn:hover::after { transform: translate(-50%, .2em) rotate(45deg); }

/* FAQ sub-tabs: same shapes and motion as lyrapp.to (centered chips, beige fill rising from the bottom, groups fade up) */
.pg-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: .5em; margin-bottom: 1.1em; }
.pg-tab { position: relative; overflow: hidden; cursor: pointer; font-family: var(--mono); font-size: .68em; font-weight: 600; letter-spacing: .01em; color: var(--muted);
  border: 1px solid var(--line); background: var(--panel); padding: .65em .95em; border-radius: 2px; transition: color .4s ease, border-color .4s ease; }
.pg-tab:hover { color: var(--beige); border-color: var(--accent-deep); }
.pg-tab-label { position: relative; z-index: 1; }
.pg-tab-fill { position: absolute; inset: 0; z-index: 0; background: var(--accent); transform: translateY(100%); transition: transform .45s cubic-bezier(.16, 1, .3, 1); }
.pg-tab.active, .pg-tab.active:hover { color: #241735; border-color: transparent; }
.pg-tab.active .pg-tab-fill { transform: translateY(0); }
@keyframes pgPaneIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.pg-pane-in { animation: pgPaneIn .45s cubic-bezier(.16, 1, .3, 1) both; }
.pg-q { border-radius: 2px; background: var(--panel); transition: background .3s ease, border-color .3s ease; }
.pg-q.open { background: var(--panel2); border-color: var(--accent-deep); }
