/* ===================== landing and sign-in ===================== */
/* Welcome is scrollable independently of the full-screen instrument. */
.auth {
  overflow: auto;
  background:
    radial-gradient(ellipse 60% 70% at 78% 34%, #f0e7d8 0, transparent 70%),
    radial-gradient(ellipse 50% 50% at 4% 100%, rgb(var(--sage-rgb) / 0.12) 0, transparent 70%),
    var(--bg);
}
.entry-shell { max-width: 1440px; min-height: 100%; margin: auto; padding: 34px 64px 24px; display: flex; flex-direction: column; }
.entry-header, .entry-brand, .entry-nav, .entry-actions { display: flex; align-items: center; }
.entry-header { justify-content: space-between; gap: 20px; }
.entry-brand { gap: 10px; font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.entry-brand .wordmark-glyph { width: 25px; height: 25px; flex: none; }
.entry-nav { gap: 12px; }
.entry-nav .btn { height: 38px; padding: 0 18px; color: var(--ink); }
.entry-hero { flex: 1; display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; padding: 70px 0 62px; }
.entry-eyebrow { display: block; color: var(--accent-ink); text-transform: uppercase; letter-spacing: .2em; font-size: 10px; font-weight: 500; }
.entry-copy h1 { font-size: clamp(44px, 5.4vw, 76px); line-height: 1.08; letter-spacing: -.04em; font-weight: 400; margin: 26px 0; }
.entry-copy h1 em { font-style: normal; font-weight: 500; color: var(--primary); }
.entry-description { max-width: 390px; color: var(--ink-2); font-size: 15px; line-height: 1.8; margin: 0; }
.entry-actions { gap: 20px; margin-top: 32px; flex-wrap: wrap; }
.entry-start { height: 48px; padding: 0 22px; gap: 34px; font-size: 13.5px; border-radius: 12px; }

/* Curated performance preview, with four playable sectors. */
.entry-demo { --chord-angle: 0deg; min-width: 0; width: 100%; max-width: 540px; justify-self: center; border: 1px solid var(--line); border-radius: 22px; background: rgb(var(--paper-rgb) / 0.72); box-shadow: var(--shadow-lift); overflow: hidden; }
.demo-stage { position: relative; display: grid; place-items: center; padding: 24px; aspect-ratio: 1.14; overflow: hidden; isolation: isolate; background: linear-gradient(160deg, #877f6f, #6f695b); }
.demo-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); z-index: -2; }

.demo-camera-message { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 24px); width: max-content; padding: 4px 11px; border-radius: 999px; color: var(--ink-2); background: var(--panel-bg); font-size: 11px; line-height: 1.5; text-align: center; }
.demo-camera-message:empty { display: none; }
.demo-hand { position: absolute; z-index: 5; width: 10px; height: 10px; transform: translate(-50%, -50%); border: 1.5px solid var(--paper); border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 calc(5px + var(--openness) * 12px) rgb(var(--sage-rgb) / 0.3); pointer-events: none; }
.entry-demo [hidden] { display: none !important; }
.demo-control-buttons { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; max-width: 48%; }
.demo-retry { height: 28px; font-size: 11px; }
.demo-orbit { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 84%; max-width: 348px; aspect-ratio: 1; border: 1px dashed rgb(var(--paper-rgb) / 0.5); border-radius: 50%; pointer-events: none; }
.demo-wheel { position: relative; width: 88%; max-width: 320px; aspect-ratio: 1; border: 1px solid rgb(var(--paper-rgb) / 0.7); border-radius: 50%; background: transparent; box-shadow: 0 0 0 1px rgb(var(--ink-rgb) / 0.22), 0 16px 40px -24px rgb(var(--shadow-rgb) / 0.5); }
.demo-wheel::before, .demo-wheel::after { content: ''; position: absolute; z-index: 2; background: rgb(var(--paper-rgb) / 0.55); pointer-events: none; }
.demo-wheel::before { width: 1px; height: 100%; left: 50%; }
.demo-wheel::after { height: 1px; width: 100%; top: 50%; }
.demo-pad { position: absolute; z-index: 1; width: 50%; height: 50%; display: flex; align-items: center; justify-content: center; font-size: clamp(14px, 1.5vw, 20px); font-weight: 600; color: var(--ink); background: rgb(var(--paper-rgb) / 0.1); transition: background .32s var(--ease-out), box-shadow .32s var(--ease-out); -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.demo-pad-label { display: flex; flex-direction: column; align-items: center; gap: 2px; color: #fff; text-shadow: 0 1px 6px rgb(var(--ink-rgb) / 0.75); }
.demo-pad-number { font-size: 9px; letter-spacing: .15em; }
.demo-pad-0 { top: 0; right: 0; border-radius: 0 100% 0 0; padding: 0 8% 9% 0; }
.demo-pad-1 { bottom: 0; right: 0; border-radius: 0 0 100% 0; padding: 9% 8% 0 0; }
.demo-pad-2 { bottom: 0; left: 0; border-radius: 0 0 0 100%; padding: 9% 0 0 8%; }
.demo-pad-3 { top: 0; left: 0; border-radius: 100% 0 0 0; padding: 0 0 9% 8%; }
.demo-pad.is-selected { color: var(--on-accent); background: rgb(216 190 140 / 0.72); }
.demo-pad.is-selected .demo-pad-label { color: var(--ink); text-shadow: none; }
.is-playing .demo-pad.is-selected { background: rgb(216 190 140 / calc(0.76 + var(--expression, 0) * 0.18)); }
.demo-pad:hover { background: rgb(216 190 140 / 0.3); }
.demo-pad.is-selected:hover { background: rgb(216 190 140 / 0.8); }
.demo-pad:active { background: rgb(216 190 140 / 0.88); }
.demo-pad:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: -5px; }
.demo-hub { position: absolute; inset: 36%; z-index: 2; pointer-events: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 1px solid var(--line-strong); border-radius: 50%; background: rgb(var(--paper-rgb) / 0.78); box-shadow: 0 6px 20px -10px rgb(var(--shadow-rgb) / 0.5); }
.demo-hub-label { font-size: 8px; font-weight: 600; letter-spacing: .2em; color: var(--ink-2); }
.demo-current { color: var(--ink); font-size: clamp(16px, 1.9vw, 24px); font-weight: 500; letter-spacing: -.03em; }
.demo-trace { position: absolute; z-index: 3; pointer-events: none; inset: 7%; transform: rotate(var(--chord-angle)); transition: transform .65s var(--ease-out); }
.demo-trace::after { content: ''; position: absolute; top: 13%; right: 13%; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px var(--paper), 0 0 0 9px rgb(var(--sage-rgb) / 0.22); }
.demo-output { display: flex; justify-content: space-between; align-items: center; width: 80%; max-width: 300px; gap: 12px; margin: 16px auto 8px; min-height: 26px; }
.demo-notes { font-size: 11px; letter-spacing: .14em; color: var(--ink-2); }
.demo-meter { height: 26px; display: flex; align-items: center; gap: 3px; }
.demo-meter i { width: 2px; height: var(--bar); background: var(--sage); opacity: .4; border-radius: 2px; transform: scaleY(calc(.15 + var(--expression, 0) * .85)); transition: transform 100ms linear, opacity 100ms linear; }
.is-playing .demo-meter i { opacity: 1; }
.is-playing .demo-hub { border-color: var(--sage); box-shadow: 0 0 calc(var(--expression, 0) * 28px) rgb(var(--sage-rgb) / 0.4); }
.demo-controls { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin: 0 20px; padding: 12px 0; border-top: 1px solid var(--line); }
.demo-status-wrap { flex: 1; display: flex; align-items: center; gap: 7px; min-width: 0; }
.demo-status { font-size: 11px; line-height: 1.6; color: var(--ink-2); }
.demo-status-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--sage); flex: none; }
.demo-instruction { margin: 2px 20px 17px; font-size: 11px; line-height: 1.6; color: var(--ink-3); }
.demo-caption { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); background: rgb(var(--accent-rgb) / 0.1); color: var(--ink-3); font-size: 11px; line-height: 1.6; }
.demo-caption .icon { color: var(--sage-ink); flex: none; }

