/* The sign-in splash at `/`. Mirrors the sign-in screens of Atlas, the Academy and Plutus: a photo
   with the product name on the left, a light panel with one sign-in button on the right.
   Every colour is a token on the TruPorch design system (/tokens.css): the page, card and shadows are its
   semantic tokens, which switch to dark by themselves; the rest are palette steps. /theme.js sets
   <html data-theme="light|dark" class="dark"> before the first paint, and the dark values of the palette-step
   tokens follow (tests/theme.test.ts checks their contrast). */
:root {
  --page: var(--bg-page); --text: var(--tp-gray-900); --muted: var(--tp-gray-600); --faint: var(--tp-gray-500);
  --line: var(--tp-gray-200); --line-strong: var(--tp-gray-300); --card: var(--bg-card); --card-hover: var(--tp-gray-50); --btn-text: var(--tp-gray-700); --accent: var(--tp-blue-600);
  --shadow: var(--shadow-card);
  --shadow-hover: var(--shadow-card-hover);
  /* The photo side looks the same in both themes, only dimmer in the dark one. */
  --hero-bg: var(--tp-gray-800); --hero-title: #fff; --hero-line: rgba(255, 255, 255, 0.8);
  --hero-shade: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.2) 55%, rgba(0, 0, 0, 0.1));
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --text: var(--tp-gray-100); --muted: var(--tp-gray-400); --faint: var(--tp-gray-400);
  --line: var(--tp-zinc-800); --line-strong: var(--tp-gray-600); --card-hover: var(--bg-elevated); --btn-text: var(--tp-gray-200); --accent: var(--tp-blue-400);
  --hero-shade: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.35) 55%, rgba(0, 0, 0, 0.3));
  --logo-plate: var(--tp-gray-200);
}
/* Increase Contrast (DESIGN.md §12): the quiet greys and the button's edge get stronger. */
@media (prefers-contrast: more) {
  :root { --muted: var(--tp-gray-700); --faint: var(--tp-gray-700); --line: var(--tp-gray-400); --line-strong: var(--tp-gray-500); }
  :root[data-theme="dark"] { --muted: var(--tp-gray-300); --faint: var(--tp-gray-300); --line: var(--tp-gray-500); --line-strong: var(--tp-gray-400); }
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--page);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.splash { min-height: 100vh; display: flex; }

/* Left: the photo, from 768px up (like Atlas's md: breakpoint). Sunlight through the oculus of the
   Pantheon in Rome, by Wyatt Simpson on Unsplash (unsplash.com/photos/eWRMiEEChpg), Unsplash
   License: free for commercial use. It drifts slowly toward the light, like the Plutus and Academy
   heroes, unless the visitor asks for reduced motion. */
.splash-hero { display: none; position: relative; overflow: hidden; background: var(--hero-bg); }
.splash-hero::before {
  content: ''; position: absolute; inset: 0;
  background: url('/splash-hero.jpg') 42% 30% / cover no-repeat;
  transform-origin: 46% 25%;
  animation: splash-drift 40s ease-in-out infinite alternate;
}
@keyframes splash-drift { from { transform: scale(1.02); } to { transform: scale(1.1) translate(-1.5%, -1%); } }
@media (prefers-reduced-motion: reduce) { .splash-hero::before { animation: none; } }
.splash-hero-shade { position: absolute; inset: 0; background: var(--hero-shade); }
.splash-hero-text { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: flex-end; width: 100%; padding: 40px 40px 56px; }
.splash-hero-title { margin: 0; font-size: 1.875rem; line-height: 2.25rem; font-weight: 700; letter-spacing: -0.025em; color: var(--hero-title); }
.splash-hero-line { margin: 8px 0 0; max-width: 28rem; font-size: 1rem; line-height: 1.5rem; color: var(--hero-line); }
@media (min-width: 48em) { .splash-hero { display: flex; width: 50%; } }

/* Right: the sign-in panel. */
.splash-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 24px; position: relative; }
.splash-card { width: 100%; max-width: 28rem; display: flex; flex-direction: column; gap: 32px; }
.splash-intro { text-align: center; }
.splash-logo { display: block; height: 48px; width: auto; margin: 0 auto; }
/* The logo is dark ink on a transparent background: give it a light plate on the dark page. */
[data-theme="dark"] .splash-logo { background: var(--logo-plate); box-shadow: 0 0 0 8px var(--logo-plate); border-radius: 6px; }
.splash-intro h1 { margin: 24px 0 0; font-size: 1.5rem; line-height: 2rem; font-weight: 700; color: var(--text); }
.splash-sub { margin: 8px 0 0; font-size: 0.875rem; line-height: 1.25rem; color: var(--muted); }

.splash-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%;
  padding: 14px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--card);
  font-family: inherit; font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; color: var(--btn-text); text-decoration: none;
  box-shadow: var(--shadow);
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.splash-btn:hover { background: var(--card-hover); border-color: var(--line-strong); box-shadow: var(--shadow-hover); }
.splash-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.splash-btn svg { color: var(--accent); flex: none; }

.splash-rule { margin: 0; border: 0; border-top: 1px solid var(--line); }
.splash-notes { text-align: center; }
.splash-notes p { margin: 0; font-size: 0.75rem; line-height: 1rem; color: var(--faint); }
.splash-notes p + p { margin-top: 8px; }

/* The light/dark switch, top right. Hidden until /theme.js has run, so it is never a dead button. */
.theme-toggle {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  display: none; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--btn-text);
  box-shadow: var(--shadow); cursor: pointer;
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
[data-theme] .theme-toggle { display: inline-flex; }
.theme-toggle:hover { background: var(--card-hover); border-color: var(--line-strong); box-shadow: var(--shadow-hover); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-sun, [data-theme="dark"] .theme-moon { display: none; }
[data-theme="dark"] .theme-sun { display: block; }
/* While the theme changes, no colour fades: everything switches in the same frame. */
.theme-switching *, .theme-switching *::before, .theme-switching *::after { transition: none !important; }

/* Continuous corners where the browser has them (DESIGN.md §18). */
@supports (corner-shape: squircle) {
  .splash-btn, .theme-toggle { corner-shape: squircle; }
}
