/* Fancy Text Generator — main stylesheet. Mobile-first, no framework. */

:root {
	--brand: #3d7ab5;
	--brand-dark: #2c5c8a;
	--brand-2: #6fa8c9;
	--accent: #ffd84d;
	--ink: #121a33;
	--ink-2: #3b4566;
	--muted: #69728f;
	--line: #e3e7f2;
	--bg: #f5f7fc;
	--card: #ffffff;
	--ok: #0f7b4b;
	--err: #b3261e;
	--radius: 14px;
	--shadow: 0 1px 2px rgba(18, 26, 51, .06), 0 8px 24px rgba(18, 26, 51, .06);
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	/* Fancy output needs fonts with broad Unicode coverage. */
	--font-fancy: "Segoe UI", "Segoe UI Symbol", "Noto Sans", "Noto Sans Math", "Apple Symbols", "Cambria Math", "DejaVu Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
	margin: 0;
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.7;
	color: var(--ink);
	background: var(--bg);
	overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-dark); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.25; color: var(--ink); letter-spacing: -.01em; }
h2 { font-size: clamp(1.45rem, 1.1rem + 1.2vw, 1.9rem); margin: 0 0 .7em; }
h3 { font-size: 1.15rem; margin: 1.4em 0 .4em; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: .35em; }

.container { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 16px; }
.container--narrow { max-width: 960px; }
@media (min-width: 768px) { .container { padding: 0 32px; } }
@media (min-width: 1400px) { .container { max-width: 1400px; } }

.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 1000; background: #fff; padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }

/* ---------- Header ---------------------------------------------------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(255, 255, 255, .96);
	backdrop-filter: saturate(160%) blur(8px);
	border-bottom: 1px solid var(--line);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; } }

.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }

.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.08rem; letter-spacing: -.02em; white-space: nowrap; }
.logo:hover { color: var(--ink); }
.logo-mark { flex: none; }
.logo--light, .logo--light:hover { color: #fff; }

.nav-toggle { display: inline-flex; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); max-height: calc(100vh - 64px); overflow-y: auto; }
.site-nav.is-open { display: block; }
.nav-list { list-style: none; margin: 0; padding: 8px 16px 16px; }
.nav-list > li { margin: 0; border-bottom: 1px solid var(--line); }
.nav-list > li:last-child { border-bottom: 0; }
.nav-link { display: flex; align-items: center; gap: 6px; width: 100%; padding: 12px 4px; font: inherit; font-size: .98rem; font-weight: 600; color: var(--ink-2); text-decoration: none; background: none; border: 0; cursor: pointer; text-align: left; }
.nav-link:hover, .nav-link[aria-current="page"], .nav-link.is-current { color: var(--brand); }
.nav-dropdown-btn svg { transition: transform .2s; }
.nav-dropdown.is-open .nav-dropdown-btn svg { transform: rotate(180deg); }
.nav-menu { display: none; list-style: none; margin: 0; padding: 0 0 8px 8px; }
.nav-dropdown.is-open .nav-menu { display: block; }
.nav-menu a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: .95rem; }
.nav-menu a:hover, .nav-menu a[aria-current="page"] { background: var(--bg); color: var(--brand); }
.nav-menu li { margin: 0; }

@media (min-width: 1000px) {
	.nav-toggle { display: none; }
	.site-nav { display: block; position: static; background: none; border: 0; box-shadow: none; max-height: none; overflow: visible; }
	.nav-list { display: flex; align-items: center; gap: 4px; padding: 0; }
	.nav-list > li { border: 0; position: relative; }
	.nav-link { padding: 8px 12px; border-radius: 999px; font-size: .95rem; }
	.nav-link:hover, .nav-link[aria-current="page"], .nav-link.is-current { background: #e8f1f7; }
	.nav-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 260px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(18, 26, 51, .14); }
}

/* ---------- Hero & generator ------------------------------------------ */

