:root {
  --bg-1: #fff8ed;
  --bg-2: #ffe8d6;
  --paper: #fefcf7;
  --ink: #2a1a3e;
  --ink-2: #4f3d68;
  --ink-3: #5e4c7e;  /* darkened from #8278a0 (failed WCAG AA 4.5:1 on cream) — see /legal/accessibility */
  --plum: #5b3490;   /* darkened from #6b3fa0 to clear AA at all sizes */
  --plum-deep: #4a2b75;
  --coral: #c4395a;  /* darkened from #e85d75 (failed AA on cream backgrounds) */
  --gold: #c98a18;   /* darkened from #f4b942 (failed AA — yellow on cream is the classic fail) */
  --sage: #3f7e5c;   /* darkened from #5fa980 (failed AA) */
  --rule: #e5dccd;
  --rad: 14px;
  --rad-lg: 22px;
}

/* Keyboard focus indicators — required for WCAG 2.1 AA (2.4.7 Focus Visible).
   :focus-visible only shows for keyboard nav, not mouse clicks, so it doesn't
   nag visual users while still helping keyboard + screen-reader users. */
:focus-visible {
  outline: 3px solid var(--plum);
  outline-offset: 2px;
  border-radius: 4px;
}
button:focus-visible, a:focus-visible {
  outline-color: var(--plum-deep);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 100%);
  color: var(--ink);
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
main { max-width: 920px; margin: 0 auto; padding: 3rem 1.25rem 5rem; position: relative; }
h1, h2, h3 { font-family: 'Fredoka One', cursive; color: var(--plum-deep); font-weight: normal; }

/* Decorative leaves, fixed in the bg corners of the hero */
.leaf-bg {
  position: absolute;
  pointer-events: none;
  opacity: 0.55;
  z-index: 0;
}
.leaf-bg.tl { top: 0; left: -1.5rem; width: 110px; transform: rotate(-22deg); }
.leaf-bg.tr { top: 1rem; right: -1rem; width: 90px; transform: rotate(28deg); }

/* Hero brand lockup */
.brand-lockup { position: relative; z-index: 1; text-align: center; margin-bottom: 1rem; }
.brandmark {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(2.4rem, 7vw, 4rem);
  color: var(--plum-deep);
  line-height: 1.05;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}
.brandmark-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  color: var(--sage);
}
.brand-rule {
  display: block;
  width: 64px;
  height: 3px;
  background: linear-gradient(90deg, var(--coral), var(--gold));
  border-radius: 999px;
  margin: 0.85rem auto 0;
}

/* Hero tagline (clearly smaller than brand) */
.tagline {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(1.15rem, 2.6vw, 1.55rem);
  color: var(--ink);
  line-height: 1.25;
  margin: 1.25rem auto 0;
  max-width: 640px;
  font-weight: normal;
}
.tagline .accent { color: var(--plum); }

.subhead {
  font-size: 1.05rem;
  color: var(--ink-2);
  max-width: 580px;
  margin: 1rem auto 1.5rem;
}

.btn-primary {
  font-family: 'Fredoka One', cursive;
  background: var(--plum);
  color: white;
  border: none;
  padding: 0.95rem 1.6rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
  letter-spacing: 0.02em;
  transition: transform 0.15s, background 0.15s;
}
.btn-primary:hover { background: var(--plum-deep); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  font-family: 'Fredoka One', cursive;
  background: white;
  color: var(--plum);
  border: 1px solid var(--rule);
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  cursor: pointer;
}

.card {
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--rad-lg);
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 28px -16px rgba(74,43,117,0.18);
  position: relative;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 1.5rem; right: 1.5rem;
  height: 3px;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(90deg, var(--sage), var(--plum));
  opacity: 0.7;
}
.card h2 { color: var(--plum-deep); }

label { display: block; font-weight: 700; margin-bottom: 0.4rem; }
textarea, input[type="text"], input[type="email"], input[type="password"] {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--rad);
  background: white;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  resize: vertical;
}
textarea { min-height: 140px; }

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(42,26,62,0.5);
  display: none;
  align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--paper);
  border-radius: var(--rad-lg);
  padding: 2rem;
  max-width: 460px;
  width: calc(100% - 2rem);
  box-shadow: 0 20px 60px rgba(74,43,117,0.3);
}

.error { color: var(--coral); margin-top: 0.5rem; font-size: 0.95rem; }
.muted { color: var(--ink-3); font-size: 0.9rem; }

footer {
  margin-top: 4rem;
  padding: 2rem 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
  color: var(--ink-3);
  text-align: center;
}
footer a { color: var(--plum); text-decoration: underline; }
footer a:hover { color: var(--plum-deep); }

