/* Tokens ported from the previous app (ExhibitPro design system, docs/phase-0/00-design-system.md). */
:root {
  --font-sans: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --font-heading: 'Montserrat', var(--font-sans);

  --background: oklch(100% 0 0);
  --foreground: oklch(14.5% 0 0);
  --primary: oklch(20.5% 0 0);
  --primary-foreground: oklch(98.5% 0 0);
  --secondary: oklch(97% 0 0);
  --muted-foreground: oklch(55.6% 0 0);
  --card: oklch(100% 0 0);

  --accent-primary: #60a5fa;
  --accent-primary-hover: #3b82f6;
  --accent-danger: #ef4444;
  --accent-success: #29763d;
  --accent-warning: #fbbf24;
  --border-subtle: #e5e7eb;
  --border-soft: #f3f4f6;

  --radius-xs: 0.125rem;
  --radius: 0.625rem;
  --radius-2xl: 1rem;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.05);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-sans); background: var(--background); color: var(--foreground); line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-heading); letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; font-weight: 700; margin: 0 0 0.25rem; }
h2 { font-size: 1.05rem; font-weight: 600; margin: 0 0 0.75rem; }
h3 { font-weight: 600; }
a { color: var(--accent-primary-hover); text-decoration: none; }
a:hover { text-decoration: underline; }
.icon { width: 1rem; height: 1rem; flex: none; }

.muted { color: var(--muted-foreground); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.eyebrow { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-foreground); margin: 0; }
.danger { color: var(--accent-danger); }

/* App shell: persistent left sidebar */
.shell { display: flex; min-height: 100vh; }
.sidebar-nav { width: 15rem; flex: none; display: flex; flex-direction: column; padding: 1rem; background: var(--secondary); border-right: 1px solid var(--border-subtle); position: sticky; top: 0; height: 100vh; }
.logo img { height: 2.75rem; width: auto; display: block; }
.sidebar-nav nav { display: flex; flex-direction: column; gap: 0.15rem; margin-top: 1rem; font-size: 0.875rem; }
.nav-org { font-weight: 600; padding: 0.5rem; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-section { margin: 1.1rem 0 0.25rem; padding: 0 0.5rem; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: oklch(55.6% 0 0 / 0.7); }
.nav-link { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.5rem; border-radius: 0.5rem; color: var(--muted-foreground); }
.nav-link:hover { background: var(--card); color: var(--foreground); text-decoration: none; }
.nav-link.active { background: var(--card); color: var(--foreground); font-weight: 500; }
.nav-user { margin-top: auto; padding-top: 1.5rem; font-size: 0.875rem; }
.nav-user-name { font-weight: 500; }
.nav-user-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user form { margin: 0.75rem 0 0; }
.nav-signout { display: inline-flex; align-items: center; gap: 0.35rem; }
.page { flex: 1; min-width: 0; max-width: 1120px; padding: 2rem 2.5rem; }
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .sidebar-nav { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
  .sidebar-nav nav { flex-direction: row; flex-wrap: wrap; margin: 0; }
  .nav-section, .nav-user-email { display: none; }
  .nav-user { margin: 0 0 0 auto; padding: 0; }
  .page { padding: 1.5rem 1rem; }
}

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: var(--secondary); }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.org-header { margin-bottom: 1.5rem; }
.org-title { display: flex; align-items: center; gap: 0.75rem; margin: 0.35rem 0 0.25rem; }
.org-title h1 { margin: 0; }
.breadcrumbs { display: flex; gap: 0.4rem; align-items: center; }

