/* Orange Book Reader — companion site
   Liquid-glass look matching tvOS: near-black canvas, frosted cards, one accent. */

:root {
  --bg: #050506;
  --text: #ffffff;
  --text-2: rgba(255, 255, 255, 0.72);
  --text-3: rgba(255, 255, 255, 0.48);
  --text-4: rgba(255, 255, 255, 0.3);
  --fill: rgba(255, 255, 255, 0.07);
  --fill-2: rgba(255, 255, 255, 0.1);
  --fill-3: rgba(255, 255, 255, 0.14);
  --stroke: rgba(255, 255, 255, 0.14);
  --stroke-soft: rgba(255, 255, 255, 0.08);
  --accent-1: #ff7a1a;
  --accent-2: #ff9f43;
  --accent: linear-gradient(135deg, var(--accent-1) 0%, var(--accent-2) 100%);
  --on-accent: #1c0d02;
  --radius: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04), 0 24px 48px -18px rgba(0, 0, 0, 0.75),
    0 8px 20px -10px rgba(0, 0, 0, 0.6);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", system-ui, "Segoe UI",
    Roboto, sans-serif;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --gutter: 16px;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  /* The page colour lives on <html> and .ambient; a body background would
     paint over the z-index:-1 ambient glows. */
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

img,
svg {
  display: block;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

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

:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.92);
  outline-offset: 3px;
}

[tabindex="-1"]:focus {
  outline: none;
}

::selection {
  background: rgba(255, 159, 67, 0.35);
}

/* ---------- ambient background ---------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: var(--bg);
}

.ambient::before,
.ambient::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}

.ambient::before {
  width: 96vmax;
  height: 96vmax;
  left: calc(18vw - 48vmax);
  top: calc(2vh - 48vmax);
  background: radial-gradient(closest-side, rgba(255, 122, 26, 0.24), rgba(255, 122, 26, 0.08) 52%, transparent);
  animation: drift-warm 42s ease-in-out infinite alternate;
}

.ambient::after {
  width: 88vmax;
  height: 88vmax;
  left: calc(92vw - 44vmax);
  top: calc(88vh - 44vmax);
  background: radial-gradient(closest-side, rgba(196, 204, 218, 0.11), rgba(196, 204, 218, 0.035) 55%, transparent);
  animation: drift-cool 54s ease-in-out infinite alternate;
}

@keyframes drift-warm {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(9vmax, 7vmax, 0) scale(1.06);
  }
  100% {
    transform: translate3d(3vmax, 13vmax, 0) scale(0.97);
  }
}

@keyframes drift-cool {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(-8vmax, -6vmax, 0) scale(1.05);
  }
  100% {
    transform: translate3d(-3vmax, -12vmax, 0) scale(0.98);
  }
}

/* ---------- layout ---------- */

.topbar {
  width: min(100% - 2 * var(--gutter), 1080px);
  margin: 0 auto;
  min-height: 68px;
  padding-top: env(safe-area-inset-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -0.02em;
  border-radius: 10px;
}

.brand svg {
  width: 30px;
  height: 30px;
  flex: none;
}

.page {
  width: min(100% - 2 * var(--gutter), 560px);
  margin: 0 auto;
  padding: 8px 0 40px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.page.wide {
  width: min(100% - 2 * var(--gutter), 1080px);
}

.footer {
  width: min(100% - 2 * var(--gutter), 1080px);
  margin: 0 auto;
  padding: 20px 0 calc(28px + env(safe-area-inset-bottom));
  color: var(--text-3);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
}

.footer a {
  color: var(--text-2);
  text-decoration: none;
}

/* ---------- glass ---------- */

.glass {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.095) 0%, rgba(255, 255, 255, 0.06) 100%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--stroke);
  border-top-color: rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), var(--shadow);
}

.card {
  padding: 20px;
}

.card + .card {
  margin-top: 0;
}

@media (min-width: 640px) {
  .card {
    padding: 32px;
  }
}

/* ---------- type ---------- */

.eyebrow {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.12;
  text-wrap: balance;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 22px;
  letter-spacing: -0.022em;
}

h3 {
  font-size: 17px;
  letter-spacing: -0.015em;
  font-weight: 650;
}

.lead {
  margin: 10px 0 0;
  color: var(--text-2);
  font-size: 17px;
  line-height: 1.45;
  text-wrap: pretty;
}

.muted {
  color: var(--text-3);
}

.small {
  font-size: 14px;
}

.tiny {
  font-size: 13px;
}