/* ATS resume doc — clean, ATS-parser-friendly print layout */
.ats-doc {
  padding: 0.5in 0.55in;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 10.5pt;
  line-height: 1.4;
  color: #000;
  background: white;
  max-width: 8.5in;
  margin: 0 auto;
  border-radius: 0 0 var(--rad) var(--rad);
  border: 1px solid var(--rule);
  border-top: none;
}
.ats-doc h1 {
  font-family: inherit;
  font-size: 22pt;
  font-weight: 700;
  margin: 0 0 4pt;
  color: #000;
  letter-spacing: 0.01em;
}
.ats-doc .ats-title-line { font-size: 11.5pt; font-weight: 600; margin-bottom: 6pt; color: #333; }
.ats-doc .ats-contact { font-size: 10.5pt; margin-bottom: 4pt; color: #333; }
.ats-doc .ats-links { font-size: 10pt; margin-bottom: 14pt; color: #333; word-break: break-all; }
.ats-doc .ats-contact a, .ats-doc .ats-links a { color: #1a4d8c; text-decoration: none; }
.ats-doc hr.ats-divider { border: none; border-top: 1px solid #888; margin: 8pt 0 14pt; }
.ats-doc h2 {
  font-family: inherit;
  font-size: 12pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 14pt 0 7pt;
  padding-bottom: 3pt;
  border-bottom: 1px solid #555;
  color: #000;
}
.ats-doc .ats-summary { font-size: 10.5pt; line-height: 1.5; margin-bottom: 12pt; }
.ats-doc .ats-skills-row { font-size: 10.5pt; margin-bottom: 5pt; line-height: 1.5; }
.ats-doc .ats-skills-row strong { font-weight: 700; }
.ats-doc .ats-job, .ats-doc .ats-project { margin-bottom: 12pt; }
.ats-doc .ats-job-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  font-size: 11pt;
  font-weight: 700;
  margin-bottom: 1pt;
}
.ats-doc .ats-job-dates { font-weight: 600; font-size: 10.5pt; color: #333; }
.ats-doc .ats-job-role { font-style: italic; font-size: 10.5pt; margin-bottom: 4pt; color: #333; font-weight: 600; }
.ats-doc ul.ats-bullets { margin: 0 0 4pt 20pt; padding: 0; list-style: disc outside; }
.ats-doc ul.ats-bullets li { font-size: 10.5pt; line-height: 1.5; margin-bottom: 3pt; }
.ats-doc .ats-project-line { font-size: 11pt; font-weight: 700; margin-bottom: 1pt; }
.ats-doc .ats-project-tech { font-size: 10pt; margin-top: 3pt; color: #333; }

/* Cover letter doc */
.cover-doc {
  padding: 0.7in 0.8in;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 11pt;
  line-height: 1.55;
  color: #000;
  background: white;
  max-width: 8.5in;
  margin: 0 auto;
  border-radius: 0 0 var(--rad) var(--rad);
  border: 1px solid var(--rule);
  border-top: none;
}
.cover-doc .cover-header { margin-bottom: 24pt; }
.cover-doc .cover-name { font-size: 15pt; font-weight: 700; margin-bottom: 2pt; }
.cover-doc .cover-contact { font-size: 10pt; color: #333; }
.cover-doc .cover-contact a { color: #1a4d8c; text-decoration: none; }
.cover-doc .cover-date { font-size: 10.5pt; margin-bottom: 16pt; color: #444; }
.cover-doc .cover-greeting { font-size: 11pt; margin-bottom: 12pt; font-weight: 600; }
.cover-doc .cover-body p { font-size: 11pt; line-height: 1.6; margin-bottom: 12pt; }
.cover-doc .cover-signoff { margin-top: 18pt; font-size: 11pt; font-weight: 600; }

/* Doc preview wrappers (the boxed area on the page that holds the doc + print button) */
.doc-preview {
  background: white;
  border-radius: var(--rad);
  padding: 0;
  margin-top: 1rem;
}
.doc-preview-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1rem;
  background: #f7f0e8;
  border-radius: var(--rad) var(--rad) 0 0;
  border: 1px solid var(--rule);
  border-bottom: 0;
}
.doc-preview-header span { font-family: 'Fredoka One', cursive; color: var(--plum-deep); font-size: 1rem; }
/* Small explanatory note under the doc preview header. Sits between the header
   bar and the rendered document, framing why the output looks plain (ATS-friendly
   format is deliberately minimal). Style: muted sage italic, no margin top so
   it tucks under the header chip cleanly. */
.ats-note {
  margin: 0 0 0.85rem;
  padding: 0.55rem 1rem 0.7rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #5b7763;
  background: #f7f0e8;
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-style: italic;
}
.print-btn {
  font-family: 'Fredoka One', cursive;
  background: var(--plum);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
}
.print-btn:hover { background: var(--plum-deep); }

/* Loading UI */
.loading-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: rgba(95,169,128,0.08);
  border: 1px solid rgba(95,169,128,0.3);
  border-radius: var(--rad);
  color: var(--ink-2);
  font-size: 0.95rem;
}
.spinner {
  width: 18px; height: 18px; flex-shrink: 0;
  border: 2px solid rgba(107,63,160,0.2);
  border-top-color: var(--plum);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Print modes — when printing, hide everything except the active doc */
@media print {
  /* @page margins apply to EVERY page (page 1, 2, 3, ...). Using doc padding alone
     only spaces page 1 — page 2 ends up flush to the top. */
  @page { size: letter; margin: 0.5in 0.55in; }

  /* PRINT-STAGE STRATEGY:
     printDoc() (in shared/render.js) physically relocates the active
     doc-preview into a #print-stage div that's a direct body child, then
     restores it on afterprint. We hide every other body child with
     display:none — which collapses layout space (no blank pages) — and
     let the print stage render fresh from the @page margins. */
  html, body { margin: 0 !important; padding: 0 !important; background: white !important; }
  body > *:not(#print-stage) { display: none !important; }
  #print-stage { display: block !important; padding: 0 !important; margin: 0 !important; background: white !important; }
  #print-stage .doc-preview { display: block !important; padding: 0 !important; margin: 0 !important;
    background: white !important; border: none !important; border-radius: 0 !important;
    box-shadow: none !important; backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important; max-width: 100% !important; }
  /* Hide the doc-preview header (label + Print button) and any .card pseudo bars */
  #print-stage .doc-preview-header { display: none !important; }
  .card::before, .card::after { display: none !important; content: none !important; }

  /* ATS doc — force black text everywhere, neutral sans, no decoration */
  .ats-doc, .ats-doc * { color: #000 !important; }
  .ats-doc { padding: 0 !important; max-width: 100% !important; font-size: 10pt !important;
             border: none !important; border-radius: 0 !important; background: white !important;
             font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important; }
  .ats-doc h1, .ats-doc h2, .ats-doc h3 {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
    color: #000 !important; font-weight: 700 !important;
  }
  .ats-doc a { color: #000 !important; text-decoration: none !important; }
  .ats-doc .ats-job, .ats-doc .ats-project { page-break-inside: avoid; break-inside: avoid; }
  .ats-doc h2 { page-break-after: avoid; }

  /* Cover doc — same treatment */
  .cover-doc, .cover-doc * { color: #000 !important; }
  .cover-doc { padding: 0 !important; max-width: 100% !important; border: none !important;
               border-radius: 0 !important; background: white !important;
               font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important; }
  .cover-doc a { color: #000 !important; text-decoration: none !important; }
  .cover-doc p { page-break-inside: avoid; break-inside: avoid; }
}

/* Pricing grid */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.plan {
  background: white;
  border: 1px solid var(--rule);
  border-radius: var(--rad);
  padding: 1.5rem 1.25rem;
  position: relative;
  display: flex;
  flex-direction: column;
}
.plan-featured {
  border: 2px solid var(--plum);
  box-shadow: 0 12px 32px -16px rgba(107,63,160,0.45);
  transform: translateY(-4px);
}
.plan-badge {
  position: absolute;
  top: -0.7rem; left: 50%;
  transform: translateX(-50%);
  background: var(--plum);
  color: white;
  font-family: 'Fredoka One', cursive;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}
.plan-name {
  font-family: 'Fredoka One', cursive;
  color: var(--plum-deep);
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}
.plan-price {
  font-family: 'Fredoka One', cursive;
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
}
.plan-per { font-size: 0.95rem; color: var(--ink-3); font-family: 'Nunito'; font-weight: 700; }
.plan-meta { color: var(--ink-3); font-size: 0.9rem; margin-top: 0.4rem; margin-bottom: 1rem; }
.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  color: var(--ink-2);
  flex-grow: 1;
}
.plan-features li {
  padding: 0.3rem 0 0.3rem 1.4rem;
  position: relative;
}
.plan-features li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.65rem;
  width: 6px; height: 6px;
  background: var(--sage);
  border-radius: 50%;
}
.plan-cta { display: block; text-align: center; text-decoration: none; }

/* Turnstile container */
.cf-turnstile { margin: 0.75rem 0; min-height: 1px; }

@media (max-width: 700px) {
  .pricing-grid { grid-template-columns: 1fr; }
  .plan-featured { transform: none; }
}
@media (max-width: 600px) {
  main { padding: 1.5rem 1rem 4rem; }
  .card { padding: 1.25rem; }
}