/* Surfaces */
.card { background: var(--card); border: 1px solid var(--border-subtle); border-radius: var(--radius-2xl); box-shadow: var(--shadow); padding: 1.5rem; margin-top: 1.5rem; }
.card.narrow { width: 100%; max-width: 420px; margin-top: 0; padding: 2rem; }
.card.compact { padding: 1.1rem; margin-top: 1rem; }
.brand-logo { height: 3.5rem; width: auto; display: block; margin: 0 0 1.25rem; }
.empty { text-align: center; padding: 2.25rem 1rem; border: 1px dashed var(--border-subtle); border-radius: var(--radius-2xl); background: var(--card); }
.empty p { margin: 0.25rem 0; }
.danger-zone { border-color: #fecaca; }

/* Forms */
.stack { display: grid; gap: 1rem; margin: 1rem 0; }
.stack.tight { gap: 0.6rem; margin: 0.5rem 0; }
label { display: grid; gap: 0.35rem; font-size: 0.875rem; font-weight: 500; }
input[type='text'], input[type='email'], input[type='password'], input[type='number'], input[type='search'], select {
  font: inherit; font-size: 0.9rem; padding: 0.55rem 0.75rem; width: 100%;
  border: 1px solid var(--border-subtle); border-radius: var(--radius); background: var(--background); color: var(--foreground);
}
select { width: auto; }
label select, fieldset select { width: 100%; }
input:focus, select:focus { outline: 2px solid var(--accent-primary); outline-offset: 1px; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 0.6rem; min-width: 0; }
.hint { font-weight: 400; color: var(--muted-foreground); font-size: 0.8rem; }
.code-input { font-size: 1.5rem; letter-spacing: 0.5em; text-align: center; }
.inline-form { display: flex; gap: 0.5rem; }
.form-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.form-grid.even { grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-bottom: 0; }
.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
.form-message:empty { display: none; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; white-space: nowrap;
  font: inherit; font-size: 0.875rem; font-weight: 500; padding: 0.55rem 1rem; cursor: pointer;
  border: 1px solid var(--border-subtle); border-radius: var(--radius); background: var(--background); color: var(--foreground);
}
.button:hover { background: var(--secondary); text-decoration: none; }
.button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.button.primary:hover { background: oklch(30% 0 0); }
.button.danger { color: var(--accent-danger); border-color: #fecaca; }
.button.danger:hover { background: #fef2f2; }
button[disabled] { opacity: 0.6; cursor: progress; }
.link-button { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; color: var(--accent-primary-hover); }
.link-button:hover { text-decoration: underline; }
.link-button.danger { color: var(--accent-danger); }
/* Square icon-only action; the label lives in title and aria-label. */
.icon-button { flex: none; display: inline-grid; place-items: center; width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: var(--radius); background: none; color: var(--muted-foreground); cursor: pointer; transition: background 0.15s, color 0.15s; }
.icon-button:hover { background: var(--secondary); color: var(--foreground); }
.icon-button.danger:hover { background: #fef2f2; color: var(--accent-danger); }
.icon-button:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 1px; }
.icon-button.htmx-request { opacity: 0.5; pointer-events: none; }

.alert { padding: 0.65rem 0.85rem; border-radius: var(--radius); font-size: 0.875rem; border: 1px solid; }
.alert-error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

/* Lists, badges, tables */
.list { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--border-subtle); border-radius: var(--radius-2xl); overflow: hidden; }
.list-row { position: relative; }
.list-row + .list-row { border-top: 1px solid var(--border-soft); }
.list-link { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 1.1rem; color: var(--foreground); }
.list-link:hover { background: var(--secondary); text-decoration: none; }
.list-title { font-weight: 600; }
.list.compact .list-row { padding: 0.6rem 1rem; }
.list.compact .list-row:has(> .list-link) { padding: 0; }
.list.compact .list-link { padding: 0.6rem 1rem; }
.list-row.split { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.list-row .row-action { position: absolute; right: 1.1rem; top: 50%; transform: translateY(-50%); display: none; background: var(--card); }
.list-row:hover .row-action, .list-row .row-action:focus-visible { display: inline-grid; }
.list-row:hover .list-link > .muted { visibility: hidden; }

.badge { display: inline-block; font-size: 0.72rem; font-weight: 500; padding: 0.1rem 0.45rem; border-radius: var(--radius-xs); background: var(--secondary); border: 1px solid var(--border-subtle); color: var(--muted-foreground); text-transform: capitalize; white-space: nowrap; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--border-subtle); border-radius: var(--radius-2xl); overflow: hidden; }
.table th { text-align: left; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-foreground); padding: 0.65rem 1rem; background: var(--secondary); border-bottom: 1px solid var(--border-subtle); }
.table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-soft); font-size: 0.9rem; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: oklch(98.5% 0 0); }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .icon-button + .icon-button { margin-left: 0.25rem; }
.status { font-size: 0.8rem; text-transform: capitalize; }
.status-suspended { color: var(--accent-danger); }

/* Matters list */
.toolbar { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 1rem; }
.toolbar input[type='search'] { flex: 1; }
.segmented { display: inline-flex; border: 1px solid var(--border-subtle); border-radius: var(--radius); overflow: hidden; background: var(--secondary); padding: 2px; }
.segmented a { padding: 0.35rem 0.85rem; color: var(--muted-foreground); font-size: 0.85rem; border-radius: 0.5rem; }
.segmented a.active { background: var(--card); color: var(--foreground); font-weight: 500; box-shadow: var(--shadow); }
.segmented a:hover { text-decoration: none; color: var(--foreground); }
.invitations { margin-top: 1.25rem; }
.invitations h3 { font-size: 0.95rem; margin: 0 0 0.5rem; }
#members-message, #matters-message, #documents-message { margin-bottom: 0.75rem; }

