/* UI refinement layer for the recovered Hansen PDF Workshop build. */
:root {
  --bg: #f5f7f5;
  --surface: #ffffff;
  --surface-2: #eaf0ee;
  --ink: #172522;
  --muted: #65736f;
  --line: #dce5e1;
  --accent: #e85e49;
  --accent-strong: #c94331;
  --accent-soft: #fff0eb;
  --teal: #187568;
  --teal-soft: #e1f2ed;
  --shadow: 0 20px 54px rgb(24 46 40 / 9%);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #101817;
  --surface: #18211f;
  --surface-2: #222e2b;
  --ink: #f4f7f5;
  --muted: #a8b5b0;
  --line: #35443f;
  --accent: #ff806a;
  --accent-strong: #ff9a87;
  --accent-soft: #402923;
  --teal: #76d5c2;
  --teal-soft: #1e3934;
  --shadow: 0 20px 54px rgb(0 0 0 / 28%);
  color-scheme: dark;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  background:
    radial-gradient(ellipse at 50% 0, rgb(232 94 73 / 6%), transparent 35rem),
    var(--bg);
  line-height: 1.65;
}

button,
a,
input,
select,
textarea {
  transition-timing-function: cubic-bezier(.2, .75, .25, 1);
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--teal) 70%, white);
  outline-offset: 3px;
}

.site-header {
  width: min(1240px, calc(100% - 40px));
  height: 74px;
}

.hero {
  padding-top: 86px;
  padding-bottom: 70px;
}

.hero:before {
  width: 70%;
  height: 300px;
  inset: 12px 15% auto;
  opacity: .78;
}

.hero h1 {
  max-width: 860px;
  line-height: 1.06;
  letter-spacing: -.065em;
}

.hero > p {
  max-width: 760px;
  margin-inline: auto;
  line-height: 1.9;
}

.hero-search {
  min-height: 70px;
  margin-top: 38px;
  border-radius: 20px;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}

.hero-search:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 13%, transparent), var(--shadow);
  transform: translateY(-1px);
}

.trust-row {
  gap: 12px 22px;
}

.personal-hub,
.tool-section {
  width: min(1240px, calc(100% - 40px));
}

.personal-grid {
  gap: 14px;
}

.personal-grid > article {
  min-height: 158px;
  padding: 19px;
  border-radius: 19px;
  box-shadow: 0 5px 18px rgb(24 46 40 / 3%);
}

.tool-section {
  padding-top: 66px;
}

.section-heading {
  margin-bottom: 26px;
}

.popular-strip {
  padding-block: 13px 19px;
}

.popular-strip button {
  transition: color .18s, background .18s, border-color .18s, transform .18s;
}

.popular-strip button:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.library-controls {
  position: sticky;
  top: 74px;
  z-index: 30;
  margin: 0 -8px 22px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  box-shadow: 0 8px 24px rgb(24 46 40 / 6%);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.category-tabs {
  gap: 4px;
  border-radius: 13px;
}

.category-tabs button {
  padding-inline: 16px;
  transition: color .18s, background .18s, box-shadow .18s;
}

.category-tabs button.active {
  color: var(--accent-strong);
  background: var(--surface);
  box-shadow: 0 2px 9px rgb(23 37 34 / 10%);
}

.status-filter {
  transition: color .18s, background .18s, border-color .18s;
}

.tool-grid {
  gap: 14px;
}

.tool-card {
  min-height: 138px;
  border-radius: 19px;
  box-shadow: 0 3px 12px rgb(24 46 40 / 3%);
}

.tool-card.ready:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgb(24 46 40 / 10%);
}

.tool-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
}

.favorite-button {
  opacity: .68;
}

.tool-card-shell:hover .favorite-button,
.favorite-button:focus-visible,
.favorite-button.active {
  opacity: 1;
}

.privacy-section {
  border-radius: 30px;
  box-shadow: 0 22px 60px rgb(19 37 33 / 12%);
}

.privacy-copy > p {
  line-height: 1.9;
}

.roadmap {
  width: min(1240px, calc(100% - 40px));
}

@media (width <= 900px) {
  .site-header {
    width: calc(100% - 32px);
  }

  .library-controls {
    top: 74px;
  }
}

@media (width <= 680px) {
  html {
    scroll-padding-top: 74px;
  }

  .site-header,
  .personal-hub,
  .tool-section,
  .roadmap {
    width: calc(100% - 28px);
  }

  .hero {
    padding-top: 60px;
    padding-bottom: 48px;
  }

  .hero h1 {
    font-size: clamp(43px, 12vw, 64px);
  }

  .hero-search {
    min-height: 60px;
    margin-top: 28px;
    padding-inline: 14px;
    border-radius: 16px;
  }

  .hero-search input {
    height: 58px;
    font-size: 15px;
  }

  .personal-grid {
    gap: 9px;
  }

  .personal-grid > article {
    min-height: 138px;
    padding: 14px;
    border-radius: 16px;
  }

  .tool-section {
    padding-top: 46px;
  }

  .library-controls {
    top: 64px;
    margin: 0 -5px 18px;
    padding: 6px;
    gap: 8px;
    border-radius: 15px;
  }

  .category-tabs {
    padding: 4px;
  }

  .category-tabs button {
    padding: 9px 12px;
    font-size: 12px;
  }

  .tool-grid {
    gap: 10px;
  }

  .tool-card {
    min-height: 122px;
    padding: 16px;
    border-radius: 16px;
  }

  .tool-card-shell .tool-card {
    padding-right: 40px;
  }

  .privacy-section {
    width: calc(100% - 28px);
    margin-bottom: 64px;
    padding: 34px 24px;
    border-radius: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