.entry-footer { border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; padding-top: 24px; }
.entry-step { display: flex; gap: 14px; align-items: baseline; }
.entry-step > span { color: var(--accent-ink); font-size: 11px; font-variant-numeric: tabular-nums; }
.entry-step p { margin: 0; font-size: 12px; line-height: 1.75; color: var(--ink-3); }
.entry-step strong { display: block; color: var(--ink); font-weight: 500; font-size: 13px; }
.entry-colophon { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-top: 24px; }
.entry-footnote { color: var(--ink-3); font-size: 11px; line-height: 1.7; margin: 0; }
.entry-credit { flex: none; color: var(--ink-3); font-size: 12px; font-weight: 500; margin: 0; }

.auth-dialog { position: fixed; padding: 0; width: min(420px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: auto; color: var(--ink); background: var(--paper); border-radius: 22px; }
.auth-dialog::backdrop { background: var(--scrim); backdrop-filter: blur(12px); }
.auth-dialog[open] { animation: toast-in 300ms var(--ease-out) both; }
.auth-card { position: relative; padding: 38px 32px 32px; }
.auth-close { position: absolute; top: 14px; right: 14px; padding: 0; width: 30px; justify-content: center; }
.auth-card .entry-eyebrow { font-size: 9px; }
.auth-card h2 { margin: 14px 0 6px; font-weight: 600; letter-spacing: -.025em; line-height: 1.15; font-size: 28px; }
.auth-description { margin: 0 0 26px; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.auth-card .dock-label { display: block; margin-bottom: 7px; }
.auth-card .text-input, .auth-card .auth-submit, .auth-card .auth-oauth { height: 44px; }
@media (min-width: 1500px) { .entry-shell { padding-top: 44px; padding-bottom: 32px; } }
@media (max-width: 900px) {
  .entry-shell { padding: 26px 32px 24px; }
  .entry-hero { gap: 20px; padding: 64px 0; }
  .entry-copy h1 { font-size: clamp(40px, 5.6vw, 54px); }
  .entry-description { font-size: 14px; }
  .entry-actions { gap: 14px; }
}
@media (max-width: 620px) {
  .entry-shell { padding: 22px 24px; }
  .entry-brand { font-size: 17px; gap: 9px; }
  .entry-nav { gap: 0; }
  .entry-nav .btn { padding: 0 12px; font-size: 12px; }
  .entry-hero { grid-template-columns: 1fr; padding: 50px 0 58px; gap: 48px; }
  .entry-copy h1 { font-size: clamp(42px, 10.5vw, 64px); margin: 22px 0; }
  .entry-demo { max-width: 420px; }
  .demo-pad { font-size: 17px; }
  .demo-current { font-size: 21px; }
  .entry-footer { grid-template-columns: 1fr; gap: 20px; }
  .entry-step strong { display: inline; margin-right: 5px; }
  .entry-colophon { flex-direction: column; gap: 8px; }
  .auth-card { padding: 38px 24px 26px; }
}

.auth-mode {
  margin-bottom: 18px;
}

.auth-form.is-hidden { display: none; }

.text-input {
  display: block;
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--field);
  border: 1px solid var(--line);
  font-size: 13px;
  transition: background 200ms var(--ease-out), border-color 200ms var(--ease-out);
}
.text-input::placeholder { color: var(--ink-3); opacity: .75; }
.text-input:hover { border-color: var(--line-strong); }
.text-input:focus {
  background: var(--field-focus);
  border-color: var(--accent-ink);
  outline: none;
}
.text-input:disabled { opacity: 0.5; }

.auth-error {
  min-height: 14px;
  margin-top: -6px;
  margin-bottom: 14px;
}

.auth-submit {
  width: 100%;
  justify-content: center;
  height: 38px;
  margin-top: 2px;
}
.auth-spinner {
  width: 15px;
  height: 15px;
  border-width: 1.5px;
  border-color: rgb(250 244 233 / 0.3);
  border-top-color: var(--on-primary);
}

.auth-confirm {
  display: none;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-2);
  text-align: center;
  padding: 4px 2px 2px;
}
.auth-confirm.is-visible { display: block; }

