/* ============================================================
   CursiveFontMaker.com — shared stylesheet (style.css)
   Identity: "ink & paper" calligraphy studio.
   Warm cream paper surface, deep ink text, rose-quill accent,
   sage secondary. A real cursive display face (Dancing Script)
   for headings/brand so the site LOOKS like what it makes.
   Body stays on a fast native stack for legibility + speed.
   ============================================================ */

:root {
  --ink:        #221a17;   /* near-black warm ink            */
  --ink-soft:   #4a3f39;
  --rose:       #b5476b;   /* quill / accent                 */
  --rose-700:   #93304f;
  --rose-100:   #f6e3ea;
  --sage:       #5c7a6b;   /* secondary                      */
  --gold:       #c08a2e;   /* highlight                      */
  --paper:      #fbf6ee;   /* page background (cream)        */
  --paper-tint: #f4ebdd;
  --surface:    #fffdf8;   /* cards                          */
  --muted:      #6b6058;
  --border:     #e7dccb;
  --shadow-sm:  0 1px 2px rgba(60,40,20,.06), 0 2px 8px rgba(60,40,20,.05);
  --shadow-md:  0 6px 24px rgba(80,50,30,.12);
  --shadow-lg:  0 18px 50px rgba(80,50,30,.16);
  --radius:     18px;
  --radius-sm:  11px;
  --maxw:       920px;
  --font-script: "Dancing Script", "Fraunces Fallback", "Brush Script MT", "Segoe Script", cursive;
  --font-display: "Fraunces", "Fraunces Fallback", Georgia, "Times New Roman", serif;
  --font-body:  ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono:  ui-monospace, "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
}

/* Metric-adjusted fallback: keeps text occupying ~the same box before the
   web font loads, so the swap produces negligible layout shift (lower CLS). */
@font-face {
  font-family: "Fraunces Fallback";
  src: local("Georgia"), local("Times New Roman");
  size-adjust: 105%;
  ascent-override: 92%;
  descent-override: 24%;
  line-gap-override: 0%;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:        #f3ead9;
    --ink-soft:   #d8cbb8;
    --paper:      #1a1613;
    --paper-tint: #221c18;
    --surface:    #241d18;
    --muted:      #a99b8b;
    --border:     #3a2f27;
    --rose-100:   #3a2028;
    --shadow-md:  0 6px 24px rgba(0,0,0,.5);
    --shadow-lg:  0 18px 50px rgba(0,0,0,.6);
  }
}

/* ---- reset ------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.72;
  color: var(--ink);
  background-color: var(--paper);
  /* paper atmosphere: faint ruled-warmth glows */
  background-image:
    radial-gradient(58rem 40rem at 88% -12%, rgba(181,71,107,.07), transparent 60%),
    radial-gradient(48rem 38rem at -12% 8%, rgba(92,122,107,.07), transparent 55%);
  background-attachment: fixed;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--rose-700); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---- layout ----------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
main { padding-block: 8px 56px; }
section { margin-block: 46px; }
main p a, main li a, .note a, .breadcrumb a:hover { text-decoration: underline; text-underline-offset: 2px; color: var(--rose-700); }

/* ---- illustration figure (reserves space → no CLS) -------- */
.ill { margin: 8px 0 4px; }
.ill img { display: block; width: 100%; height: auto; aspect-ratio: 1000 / 525;
  object-fit: cover; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--rose-100), color-mix(in srgb, var(--sage) 14%, var(--paper)));
  border: 1px solid var(--border); }
.ill figcaption { font-size: .82rem; color: var(--muted); margin-top: 8px; text-align: center; font-style: italic; }

