/* ==========================================================================
   PDFolio design system
   Concept: the desk of someone who processes paperwork all day — a stack
   of folders, a rubber stamp, a hairline ruled ledger. Warm paper surface,
   deep ink text, a forest-green "stamp ink" accent instead of the default
   AI-generated cream/terracotta pairing.
   ========================================================================== */

:root {
  /* -- Color: named tokens -- */
  --paper:      #F6F4EE;   /* page background, warm off-white */
  --surface:    #FFFFFF;   /* cards */
  --ink:        #1C2321;   /* primary text, near-black with a green cast */
  --ink-soft:   #55605C;   /* secondary text */
  --line:       #DEDACB;   /* hairline rules / borders */
  --accent:     #2F6F4E;   /* stamp-ink green — primary actions */
  --accent-dark:#204F37;
  --accent-2:   #B8912F;   /* muted gold — badges, highlights */
  --danger:     #B3492B;
  --danger-bg:  #FBEEE8;
  --success-bg: #EAF3EC;

  /* -- Type -- */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  /* -- Layout -- */
  --max-width: 1120px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-card: 0 1px 2px rgba(28,35,33,0.04), 0 8px 24px rgba(28,35,33,0.06);
}

/* -- Reset -- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
body {
  margin: 0;
  max-width: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
  color: var(--ink);
}
h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; color: var(--ink-soft); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-dark);
  background: var(--success-bg);
  border: 1px solid var(--line);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px;
  flex-shrink: 0;
}
.main-nav { display: flex; gap: 28px; align-items: center; }
.main-nav a {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 500;
}
.main-nav a:hover { color: var(--accent-dark); }
.nav-toggle { display: none; }

/* ---- Nav search (desktop: inline in the main nav; mobile: inside the
   hamburger dropdown, since .main-nav is a single element reused for both) ---- */
.nav-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.nav-search input[type="text"] {
  width: 180px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--font-body);
  font-size: 0.85rem;
  background: var(--surface);
  color: var(--ink);
}
.nav-search input[type="text"]:focus { width: 220px; }
.nav-search__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
}
.nav-search__btn:hover { border-color: var(--accent); color: var(--accent-dark); }
.nav-search__results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  min-width: 260px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  z-index: 60;
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
}
.nav-search__result {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: var(--font-body);
  color: var(--ink);
  cursor: pointer;
}
.nav-search__result small { display: block; color: var(--ink-soft); font-size: 0.72rem; margin-top: 2px; }
.nav-search__result:hover,
.nav-search__result.is-active { background: var(--success-bg); color: var(--accent-dark); }
.nav-search__empty { padding: 8px 10px; color: var(--ink-soft); font-size: 0.82rem; }

.breadcrumbs-bar {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.breadcrumbs-bar .container { max-width: var(--max-width); margin: 0 auto; padding: 10px 24px; }
.breadcrumbs { font-size: 0.82rem; color: var(--ink-soft); }
.breadcrumbs a { color: var(--ink-soft); }
.breadcrumbs a:hover { color: var(--accent-dark); }
.breadcrumbs__sep { margin: 0 8px; color: var(--line); }
.breadcrumbs [aria-current="page"] { color: var(--ink); font-weight: 500; }

@media (max-width: 720px) {
  .site-header__inner { padding: 14px 16px; }
  .main-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    width: 100%;
    box-sizing: border-box;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 16px;
    display: none;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }
  .main-nav.is-open { display: flex; }
  .main-nav a { align-self: flex-start; }

  /* Hamburger icon: three bars via a single span + its ::before/::after,
     morphs into an X while the dropdown is open. */
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
  }
  .nav-toggle__bars,
  .nav-toggle__bars::before,
  .nav-toggle__bars::after {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
    transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
  }
  .nav-toggle__bars { position: relative; }
  .nav-toggle__bars::before,
  .nav-toggle__bars::after { content: ''; position: absolute; left: 0; }
  .nav-toggle__bars::before { top: -6px; }
  .nav-toggle__bars::after { top: 6px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { top: 0; transform: rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { top: 0; transform: rotate(-45deg); }

  .nav-search { width: 100%; order: -1; }
  .nav-search input[type="text"] { width: 100%; flex: 1; }
  .nav-search input[type="text"]:focus { width: 100%; }
  .nav-search__results { position: static; margin-top: 8px; box-shadow: none; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-card);
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-primary:disabled { background: #A9B4AE; cursor: not-allowed; transform: none; }
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn-block { width: 100%; }

/* ==========================================================================
   Hero — fanned document-stack signature element
   ========================================================================== */
.hero {
  padding: 64px 0 40px;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
}
.hero p.lede {
  font-size: 1.1rem;
  max-width: 46ch;
}
.hero__search {
  position: relative;
  display: flex;
  gap: 10px;
  margin-top: 28px;
  max-width: 440px;
}
.hero__search input {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--surface);
}
.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  margin-top: 32px;
}
.hero__stats div { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-soft); }
.hero__stats strong { display: block; font-family: var(--font-display); font-size: 1.6rem; color: var(--ink); }