/* ---------- account control, in the Library header ---------- */

.library-head-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.account-control {
  display: flex;
  align-items: center;
  gap: 10px;
}
.account-email {
  font-size: 11.5px;
  color: var(--ink-2);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-logout {
  height: 26px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 11px;
}

@media (max-width: 720px) {
  .account-email { flex: 1; min-width: 0; max-width: none; }
}

/* ---------- continue with Google ---------- */

.auth-oauth-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-oauth {
  width: 100%;
  height: 38px;
  justify-content: center;
  gap: 9px;
  border-radius: 10px;
  color: var(--ink);
  background: var(--field);
}
.auth-oauth:hover { background: var(--field-focus); border-color: var(--line-strong); }
.auth-oauth:disabled { opacity: 0.5; cursor: default; }
.auth-oauth:disabled:active { transform: none; }
.auth-oauth .icon { width: 15px; height: 15px; }
.auth-oauth-spinner { width: 15px; height: 15px; }

.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.auth-or::before,
.auth-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Account confirmation shares the entry surfaces and native dialog focus. */
.logout-dialog { width: min(390px, calc(100% - 32px)); padding: 28px; border-radius: 20px; background: var(--paper); color: var(--ink); }
.logout-dialog::backdrop { background: var(--scrim); backdrop-filter: blur(8px); }
.logout-dialog h2 { font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -.02em; margin: 0; }
.logout-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.logout-actions .btn { height: 38px; padding: 0 18px; }
.logout-actions .btn:disabled { opacity: .5; cursor: wait; }
.logout-error { color: var(--danger); font-size: 12px; line-height: 1.6; }
.logout-error:empty { display: none; }