/* Matter page */
.columns { display: grid; grid-template-columns: 3fr 2fr; gap: 2rem; align-items: start; }
@media (max-width: 980px) { .columns { grid-template-columns: 1fr; } }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem; text-align: center; padding: 1.5rem; margin-bottom: 1rem; cursor: pointer;
  border: 2px dashed var(--border-subtle); border-radius: var(--radius-2xl); background: var(--card); font-weight: 400; transition: border-color 0.15s, background 0.15s;
}
.dropzone .icon { width: 1.5rem; height: 1.5rem; color: var(--muted-foreground); }
.dropzone:hover, .dropzone.dragging { border-color: var(--accent-primary); background: #eff6ff; }
.upload-queue { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.5rem; }
.upload-queue li { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 1rem; padding: 0.6rem 0.8rem; background: var(--card); border: 1px solid var(--border-subtle); border-radius: var(--radius); font-size: 0.875rem; }
.upload-queue progress { grid-column: 1 / -1; width: 100%; height: 6px; accent-color: var(--accent-primary-hover); }
.upload-queue li.failed { border-color: #fecaca; background: #fef2f2; }
.upload-queue li.failed .upload-state { color: #991b1b; }
.doc-name { display: grid; min-width: 0; }
.doc-name .list-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-actions { display: flex; gap: 0.25rem; align-items: center; white-space: nowrap; }
.doc-actions .status { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.spinner { display: inline-block; width: 0.75rem; height: 0.75rem; border: 2px solid var(--border-subtle); border-top-color: var(--accent-primary-hover); border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Binder editor */
.binder-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2rem; align-items: start; }
@media (max-width: 1100px) { .binder-layout { grid-template-columns: 1fr; } }
.sidebar .card { margin-top: 0; margin-bottom: 1rem; }
.sidebar h2 { font-size: 1rem; }
.sections { display: grid; gap: 1rem; }
.section { background: var(--card); border: 1px solid var(--border-subtle); border-radius: var(--radius-2xl); box-shadow: var(--shadow); }
.section-header { display: flex; align-items: center; gap: 0.6rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-soft); background: var(--secondary); border-radius: var(--radius-2xl) var(--radius-2xl) 0 0; }
.section-header h3 { margin: 0; font-size: 0.95rem; flex: 1; }
.section-menu { position: relative; }
.section-menu summary { list-style: none; }
.section-menu summary::-webkit-details-marker { display: none; }
.section-menu[open] > :not(summary) { position: absolute; right: 0; z-index: 2; }
.section-menu[open] form { top: 2.25rem; background: var(--card); border: 1px solid var(--border-subtle); border-radius: var(--radius); padding: 0.6rem; box-shadow: 0 8px 24px rgb(0 0 0 / 0.08); width: 320px; }
.items { list-style: none; margin: 0; padding: 0.4rem; min-height: 3rem; }
.items:not(:has(.item))::before { content: 'Drop exhibits here'; display: block; padding: 0.75rem; text-align: center; color: var(--muted-foreground); font-size: 0.85rem; border: 1px dashed var(--border-subtle); border-radius: var(--radius); }
.item { display: flex; align-items: center; gap: 0.75rem; padding: 0.55rem 0.6rem; border-radius: var(--radius); background: var(--card); }
.item + .item { border-top: 1px solid var(--border-soft); }
.item:hover { background: var(--secondary); }
.item-body { display: grid; flex: 1; min-width: 0; }
.item-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exhibit-label { min-width: 2.5rem; text-align: center; font-family: var(--font-heading); font-weight: 700; font-size: 0.85rem; padding: 0.2rem 0.4rem; border-radius: var(--radius-xs); background: var(--primary); color: var(--primary-foreground); }
.drag-handle { cursor: grab; color: var(--muted-foreground); user-select: none; display: inline-flex; }
.drag-ghost { opacity: 0.4; background: #eff6ff; }
.picker { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow: auto; border: 1px solid var(--border-subtle); border-radius: var(--radius); }
.picker li + li { border-top: 1px solid var(--border-soft); }
.picker .check { padding: 0.45rem 0.6rem; }
.picker-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exports { margin-top: 0.75rem; }
.exports .list-row > span:first-child { display: grid; }
.exports .muted { white-space: nowrap; }

/* Landing page */
.landing { background: var(--background); }
.landing-container { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }
.landing-header { position: sticky; top: 0; z-index: 10; background: rgb(255 255 255 / 0.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-subtle); }
.landing-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 0.85rem; padding-bottom: 0.85rem; }
.landing-nav .logo img { height: 2.25rem; }
.landing-links { display: flex; gap: 1.5rem; font-size: 0.875rem; }
.landing-links a { color: var(--muted-foreground); }
.landing-links a:hover { color: var(--foreground); text-decoration: none; }
.landing-actions { display: flex; gap: 0.5rem; }
.button.ghost { border-color: transparent; background: transparent; }
.button.ghost:hover { background: var(--secondary); }
.button.large { font-size: 1rem; padding: 0.75rem 1.75rem; }
@media (max-width: 760px) { .landing-links { display: none; } }

.hero { text-align: center; padding-top: 5.5rem; padding-bottom: 5rem; }
.pill { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0.75rem; margin-bottom: 1.5rem; font-size: 0.75rem; color: var(--muted-foreground); background: var(--secondary); border: 1px solid var(--border-subtle); border-radius: 999px; }
.pill .dot { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--accent-success); }
.hero h1 { font-size: clamp(2.25rem, 6vw, 3.75rem); line-height: 1.1; letter-spacing: -0.02em; margin: 0; }
.hero .accent { color: var(--accent-primary); }
.lead { max-width: 42rem; margin: 1.5rem auto 0; font-size: 1.125rem; line-height: 1.65; color: var(--muted-foreground); }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin-top: 2.5rem; }
.hero-actions .icon { width: 1rem; height: 1rem; }

.mockup { margin-top: 4rem; text-align: left; border: 1px solid var(--border-subtle); border-radius: var(--radius-2xl); background: var(--secondary); overflow: hidden; box-shadow: 0 20px 50px rgb(0 0 0 / 0.08); }
.mockup-bar { display: flex; align-items: center; gap: 0.4rem; padding: 0.75rem 1rem; background: var(--card); border-bottom: 1px solid var(--border-subtle); }
.light { width: 0.75rem; height: 0.75rem; border-radius: 50%; }
.light.red { background: rgb(239 68 68 / 0.6); } .light.amber { background: rgb(251 191 36 / 0.6); } .light.green { background: rgb(41 118 61 / 0.6); }
.mockup-title { margin-left: 0.75rem; font-size: 0.75rem; color: var(--muted-foreground); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.mockup-body { display: grid; grid-template-columns: 1fr 3fr; min-height: 16rem; }
.mockup-side { background: var(--card); padding: 1rem; display: grid; align-content: start; gap: 0.4rem; border-right: 1px solid var(--border-subtle); }
.mockup-tab { font-size: 0.75rem; font-weight: 500; padding: 0.4rem 0.75rem; border-radius: 0.35rem; color: var(--muted-foreground); }
.mockup-tab.active { background: rgb(96 165 250 / 0.12); color: var(--accent-primary-hover); }
.mockup-main { padding: 1.5rem; display: grid; gap: 0.5rem; align-content: start; }
.mockup-main p { margin: 0 0 0.25rem; }
.mockup-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.5rem 0.75rem; font-size: 0.8rem; background: var(--card); border: 1px solid var(--border-soft); border-radius: 0.35rem; }
.mockup-row .exhibit-label { min-width: 1.75rem; font-size: 0.72rem; margin-right: 0.5rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.75rem; }
@media (max-width: 760px) { .mockup-body { grid-template-columns: 1fr; } .mockup-side { display: none; } }

.band { padding-top: 6rem; padding-bottom: 6rem; }
.band.shaded { background: var(--secondary); border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }
.band-heading { text-align: center; margin-bottom: 3.5rem; }
.band-heading h2, .cta h2 { font-size: 1.9rem; font-weight: 700; margin: 0; }
.band-heading p { max-width: 36rem; margin: 0.75rem auto 0; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.5rem; }
.feature { padding: 1.5rem; background: var(--card); border: 1px solid var(--border-subtle); border-radius: var(--radius-2xl); transition: border-color 0.15s; }
.feature:hover { border-color: rgb(96 165 250 / 0.35); }
.feature h3 { font-size: 0.95rem; margin: 0 0 0.5rem; }
.feature p { margin: 0; line-height: 1.6; }
.feature-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; margin-bottom: 1rem; border-radius: 0.75rem; background: rgb(96 165 250 / 0.12); color: var(--accent-primary-hover); }
.feature-icon .icon { width: 1.25rem; height: 1.25rem; }
.steps { list-style: none; margin: 0 auto; padding: 0; max-width: 44rem; display: grid; gap: 2.25rem; position: relative; }
.steps::before { content: ''; position: absolute; left: 1.1rem; top: 0.5rem; bottom: 0.5rem; width: 1px; background: var(--border-subtle); }
.step { display: flex; gap: 1.75rem; align-items: flex-start; position: relative; }
.step h3 { font-size: 1rem; margin: 0.15rem 0 0.25rem; }
.step p { margin: 0; line-height: 1.6; }
.step-number { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 2px solid var(--accent-primary); background: var(--card); color: var(--accent-primary-hover); font-family: var(--font-heading); font-size: 0.75rem; font-weight: 700; }
.cta { text-align: center; }
.cta h2 { font-size: 2.25rem; }
.landing-footer { background: var(--secondary); border-top: 1px solid var(--border-subtle); font-size: 0.75rem; color: var(--muted-foreground); }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; padding-top: 2rem; padding-bottom: 2rem; }
.footer-row p { margin: 0; }
.footer-brand { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--foreground); font-family: var(--font-heading); font-weight: 600; }
.footer-brand .icon { color: var(--accent-primary-hover); width: 0.9rem; height: 0.9rem; }
.footer-links { display: flex; gap: 1rem; }
.footer-links a { color: var(--muted-foreground); }