p {
  margin: 0;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.spacer {
  flex: 1;
}

.accent-text {
  background: var(--accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* ---------- buttons ---------- */

.btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.012em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 180ms var(--ease), background-color 180ms var(--ease), opacity 180ms var(--ease),
    box-shadow 180ms var(--ease), border-color 180ms var(--ease);
}

.btn:active {
  transform: scale(0.975);
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

.btn.block {
  width: 100%;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 10px 24px -12px rgba(255, 122, 26, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-primary:hover:not([disabled]) {
  box-shadow: 0 14px 30px -12px rgba(255, 122, 26, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-glass {
  background: var(--fill-2);
  border-color: var(--stroke);
  border-top-color: rgba(255, 255, 255, 0.22);
  color: var(--text);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
}

.btn-glass:hover:not([disabled]) {
  background: var(--fill-3);
}

.btn-quiet {
  min-height: 44px;
  padding: 0 14px;
  background: transparent;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
}

.btn-quiet:hover:not([disabled]) {
  color: var(--text);
  background: var(--fill);
}

.btn-sm {
  min-height: 40px;
  padding: 0 16px;
  font-size: 15px;
}

.icon-btn {
  -webkit-appearance: none;
  appearance: none;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 0;
  display: inline-grid;
  place-items: center;
  background: var(--fill);
  color: var(--text-2);
  cursor: pointer;
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
  flex: none;
}

.icon-btn:hover {
  background: var(--fill-3);
  color: var(--text);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.link {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: 0;
  padding: 4px 2px;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.3);
  text-underline-offset: 3px;
  cursor: pointer;
  border-radius: 6px;
}

.link:hover {
  color: var(--text);
  text-decoration-color: rgba(255, 255, 255, 0.7);
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
  flex: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- forms ---------- */

.segmented {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke-soft);
}

.segmented::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 4px 12px -6px rgba(0, 0, 0, 0.6);
  transition: transform 260ms var(--ease);
}

.segmented[data-active="1"]::before {
  transform: translateX(100%);
}

.segmented button {
  position: relative;
  z-index: 1;
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-3);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: color 200ms var(--ease);
}

.segmented button[aria-selected="true"] {
  color: var(--text);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field .tiny {
  margin-top: -2px;
}

.field label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
}

.input-wrap {
  position: relative;
}

.input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font-size: 17px;
  outline: none;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.input::placeholder {
  color: var(--text-4);
}

.input:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.input:focus,
.input:focus-visible {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
  outline: none;
}

.input[aria-invalid="true"] {
  border-color: rgba(255, 159, 67, 0.75);
}

.input-wrap .input {
  padding-right: 58px;
}

.input-wrap .icon-btn {
  position: absolute;
  right: 7px;
  top: 7px;
  background: transparent;
}

.input-wrap .icon-btn:hover {
  background: var(--fill);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-msg {
  min-height: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-2);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke-soft);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.form-msg.is-error {
  border-color: rgba(255, 159, 67, 0.4);
  background: rgba(255, 122, 26, 0.08);
  color: #fff;
}

.form-msg svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 1px;
}

.form-msg.is-error svg {
  color: var(--accent-2);
}

.form-foot {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- account chip ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: var(--fill);
  border: 1px solid var(--stroke-soft);
  font-size: 15px;
  color: var(--text-2);
  max-width: 100%;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--fill-3);
  color: var(--text);
  font-weight: 650;
  font-size: 14px;
  flex: none;
  text-transform: uppercase;
}

/* ---------- countdown ring ---------- */

.ring {
  position: relative;
  width: 76px;
  height: 76px;
  flex: none;
}

.ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring .ring-track {
  stroke: rgba(255, 255, 255, 0.1);
}

.ring .ring-value {
  transition: stroke-dashoffset 1s linear;
}

.ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  line-height: 1.05;
}

.ring-time {
  font-size: 18px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.ring-unit {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.ring.is-low .ring-time {
  color: var(--accent-2);
}

/* ---------- session header ---------- */

.session-head {
  display: flex;
  align-items: center;
  gap: 18px;
}

.session-head .grow {
  flex: 1;
  min-width: 0;
}

.session-head h1 {
  font-size: 26px;
  overflow-wrap: anywhere;
}

.device-name {
  color: var(--text);
}

@media (min-width: 640px) {
  .session-head h1 {
    font-size: 30px;
  }
  .ring {
    width: 88px;
    height: 88px;
  }
  .ring-time {
    font-size: 20px;
  }
}

/* ---------- uploader ---------- */

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 28px 20px 24px;
  border-radius: var(--radius-md);
  border: 1.5px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 200ms var(--ease), background-color 200ms var(--ease), transform 200ms var(--ease);
}

.dropzone.is-over {
  border-color: rgba(255, 159, 67, 0.85);
  background: rgba(255, 122, 26, 0.07);
  transform: scale(1.01);
}

.dropzone-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--fill-2);
  border: 1px solid var(--stroke-soft);
  border-top-color: rgba(255, 255, 255, 0.2);
  color: var(--text);
}

.dropzone-icon svg {
  width: 26px;
  height: 26px;
}

.dropzone .btn {
  width: 100%;
  max-width: 340px;
}

.dropzone-hint {
  font-size: 14px;
  color: var(--text-3);
  max-width: 34ch;
  line-height: 1.45;
}

.dropzone .drop-only {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .dropzone .drop-only {
    display: inline;
  }
}

.uploader.has-files .dropzone {
  padding: 14px;
  gap: 0;
}

.uploader.has-files .dropzone-icon,
.uploader.has-files .dropzone-hint {
  display: none;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.files {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.files:not(:empty) {
  margin-top: 16px;
}

.file {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 8px 10px 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--stroke-soft);
  animation: rise 360ms var(--ease) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.badge {
  width: 40px;
  height: 50px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06));
  border: 1px solid var(--stroke-soft);
  border-top-color: rgba(255, 255, 255, 0.2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-2);
  text-transform: uppercase;
  overflow: hidden;
}

.file-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.file-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta {
  display: flex;
  gap: 6px;
  font-size: 13px;
  color: var(--text-3);
  min-width: 0;
  white-space: nowrap;
}

.file-status {
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.file[data-state="done"] .file-status {
  color: var(--text);
}

.file[data-state="error"] .file-status {
  color: var(--accent-2);
  white-space: normal;
}

.file[data-state="error"] .file-meta {
  white-space: normal;
}

.bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: var(--accent);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 300ms var(--ease);
}

.bar.is-indeterminate > i {
  width: 40%;
  transform: none;
  animation: indeterminate 1.4s var(--ease) infinite;
}

@keyframes indeterminate {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(250%);
  }
}

