:root {
  --paper: #f4f1e8;
  --paper-2: #ebe7dc;
  --ink: #171815;
  --muted: #686a61;
  --line: #cbc7bb;
  --blue: #3157e1;
  --blue-soft: #dce4ff;
  --lime: #c7f36b;
  --card: rgba(255, 255, 255, .52);
  --shadow: 0 18px 50px rgba(27, 29, 24, .08);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 7rem;
}

.fonts-loading body { visibility: hidden; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 5%, rgba(49, 87, 225, .08), transparent 24rem),
    var(--paper);
  font-family: "Manrope", system-ui, sans-serif;
  transition: color .25s ease, background-color .25s ease;
}

html[data-theme="dark"] {
  --paper: #171916;
  --paper-2: #20231e;
  --ink: #f4f1e8;
  --muted: #a7aa9e;
  --line: #3b3e37;
  --blue: #7d99ff;
  --blue-soft: #27345f;
  --card: rgba(255, 255, 255, .035);
  --shadow: none;
}

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

.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;
}

.site-header {
  width: min(1240px, calc(100% - 40px));
  min-height: 84px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
  letter-spacing: -.035em;
  text-decoration: none;
}

.logo-mark {
  width: 29px;
  height: 29px;
  display: block;
  flex: 0 0 auto;
  transform: rotate(-2deg);
}

nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

nav a {
  color: var(--muted);
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
}

nav a:hover { color: var(--ink); }

.theme-button {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.theme-icon {
  display: block;
  font-family: Georgia, serif;
  font-size: 1.2rem;
  line-height: 1;
}

.hero,
.tool-section,
.principles,
footer {
  width: min(1240px, calc(100% - 40px));
  margin-inline: auto;
}

.hero {
  min-height: 610px;
  padding: 112px 0 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.tool-tag {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(4rem, 8vw, 7.4rem);
  line-height: .9;
  letter-spacing: -.075em;
}

h1 em {
  color: var(--blue);
  font-family: Georgia, serif;
  font-weight: 400;
}

.hero-copy {
  max-width: 610px;
  margin: 35px auto 39px;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.7;
}

.tool-search {
  width: min(630px, 100%);
  height: 68px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 18px 0 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .62);
  box-shadow: var(--shadow);
  text-align: left;
}

html[data-theme="dark"] .tool-search { background: rgba(255, 255, 255, .04); }

.tool-search > span {
  color: var(--blue);
  font-size: 1.8rem;
  line-height: 1;
}

.tool-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 1rem;
}

.tool-search input::placeholder { color: var(--muted); }

kbd {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  color: var(--muted);
  background: var(--paper);
  font-size: .78rem;
  font-weight: 700;
}

.quick-links {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  font-size: .77rem;
}

.quick-links button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}

.tool-section,
.principles {
  padding: 90px 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  margin-bottom: 38px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}

.section-heading > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 20px;
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.35rem);
  letter-spacing: -.06em;
}

.filters {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.filters button {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  background: transparent;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
}

.filters button.active {
  color: white;
  border-color: var(--blue);
  background: var(--blue);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.tool-card {
  min-height: 310px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: inherit;
  background: var(--card);
  text-decoration: none;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--ink);
  box-shadow: var(--shadow);
}

.tool-card.hidden { display: none; }

.tool-card.featured {
  grid-column: span 2;
  color: white;
  background: var(--blue);
  border-color: var(--blue);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.tool-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--paper-2);
  border-radius: 11px;
  font-weight: 700;
  font-size: 1rem;
}

.featured .tool-icon {
  color: var(--blue);
  background: white;
}

