/* ==========================================================================
   PDF Editor — home page.  Uses the editor's own tokens from app.css.
   ========================================================================== */
/* the editor makes body a fixed-height grid that scrolls inside itself; these pages
   are ordinary documents, so hand the scrolling back to the window */
html:has(body.home) { height: auto; }

body.home {
  margin: 0;
  min-height: 100%;
  height: auto;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow: visible;
  display: block;
}

body.home a {
  color: inherit;
  text-decoration: none;
}

/* ------------------------------------------------------------------ header */
.home-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-h);
  padding: 0 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.home-header .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
}

.home-nav {
  display: flex;
  gap: 20px;
  margin-left: auto;
  font-size: 13.5px;
  color: var(--text-2);
}

.home-nav a:hover {
  color: var(--text);
}

/* -------------------------------------------------------------------- hero */
main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px 64px;
}

.hero {
  padding: 56px 0 36px;
  text-align: center;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 4.4vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.lede {
  max-width: 620px;
  margin: 0 auto 30px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-2);
}

.drop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  max-width: 620px;
  margin: 0 auto;
  padding: 26px 24px;
  background: var(--surface);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.drop:hover,
.drop.over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.drop-icon svg {
  width: 21px;
  height: 21px;
}

.drop-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  font-size: 13.5px;
  color: var(--text-2);
}

.drop-text strong {
  font-size: 15px;
  color: var(--text);
}

.linklike {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}

.hero-note {
  min-height: 20px;
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--text-3);
}

.hero-note.error {
  color: var(--danger);
}

/* ---------------------------------------------------------------- features */
.group {
  margin-top: 40px;
}

.group h2 {
  margin: 0 0 4px;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.group p.group-note {
  margin: 0 0 16px;
  font-size: 13.5px;
  color: var(--text-2);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 12px;
}

.card {
  display: flex;
  gap: 12px;
  padding: 14px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
}

.card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(16, 24, 40, 0.07);
  transform: translateY(-1px);
}

.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
}

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

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

.card-title {
  font-weight: 600;
  font-size: 14px;
}

.card-desc {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-2);
}

.card[data-disabled="1"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.card[data-disabled="1"]:hover {
  border-color: var(--border);
  box-shadow: none;
  transform: none;
}

/* ------------------------------------------------------------------ footer */
.home-footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-2);
}

.home-footer a {
  color: var(--accent);
}

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

/* -------------------------------------------------------------------- busy */
.busy {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(16, 24, 40, 0.28);
}

.busy-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--pop-shadow);
  font-size: 14px;
}

.spinner {
  width: 17px;
  height: 17px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: home-spin 0.7s linear infinite;
}

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

@media (max-width: 720px) {
  .home-nav { display: none; }
  .drop { flex-direction: column; text-align: center; }
  .drop-text { text-align: center; }
}