.file[data-state="done"] .bar > i {
  opacity: 0.5;
}

.file[data-state="error"] .bar > i {
  background: rgba(255, 255, 255, 0.22);
}

.file-end {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--text-3);
}

.state-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.state-icon svg {
  width: 16px;
  height: 16px;
}

.state-icon.is-done {
  background: var(--accent);
  color: var(--on-accent);
  animation: pop 420ms var(--ease) both;
}

.state-icon.is-error {
  background: rgba(255, 122, 26, 0.12);
  color: var(--accent-2);
}

@keyframes pop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  60% {
    transform: scale(1.08);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

.uploader-note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
  line-height: 1.45;
}

/* ---------- state panels (empty / expired / error / success) ---------- */

.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 36px 24px 32px;
}

.state .lead {
  margin-top: 0;
  max-width: 36ch;
}

.state-mark {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: var(--fill-2);
  border: 1px solid var(--stroke-soft);
  border-top-color: rgba(255, 255, 255, 0.22);
  color: var(--text-2);
  margin-bottom: 4px;
}

.state-mark svg {
  width: 32px;
  height: 32px;
}

.state-mark.is-success {
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  border: 0;
  box-shadow: 0 16px 40px -14px rgba(255, 122, 26, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  animation: pop 520ms var(--ease) both;
}

.state .actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 340px;
  margin-top: 6px;
}

.skeleton {
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.loading-card {
  min-height: 280px;
  display: grid;
  place-items: center;
  color: var(--text-3);
}

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--stroke-soft);
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.45;
}

.notice svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 1px;
  color: var(--text-3);
}

.notice strong {
  color: var(--text);
  font-weight: 600;
}

/* ---------- landing ---------- */

.hero {
  padding: 28px 0 8px;
}

.hero h1 {
  font-size: 42px;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.hero .lead {
  margin-top: 16px;
  font-size: 18px;
  max-width: 34ch;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 28px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  background: var(--fill);
  border: 1px solid var(--stroke-soft);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 18px;
}

.hero-badge i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 122, 26, 0.15);
}

.section-title {
  margin: 28px 0 4px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.steps {
  display: grid;
  gap: 12px;
  counter-reset: step;
}

.step {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 4px 16px;
  padding: 20px;
  align-items: start;
}

.step-num {
  grid-row: span 2;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--fill-2);
  border: 1px solid var(--stroke-soft);
  border-top-color: rgba(255, 255, 255, 0.2);
  color: var(--text);
}