/* Landing motion (only after landing.js adds .motion, and never for reduced motion) */
.hero { position: relative; }
.hero > :not(.hero-glow) { position: relative; }
.hero-glow { position: absolute; inset: 2rem 10% auto; height: 26rem; z-index: 0; pointer-events: none; filter: blur(70px); opacity: 0.55;
  background: radial-gradient(closest-side, rgb(96 165 250 / 0.35), transparent 70%), radial-gradient(closest-side at 70% 60%, rgb(251 146 60 / 0.18), transparent 70%); }
.motion [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); transition-delay: var(--delay, 0ms); }
.motion [data-reveal].revealed { opacity: 1; transform: none; }
.motion .mockup[data-reveal] { transform: translateY(32px) scale(0.98); }
.motion .mockup[data-reveal].revealed { transform: none; }
.motion .hero-glow { animation: drift 14s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translate(-3%, 0) scale(1); } to { transform: translate(3%, 3%) scale(1.06); } }

.feature { transition: border-color 0.2s, transform 0.25s, box-shadow 0.25s; }
.feature:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgb(0 0 0 / 0.06); }
.feature:hover .feature-icon { transform: scale(1.08) rotate(-4deg); }
.feature-icon { transition: transform 0.25s; }
.button.large .icon { transition: transform 0.2s; }
.button.large:hover .icon { transform: translateX(3px); }

