:root {
    --ink: #14161f;
    --ink-soft: #464b5c;
    --muted: #767c8f;
    --line: #e7e8f0;
    --line-soft: #f0f1f6;
    --bg: #fbfbfd;
    --surface: #ffffff;
    --accent: #4438ca;
    --accent-bright: #6d5ef8;
    --accent-soft: #efecff;
    --accent-ink: #362e9c;
    --error-bg: #fef2f2;
    --error-border: #fecaca;
    --error-text: #b91c1c;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(20, 22, 31, 0.05);
    --shadow-md: 0 8px 24px -8px rgba(20, 22, 31, 0.12);
    --shadow-lg: 0 24px 48px -16px rgba(20, 22, 31, 0.18);

    --icon-pdf: #e0473b;
    --icon-word: #2b63d9;
    --icon-ppt: #e1832f;
    --icon-excel: #1f9d55;
    --icon-html: #7c3aed;
    --icon-image: #0d9488;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: "Fraunces", Georgia, serif;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
}

a {
    color: inherit;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(251, 251, 253, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.nav-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: "Fraunces", Georgia, serif;
    font-weight: 600;
    font-size: 19px;
    color: var(--ink);
    text-decoration: none;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent);
}

.brand-mark svg {
    width: 17px;
    height: 17px;
}

.site-header nav {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
}

.site-header nav a {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-soft);
    text-decoration: none;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.site-header nav a:hover,
.site-header nav a.active {
    color: var(--accent);
    border-bottom-color: var(--accent-bright);
}

/* ---- Mobile hamburger menu ---- */

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: none;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0;
    cursor: pointer;
    color: var(--ink);
    flex-shrink: 0;
}

.nav-toggle svg {
    width: 20px;
    height: 20px;
}

.nav-toggle .icon-close {
    display: none;
}

.nav-toggle[aria-expanded="true"] .icon-burger {
    display: none;
}

.nav-toggle[aria-expanded="true"] .icon-close {
    display: block;
}

@media (max-width: 720px) {
    .nav-toggle {
        display: inline-flex;
        order: 2;
    }

    .brand {
        order: 1;
    }

    #siteNavLinks {
        display: none;
        order: 3;
        width: 100%;
        flex-direction: column;
        gap: 2px;
        padding-top: 8px;
        border-top: 1px solid var(--line-soft);
        margin-top: 12px;
    }

    #siteNavLinks.open {
        display: flex;
    }

    .site-header nav a {
        padding: 12px 4px;
        border-bottom: 1px solid var(--line-soft);
        width: 100%;
    }

    .site-header nav a:last-child {
        border-bottom: none;
    }

    .site-header nav a.active,
    .site-header nav a:hover {
        border-bottom-color: var(--line-soft);
        background: var(--accent-soft);
        border-radius: 8px;
    }
}

/* ---- Section scaffolding ---- */

.section {
    padding: 44px 24px;
}

.section-inner {
    max-width: 1080px;
    margin: 0 auto;
}

.section-inner.narrow {
   /* max-width: 700px; */
}

.section h2 {
    font-size: 25px;
    margin: 0 0 8px;
}

.section-sub {
    color: var(--muted);
    margin: 0 0 18px;
    font-size: 15.5px;
}

.explainer p,
.faq-item p {
    color: var(--ink-soft);
    font-size: 16px;
}

/* Inline links within body copy (e.g. the "contact us" links in FAQ
   answers and feature bullets) need their own color - the base `a { color:
   inherit; }` rule would otherwise make them blend into the surrounding
   muted text with only an underline to signal they're clickable. */
.explainer p a,
.feature-list a,
.faq-item p a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: underline;
}

.explainer p a:hover,
.feature-list a:hover,
.faq-item p a:hover {
    color: var(--accent-ink);
}

/* ---- Legal pages (Terms, Privacy) ---- */

.legal-page .hero-lede {
    font-style: italic;
    color: var(--muted);
}

.legal-content {
    color: var(--ink-soft);
    font-size: 15.5px;
    line-height: 1.7;
}

.legal-content h2 {
    font-size: 20px;
    margin: 32px 0 10px;
}

.legal-content h2:first-child {
    margin-top: 0;
}

.legal-content h3 {
    font-size: 17px;
    margin: 22px 0 8px;
}

.legal-content p {
    margin: 0 0 14px;
}

.legal-content ul,
.legal-content ol {
    margin: 0 0 14px;
    padding-left: 22px;
}

.legal-content li {
    margin-bottom: 6px;
}

/* ---- Contact page ---- */

