/* ==========================================================================
   igFont — design system
   Hand-written, dependency free. One file, no external font requests.
   ========================================================================== */

/* 1. Reset ---------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body,
h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol {
    margin: 0;
}

ul, ol {
    padding: 0;
    list-style: none;
}

img, svg {
    display: block;
    max-width: 100%;
}

button, input, textarea, select {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
    border-radius: 4px;
}

/* 2. Tokens --------------------------------------------------------------- */
:root {
    --bg: #ffffff;
    --bg-soft: #f7f7fb;
    --bg-tint: #f4f0ff;

    --ink: #101018;
    --ink-2: #4b4b61;
    --ink-3: #78788f;

    --line: #e6e6ef;
    --line-soft: #f0f0f6;

    --brand: #6d28d9;
    --brand-hover: #5b21b6;
    --brand-soft: #f3eeff;
    --accent: #db2777;

    --gradient: linear-gradient(118deg, #7c3aed 0%, #db2777 100%);

    --radius-lg: 20px;
    --radius: 14px;
    --radius-sm: 9px;

    --shadow-sm: 0 1px 2px rgba(16, 16, 40, 0.05);
    --shadow: 0 1px 2px rgba(16, 16, 40, 0.04), 0 12px 32px -16px rgba(16, 16, 40, 0.18);
    --shadow-lg: 0 2px 4px rgba(16, 16, 40, 0.04), 0 28px 60px -28px rgba(16, 16, 40, 0.28);

    --shell: 1120px;
    --gutter: 20px;

    --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
                    "Songti SC", "Times New Roman", serif;
}

/* 3. Base ----------------------------------------------------------------- */
body {
    font-family: var(--font-ui);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 16px;
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

h1, h2, h3, h4 {
    line-height: 1.2;
    letter-spacing: -0.022em;
    font-weight: 700;
    color: var(--ink);
}

p {
    color: var(--ink-2);
}

.shell {
    width: 100%;
    max-width: var(--shell);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 200;
    padding: 12px 18px;
    background: var(--ink);
    color: #fff;
    border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
    left: 0;
}

/* 4. Header --------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line-soft);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 66px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--ink);
    font-weight: 700;
    font-size: 1.0625rem;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--gradient);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.brand-name {
    color: var(--ink);
}

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.nav-link {
    display: block;
    padding: 8px 13px;
    border-radius: var(--radius-sm);
    color: var(--ink-2);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
    background: var(--bg-soft);
    color: var(--ink);
    text-decoration: none;
}

.nav-link.is-active {
    color: var(--brand);
    background: var(--brand-soft);
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Language dropdown — native <details>, zero JS */
.lang-switch {
    position: relative;
}

.lang-switch > summary {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ink-2);
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.lang-switch > summary::-webkit-details-marker {
    display: none;
}

.lang-switch > summary:hover {
    border-color: #d3d3e4;
    color: var(--ink);
}

.lang-switch[open] > summary {
    border-color: var(--brand);
    color: var(--brand);
}

.lang-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 200px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: grid;
    gap: 1px;
    max-height: min(70vh, 460px);
    overflow-y: auto;
}

.lang-menu a {
    display: block;
    padding: 8px 11px;
    border-radius: 7px;
    color: var(--ink-2);
    font-size: 0.875rem;
}

.lang-menu a:hover {
    background: var(--bg-soft);
    color: var(--ink);
    text-decoration: none;
}

.lang-menu a.is-active {
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 600;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 16px;
    height: 1.5px;
    margin-inline: auto;
    background: var(--ink-2);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(5.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-5.5px) rotate(-45deg);
}

/* 5. Hero ----------------------------------------------------------------- */
.hero {
    position: relative;
    overflow: hidden;
    padding: 64px 0 0;
    background:
        radial-gradient(58% 62% at 50% 0%, rgba(124, 58, 237, 0.09) 0%, rgba(255, 255, 255, 0) 68%),
        radial-gradient(40% 40% at 82% 8%, rgba(219, 39, 119, 0.07) 0%, rgba(255, 255, 255, 0) 70%);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(16, 16, 40, 0.035) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(16, 16, 40, 0.035) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(70% 58% at 50% 0%, #000 0%, transparent 78%);
    -webkit-mask-image: radial-gradient(70% 58% at 50% 0%, #000 0%, transparent 78%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    text-align: center;
    max-width: 760px;
    margin-inline: auto;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px 5px 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ink-2);
    box-shadow: var(--shadow-sm);
}

.eyebrow b {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.hero h1 {
    margin-top: 22px;
    font-size: clamp(2.1rem, 5.6vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.035em;
}

.hero h1 em {
    font-style: normal;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-lead {
    margin: 18px auto 0;
    max-width: 600px;
    font-size: clamp(1rem, 1.6vw, 1.125rem);
    color: var(--ink-2);
}

/* 6. Tool ----------------------------------------------------------------- */
.tool {
    position: relative;
    margin: 38px auto 0;
    max-width: 780px;
    padding: 22px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: left;
}

.tool-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
}

.tool-label label {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.tool-count {
    font-size: 0.8125rem;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}

.tool-count.is-over {
    color: #dc2626;
    font-weight: 600;
}

.tool textarea {
    display: block;
    width: 100%;
    min-height: 94px;
    max-height: 320px;
    padding: 14px 16px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-soft);
    font-size: 1.0625rem;
    line-height: 1.55;
    resize: vertical;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.tool textarea::placeholder {
    color: #a3a3b8;
}

.tool textarea:focus {
    outline: none;
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.1);
}

.tool-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.tool-hint {
    font-size: 0.8125rem;
    color: var(--ink-3);
    margin-right: auto;
}

/* 7. Buttons -------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
    text-align: center;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 1px 2px rgba(109, 40, 217, 0.3), 0 8px 20px -10px rgba(109, 40, 217, 0.6);
}

.btn-primary:hover {
    background: var(--brand-hover);
    text-decoration: none;
    color: #fff;
}

.btn-ghost {
    background: #fff;
    border-color: var(--line);
    color: var(--ink-2);
}

.btn-ghost:hover {
    background: var(--bg-soft);
    border-color: #d8d8e6;
    color: var(--ink);
    text-decoration: none;
}

.btn-quiet {
    background: transparent;
    color: var(--ink-3);
    padding: 8px 10px;
    font-weight: 500;
    font-size: 0.875rem;
}

.btn-quiet:hover {
    background: var(--bg-soft);
    color: var(--ink);
    text-decoration: none;
}

/* 8. Output --------------------------------------------------------------- */
.output-section {
    padding: 44px 0 0;
}

.output-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
}

.output-head h2 {
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.output-head p {
    font-size: 0.875rem;
    color: var(--ink-3);
}

.output-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
    gap: 10px;
}

.style-card {
    position: relative;
    display: block;
    width: 100%;
    padding: 13px 15px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.style-card:hover {
    border-color: #cdbdf5;
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.style-card.is-copied {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

/* Two-line clamp keeps 68 cards on an even grid even when a style
   produces something long like Morse or binary. */
.style-sample {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 1.0625rem;
    line-height: 1.5;
    color: var(--ink);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.style-name {
    display: block;
    margin-top: 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink-3);
}

/* Decorative alphabet and border styles are longer and busier than a font
   variant, so they get a smaller type size and a third line of room. */
.style-card[data-extra] {
    padding: 12px 14px 10px;
}

.style-card[data-extra] .style-sample {
    font-size: 0.8125rem;
    line-height: 1.45;
    -webkit-line-clamp: 3;
}

.style-card[data-extra] .style-name {
    margin-top: 5px;
    font-size: 0.625rem;
}

.style-copied-flag {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #16a34a;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-3px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
}

.style-card.is-copied .style-copied-flag {
    opacity: 1;
    transform: translateY(0);
}

.output-empty {
    padding: 40px 24px;
    border: 1.5px dashed var(--line);
    border-radius: var(--radius-lg);
    background: var(--bg-soft);
    text-align: center;
}

.output-empty svg {
    margin: 0 auto 12px;
    color: #b9b9cc;
}

.output-empty p {
    font-size: 0.9375rem;
    color: var(--ink-3);
    max-width: 380px;
    margin-inline: auto;
}

.output-empty strong {
    display: block;
    color: var(--ink);
    font-size: 1rem;
    margin-bottom: 4px;
}

.output-more {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

/* 9. Sections ------------------------------------------------------------- */
.section {
    padding: 72px 0;
}

.section--soft {
    background: var(--bg-soft);
    border-block: 1px solid var(--line-soft);
}

.section-head {
    max-width: 680px;
    margin-bottom: 40px;
}

.section-head--center {
    margin-inline: auto;
    text-align: center;
}

.section-kicker {
    display: block;
    margin-bottom: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--brand);
}

.section-head h2 {
    font-size: clamp(1.5rem, 3.2vw, 2.125rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.section-head p {
    margin-top: 12px;
    font-size: 1.0625rem;
    color: var(--ink-2);
}

/* 10. Cards --------------------------------------------------------------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.card {
    padding: 24px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.card-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin-bottom: 14px;
    border-radius: 11px;
    background: var(--brand-soft);
    color: var(--brand);
}

.card h3 {
    font-size: 1.0625rem;
    font-weight: 700;
    margin-bottom: 7px;
}

.card p {
    font-size: 0.9375rem;
    color: var(--ink-2);
}

/* Steps */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    counter-reset: step;
}

.step {
    position: relative;
    padding: 24px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.step::before {
    counter-increment: step;
    content: counter(step);
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
}

.step h3 {
    font-size: 1rem;
    margin-bottom: 6px;
}

.step p {
    font-size: 0.9375rem;
}

/* 11. Style preview strip ------------------------------------------------- */
.style-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.showcase-item {
    padding: 20px 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-align: center;
    overflow: hidden;
}

.showcase-sample {
    display: block;
    font-size: 1.375rem;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.showcase-label {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--ink-3);
    letter-spacing: 0.03em;
}

/* 12. Guide cards --------------------------------------------------------- */
.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.guide-card {
    display: flex;
    flex-direction: column;
    padding: 22px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.guide-card:hover {
    border-color: #cdbdf5;
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    text-decoration: none;
}

.guide-tag {
    align-self: flex-start;
    margin-bottom: 12px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--ink-3);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.guide-card h3 {
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin-bottom: 8px;
}

.guide-card p {
    font-size: 0.9375rem;
    color: var(--ink-2);
    flex: 1;
}

.guide-more {
    margin-top: 14px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--brand);
}

/* 13. Prose (articles + legal pages) -------------------------------------- */
.prose {
    max-width: 720px;
}

.page-head {
    padding: 56px 0 32px;
    border-bottom: 1px solid var(--line-soft);
}

.page-head h1 {
    font-size: clamp(1.85rem, 4.6vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.032em;
    max-width: 820px;
}

.page-head p {
    margin-top: 14px;
    max-width: 660px;
    font-size: 1.0625rem;
    color: var(--ink-2);
}

.lang-notice {
    margin-top: 18px;
    padding: 10px 14px;
    border: 1px solid #e4dcfb;
    border-radius: var(--radius-sm);
    background: var(--brand-soft);
    font-size: 0.875rem;
    color: #4c2f9c;
    max-width: 620px;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-bottom: 16px;
    font-size: 0.8125rem;
    color: var(--ink-3);
}

.breadcrumbs a {
    color: var(--ink-3);
}

.breadcrumbs a:hover {
    color: var(--brand);
}

.breadcrumbs span[aria-hidden] {
    color: #c8c8d8;
}

.prose h2 {
    margin-top: 44px;
    margin-bottom: 14px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.prose h3 {
    margin-top: 30px;
    margin-bottom: 10px;
    font-size: 1.125rem;
    font-weight: 700;
}

.prose p {
    margin-bottom: 16px;
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--ink-2);
}

.prose ul,
.prose ol {
    margin: 0 0 18px;
    padding-left: 22px;
    color: var(--ink-2);
    font-size: 1.0625rem;
    line-height: 1.75;
    list-style: revert;
}

.prose li {
    margin-bottom: 8px;
}

.prose li::marker {
    color: #b0a8cc;
}

.prose strong {
    color: var(--ink);
    font-weight: 650;
}

.prose a {
    text-decoration: underline;
    text-decoration-color: #d6cdf5;
    text-underline-offset: 2px;
}

.prose a:hover {
    text-decoration-color: var(--brand);
}

.prose blockquote {
    margin: 24px 0;
    padding: 4px 0 4px 20px;
    border-left: 3px solid var(--brand);
    color: var(--ink-2);
    font-style: italic;
}

.prose code {
    padding: 1px 6px;
    border-radius: 5px;
    background: var(--bg-soft);
    border: 1px solid var(--line-soft);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
}

.prose hr {
    margin: 36px 0;
    border: 0;
    border-top: 1px solid var(--line-soft);
}

.prose .callout {
    margin: 24px 0;
    padding: 18px 20px;
    border: 1px solid #e4dcfb;
    border-radius: var(--radius);
    background: var(--brand-soft);
}

.prose .callout p:last-child {
    margin-bottom: 0;
}

.prose .sample-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0 24px;
}

.prose .sample-row span {
    padding: 7px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    font-size: 1.0625rem;
    color: var(--ink);
}

/* Article meta */
.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin-top: 18px;
    font-size: 0.875rem;
    color: var(--ink-3);
}

.article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Consent control block (privacy / cookie pages) ------------------------- */
.consent-box {
    max-width: 620px;
    margin-top: 44px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--bg-soft);
}

.consent-box h2 {
    margin: 0 0 8px;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.consent-box p {
    margin: 0 0 16px;
    font-size: 0.9375rem;
    color: var(--ink-2);
}

/* 14. FAQ ----------------------------------------------------------------- */
.faq-list {
    max-width: 800px;
    margin-inline: auto;
}

.faq-item {
    border-bottom: 1px solid var(--line);
}

.faq-item:first-child {
    border-top: 1px solid var(--line);
}

.faq-item summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 2px;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "";
    flex-shrink: 0;
    width: 11px;
    height: 11px;
    margin-top: 7px;
    border-right: 2px solid var(--ink-3);
    border-bottom: 2px solid var(--ink-3);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
    transform: rotate(225deg);
}

.faq-item summary:hover {
    color: var(--brand);
}

.faq-answer {
    padding: 0 2px 22px;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--ink-2);
    max-width: 680px;
}

/* 15. CTA ----------------------------------------------------------------- */
.cta {
    padding: 44px 32px;
    border-radius: var(--radius-lg);
    background: var(--gradient);
    color: #fff;
    text-align: center;
}

.cta h2 {
    color: #fff;
    font-size: clamp(1.375rem, 3vw, 1.875rem);
    letter-spacing: -0.03em;
    margin-bottom: 10px;
}

.cta p {
    color: rgba(255, 255, 255, 0.86);
    max-width: 520px;
    margin: 0 auto 22px;
    font-size: 1rem;
}

.cta .btn {
    background: #fff;
    color: var(--brand);
    box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.5);
}

.cta .btn:hover {
    background: #f7f4ff;
    color: var(--brand-hover);
}

/* 16. Footer -------------------------------------------------------------- */
.site-footer {
    margin-top: 84px;
    padding: 56px 0 32px;
    background: #0d0d14;
    color: #a6a6bb;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr repeat(3, 1fr);
    gap: 32px;
    padding-bottom: 36px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.site-footer .brand {
    color: #fff;
    margin-bottom: 12px;
}

.site-footer .brand-name {
    color: #fff;
}

.footer-blurb {
    max-width: 300px;
    font-size: 0.875rem;
    line-height: 1.65;
    color: #8c8ca4;
}

.footer-heading {
    margin-bottom: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
}

.footer-col ul {
    display: grid;
    gap: 8px;
}

.footer-col a {
    color: #a6a6bb;
    font-size: 0.875rem;
}

.footer-col a:hover {
    color: #fff;
    text-decoration: none;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    padding-top: 24px;
    font-size: 0.8125rem;
    color: #7c7c93;
}

.footer-note {
    color: #6a6a80;
    font-size: 0.8125rem;
}

/* 17. Ad slots ------------------------------------------------------------ */
.ad-slot {
    margin: 32px auto;
    max-width: 970px;
    min-height: 90px;
    overflow: hidden;
}

/* 18. Utilities ----------------------------------------------------------- */
.stack > * + * {
    margin-top: 16px;
}

.muted {
    color: var(--ink-3);
}

.center {
    text-align: center;
}

.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;
}

/* 19. Responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 780px) {
    :root {
        --gutter: 16px;
    }

    .header-inner {
        height: 60px;
        gap: 12px;
    }

    .nav-toggle {
        display: flex;
    }

    .nav {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        margin: 0;
        padding: 10px var(--gutter) 16px;
        background: #fff;
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow);
    }

    .nav.is-open {
        display: flex;
    }

    .nav-link {
        padding: 11px 12px;
    }

    .hero {
        padding-top: 44px;
    }

    .hero h1 {
        letter-spacing: -0.03em;
    }

    .tool {
        padding: 18px;
        margin-top: 28px;
    }

    .tool-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .tool-actions .btn-primary {
        width: 100%;
    }

    .tool-hint {
        text-align: center;
        margin: 0;
        order: 2;
    }

    /* Two columns keeps 68 cards from turning into 6000px of scroll. */
    .output-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .style-card {
        padding: 10px 11px 9px;
    }

    .style-sample {
        font-size: 0.9375rem;
        line-height: 1.4;
    }

    .style-name {
        margin-top: 5px;
        font-size: 0.625rem;
        letter-spacing: 0.04em;
    }

    .section {
        padding: 52px 0;
    }

    .page-head {
        padding: 40px 0 26px;
    }

    .cta {
        padding: 34px 22px;
    }

    .lang-switch > summary span {
        display: none;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 6px;
    }
}

@media (max-width: 420px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* 20. Right-to-left -------------------------------------------------------
   Flexbox already mirrors `row` for RTL containers, so only the physical
   properties (auto margins, absolute offsets, text alignment) need fixing.
   ------------------------------------------------------------------------- */
[dir="rtl"] body {
    text-align: right;
}

[dir="rtl"] .nav {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .lang-menu {
    right: auto;
    left: 0;
}

[dir="rtl"] .lang-switch > summary {
    flex-direction: row-reverse;
}

[dir="rtl"] .style-card {
    text-align: right;
}

[dir="rtl"] .style-copied-flag {
    right: auto;
    left: 10px;
}

[dir="rtl"] .breadcrumbs {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

[dir="rtl"] .article-meta {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

[dir="rtl"] .prose ul,
[dir="rtl"] .prose ol {
    padding-left: 0;
    padding-right: 22px;
}

[dir="rtl"] .prose blockquote {
    padding: 4px 20px 4px 0;
    border-left: 0;
    border-right: 3px solid var(--brand);
}

[dir="rtl"] .tool-hint {
    margin-right: 0;
    margin-left: auto;
}

[dir="rtl"] .footer-col ul,
[dir="rtl"] .tool-label {
    direction: rtl;
}

[dir="rtl"] .tool textarea {
    direction: rtl;
    text-align: right;
}

/* The tool itself always renders Latin styling artefacts; keep the sample
   left-aligned so the Unicode output reads correctly even in RTL locales. */
[dir="rtl"] .style-sample,
[dir="rtl"] .showcase-sample {
    direction: ltr;
    text-align: left;
    unicode-bidi: plaintext;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media print {
    .site-header,
    .site-footer,
    .tool,
    .output-section,
    .cta {
        display: none;
    }
}
