/* Base design tokens for the whole interface. */
:root {
    --bg: #f7f9fc;
    --surface: #ffffff;
    --surface-strong: #111827;
    --text: #172033;
    --muted: #637083;
    --line: #dbe3ef;
    --primary: #0f9f8f;
    --primary-dark: #087b70;
    --accent: #e7525b;
    --shadow: 0 20px 60px rgba(23, 32, 51, 0.12);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    padding: 16px clamp(16px, 5vw, 72px);
    background: rgba(247, 249, 252, 0.9);
    border-bottom: 1px solid rgba(219, 227, 239, 0.8);
    backdrop-filter: blur(16px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: 0;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    background: var(--surface-strong);
    color: #ffffff;
    border-radius: var(--radius);
}

.nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    margin: 5px 0;
    background: var(--text);
    border-radius: 999px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav a {
    padding: 9px 12px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.nav a:hover {
    color: var(--text);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: clamp(24px, 5vw, 64px);
    align-items: center;
    min-height: calc(100vh - 69px);
    padding: clamp(42px, 8vw, 96px) clamp(16px, 5vw, 72px) 48px;
    background:
        linear-gradient(120deg, rgba(15, 159, 143, 0.12), rgba(231, 82, 91, 0.08)),
        var(--bg);
}

.hero-content {
    max-width: 780px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 18px;
    font-size: clamp(40px, 7vw, 82px);
    line-height: 0.95;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 10px;
    font-size: clamp(30px, 5vw, 52px);
    line-height: 1;
    letter-spacing: 0;
}

h3 {
    margin-bottom: 10px;
    font-size: 20px;
}

.hero-copy {
    max-width: 650px;
    color: var(--muted);
    font-size: clamp(17px, 2vw, 21px);
}

.hero-actions,
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button.primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 159, 143, 0.25);
}

.button.primary:hover {
    background: var(--primary-dark);
}

.button.secondary {
    background: #ffffff;
    color: var(--text);
    border-color: var(--line);
}

.hero-panel {
    display: grid;
    gap: 14px;
    padding: 20px;
    background: var(--surface-strong);
    color: #ffffff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-panel div {
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
}

.hero-panel strong,
.hero-panel span {
    display: block;
}

.hero-panel span {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.72);
}

.tool-section,
.features,
.page {
    padding: 54px clamp(16px, 5vw, 72px);
}

.section-heading {
    max-width: 760px;
    margin-bottom: 24px;
}

.tool {
    padding: clamp(14px, 3vw, 24px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    padding: 5px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.tab {
    flex: 1;
    min-height: 42px;
    background: transparent;
    border: 0;
    border-radius: var(--radius);
    color: var(--muted);
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.tab.is-active {
    background: var(--surface-strong);
    color: #ffffff;
    box-shadow: 0 10px 26px rgba(23, 32, 51, 0.14);
}

.toolbar,
.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.toolbar label {
    font-weight: 800;
}

select {
    min-height: 44px;
    margin-right: auto;
    padding: 0 12px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    font: inherit;
    font-weight: 700;
}

.editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.editor-box {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.editor-box span {
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
}

textarea {
    width: 100%;
    min-height: 360px;
    resize: vertical;
    padding: 16px;
    background: #0d1320;
    color: #eaf2ff;
    border: 1px solid #273244;
    border-radius: var(--radius);
    font: 14px/1.5 Consolas, "Courier New", monospace;
    outline: none;
}

textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 159, 143, 0.18);
}

#message {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.saving {
    margin: 0 auto 0 0;
    color: var(--primary-dark);
    font-weight: 900;
}

.toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 50;
    max-width: min(360px, calc(100vw - 36px));
    padding: 14px 16px;
    background: var(--surface-strong);
    color: #ffffff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.features article {
    padding: 22px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.features p,
.content-page p {
    color: var(--muted);
}

.content-page {
    max-width: 860px;
    padding: clamp(20px, 4vw, 42px);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.content-page h1 {
    font-size: clamp(36px, 6vw, 64px);
}

.content-page h2 {
    margin-top: 28px;
    font-size: 24px;
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 26px clamp(16px, 5vw, 72px);
    color: var(--muted);
    border-top: 1px solid var(--line);
}

.footer a {
    color: var(--primary-dark);
    font-weight: 800;
}

@media (max-width: 860px) {
    .site-header,
    .toolbar,
    .status-row,
    .footer {
        align-items: stretch;
        flex-direction: column;
    }

    .site-header {
        position: sticky;
    }

    .site-header {
        display: grid;
        grid-template-columns: 1fr 44px;
        gap: 12px;
    }

    .menu-toggle {
        display: inline-block;
        justify-self: end;
    }

    .nav {
        display: none;
        grid-column: 1 / -1;
        width: 100%;
        padding: 10px;
        background: #ffffff;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        box-shadow: 0 16px 40px rgba(23, 32, 51, 0.1);
    }

    .nav.is-open {
        display: grid;
        gap: 4px;
    }

    .nav a {
        padding: 13px 12px;
        border-radius: var(--radius);
    }

    .nav a:hover {
        background: var(--bg);
    }

    .hero {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .editor-grid,
    .features {
        grid-template-columns: 1fr;
    }

    .toolbar .button,
    select,
    .actions,
    .actions .button {
        width: 100%;
    }

    .tabs {
        flex-direction: column;
    }

    .saving {
        margin: 0;
    }

    textarea {
        min-height: 280px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 38px;
    }

    .hero-actions .button {
        width: 100%;
    }
}