.contact-card {
    text-align: left;
}

.contact-card p {
    color: var(--ink-soft);
    font-size: 15px;
    margin: 0 0 18px;
}

.contact-email-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 0 18px;
    border-radius: var(--radius-sm);
}

.contact-note {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
}

/* Tool pages stack several narrow text sections in a row; a lighter
   vertical rhythm here keeps the page from feeling sparse. */
.upload-section,
.explainer,
.features-section,
.faq-section,
.other-tools {
    padding-top: 32px;
    padding-bottom: 32px;
}

.upload-section {
    padding-top: 40px;
}

/* The tool grid is the primary above-the-fold call to action on the
   homepage, right after a compact hero and callout - keep the gap
   before it tight so the first row of cards doesn't get pushed below
   the fold on common laptop screen heights. */
.tool-section {
    padding-top: 20px;
    padding-bottom: 32px;
}

/* ---- Hero ---- */

.hero {
    background:
        radial-gradient(ellipse 900px 480px at 15% -10%, #e9e5ff 0%, transparent 60%),
        radial-gradient(ellipse 700px 420px at 100% 0%, #dff5ef 0%, transparent 55%),
        var(--bg);
    padding: 32px 24px 24px;
    border-bottom: 1px solid var(--line);
}

.tool-hero {
    padding: 40px 24px 32px;
}

.hero-inner {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.tool-hero .hero-inner {
    text-align: left;
    max-width: 1080px;
    margin: 0 auto;
}

.eyebrow {
    display: inline-block;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 6px 14px;
    border-radius: 999px;
    margin: 0 0 12px;
}

/* ---- Flow line (hero) ---- */

.flow-line {
    margin: 2px 0 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-soft);
    line-height: 1.7;
}

.flow-line .flow-arrow {
    color: var(--accent);
    font-weight: 600;
    margin: 0 9px;
    font-size: 13px;
}

.flow-line .flow-final {
    color: var(--accent-ink);
    font-weight: 700;
}

@media (max-width: 480px) {
    .flow-line .flow-arrow {
        margin: 0 6px;
    }
}

/* ---- Prominent callout ---- */

.callout {
    background: linear-gradient(135deg, var(--accent) 0%, #372ea8 100%);
    padding: 10px 24px;
}

.callout .section-inner.narrow {
    text-align: center;
}

.callout-text {
    margin: 0;
    color: #fff;
    font-family: "Fraunces", Georgia, serif;
    font-weight: 500;
    font-size: 19px;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

@media (max-width: 640px) {
    .callout-text {
        font-size: 17px;
    }
}

.hero h1 {
    font-size: 33px;
    line-height: 1.2;
    margin: 0 0 10px;
}

.tool-hero h1 {
    font-size: 32px;
}

.hero-lede {
    color: var(--ink-soft);
    font-size: 17px;
    line-height: 1.55;
    margin: 0 0 16px;
}

.tool-hero .hero-lede {
    font-size: 16.5px;
    margin: 0;
}

.breadcrumb {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 18px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.breadcrumb a {
    color: var(--muted);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--accent);
}

/* ---- Buttons ---- */

.btn {
    border: none;
    border-radius: 999px;
    padding: 12px 22px;
    font-size: 14.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}

.btn.primary {
    background: linear-gradient(135deg, var(--accent-bright), var(--accent));
    color: #fff;
    box-shadow: 0 6px 18px -6px rgba(68, 56, 202, 0.55);
}

.btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px -6px rgba(68, 56, 202, 0.6);
}

.btn.large {
    padding: 14px 28px;
    font-size: 15px;
}

.btn.secondary {
    background: var(--accent-soft);
    color: var(--accent-ink);
}

.btn.secondary:hover {
    background: #e2ddff;
}

/* ---- Tool grid (landing) ---- */

.tool-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

@media (max-width: 860px) {
    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .tool-grid {
        grid-template-columns: 1fr;
    }
}

.tool-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.premium-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #8a6116;
    background: #fff2cc;
    padding: 3px 9px;
    border-radius: 999px;
}

.premium-note {
    margin-top: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    background: #fffaf0;
    border: 1px solid #fbe3a6;
    border-radius: var(--radius-lg);
    padding: 20px 24px;
}

.premium-note-text h3 {
    margin: 0 0 4px;
    font-size: 16px;
}

.premium-note-text p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 14px;
}

.premium-note .btn.secondary {
    flex-shrink: 0;
    white-space: nowrap;
}

.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: #dedaff;
}

.tool-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}

.tool-icon svg {
    width: 22px;
    height: 22px;
}