/* ---- typography ------------------------------------------- */
h1, h2, h3 { font-family: var(--font-display); line-height: 1.16; letter-spacing: -.012em; color: var(--ink); font-weight: 600; }
h1 { font-size: clamp(2rem, 4.6vw, 3.05rem); margin: .2em 0 .35em; }
h1 .scr { font-family: var(--font-script); font-weight: 700; color: var(--rose); letter-spacing: 0; }
h2 { font-size: clamp(1.5rem, 3vw, 2.05rem); margin: 1.6em 0 .5em; }
h3 { font-size: 1.22rem; margin: 1.4em 0 .4em; }
p { margin: 0 0 1em; }
.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 62ch; }
.eyebrow { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--rose); font-weight: 600; }

/* ---- header / nav ----------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 8px; height: 64px; }
.brand { font-family: var(--font-script); font-weight: 700; font-size: 1.6rem;
  letter-spacing: 0; color: var(--ink); display: flex; align-items: center; gap: 9px; line-height: 1; }
.brand:hover { text-decoration: none; }
.brand .quill { width: 26px; height: 26px; flex: none; }
.nav-spacer { flex: 1; }
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-item { position: relative; }
.nav-item > a, .nav-trigger {
  display: inline-block; padding: 8px 12px; border-radius: var(--radius-sm);
  color: var(--ink); font-weight: 500; font-size: .95rem; background: none;
  border: 0; font-family: inherit; cursor: pointer;
}
.nav-item > a:hover, .nav-trigger:hover { background: var(--rose-100); text-decoration: none; }
.dropdown {
  position: absolute; top: 100%; left: 0; min-width: 232px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  display: none; flex-direction: column;
}
@media (hover: hover) and (pointer: fine) {
  .nav-item:hover .dropdown, .nav-item:focus-within .dropdown { display: flex; }
}
.dropdown.open { display: flex; }
.dropdown a { padding: 7px 10px; border-radius: 8px; color: var(--ink); font-size: .92rem; }
.dropdown a:hover { background: var(--rose-100); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer;
  font-size: 1.6rem; line-height: 1; color: var(--ink); padding: 4px 10px;
  border-radius: var(--radius-sm); font-family: inherit; }
.nav-toggle:hover { background: var(--rose-100); }

/* ---- breadcrumb ------------------------------------------- */
.breadcrumb { font-size: .82rem; color: var(--muted); margin: 18px 0 2px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--rose); }
.breadcrumb span[aria-current] { color: var(--ink); }

/* ---- buttons ---------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: .95rem;
  padding: 11px 22px; border-radius: 999px; border: 1px solid transparent;
  transition: transform .12s ease, box-shadow .12s ease, background .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--rose); color: #fff; box-shadow: 0 6px 18px rgba(181,71,107,.32); }
.btn-primary:hover { background: var(--rose-700); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--rose); color: var(--rose); }

/* ---- generator widget ------------------------------------- */
.generator {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 22px; margin-top: 18px;
  position: relative;
}
.generator::before {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius);
  padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, color-mix(in srgb,var(--rose) 40%,transparent), transparent 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.generator-input {
  width: 100%; font-family: var(--font-body); font-size: 1.18rem; color: var(--ink);
  padding: 16px 18px; border: 2px solid var(--border); border-radius: var(--radius-sm);
  background: var(--paper); transition: border-color .15s, box-shadow .15s;
}
.generator-input:focus {
  outline: none; border-color: var(--rose);
  box-shadow: 0 0 0 4px var(--rose-100);
}
.generator-hint { font-size: .82rem; color: var(--muted); margin: 10px 2px 0; }

.fgw-results { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.fgw-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--paper); border: 1px solid var(--border);
  transition: border-color .15s, background .15s;
}
.fgw-row:hover { border-color: color-mix(in srgb, var(--rose) 40%, var(--border)); }
.fgw-row-main { flex: 1; min-width: 0; }
.fgw-name { display: block; font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.fgw-out { display: block; font-size: 1.3rem; line-height: 1.5;
  word-break: break-word; overflow-wrap: anywhere; }
.fgw-copy {
  flex: none; cursor: pointer; font-family: inherit; font-weight: 600; font-size: .82rem;
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--rose); transition: all .14s;
}
.fgw-copy:hover { background: var(--rose); color: #fff; border-color: var(--rose); }
.fgw-copy.is-copied { background: var(--sage); color: #fff; border-color: var(--sage); }

/* ---- cards / tool grid ------------------------------------ */
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm);
  transition: transform .14s, box-shadow .14s, border-color .14s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--rose) 35%, var(--border)); }
