/* Bardic Flow: which face of the page shows, and the install guide (the same as Bardic for iPhone, ../ios/ios.css).
 *   html.mode-app      the app: from the Home Screen on an iPhone, or on a computer (the editor lives there)
 *   html.mode-install  an iPhone, in a browser tab: this page is the app, add it to the Home Screen
 *   html.mode-other    any other device */
main.gate, .app { display: none; }
html.mode-other .gate-other, html.mode-install .gate-install { display: flex; }
html.mode-app .app { display: block; }
html:not(.mode-app) .rotate { display: none !important; }

/* ---------- Gates (browser tab, other devices) ---------- */
main.gate { min-height: 100dvh; align-items: center; justify-content: center; padding: max(28px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom)); }
.gate-card { width: min(460px, 100%); text-align: center; }
.gate-card h1 { font-size: clamp(40px, 11vw, 56px); line-height: 1; margin: 0 0 14px; }
.gate-card > p { color: var(--muted); font-size: 18px; margin: 0 0 18px; }
.gate-card > p.small { font-size: 15px; }
.gate-card .btn { margin-top: 6px; }
.gate-icon { width: 84px; height: 84px; border-radius: 19px; display: block; margin: 0 auto 18px; box-shadow: 0 10px 30px var(--shadow); }
.back-link { color: var(--muted); font-size: 15px; }
main.gate .eq { margin-bottom: 18px; }


/* ---------- Install page ---------- */
.gate-install { align-items: flex-start; padding-bottom: 110px; }
.inst { text-align: left; }
.inst-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.inst-hero .gate-icon { width: 72px; height: 72px; border-radius: 16px; margin: 0; flex: none; }
.inst-hero .kicker { margin: 0 0 4px; font-size: 12px; letter-spacing: 3px; }
.inst h1 { font-size: 28px; line-height: 1.02; margin: 0; }
.inst-key {
  margin: 0 0 18px !important; padding: 12px 14px; border-radius: 14px; font-size: 16px !important; line-height: 1.4;
  border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--card)); color: var(--muted);
}
.inst-key b { color: var(--accent); }
.inst-inapp { padding: 14px; border-radius: 14px; border: 1px solid var(--evt); background: color-mix(in srgb, var(--evt) 10%, var(--card)); margin: 0 0 18px; }
.inst-inapp p { margin: 0 0 8px; color: var(--muted); }
.inst-inapp b { color: var(--text); }
html.in-app-browser .isteps { opacity: .45; }
html.arrow-top .gate-install { padding-top: max(64px, env(safe-area-inset-top)); }

.isteps { list-style: none; counter-reset: s; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.isteps li {
  counter-increment: s; display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 14px; align-items: center;
  padding: 10px; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
}
.itxt { display: grid; gap: 3px; font-size: 14px; color: var(--muted); line-height: 1.35; }
.itxt > b { font-size: 16px; color: var(--text); font-weight: 600; }
.itxt > b::before { content: counter(s) ". "; font-family: 'Cormorant SC', serif; font-weight: 700; color: var(--accent); font-size: 19px; }
.itxt span b { color: var(--text); font-weight: 600; }

/* Little drawings of what the person will see. */
.mock { height: 84px; border-radius: 11px; background: var(--bg); border: 1px solid var(--line); position: relative; overflow: hidden; font-size: 9px; color: var(--muted); }
.m-bar { display: flex; align-items: flex-end; }
.m-bar::before { content: ""; position: absolute; inset: 10px 10px 34px; border-radius: 6px; background: repeating-linear-gradient(180deg, var(--line) 0 4px, transparent 4px 10px); opacity: .5; }
.m-bar .m-dot { display: none; }
.m-bar .m-url { position: absolute; left: 8px; right: 34px; bottom: 7px; height: 20px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; padding: 0 8px; white-space: nowrap; overflow: hidden; font-size: 8px; }
.m-btn {
  position: absolute; right: 6px; bottom: 6px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--blue); color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 30%, transparent); animation: ping 1.6s ease-out infinite;
}
.m-btn:not(.dots) { background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 22' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 13V1.5M5 5l4-4 4 4'/%3E%3Cpath d='M5.5 8.5H3a1.5 1.5 0 0 0-1.5 1.5v9A1.5 1.5 0 0 0 3 20.5h12a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 15 8.5h-2.5'/%3E%3C/svg%3E") center / 11px 13px no-repeat; }
.m-btn svg { width: 12px; height: 12px; }
.m-bar.top::before { inset: 34px 10px 10px; }
.m-bar.top .m-url { top: 7px; bottom: auto; }
.m-bar.top .m-btn { top: 6px; bottom: auto; }
@keyframes ping { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--blue) 0%, transparent); } }