/* Fanned card stack, built purely in CSS: three rotated "documents" */
.doc-stack {
  position: relative;
  height: 320px;
  overflow: hidden; /* contain the rotated cards' bleed within this element only — not the text column */
  contain: paint;    /* hard guarantee to the browser that nothing here paints (or registers scroll) outside this box */
}
@media (max-width: 480px) {
  /* The rotated cards pivot around their bottom edge, so even a small tilt
     swings the top corners well past the card's own width. Relying on clip
     alone wasn't enough on real devices, so on narrow phones this purely
     decorative illustration (aria-hidden, no content) is hidden outright —
     that's a hard, deterministic guarantee against any horizontal overflow,
     instead of one more layer of clipping to get wrong. */
  .doc-stack { display: none; }
}
.doc-card {
  position: absolute;
  top: 10px; left: 50%;
  width: 220px;
  height: 280px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 20px;
  transform-origin: bottom center;
}
.doc-card--1 { transform: translateX(-50%) rotate(-9deg); z-index: 1; background: #FBFAF6; }
.doc-card--2 { transform: translateX(-50%) rotate(4deg); z-index: 2; }
.doc-card--3 { transform: translateX(-50%) rotate(-2deg) translateY(-6px); z-index: 3; }
.doc-card__bar { height: 8px; border-radius: 4px; background: var(--line); margin-bottom: 10px; }
.doc-card__bar.short { width: 60%; }
.doc-card__badge {
  position: absolute;
  bottom: 18px; left: 20px; right: 20px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent-dark);
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}
.doc-card--3 .doc-card__badge {
  color: var(--accent-2);
}

/* ==========================================================================
   Tool grid / cards
   ========================================================================== */
.section { padding: 48px 0; }
.section--muted { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 18px;
}
@media (max-width: 720px) {
  /* auto-fill can still squeeze 2 narrow columns on ~480-720px phones —
     force a single full-width column below the mobile breakpoint instead. */
  .tool-grid { grid-template-columns: 1fr; }
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color 0.15s ease, transform 0.15s ease;
  position: relative;
}
.tool-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.tool-card__icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--success-bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-dark);
  margin-bottom: 14px;
}
.tool-card h3 { margin-bottom: 6px; color: var(--ink); }
.tool-card p { margin: 0; font-size: 0.9rem; }
.tool-card__soon {
  position: absolute; top: 16px; right: 16px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-2);
  background: #FBF4E4;
  border: 1px solid #EFDFB0;
  padding: 3px 8px;
  border-radius: 999px;
}

/* ==========================================================================
   Tool page: upload widget
   ========================================================================== */
.tool-page__head { max-width: 70ch; margin: 0 auto 8px; text-align: center; }
.tool-page__head .eyebrow { display: block; width: fit-content; margin: 0 auto 14px; }
.tool-page__lede { text-align: center; max-width: 60ch; margin: 0 auto 32px; }