.mockup-rows { display: grid; gap: 0.5rem; }
.mockup-row.moved { box-shadow: 0 0 0 2px rgb(96 165 250 / 0.6); z-index: 1; position: relative; }
.mockup-row.renumbered .exhibit-label, .mockup-row.renumbered .mockup-bates { animation: flash 0.9s ease-out; }
@keyframes flash { 0% { color: var(--accent-primary-hover); } 100% { color: inherit; } }
.mockup-row.renumbered .exhibit-label { animation-name: flash-label; }
@keyframes flash-label { 0% { background: var(--accent-primary-hover); } 100% { background: var(--primary); } }

.motion .steps::before { transform-origin: top; transform: scaleY(var(--progress, 0)); background: var(--accent-primary); transition: transform 0.15s linear; }
.steps::after { content: ''; position: absolute; left: 1.1rem; top: 0.5rem; bottom: 0.5rem; width: 1px; background: var(--border-subtle); z-index: -1; }
.motion .step.revealed .step-number { animation: pop 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: var(--delay, 0ms); }
@keyframes pop { 0% { transform: scale(0.6); } 70% { transform: scale(1.1); } 100% { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .feature:hover, .feature:hover .feature-icon, .button.large:hover .icon { transform: none; }
}
.steps { isolation: isolate; }

/* Busy state: htmx marks the form while its request is in flight. */
form.htmx-request [type='submit'] { cursor: progress; opacity: 0.85; }
form.htmx-request [type='submit']::before {
  content: ''; width: 0.8em; height: 0.8em; margin-right: 0.15rem; flex: none;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite;
}
input:disabled { background: var(--secondary); color: var(--muted-foreground); }

/* Single-card pages (invitation, errors) sit in the middle of the screen. */
.page-center { min-height: calc(100vh - 4rem); display: grid; place-items: center; }
.signed-in-as { margin: 0 0 1rem; padding: 0.6rem 0.75rem; border-radius: var(--radius); background: var(--secondary); line-height: 1.6; }
.signed-in-as .link-button { font-size: inherit; }