.step-num svg {
  width: 22px;
  height: 22px;
}

.step p {
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.45;
}

.formats {
  display: grid;
  gap: 18px;
}

.format-group h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.01em;
  margin-bottom: 10px;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke-soft);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-2);
}

.privacy {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.privacy .step-num {
  grid-row: auto;
  flex: none;
}

.privacy p {
  color: var(--text-2);
  font-size: 15px;
}

@media (min-width: 900px) {
  .hero {
    padding-top: 56px;
  }
  .hero h1 {
    font-size: 64px;
  }
  .hero .lead {
    font-size: 20px;
  }
  .hero-actions {
    flex-direction: row;
  }
  .hero-actions .btn {
    min-width: 200px;
  }
  .landing-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 48px;
    align-items: center;
  }
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
  .step {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 24px;
  }
  .step-num {
    grid-row: auto;
    margin-bottom: 8px;
  }
}

/* ---------- dashboard ---------- */

.dash-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0 4px;
}

.dash-grid {
  display: grid;
  gap: 16px;
  align-items: start;
}

@media (min-width: 900px) {
  .dash-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
  }
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.card-head p {
  margin-top: 6px;
  color: var(--text-3);
  font-size: 14px;
  line-height: 1.45;
}

.count {
  min-width: 32px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: var(--fill-2);
  font-size: 13px;
  font-weight: 650;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.books {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.book {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.book:first-child {
  border-top: 0;
  padding-top: 0;
}

.book-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.book-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-author {
  font-size: 13px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
}

.book-progress .bar {
  height: 3px;
}

.book-pct {
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  min-width: 7ch;
  text-align: right;
}

.verify-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.verify-banner p {
  flex: 1 1 220px;
}

/* ---------- footer links ---------- */

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.footer a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- destructive actions ---------- */

.btn-danger {
  /* White on both stops stays above 4.8:1. */
  background: linear-gradient(135deg, #c9302c 0%, #d92d20 100%);
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(217, 45, 32, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn-danger:hover:not([disabled]) {
  box-shadow: 0 14px 30px -12px rgba(217, 45, 32, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.btn-danger-quiet {
  background: rgba(255, 90, 80, 0.1);
  border-color: rgba(255, 120, 110, 0.35);
  color: #ff8a80;
}

.btn-danger-quiet:hover:not([disabled]) {
  background: rgba(255, 90, 80, 0.16);
  border-color: rgba(255, 120, 110, 0.5);
}

.btn-danger svg,
.btn-danger-quiet svg {
  width: 20px;
  height: 20px;
  flex: none;
}

/* ---------- document pages (privacy, account deletion) ---------- */

.page.doc {
  width: min(100% - 2 * var(--gutter), 760px);
}

.doc-hero {
  padding: 20px 0 4px;
}

.doc-hero h1 {
  font-size: 36px;
  line-height: 1.06;
  letter-spacing: -0.032em;
}

.doc-meta {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (min-width: 640px) {
  .doc-hero {
    padding-top: 36px;
  }
  .doc-hero h1 {
    font-size: 48px;
  }
}

.prose {
  color: var(--text-2);
  font-size: 16px;
  line-height: 1.65;
}

.prose h2 {
  color: var(--text);
  scroll-margin-top: 20px;
}

.prose h3 {
  color: var(--text);
  margin-top: 22px;
}

.prose p,
.prose ul,
.prose ol {
  margin: 12px 0 0;
}

.prose ul,
.prose ol {
  padding-left: 1.25em;
}

.prose li + li {
  margin-top: 6px;
}

.prose li::marker {
  color: var(--text-4);
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

.prose a,
.text-link {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgba(255, 159, 67, 0.6);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.prose a:hover,
.text-link:hover {
  text-decoration-color: var(--accent-2);
}

.path {
  display: inline;
  padding: 1px 7px;
  border-radius: 7px;
  background: var(--fill-2);
  border: 1px solid var(--stroke-soft);
  color: var(--text);
  font-weight: 600;
  font-size: 0.94em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ---------- motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  .ambient::before,
  .ambient::after {
    animation: none;
  }
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
  .spinner {
    animation: spin 1.2s linear infinite !important;
  }
  .bar.is-indeterminate > i {
    animation: none !important;
    width: 100%;
    opacity: 0.4;
  }
  .skeleton {
    animation: none !important;
  }
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .glass {
    background: rgba(28, 28, 30, 0.92);
  }
}