.m-sheet { display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; padding: 6px; }
.m-sheet span { height: 22px; border-radius: 6px; background: var(--card); display: flex; align-items: center; padding: 0 7px; white-space: nowrap; }
.m-sheet span.hl { color: var(--text); font-weight: 600; font-size: 9px; outline: 2px solid var(--blue); gap: 5px; }
.m-plus { width: 11px; height: 11px; border: 1.5px solid currentColor; border-radius: 3px; position: relative; flex: none; }
.m-plus::before, .m-plus::after { content: ""; position: absolute; left: 50%; top: 50%; background: currentColor; transform: translate(-50%, -50%); }
.m-plus::before { width: 6px; height: 1.5px; }
.m-plus::after { width: 1.5px; height: 6px; }

.m-add { display: flex; flex-direction: column; gap: 6px; padding: 7px 8px; }
.m-top { display: flex; justify-content: space-between; }
.m-top i { font-style: normal; color: var(--blue); }
.m-top em { font-style: normal; color: #fff; background: var(--blue); border-radius: 8px; padding: 1px 7px; font-weight: 600; box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 30%, transparent); }
.m-name { display: flex; align-items: center; gap: 6px; color: var(--text); font-size: 11px; font-weight: 600; }
.m-name img { width: 22px; height: 22px; border-radius: 5px; }
.m-toggle { display: flex; align-items: center; justify-content: space-between; background: var(--card); border-radius: 6px; padding: 4px 6px; }
.m-toggle i { width: 20px; height: 12px; border-radius: 6px; background: #34C759; position: relative; }
.m-toggle i::after { content: ""; position: absolute; right: 1px; top: 1px; width: 10px; height: 10px; border-radius: 50%; background: #fff; }

.m-home { display: grid; grid-template-columns: repeat(4, 20px); gap: 8px 9px; justify-content: center; align-content: center; background: linear-gradient(160deg, color-mix(in srgb, var(--blue) 25%, var(--bg)), var(--bg)); }
.m-home i { width: 20px; height: 20px; border-radius: 5px; background: var(--line); opacity: .7; }
.m-home img { width: 20px; height: 20px; border-radius: 5px; box-shadow: 0 0 0 2px var(--accent); animation: tap 1.6s ease-in-out infinite; }
@keyframes tap { 50% { transform: scale(.85); } }

/* The arrow at the edge of the screen, pointing at the browser button to tap first. */
.to-share { position: fixed; z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 0; color: var(--blue); font-weight: 600; font-size: 14px; pointer-events: none; }
.to-share span { background: var(--blue); color: #fff; border-radius: 999px; padding: 4px 12px; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.to-share i { width: 16px; height: 16px; margin-top: -4px; border-right: 4px solid currentColor; border-bottom: 4px solid currentColor; transform: rotate(45deg); }
.to-share.at-top-right i { margin: 0 0 -4px; }
.to-share.at-bottom-center { left: 50%; bottom: max(8px, env(safe-area-inset-bottom)); animation: nudge-c 1.4s ease-in-out infinite; }
.to-share.at-bottom-right { right: 14px; bottom: max(8px, env(safe-area-inset-bottom)); animation: nudge 1.4s ease-in-out infinite; }
.to-share.at-top-right { right: 14px; top: max(8px, env(safe-area-inset-top)); flex-direction: column-reverse; animation: nudge-up 1.4s ease-in-out infinite; }
.to-share.at-top-right i { transform: rotate(-135deg); }
.to-share.at-bottom-center { transform: translateX(-50%); }
@keyframes nudge-c { 50% { transform: translate(-50%, 8px); } }
@keyframes nudge { 50% { transform: translateY(8px); } }
@keyframes nudge-up { 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .to-share, .m-btn, .m-home img { animation: none !important; } }
@media (max-width: 360px) { .isteps li { grid-template-columns: 104px minmax(0, 1fr); } }