.icon-pdf { background: #fbe7e5; color: var(--icon-pdf); }
.icon-word { background: #e4ecfb; color: var(--icon-word); }
.icon-ppt { background: #fcecd9; color: var(--icon-ppt); }
.icon-excel { background: #e1f5e9; color: var(--icon-excel); }
.icon-html { background: #f0e6fd; color: var(--icon-html); }
.icon-image { background: #ddf2ef; color: var(--icon-image); }

.tool-card h3 {
    margin: 0;
    font-size: 18px;
}

.tool-card-blurb {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 14.5px;
    flex: 1;
}

.tool-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.tool-card-link svg {
    width: 14px;
    height: 14px;
    transition: transform 0.15s ease;
}

.tool-card:hover .tool-card-link svg {
    transform: translateX(3px);
}

/* ---- How it works ---- */

.steps-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

@media (max-width: 760px) {
    .steps-grid {
        grid-template-columns: 1fr;
    }
}

.steps-grid li {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 22px;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 12px;
}

.steps-grid h3 {
    font-size: 16.5px;
    margin: 0 0 6px;
}

.steps-grid p {
    margin: 0;
    color: var(--muted);
    font-size: 14.5px;
}

/* ---- Upload card ---- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 22px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.upload-form button[type="submit"] {
    align-self: flex-start;
    padding: 13px 28px;
    font-size: 15px;
}

@media (max-width: 480px) {
    .upload-form button[type="submit"] {
        align-self: stretch;
    }
}

.file-drop {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1.5px dashed var(--line);
    border-radius: var(--radius-md);
    padding: 22px;
    cursor: pointer;
    color: var(--ink-soft);
    transition: border-color 0.15s ease, background 0.15s ease;
    position: relative;
}

.file-drop:hover {
    border-color: var(--accent-bright);
    background: var(--accent-soft);
}

.file-drop svg {
    width: 26px;
    height: 26px;
    color: var(--accent);
    flex-shrink: 0;
}

.file-drop-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 14px;
}

.file-drop-text strong {
    color: var(--ink);
    font-size: 15px;
}

/* The file input is intentionally NOT layered over this label with
   "position:absolute + opacity:0" - that common trick is unreliable on iOS
   Safari, where a tap sometimes fails to reach the input inside a flex
   container. The native <label for="..."> association is used instead,
   which is a standard, guaranteed-by-spec click delegation independent of
   the input's own size or position; the input itself is just visually
   hidden below. */
.visually-hidden-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.supported {
    margin: 14px 0 0;
    font-size: 13px;
    color: var(--muted);
}

code {
    background: var(--line-soft);
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 12.5px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.banner.error {
    background: var(--error-bg);
    border-color: var(--error-border);
    color: var(--error-text);
}

.banner.notice {
    background: #fff8e8;
    border-color: #fbe3a6;
    color: #8a6116;
    font-size: 13.5px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid #fbe3a6;
    margin-bottom: 16px;
}

/* The upload card is the entire point of a converter page, so it gets a
   visibly stronger treatment than the informational cards below it. */
.upload-card {
    border: 1.5px solid #ded8ff;
    box-shadow: var(--shadow-md);
    background: linear-gradient(180deg, #fbfaff 0%, var(--surface) 140px);
}

.premium-card {
    border-color: #fbe3a6;
    background: linear-gradient(180deg, #fffaf0 0%, var(--surface) 140px);
}

.premium-card p {
    color: var(--ink-soft);
    font-size: 15px;
    margin: 0 0 18px;
}

.premium-badge-static {
    position: static;
    display: inline-block;
    margin-bottom: 10px;
}

.upload-card-heading {
    font-size: 18px;
    margin: 0 0 16px;
}

/* ---- Result ---- */

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    /* Matches (with a little breathing room) the sticky header's rendered
       height, so scrolling this element into view via JS doesn't leave it
       tucked partly underneath the nav bar. */
    scroll-margin-top: 88px;
}

.result-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.result-actions form {
    display: contents;
}

.result-header h2 {
    margin: 0 0 4px;
    font-size: 17px;
    font-family: inherit;
    font-weight: 600;
    word-break: break-all;
}

.meta {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}

.token-estimate {
    background: #f2fbf6;
    border: 1px solid #c8ecd7;
    border-radius: var(--radius-md);
    padding: 16px 18px;
    margin-bottom: 16px;
}

.token-estimate-stat {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.token-estimate-number {
    font-family: "Fraunces", Georgia, serif;
    font-weight: 600;
    font-size: 26px;
    color: #157347;
}

.token-estimate-label {
    font-size: 13.5px;
    font-weight: 600;
    color: #1c6b45;
}

.token-estimate-note {
    margin: 0;
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.5;
}

.token-estimate-none {
    margin-bottom: 16px;
}

.markdown-preview {
    width: 100%;
    min-height: 380px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 13px;
    line-height: 1.55;
    padding: 18px;
    border-radius: var(--radius-md);
    border: 1px solid #232637;
    background: #14161f;
    color: #e7e8f0;
    resize: vertical;
}

/* ---- Feature list ---- */

.feature-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--ink-soft);
    font-size: 15.5px;
}

.feature-list svg {
    width: 20px;
    height: 20px;
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 1px;
}

/* ---- FAQ ---- */

.faq-item {
    border-top: 1px solid var(--line);
    padding: 20px 0;
}

.faq-item:first-of-type {
    border-top: none;
    padding-top: 0;
}

.faq-item h3 {
    margin: 0 0 8px;
    font-size: 16.5px;
    font-family: inherit;
    font-weight: 600;
}

.faq-item p {
    margin: 0;
    font-size: 15px;
}

/* ---- Other tools ---- */

.other-tools-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.other-tool-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.other-tool-chip svg {
    width: 13px;
    height: 13px;
}

.other-tool-chip:hover {
    border-color: var(--accent-bright);
    color: var(--accent);
    background: var(--accent-soft);
}

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

.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--line);
}

.footer-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 36px 24px 28px;
}

.footer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.footer-brand {
    pointer-events: none;
}

.footer-tagline {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
    margin-bottom: 14px;
}

.footer-links a {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink-soft);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-note {
    max-width: 720px;
    font-size: 12.5px;
    color: var(--muted);
    margin: 0 0 8px;
}

.footer-note a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.footer-note a:hover {
    text-decoration: underline;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 20px;
}

.footer-copy {
    font-size: 12px;
    color: var(--muted);
    margin: 0;
}

.footer-legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-legal-links a {
    font-size: 12px;
    color: var(--muted);
    text-decoration: none;
}

.footer-legal-links a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* ---- Loading overlay (shown while a conversion is in progress) ----
   The spinner is a plain CSS animation, not an image/GIF - this avoids
   any question of whether a loading GIF is licensed for commercial use,
   since there's nothing here to license: it's an animated CSS border,
   same as countless production sites use for this exact purpose. */

.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 17, 26, 0.62);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.loading-overlay.visible {
    display: flex;
}

body.modal-open {
    overflow: hidden;
}

.loading-card {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 40px 34px 32px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: loading-card-in 0.2s ease-out;
}

@keyframes loading-card-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.loading-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.loading-close svg {
    width: 16px;
    height: 16px;
}

.loading-close:hover,
.loading-close:focus-visible {
    background: var(--line-soft);
    color: var(--ink);
}

.loading-spinner {
    width: 46px;
    height: 46px;
    margin: 4px auto 20px;
    border-radius: 50%;
    border: 4px solid var(--accent-soft);
    border-top-color: var(--accent);
    animation: loading-spin 0.8s linear infinite;
}

@keyframes loading-spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-title {
    margin: 0 0 8px;
    font-family: "Fraunces", Georgia, serif;
    font-weight: 600;
    font-size: 18px;
    color: var(--ink);
}

.loading-sub {
    margin: 0;
    font-size: 13.5px;
    color: var(--muted);
    line-height: 1.55;
}

@media (prefers-reduced-motion: reduce) {
    .loading-spinner {
        animation-duration: 1.6s;
    }
    .loading-card {
        animation: none;
    }
}

/* ---- Result highlight (draws attention to freshly generated Markdown) ---- */

.result-card {
    animation: result-highlight 1.8s ease-out;
}

@keyframes result-highlight {
    0% {
        box-shadow: 0 0 0 4px rgba(68, 56, 202, 0.32), var(--shadow-sm);
        border-color: var(--accent-bright);
    }
    100% {
        box-shadow: var(--shadow-sm);
        border-color: var(--line);
    }
}

@media (prefers-reduced-motion: reduce) {
    .result-card {
        animation: none;
        box-shadow: 0 0 0 3px rgba(68, 56, 202, 0.32), var(--shadow-sm);
    }
}

/* ---- Responsive tweaks ---- */

@media (max-width: 560px) {
    .hero {
        padding: 56px 20px 48px;
    }
    .hero h1 {
        font-size: 32px;
    }
    .tool-hero h1 {
        font-size: 27px;
    }
    .section {
        padding: 48px 20px;
    }
}
