/* ============================================================
   AmigoPDF — site-wide styles (tokens, header, landing)
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --paper:   #f4f5f8;   /* page background — cool paper */
  --sheet:   #ffffff;   /* card / sheet surface */
  --fold:    #dfe3ea;   /* dog-ear fold */
  --ink:     #1c2433;   /* main text */
  --ink-2:   #5a6372;   /* muted text */
  --line:    #e2e5ec;   /* hairlines */
  --marker:  #ffde59;   /* highlighter yellow */
  --marker-soft: #ffde5966;
  --sig:     #2749c9;   /* signature blue — links, CTAs */
  --sig-ink: #ffffff;
  --flag:    #e0312f;   /* brand red, small doses */
  --shadow:  0 1px 2px rgba(28,36,51,.06), 0 8px 24px rgba(28,36,51,.07);
  --shadow-lift: 0 2px 4px rgba(28,36,51,.08), 0 16px 40px rgba(28,36,51,.14);
  --radius: 10px;
  --font-display: "Avenir Next", Avenir, Futura, "Century Gothic", "Segoe UI", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

html[data-theme="dark"] {
  --paper:  #12151b;
  --sheet:  #1b202a;
  --fold:   #2a3140;
  --ink:    #e8eaf0;
  --ink-2:  #9aa3b2;
  --line:   #2a3140;
  --marker: #f0c93a;
  --marker-soft: #f0c93a4d;
  --sig:    #6e8df7;
  --sig-ink:#0e1320;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.35);
  --shadow-lift: 0 2px 4px rgba(0,0,0,.4), 0 16px 40px rgba(0,0,0,.5);
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--sig); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font: inherit; color: inherit; cursor: pointer; }

:focus-visible { outline: 2px solid var(--sig); outline-offset: 2px; }

/* ---------- shared buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--sheet);
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
  transition: border-color .15s, background .15s, transform .1s;
}
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary {
  background: var(--sig); border-color: var(--sig); color: var(--sig-ink); font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--flag); border-color: var(--flag); background: transparent; }
.btn.big { padding: 12px 22px; font-size: 1.05rem; border-radius: 10px; }
.linklike {
  background: none; border: none; color: var(--sig); text-decoration: underline; padding: 0;
}

/* ---------- site header ---------- */
.site-head {
  display: flex; align-items: center; gap: 20px;
  padding: 14px clamp(16px, 4vw, 40px);
  max-width: 1120px; margin: 0 auto;
}
.brand {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em;
  color: var(--ink) !important; text-decoration: none !important;
}
.brand svg { display: block; border-radius: 6px; }
.site-head nav { display: flex; gap: 4px; margin-left: 8px; }
.site-head nav a {
  color: var(--ink-2); padding: 6px 10px; border-radius: 7px; font-size: .95rem;
}
.site-head nav a:hover { color: var(--ink); background: var(--sheet); text-decoration: none; }
.site-head nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.site-head .spacer { flex: 1; }
.theme-btn {
  border: 1px solid var(--line); background: var(--sheet); border-radius: 8px;
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
}
.theme-btn svg { width: 18px; height: 18px; }

/* ---------- hero ---------- */
.hero {
  max-width: 1120px; margin: 0 auto;
  padding: clamp(28px, 6vw, 72px) clamp(16px, 4vw, 40px) clamp(24px, 4vw, 48px);
  display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(24px, 5vw, 64px);
  align-items: center;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.6vw, 3.3rem);
  font-weight: 700; letter-spacing: -.02em; line-height: 1.12;
  margin-bottom: 18px;
}
.hero .sub {
  color: var(--ink-2); font-size: clamp(1rem, 1.6vw, 1.15rem); max-width: 46ch;
  margin-bottom: 26px;
}
.hero .cta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.privacy-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .85rem; color: var(--ink-2);
  border: 1px dashed var(--line); border-radius: 999px; padding: 5px 12px;
  margin-bottom: 18px;
}
.privacy-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #2fa34f; }