.card h3 { margin: 0 0 6px; }
.card .sample { font-size: 1.5rem; margin: 8px 0; color: var(--rose); }
.card p { font-size: .92rem; color: var(--muted); margin: 0; }

/* ---- tables ----------------------------------------------- */
table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .95rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); }
thead th { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); }
tbody tr:nth-child(even) { background: var(--paper-tint); }
td .big { font-size: 1.35rem; }

/* ---- FAQ accordion (CSS-only) ----------------------------- */
.faq details {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 10px; background: var(--surface); overflow: hidden;
}
.faq summary {
  cursor: pointer; padding: 15px 18px; font-weight: 600; font-family: var(--font-display);
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--rose); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 18px 16px; color: var(--ink-soft); }

/* ---- callout / note --------------------------------------- */
.note {
  border-left: 3px solid var(--rose); background: var(--rose-100);
  padding: 14px 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 1.2em 0;
}
.note.warn { border-left-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--paper)); }
.note.sage { border-left-color: var(--sage); background: color-mix(in srgb, var(--sage) 12%, var(--paper)); }

/* ---- showcase strip (big cursive sample) ------------------ */
.showcase {
  font-family: var(--font-script); font-weight: 700;
  font-size: clamp(2.2rem, 7vw, 4rem); color: var(--rose);
  text-align: center; line-height: 1.2; margin: 0;
  text-shadow: 0 1px 0 color-mix(in srgb, var(--rose) 30%, transparent);
}

/* ---- footer ----------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); background: var(--paper-tint); margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; padding-block: 44px; }
.footer-grid .foot-h { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 12px; font-weight: 600; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 7px; }
.footer-grid a { color: var(--ink); font-size: .9rem; }
.footer-grid a:hover { color: var(--rose-700); }
.footer-brand .brand { margin-bottom: 10px; }
.footer-brand p { font-size: .88rem; color: var(--muted); max-width: 32ch; }
.socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.socials a { font-size: .8rem; color: var(--muted); text-decoration: none; padding: 4px 11px; border: 1px solid var(--border); border-radius: 999px; }
.socials a:hover { color: var(--rose); border-color: var(--rose); background: var(--rose-100); }
.footer-bottom { border-top: 1px solid var(--border); padding-block: 18px;
  font-size: .82rem; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---- toast ------------------------------------------------ */
.fgw-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--paper); padding: 10px 20px; border-radius: 999px;
  font-size: .9rem; font-weight: 600; opacity: 0; pointer-events: none; transition: all .25s; z-index: 100;
}
.fgw-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- prose helpers ---------------------------------------- */
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px 20px; margin: 1.4em 0; }
.toc p { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 8px; }
.toc ul { margin: 0; padding-left: 18px; }
.toc li { margin-bottom: 4px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.pill { font-size: .85rem; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink); }
.pill:hover { border-color: var(--rose); color: var(--rose); background: var(--rose-100); text-decoration: none; }

/* ---- responsive ------------------------------------------- */
@media (max-width: 760px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 22px; }
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 10px; gap: 2px; box-shadow: var(--shadow-md); }
  .nav-links.open { display: flex; }
  .nav-item, .nav-item > a, .nav-trigger { width: 100%; text-align: left; }
  .dropdown { position: static; display: none; box-shadow: none; border: 0;
    padding-left: 12px; min-width: 0; }
  .dropdown.open { display: flex; }
  .nav-trigger { display: flex; justify-content: space-between; }
  .nav-toggle { display: inline-flex; }
  .fgw-out { font-size: 1.14rem; }
}

/* ---- a11y / motion ---------------------------------------- */
:focus-visible { outline: 3px solid var(--rose); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto; } }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