.hero {
	background: radial-gradient(1200px 400px at 80% -10%, rgba(111, 168, 201, .35), transparent 60%), linear-gradient(135deg, #2c5c8a 0%, #3d7ab5 55%, #5b93bf 100%);
	color: #fff;
	padding: 28px 0 40px;
}
.hero .breadcrumbs a, .hero .breadcrumbs span, .hero .breadcrumbs li::after { color: rgba(255, 255, 255, .82); }
.hero-title { color: #fff; font-size: clamp(1.8rem, 1.2rem + 2.6vw, 2.9rem); margin: .3em 0 .3em; text-align: center; }
.hero-lead { text-align: center; font-size: 1.08rem; color: rgba(255, 255, 255, .9); max-width: 680px; margin: 0 auto 18px; }
.page-hero .hero-lead { color: var(--ink-2); }

/* Stacked, centered by default (phone/tablet); becomes a two-column layout — text
   left, generator right — once there's enough width for both to breathe (laptop+). */
.hero-grid { max-width: 640px; margin: 0 auto; }
.hero-generator { margin-top: 28px; }

@media (min-width: 1180px) {
	.hero-grid { max-width: none; margin: 0; display: grid; grid-template-columns: minmax(300px, 400px) 1fr; align-items: center; gap: 48px; }
	.hero-intro { text-align: left; }
	.hero-intro .breadcrumbs ol { justify-content: flex-start; }
	.hero-title, .hero-lead { text-align: left; max-width: none; margin-left: 0; margin-right: 0; }
	.quick-steps { justify-content: flex-start; }
	.hero-generator { margin-top: 0; }
}

.quick-steps { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; list-style: none; padding: 0; margin: 0 0 20px; font-size: .92rem; font-weight: 600; }
.quick-steps li { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.quick-steps span { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--ink); font-size: .8rem; font-weight: 800; }

.generator { background: var(--card); color: var(--ink); border-radius: 18px; padding: 16px; box-shadow: 0 20px 50px rgba(8, 16, 70, .35); }
@media (min-width: 768px) { .generator { padding: 22px; } }

.ftg-label { display: block; font-weight: 700; margin-bottom: 6px; }
.ftg-input { display: block; width: 100%; min-height: 64px; padding: 14px 16px; font: inherit; font-size: 1.1rem; color: var(--ink); background: var(--bg); border: 2px solid var(--line); border-radius: 12px; resize: vertical; transition: border-color .15s, background .15s; }
.ftg-input:focus { outline: none; border-color: var(--brand); background: #fff; }
.ftg-input-meta { display: flex; justify-content: space-between; align-items: center; margin: 6px 2px 12px; font-size: .85rem; color: var(--muted); }
.ftg-clear { font: inherit; font-size: .85rem; font-weight: 600; color: var(--brand); background: none; border: 0; padding: 6px 8px; cursor: pointer; }

.ftg-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; scrollbar-width: thin; }
.ftg-chip { flex: none; font: inherit; font-size: .88rem; font-weight: 600; color: var(--ink-2); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; cursor: pointer; }
.ftg-chip:hover { border-color: var(--brand); color: var(--brand); }
.ftg-chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

.ftg-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 620px; overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
@media (min-width: 820px) { .ftg-results { grid-template-columns: 1fr 1fr; } }
.ftg-item { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: center; gap: 2px 10px; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .15s, background .15s; min-width: 0; }
.ftg-item:hover { border-color: #b7cfe0; }
.ftg-item.is-copied { border-color: var(--ok); background: #effaf4; }
.ftg-name { grid-column: 1; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ftg-out { grid-column: 1; grid-row: 2; font-family: var(--font-fancy); font-size: 1.15rem; line-height: 1.5; overflow-wrap: anywhere; cursor: pointer; min-width: 0; }
.ftg-copy { grid-column: 2; grid-row: 1 / span 2; font: inherit; font-size: .85rem; font-weight: 700; color: #fff; background: var(--brand); border: 0; border-radius: 10px; padding: 9px 14px; cursor: pointer; min-width: 76px; }
.ftg-copy:hover { background: var(--brand-dark); }
.ftg-item.is-copied .ftg-copy { background: var(--ok); }
.ftg-noscript { margin: 8px 0 0; color: var(--err); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: .92rem; font-weight: 600; box-shadow: var(--shadow); transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100vw - 32px); text-align: center; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Breadcrumbs ----------------------------------------------- */

.breadcrumbs ol { display: flex; flex-wrap: wrap; justify-content: center; list-style: none; margin: 0; padding: 0; font-size: .86rem; }
.breadcrumbs li { margin: 0; }
.breadcrumbs li:not(:last-child)::after { content: "›"; margin: 0 8px; color: var(--muted); }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.page-hero .breadcrumbs ol { justify-content: flex-start; }

/* ---------- Content --------------------------------------------------- */

.content { padding-top: 36px; padding-bottom: 40px; }
.section { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 18px; margin-bottom: 20px; box-shadow: var(--shadow); }
@media (min-width: 768px) { .section { padding: 32px 36px; } }
.section > :last-child { margin-bottom: 0; }
.section ul li::marker { color: var(--brand); }

.page-figure { margin: 22px 0 0; }
.page-figure img { border-radius: 12px; border: 1px solid var(--line); width: 100%; }
.page-figure figcaption { font-size: .86rem; color: var(--muted); text-align: center; margin-top: 8px; }

.steps { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 14px; }
@media (min-width: 700px) { .steps { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } }
.step { position: relative; margin: 0; padding: 18px 18px 16px; background: var(--bg); border-radius: 12px; border: 1px solid var(--line); }
.step h3 { margin: 10px 0 6px; font-size: 1.05rem; }
.step p { margin: 0; font-size: .96rem; color: var(--ink-2); }
.step-num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 800; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.examples { width: 100%; border-collapse: collapse; font-size: .96rem; }
.examples th, .examples td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.examples tr:last-child th, .examples tr:last-child td { border-bottom: 0; }
.examples thead th { background: var(--bg); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.examples tbody th { font-weight: 600; white-space: nowrap; color: var(--ink-2); width: 38%; }
.example-out { font-family: var(--font-fancy); font-size: 1.1rem; overflow-wrap: anywhere; }

.tip { background: #fff8db; border: 1px solid #f5e3a0; border-radius: 12px; padding: 14px 16px; }
.tip strong { color: #6b5200; }

.faq-item { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; background: #fff; }
.faq-item summary { list-style: none; cursor: pointer; padding: 14px 44px 14px 16px; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; font-weight: 400; color: var(--brand); }
.faq-item[open] summary::after { content: "−"; }
.faq-item summary h3 { margin: 0; font-size: 1.02rem; }
.faq-answer { padding: 0 16px 14px; color: var(--ink-2); }
.faq-answer p { margin: 0; }

/* ---------- Related tools --------------------------------------------- */

.related { background: #eef3f7; padding: 40px 0 48px; }
.related h2 { text-align: center; }
.related-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.related-grid li { margin: 0; }
.related-card { display: block; height: 100%; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s, border-color .15s; }
.related-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #b7cfe0; color: var(--ink); }
.related-card strong { display: block; color: var(--brand); margin-bottom: 2px; }
.related-card span { font-size: .9rem; color: var(--muted); font-family: var(--font-fancy); }

/* ---------- Plain pages ----------------------------------------------- */

.page-hero { background: #fff; border-bottom: 1px solid var(--line); padding: 28px 0 24px; }
.page-title { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.5rem); margin: .3em 0 .2em; }
.page-hero .hero-lead { text-align: left; margin-left: 0; }
.entry-content { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 20px; margin-top: 28px; margin-bottom: 40px; }
@media (min-width: 768px) { .entry-content { padding: 36px 40px; } }
.entry-content h2 { margin-top: 1.4em; }
.entry-content h2:first-child { margin-top: 0; }
.content > .entry-content { margin-top: 0; }
.post-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }

.contact-form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 20px; box-shadow: var(--shadow); }
.contact-form label { display: block; font-weight: 600; margin-bottom: 4px; }
.contact-form input, .contact-form textarea { display: block; width: 100%; font: inherit; padding: 11px 14px; border: 2px solid var(--line); border-radius: 10px; background: var(--bg); }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--brand); background: #fff; }
.contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn { display: inline-block; font: inherit; font-weight: 700; color: #fff; background: var(--brand); border: 0; border-radius: 10px; padding: 12px 22px; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--brand-dark); color: #fff; }
.notice { padding: 12px 16px; border-radius: 10px; font-weight: 600; }
.notice--ok { background: #e7f7ee; color: var(--ok); }
.notice--err { background: #fdecea; color: var(--err); }

/* ---------- Footer ---------------------------------------------------- */

.site-footer { background: #17293b; color: #c3cfd9; font-size: .95rem; }
.footer-grid { display: grid; gap: 28px; padding-top: 44px; padding-bottom: 32px; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-brand p { margin-top: 14px; max-width: 360px; line-height: 1.6; }
.footer-title { color: #fff; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 12px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 0 0 8px; }
.footer-col a { color: #c3cfd9; text-decoration: none; }
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding: 16px 0; font-size: .85rem; color: #8fa0ac; }
.footer-bottom p { margin: 0; }