.workspace {
  max-width: 640px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 32px;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  background: var(--paper);
}
.dropzone:hover, .dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--success-bg);
}
.dropzone__icon { color: var(--accent-dark); margin-bottom: 10px; }
.dropzone strong { color: var(--ink); }
.dropzone small { display: block; margin-top: 6px; color: var(--ink-soft); font-size: 0.82rem; }
.dropzone input[type="file"] { display: none; }

.file-chip {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  font-size: 0.88rem;
}
.file-chip.is-visible { display: flex; }
.file-chip__name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip__size { font-family: var(--font-mono); color: var(--ink-soft); font-size: 0.78rem; }

.file-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.file-list:empty { margin: 0; }
.file-list__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  font-size: 0.85rem;
}
.file-list__name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list__size { font-family: var(--font-mono); color: var(--ink-soft); font-size: 0.76rem; }
.file-list__remove {
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}
.file-list__remove:hover { color: var(--danger); background: var(--danger-bg); }

.form-row { margin-top: 20px; }
.form-row label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 6px; }
.form-row .hint { font-size: 0.78rem; color: var(--ink-soft); margin-top: 4px; }
.form-row input[type="number"],
.form-row input[type="text"],
.form-row select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--surface);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
}
.range-row { display: flex; align-items: center; gap: 14px; }
.range-row input[type="range"] { flex: 1; }
.range-row output { font-family: var(--font-mono); font-weight: 600; width: 46px; text-align: right; }

.radio-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-pill { position: relative; }
.radio-pill input { position: absolute; opacity: 0; }
.radio-pill span {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.12s ease;
}
.radio-pill input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.form-actions { margin-top: 26px; }

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 20px;
}
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #EFCBBB; }
.alert-success { background: var(--success-bg); color: var(--accent-dark); border: 1px solid #CFE3D4; }

/* ==========================================================================
   Result / download — "ticket stub" signature: torn perforated edge
   ========================================================================== */
.result-card {
  max-width: 560px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.result-card__top { padding: 32px; text-align: center; }
.result-card__stamp {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--accent-dark);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--accent);
}
.result-card__stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin: 20px 0 4px;
}
.result-card__stats div { text-align: center; }
.result-card__stats strong { display: block; font-family: var(--font-display); font-size: 1.4rem; }
.result-card__stats span { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.result-card__stats .arrow { align-self: center; color: var(--accent); font-size: 1.2rem; }
@media (max-width: 720px) {
  .result-card__stats { flex-direction: column; gap: 14px; }
  .result-card__stats .arrow { transform: rotate(90deg); }
}

.perforation {
  position: relative;
  height: 1px;
  border-top: 1px dashed var(--line);
  margin: 0 32px;
}
.perforation::before, .perforation::after {
  content: '';
  position: absolute;
  top: -9px;
  width: 18px; height: 18px;
  background: var(--paper);
  border-radius: 50%;
}
.perforation::before { left: -41px; }
.perforation::after { right: -41px; }

.result-card__bottom { padding: 24px 32px 32px; text-align: center; }

/* ==========================================================================
   Content pages (about, blog, legal, FAQ)
   ========================================================================== */
.prose { max-width: 70ch; margin: 0 auto; }
.prose h2 { margin-top: 1.6em; }
.prose ul, .prose ol { color: var(--ink-soft); padding-left: 1.3em; }
.prose li { margin-bottom: 0.4em; }

.faq { max-width: 70ch; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq-item summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--accent); font-size: 1.2rem; }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { margin-top: 10px; }

.steps { counter-reset: step; list-style: none; padding: 0; max-width: 60ch; margin: 0 auto; }
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 44px;
  margin-bottom: 18px;
  color: var(--ink-soft);
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: -2px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
}

.related-tools {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 64px;
  padding: 48px 0 32px;
  background: var(--surface);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 32px;
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}
.footer-grid h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); margin-bottom: 14px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: var(--ink); font-size: 0.9rem; }
.footer-bottom {
  max-width: var(--max-width);
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}
@media (max-width: 720px) {
  .footer-bottom { flex-direction: column; gap: 8px; }
}

/* ==========================================================================
   Utility
   ========================================================================== */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