/* highlighter mark */
.mark {
  background-image: linear-gradient(100deg, transparent 0%, var(--marker) 3% 97%, transparent 100%);
  background-repeat: no-repeat;
  background-size: 100% 46%;
  background-position: 0 78%;
  padding: 0 .12em;
  animation: markDraw .7s ease-out .25s backwards;
}
@keyframes markDraw { from { background-size: 0% 46%; } to { background-size: 100% 46%; } }

/* ---------- hero mock sheet ---------- */
.mock-wrap { position: relative; min-height: 300px; }
.mock-sheet {
  position: relative;
  background: var(--sheet);
  border-radius: 3px;
  box-shadow: var(--shadow-lift);
  padding: 30px 26px;
  transform: rotate(1.6deg);
  max-width: 400px; margin: 0 auto;
}
.mock-sheet::after { /* dog-ear */
  content: ""; position: absolute; top: 0; right: 0; width: 30px; height: 30px;
  background: linear-gradient(225deg, var(--paper) 50%, var(--fold) 50%);
  border-bottom-left-radius: 6px;
}
.m-line { height: 9px; border-radius: 4px; background: var(--line); margin: 12px 0; }
.m-line.w60 { width: 60%; } .m-line.w85 { width: 85%; } .m-line.w75 { width: 75%; } .m-line.w40 { width: 40%; }
.m-hl { position: relative; }
.m-hl::after {
  content: ""; position: absolute; inset: -3px -6px;
  background: var(--marker); opacity: .55; border-radius: 3px;
  mix-blend-mode: multiply;
}
html[data-theme="dark"] .m-hl::after { mix-blend-mode: normal; opacity: .3; }
.m-textbox {
  display: inline-block; border: 1.5px dashed var(--sig); color: var(--sig);
  border-radius: 4px; padding: 3px 10px; font-size: .85rem; font-weight: 600;
  transform: rotate(-1deg); margin: 6px 0;
}
.m-sig { margin-top: 14px; }
.m-sig svg { display: block; }
.m-sig-label { font-size: .72rem; color: var(--ink-2); letter-spacing: .06em; text-transform: uppercase; }
.m-badge {
  position: absolute; bottom: -16px; left: -18px;
  background: var(--ink); color: var(--paper);
  font-size: .8rem; font-weight: 600; border-radius: 999px; padding: 7px 14px;
  transform: rotate(-2deg);
  box-shadow: var(--shadow);
}

/* ---------- sections ---------- */
.section { max-width: 1120px; margin: 0 auto; padding: clamp(28px, 5vw, 56px) clamp(16px, 4vw, 40px); }
.section h2 {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -.015em;
  font-size: clamp(1.5rem, 2.6vw, 2rem); margin-bottom: 8px;
}
.section .lede { color: var(--ink-2); margin-bottom: 28px; max-width: 60ch; }

/* tool cards */
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tool-card {
  position: relative; display: block;
  background: var(--sheet); border-radius: 3px 3px var(--radius) var(--radius);
  padding: 24px 22px 20px;
  box-shadow: var(--shadow);
  color: var(--ink) !important; text-decoration: none !important;
  transition: transform .18s ease, box-shadow .18s ease;
}
.tool-card::after { /* dog-ear */
  content: ""; position: absolute; top: 0; right: 0; width: 24px; height: 24px;
  background: linear-gradient(225deg, var(--paper) 50%, var(--fold) 50%);
  border-bottom-left-radius: 5px;
  transition: width .18s ease, height .18s ease;
}
.tool-card:hover { transform: translateY(-3px) rotate(-.3deg); box-shadow: var(--shadow-lift); }
.tool-card:hover::after { width: 32px; height: 32px; }
.tool-card .t-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.tool-card .t-icon svg { width: 24px; height: 24px; }
.t-icon.edit { background: var(--marker-soft); color: var(--ink); }
.t-icon.merge { background: color-mix(in srgb, var(--sig) 14%, transparent); color: var(--sig); }
.t-icon.split { background: color-mix(in srgb, var(--flag) 12%, transparent); color: var(--flag); }
.tool-card h3 { font-family: var(--font-display); font-size: 1.15rem; margin-bottom: 6px; }
.tool-card p { color: var(--ink-2); font-size: .95rem; margin-bottom: 14px; }
.tool-card .t-go { color: var(--sig); font-weight: 600; font-size: .95rem; }

