/* whyso shared styles: fonts, tokens, reset, top bar, buttons, footer. */

@font-face {
  font-family: "Geist";
  src: url("../../fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("../../fonts/newsreader-latin-opsz-normal.woff2") format("woff2");
  font-weight: 300 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #151517;
  --bg-2: #1b1b1e;
  --ink: #ededed;
  --muted: #a1a1a1;
  --dim: #6e6e73; /* decoration only: below 4.5:1 contrast for text */
  --line: rgba(255, 255, 255, .12);
  --chip: rgba(255, 255, 255, .04);
  --gutter: clamp(16px, 2.6vw, 28px);
  --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --serif: "Newsreader", "Times New Roman", serif;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
button:disabled { cursor: not-allowed; }

input { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 6px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Pages behind sign-in stay hidden until the session check finishes. */
body.guarded:not(.ready) > * { visibility: hidden; }

/* Top bar */
.topbar {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gutter); height: 64px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo { display: flex; }
.brand-slash { color: var(--dim); font-size: 22px; font-weight: 300; transform: translateY(-1px); }
.brand-name { font-family: var(--serif); font-size: 24px; font-weight: 400; letter-spacing: -.01em; line-height: 1; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--chip);
  font-size: 15px; font-weight: 500;
  transition: background .2s, border-color .2s, opacity .2s;
}
.btn:hover:not(:disabled) { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .22); }
.btn:disabled { opacity: .45; }
.btn-primary { background: #fff; color: var(--bg); border-color: #fff; }
.btn-primary:hover:not(:disabled) { background: #e4e4e4; border-color: #e4e4e4; }
.btn-danger { background: #e5484d; border-color: #e5484d; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #d13d42; border-color: #d13d42; }

/* Footer */
.footer {
  position: relative; z-index: 1;
  margin-top: auto;
  padding: 20px var(--gutter);
  font-size: 14px; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 6px 10px;
}
.footer a:hover { color: var(--ink); text-decoration: underline; }
.footer .sep { color: var(--dim); }

/* Load-in */
.rise { opacity: 0; transform: translateY(12px); animation: rise .9s cubic-bezier(.2, .7, .2, 1) forwards; }
.rise:nth-child(2) { animation-delay: .08s; }
.rise:nth-child(3) { animation-delay: .16s; }
.rise:nth-child(4) { animation-delay: .24s; }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes fade { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .rise, .stage { animation: none !important; opacity: 1 !important; transform: none !important; }
}