.compress-icon { font-size: 1.55rem; }
.pdf-icon { color: #c24536; font-size: .73rem; letter-spacing: -.03em; }
.metadata-icon { font-size: 1.7rem; font-weight: 400; }
.text-icon { font-family: Georgia, serif; font-size: 1.1rem; }

.card-state {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.featured .card-state {
  color: white;
  border-color: rgba(255, 255, 255, .35);
}

.tool-tag {
  display: inline-block;
  margin-bottom: 11px;
  color: var(--muted);
  font-size: .62rem;
}

.featured .tool-tag { color: rgba(255, 255, 255, .67); }

.tool-card h3 {
  margin: 0 0 8px;
  font-size: 1.42rem;
  letter-spacing: -.04em;
}

.tool-card p {
  max-width: 390px;
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.6;
}

.featured p { color: rgba(255, 255, 255, .75); }

.fee-stack {
  width: 190px;
  height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  position: absolute;
  right: 40px;
  bottom: -25px;
  transform: rotate(8deg);
  padding: 18px;
  border: 7px solid white;
  border-radius: 8px;
  background: white;
  color: #171815;
  box-shadow: 0 15px 40px rgba(0, 0, 0, .18);
  font-size: .72rem;
}
.fee-stack span { display: flex; justify-content: space-between; color: #686a61; }
.fee-stack span::after { content: "−"; }
.fee-stack strong { margin-top: 4px; padding-top: 8px; border-top: 1px solid #cbc7bb; color: #3157e1; font-size: 1rem; }

.suggestion-card {
  justify-content: center;
  background: var(--paper-2);
}

.suggestion-card > a {
  margin-top: 20px;
  color: var(--blue);
  font-size: .83rem;
  font-weight: 700;
  text-decoration: none;
}

.suggestion-card > a span { margin-left: 5px; }

.empty-state {
  padding: 60px 20px;
  color: var(--muted);
  text-align: center;
}

.principle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.principle-grid article {
  padding: 30px 35px 10px 0;
}

.principle-grid article + article {
  padding-left: 35px;
  border-left: 1px solid var(--line);
}

.principle-grid h3 {
  margin: 12px 0 10px;
  font-size: 1.15rem;
}

.principle-grid p {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.65;
}

footer {
  min-height: 180px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .77rem;
}

.footer-mark { color: var(--ink); }
.footer-mark .logo-mark { width: 25px; height: 25px; }
footer > p { text-align: center; }
footer > div { display: flex; justify-content: flex-end; gap: 22px; }
footer > div a { text-decoration: none; }

@media (max-width: 850px) {
  .hero { min-height: 570px; padding-top: 90px; }
  h1 { font-size: clamp(3.8rem, 15vw, 6rem); }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .tool-card.featured { grid-column: span 2; }
  .principle-grid { grid-template-columns: 1fr; }
  .principle-grid article,
  .principle-grid article + article {
    padding: 28px 0;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }
  .principle-grid h3 { margin-top: 18px; }
}

@media (max-width: 620px) {
  .site-header,
  .hero,
  .tool-section,
  .principles,
  footer { width: min(100% - 28px, 1240px); }

  .site-header { min-height: 72px; }
  nav a { display: none; }
  .hero { min-height: 560px; padding: 78px 0 68px; }
  h1 { max-width: 100%; font-size: clamp(2.9rem, 13.5vw, 4.7rem); }
  h1 em { display: inline-block; }
  .hero-copy { margin-top: 28px; font-size: .98rem; }
  .tool-search { height: 60px; }
  .tool-search kbd { display: none; }
  .quick-links span { width: 100%; }
  .tool-section, .principles { padding: 66px 0; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .section-heading > div:first-child { gap: 12px; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card,
  .tool-card.featured { grid-column: auto; min-height: 280px; }
  .featured { padding-bottom: 145px; }
  .fee-stack { width: 150px; height: 115px; right: 24px; }
  footer { padding: 45px 0; grid-template-columns: 1fr; gap: 22px; text-align: left; }
  footer > p { margin: 0; text-align: left; }
  footer > div { justify-content: flex-start; }
}

@media (max-width: 390px) {
  h1 { font-size: 2.85rem; }
  .wordmark { font-size: .92rem; }
  .hero-copy { line-height: 1.55; }
  .filters { gap: 5px; }
  .filters button { padding: 8px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