/* steps — a real sequence, so numbers are earned */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; }
.step {
  background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px;
}
.step::before {
  counter-increment: step; content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--ink); color: var(--paper); font-weight: 700; font-size: .9rem;
  margin-bottom: 12px;
}
.step h3 { font-size: 1.02rem; margin-bottom: 4px; }
.step p { color: var(--ink-2); font-size: .93rem; }

/* privacy */
.privacy-band { background: var(--sheet); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.privacy-cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 32px; }
.privacy-cols li { list-style: none; padding-left: 26px; position: relative; color: var(--ink-2); margin: 6px 0; }
.privacy-cols li::before { content: "✓"; position: absolute; left: 0; color: #2fa34f; font-weight: 700; }
.privacy-cols li strong { color: var(--ink); }

/* FAQ */
.faq details {
  border-bottom: 1px solid var(--line); padding: 14px 4px;
}
.faq summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--ink-2); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--ink-2); margin-top: 8px; max-width: 70ch; }

/* footer */
.site-foot {
  border-top: 1px solid var(--line);
  padding: 28px clamp(16px, 4vw, 40px);
  max-width: 1120px; margin: 24px auto 0;
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
  color: var(--ink-2); font-size: .9rem;
}
.site-foot nav { display: flex; gap: 16px; }
.site-foot a { color: var(--ink-2); }

/* ---------- toasts (shared) ---------- */
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: var(--ink); color: var(--paper);
  padding: 10px 18px; border-radius: 999px; font-size: .92rem;
  box-shadow: var(--shadow-lift);
  animation: toastIn .25s ease;
  max-width: min(90vw, 480px); text-align: center;
}
.toast.err { background: var(--flag); color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- modals (shared) ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 19, 28, .55);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-back[hidden] { display: none; }
.modal {
  background: var(--sheet); border-radius: 14px; box-shadow: var(--shadow-lift);
  padding: 22px; width: min(420px, 100%);
  max-height: 90vh; overflow: auto;
}
.modal.wide { width: min(680px, 100%); }
.modal h2 { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 10px; }
.modal p { color: var(--ink-2); font-size: .95rem; margin-bottom: 12px; }
.modal input[type="password"], .modal input[type="text"] {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper); color: var(--ink); font: inherit; margin-bottom: 14px;
}
.modal-btns { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.modal-btns.spread { justify-content: space-between; }
.btn-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--ink-2); font-size: .92rem; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .mock-wrap { order: -1; min-height: 0; margin-bottom: 8px; }
  .mock-sheet { max-width: 320px; padding: 22px 20px; }
  .tool-grid, .steps { grid-template-columns: 1fr; }
  .privacy-cols { grid-template-columns: 1fr; }
  .site-head nav a { padding: 6px 7px; font-size: .88rem; }
}

/* ---------- breadcrumbs ---------- */
.crumbs { font-size: .85rem; color: var(--ink-2); margin-bottom: 4px; }
.crumbs a { color: var(--sig); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span[aria-current] { color: var(--ink-2); }

/* ---------- related links (internal linking) ---------- */
.related { margin: 30px 0 6px; }
.related h2 { font-family: var(--font-display); font-size: 1.25rem; letter-spacing: -.01em; margin: 0 0 4px; }
.related .lede { color: var(--ink-2); margin: 0 0 14px; font-size: .95rem; }
.related-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.related-links a {
  display: block; background: var(--sheet); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 16px; text-decoration: none; color: var(--ink);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.related-links a:hover { border-color: var(--ink-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.related-links .rl-t { font-weight: 600; display: block; }
.related-links .rl-d { color: var(--ink-2); font-size: .88rem; margin-top: 2px; display: block; }

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

/* ---------- AmigoPDF brand lockup ---------- */
.brand-mark { width: 26px; height: 26px; flex: 0 0 auto; display: block; }
.brand-word { font-family: var(--font-display); font-weight: 800; letter-spacing: -.01em; }
.brand-pdf { color: var(--flag); }
