/* Stylish Font Pro - main stylesheet */
:root {
  --navy: #11162b;
  --navy-2: #1a2142;
  --bg: #f6f7fb;
  --paper: #ffffff;
  --ink: #161a2e;
  --muted: #5a6078;
  --line: #e3e6ef;
  --lime: #bff03c;
  --lime-dark: #8fc012;
  --pink: #ff3d81;
  --blue: #3b5bfd;
  --blue-soft: #eaeefe;
  --ok: #0f9d6b;
  --radius: 14px;
  --out-size: 24px;
  --shadow: 0 1px 2px rgba(17, 22, 43, .06), 0 10px 30px rgba(17, 22, 43, .10);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.7; color: var(--ink); background: var(--bg); }
img, svg { max-width: 100%; height: auto; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--pink); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(800px, 100% - 32px); margin-inline: auto; }

/* header */
.site-header { background: var(--navy); border-bottom: 1px solid #262e57; position: sticky; top: 0; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; font-weight: 800; font-size: 1.1rem; letter-spacing: -.01em; }
.brand:hover { color: #fff; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--lime); color: var(--navy); display: grid; place-items: center; font-weight: 900; font-size: 1.05rem; line-height: 1; position: relative; }
.brand-mark::after { content: ""; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--pink); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: #b9c0e6; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: .95rem; }
.nav a:hover { background: #232b52; color: #fff; }
.nav a[aria-current="page"] { background: var(--lime); color: var(--navy); }

/* hero + tool */
.hero { background: radial-gradient(1200px 400px at 50% -10%, #28316a 0%, var(--navy) 60%); color: #fff; padding: 44px 0 0; text-align: center; }
h1 { font-size: clamp(2.1rem, 5.4vw, 3.4rem); line-height: 1.08; letter-spacing: -.03em; margin: 0 0 14px; font-weight: 800; }
.hero h1 span { color: var(--lime); }
.lead { color: #c9cff0; font-size: 1.08rem; max-width: 720px; margin: 0 auto 26px; }
.tool { background: var(--paper); color: var(--ink); border-radius: 22px 22px 0 0; padding: 18px; max-width: 980px; margin: 0 auto; text-align: left; box-shadow: var(--shadow); }
.field { display: flex; gap: 10px; flex-wrap: wrap; }
.field label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.input-box { position: relative; flex: 1 1 280px; }
#font-input { width: 100%; font: inherit; font-size: 1.2rem; font-weight: 600; padding: 15px 44px 15px 16px; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
#font-input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 4px var(--blue-soft); }
#clear-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: var(--line); color: var(--ink); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 1rem; line-height: 1; }
.btn { font: inherit; font-weight: 700; border: 0; border-radius: 12px; padding: 14px 20px; cursor: pointer; background: var(--navy); color: #fff; }
.btn:hover { background: var(--navy-2); }
.btn.alt { background: var(--blue-soft); color: var(--blue); }
.btn.alt:hover { background: #dbe2ff; }
.tool-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 2px 0; color: var(--muted); font-size: .92rem; }
.size-ctl { display: flex; align-items: center; gap: 8px; }
.size-ctl input[type=range] { accent-color: var(--blue); width: 120px; }

.chips { display: flex; gap: 8px; margin: 14px 0 4px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.chip { font: inherit; font-weight: 600; font-size: .92rem; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; white-space: nowrap; flex: 0 0 auto; }
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip-count { color: var(--pink); font-weight: 800; }
.chip.active .chip-count { color: var(--lime); }

.results { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 14px; background: #fff; }
.card:hover { border-color: #b9c6ff; box-shadow: 0 4px 14px rgba(59, 91, 253, .08); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.style-name { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.card-actions { display: flex; align-items: center; gap: 6px; }
.copy-btn { font: inherit; font-size: .85rem; font-weight: 700; border: 0; background: var(--blue-soft); color: var(--blue); padding: 6px 14px; border-radius: 8px; cursor: pointer; }
.copy-btn:hover { background: var(--blue); color: #fff; }
.copy-btn.done { background: var(--ok); color: #fff; }
.star-btn { font: inherit; font-size: 1.15rem; line-height: 1; border: 0; background: transparent; color: #a9afc6; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.star-btn:hover { color: var(--pink); }
.star-btn.on { color: var(--pink); }
.out { margin: 0; font-size: var(--out-size); line-height: 1.5; word-break: break-word; overflow-wrap: anywhere; }
.empty { text-align: center; color: var(--muted); padding: 24px; }
.more { display: block; width: 100%; margin-top: 14px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 999px; font-weight: 600; font-size: .95rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 200; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.strip { display: flex; gap: 10px 22px; flex-wrap: wrap; justify-content: center; color: var(--muted); font-weight: 600; font-size: .93rem; margin: 0 auto; padding: 18px 16px; list-style: none; background: var(--paper); border-top: 1px solid var(--line); }
.strip li::before { content: "\2713"; color: var(--ok); margin-right: 7px; font-weight: 800; }

/* article */
.content { padding: 30px 0 56px; }
.content h2, #tool { scroll-margin-top: 78px; }
.content h2 { font-size: clamp(1.5rem, 3.2vw, 2rem); line-height: 1.2; letter-spacing: -.02em; margin: 2.2em 0 .5em; padding-left: 14px; border-left: 5px solid var(--lime); }
.content h3 { font-size: 1.2rem; margin: 1.6em 0 .3em; }
.content p { margin: 0 0 1.1em; }
.content ul, .content ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.content li { margin-bottom: .45em; }
.byline { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .92rem; padding: 12px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.byline strong { color: var(--ink); }
.callout { background: #f1fbd0; border-left: 4px solid var(--lime-dark); border-radius: 0 12px 12px 0; padding: 14px 18px; margin: 1.4em 0; }
.callout p:last-child { margin-bottom: 0; }
.toc { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; margin: 18px 0 8px; }
.toc strong { display: block; margin-bottom: 6px; }
.toc ol { columns: 2; column-gap: 28px; margin: 0; }
.toc li { margin-bottom: .3em; font-size: .97rem; }
.sample { font-size: 1.15rem; word-break: break-word; }
.ex { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; margin: 0 0 1.2em; }
.ex li { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 0; }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); margin: 1em 0 1.4em; }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: .96rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #eef0f8; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
td.sample { font-size: 1.05rem; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }

details { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 0 18px; margin-bottom: 10px; }
summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--pink); font-size: 1.4rem; line-height: 1; }
details[open] summary::after { content: "\2212"; }
details p { margin: 0 0 14px; color: #2c3150; }

.page-head { padding: 40px 0 8px; }
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); text-align: left; color: var(--ink); }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.crumbs span[aria-hidden] { margin: 0 6px; }
.contact-box { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.mail-link { font-size: 1.2rem; font-weight: 800; }
.back { margin-top: 2em; padding-top: 1em; border-top: 1px solid var(--line); }

/* footer */
.site-footer { background: var(--navy); color: #b9c0e6; padding: 40px 0 28px; margin-top: 24px; font-size: .95rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--lime); text-decoration: underline; }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 28px; }
.foot-grid h2 { color: #fff; font-size: 1rem; margin: 0 0 10px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { margin-bottom: 7px; }
.foot-note { border-top: 1px solid #2a3260; margin-top: 26px; padding-top: 16px; font-size: .86rem; color: #8f98c8; }

.nf { text-align: center; padding: 90px 0; }
.nf .big { font-size: clamp(4rem, 14vw, 8rem); font-weight: 800; color: var(--pink); line-height: 1; margin: 0; }

@media (max-width: 760px) {
  body { font-size: 16.5px; }
  .site-header { position: static; }
  .site-header .wrap { flex-direction: column; align-items: flex-start; padding: 10px 0; gap: 4px; }
  .hero { padding-top: 28px; }
  .toc ol { columns: 1; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .btn { flex: 1 1 100%; }
}
@media (max-width: 480px) { .foot-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .toast { transition: none; } }
