:root {
    --brand: #b4233c;
    --brand-dark: #8f1730;
    --brand-soft: #fff0f3;
    --indigo: #5b5bd6;
    --ink: #172033;
    --muted: #657086;
    --line: rgba(36, 46, 72, 0.12);
    --surface: rgba(255, 255, 255, 0.78);
    --surface-solid: #ffffff;
    --canvas: #f5f7fb;
    --success: #16835f;
    --warning: #b76a00;
    --danger: #c13f4d;
    --shadow-sm: 0 8px 24px rgba(31, 43, 74, 0.08);
    --shadow-md: 0 18px 48px rgba(31, 43, 74, 0.12);
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    min-height: 100vh;
    font-family: 'Poppins', sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 8% 4%, rgba(180, 35, 60, 0.09), transparent 26rem),
        radial-gradient(circle at 92% 12%, rgba(91, 91, 214, 0.1), transparent 28rem),
        linear-gradient(180deg, #fbfcff 0%, var(--canvas) 56%, #f9fafc 100%);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

body::before,
body::after {
    content: "";
    position: fixed;
    z-index: -1;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    filter: blur(3px);
    pointer-events: none;
}

body::before {
    top: 24%;
    left: -180px;
    background: rgba(180, 35, 60, 0.08);
}

body::after {
    right: -180px;
    bottom: 8%;
    background: rgba(91, 91, 214, 0.08);
}

h1, h2, h3, h4, h5, h6 { color: var(--ink); font-family: 'Nunito', sans-serif; font-weight: 800; letter-spacing: -0.025em; }

body > header {
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 12px 0;
    background: rgba(255, 255, 255, 0.78);
    border-bottom: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 30px rgba(32, 41, 65, 0.07);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.header-content {
    display: flex;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-family: 'Nunito', sans-serif;
    font-size: 1.28rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    text-decoration: none;
}

.logo:hover { color: var(--brand); }

.brand-logo-image {
    display: block;
    width: auto;
    height: 52px;
    object-fit: contain;
}

.logo-mark {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    color: #fff;
    border-radius: 12px;
    background: linear-gradient(145deg, #d23852, var(--brand-dark));
    box-shadow: 0 8px 20px rgba(180, 35, 60, 0.24);
}

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

nav a {
    position: relative;
    color: #536077;
    padding: 9px 13px;
    border-radius: 11px;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
}

nav a:hover {
    color: var(--ink);
    background: rgba(91, 91, 214, 0.07);
    transform: none;
}

nav a.active {
    color: var(--brand);
    background: var(--brand-soft);
}

.mobile-menu-btn {
    display: none;
    width: 42px;
    height: 42px;
    place-items: center;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.mobile-menu-btn:hover { color: var(--brand); border-color: rgba(180, 35, 60, 0.3); }

.container {
    width: min(calc(100% - 40px), 1200px);
    margin: 42px auto 72px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.container > header {
    padding: 0;
    margin-bottom: 30px;
    color: var(--ink);
    background: transparent;
    border: 0;
    box-shadow: none;
}

.page-title,
.container > header h1 {
    color: var(--ink);
    font-size: clamp(2.15rem, 4vw, 3.35rem);
    line-height: 1.08;
    text-align: left;
    letter-spacing: -0.045em;
}

.page-subtitle,
.page-lead {
    max-width: 760px;
    margin: 12px 0 34px;
    color: var(--muted);
    font-size: 1.08rem;
    text-align: left;
}

.page-kicker,
.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.page-kicker::before,
.hero-kicker::before {
    content: "";
    width: 24px;
    height: 2px;
    border-radius: 99px;
    background: currentColor;
}

/* Home */
.hero {
    position: relative;
    max-width: 1120px;
    margin: 54px auto 22px;
    padding: 82px 40px 70px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(255,255,255,.86), rgba(255,255,255,.6));
    border: 1px solid rgba(255, 255, 255, 0.95);
    border-radius: 34px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(18px);
}

.hero::after {
    content: "";
    position: absolute;
    right: -95px;
    top: -115px;
    width: 300px;
    height: 300px;
    border: 52px solid rgba(180, 35, 60, 0.07);
    border-radius: 50%;
}

.hero h1 {
    position: relative;
    max-width: 900px;
    margin: 0 auto 20px;
    color: var(--ink);
    background: none;
    font-size: clamp(2.65rem, 6vw, 4.7rem);
    line-height: 1.02;
    letter-spacing: -0.06em;
    -webkit-text-fill-color: currentColor;
}

.hero p { color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.22rem); }

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.btn,
.cta-button,
.generate-btn,
.copy-btn,
.copy-prompt-btn,
.analyze-btn,
.tab-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 46px;
    padding: 11px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.96rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}

.btn-primary,
.cta-button,
.generate-btn,
.analyze-btn {
    color: #fff;
    background: linear-gradient(135deg, #c62d48, var(--brand-dark));
    box-shadow: 0 10px 22px rgba(180, 35, 60, 0.2);
}

.btn-secondary {
    color: var(--ink);
    background: rgba(255,255,255,.76);
    border-color: var(--line);
    box-shadow: var(--shadow-sm);
}

.btn:hover,
.cta-button:hover,
.generate-btn:hover,
.analyze-btn:hover,
.copy-btn:hover,
.copy-prompt-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(31, 43, 74, 0.16); }

.tools-grid { max-width: 1160px; gap: 20px; margin: 28px auto 72px; }

.tool-card,
.features,
.style-card,
.reference-card,
.table-section,
.term-section,
.prompt-input-section,
.score-card,
.checklist-category,
.recommendations,
.example-prompts,
.result-section {
    color: var(--ink);
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.tool-card {
    position: relative;
    min-height: 270px;
    padding: 30px;
    border-radius: var(--radius-md);
}

.tool-card::after {
    content: "\2197";
    position: absolute;
    right: 24px;
    bottom: 24px;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    color: var(--brand);
    background: var(--brand-soft);
    border-radius: 50%;
    font-weight: 900;
    transition: transform .2s ease;
}

.tool-card:hover {
    color: var(--ink);
    background: rgba(255,255,255,.9);
    border-color: rgba(180, 35, 60, 0.18);
    box-shadow: var(--shadow-md);
    transform: translateY(-6px);
}

.tool-card:hover::after { transform: rotate(45deg); }

.tool-icon {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    margin-bottom: 24px;
    color: var(--brand);
    font-size: 1.55rem;
    background: linear-gradient(145deg, #fff5f7, #ffe6eb);
    border: 1px solid rgba(180, 35, 60, 0.1);
    border-radius: 17px;
}

.tool-card h3 { color: var(--ink); font-size: 1.35rem; }
.tool-card p { color: var(--muted); font-size: 0.98rem; }

.features { padding: 52px; border-radius: var(--radius-lg); }
.features h2 { color: var(--ink); font-size: clamp(2rem, 4vw, 2.7rem); }
.features-list { gap: 32px; }
.feature-item { gap: 16px; }
.feature-icon {
    display: grid;
    min-width: 42px;
    height: 42px;
    place-items: center;
    margin: 0;
    color: var(--indigo);
    background: #eeeeff;
    border-radius: 12px;
    font-size: 1.05rem;
}
.feature-text h4 { color: var(--ink); }
.feature-text p { color: var(--muted); }

.cta {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(125deg, #941d34, #c52d48 58%, #6b55c8 145%);
    box-shadow: 0 24px 56px rgba(143, 23, 48, 0.25);
}
.cta h2, .cta p { color: #fff; }
.cta-button { color: var(--brand-dark); background: #fff; box-shadow: 0 12px 24px rgba(57, 8, 18, .18); }

footer { margin-top: 80px; padding: 34px 20px; background: transparent; border-top: 1px solid var(--line); }
footer p { color: var(--muted); }

/* Generator */
.content { padding: 0; }
.template-selector { gap: 16px; margin-bottom: 26px; }
.template-card {
    position: relative;
    min-height: 160px;
    padding: 22px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255,255,255,.95);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
}
.template-card:hover { background: #fff; border-color: rgba(91,91,214,.24); box-shadow: var(--shadow-md); }
.template-card.active {
    color: var(--ink);
    background: linear-gradient(145deg, #fff, #fff1f4);
    border: 1px solid rgba(180, 35, 60, .35);
    box-shadow: 0 14px 34px rgba(180, 35, 60, .11);
}
.template-card.active::after {
    content: "\2713";
    position: absolute;
    top: 18px;
    right: 18px;
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    color: #fff;
    background: var(--brand);
    border-radius: 50%;
    font-size: .8rem;
    font-weight: 900;
}
.template-icon {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    margin-bottom: 16px;
    color: var(--indigo);
    background: #eeeeff;
    border-radius: 12px;
}
.template-card.active .template-icon { color: var(--brand); background: var(--brand-soft); }
.template-card h3 { color: var(--ink); margin-bottom: 7px; }
.template-card p { color: var(--muted); }

.form-section {
    padding: 30px;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,.95);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}
.form-section > h2 { color: var(--ink) !important; font-size: 1.55rem; }
.form-group label,
.checkbox-item label { color: #323c50; font-size: .92rem; }
.field-help {
    display: block;
    margin: -3px 0 8px;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.45;
}

input[type="text"],
input[type="search"],
textarea,
select,
.search-input {
    width: 100%;
    color: var(--ink);
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #cfd5e1;
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 2px rgba(31,43,74,.03);
    caret-color: var(--brand);
}

input[type="text"], input[type="search"], select { min-height: 48px; padding: 11px 14px; }
textarea { padding: 14px 16px; }

input::placeholder,
textarea::placeholder,
.search-input::placeholder { color: #8b95a7; opacity: 1; }

input:focus,
textarea:focus,
select:focus,
.search-input:focus {
    color: var(--ink);
    outline: none;
    background-color: #fff;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(180, 35, 60, 0.11);
}

select {
    color-scheme: light;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 46px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23536077' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
    cursor: pointer;
}

select option,
select optgroup {
    color: #172033;
    background: #ffffff;
}

select option:checked { color: #78162a; background: #fff0f3; }

input[type="checkbox"] {
    accent-color: var(--brand);
}

.checkbox-item {
    padding: 8px 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
}
.checkbox-item label { margin: 0; cursor: pointer; }
.generate-btn, .analyze-btn { width: 100%; margin-top: 10px; border-radius: 13px; }
.copy-btn,
.copy-prompt-btn { color: #fff; background: linear-gradient(135deg, #188965, #126b51); box-shadow: 0 9px 20px rgba(22, 131, 95, .18); }
.copy-btn.copied,
.copy-prompt-btn.copied { background: var(--indigo); }
.result-section { padding: 28px; border-radius: var(--radius-md); }
.result-section h2 { color: var(--ink); }
.prompt-output,
.prompt-box {
    color: #334057;
    background: #f8f9fc;
    border: 1px solid var(--line);
    border-left: 4px solid var(--brand);
    border-radius: var(--radius-sm);
}
.prompt-output { padding: 18px; }

/* Gallery */
.styles-grid { grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 22px; }
.style-card { overflow: hidden; border-radius: var(--radius-md); }
.style-card:hover { border-color: rgba(180,35,60,.2); box-shadow: var(--shadow-md); transform: translateY(-5px); }
.style-image {
    position: relative;
    height: 190px;
    color: var(--brand);
    background:
        linear-gradient(145deg, rgba(255,255,255,.3), transparent),
        linear-gradient(135deg, #ffe8ed, #eeecff);
    font-size: 3rem;
}
.style-image::after {
    content: "";
    position: absolute;
    width: 110px;
    height: 110px;
    border: 1px solid rgba(180,35,60,.14);
    border-radius: 32px;
    transform: rotate(18deg);
}
.style-image i { position: relative; z-index: 1; }
.style-content { padding: 24px; }
.style-content h3 { color: var(--ink); }
.style-description, .prompt-text { color: var(--muted); }
.tag, .reference-term { color: #8f1730; background: var(--brand-soft); border: 1px solid rgba(180,35,60,.09); }
.prompt-label { color: var(--brand); }

/* Checklist */
.prompt-input-section { padding: 30px; border-radius: var(--radius-md); }
.prompt-input-section h2 { color: var(--ink); }
.form-error {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 10px;
    color: var(--danger);
    font-size: .9rem;
    font-weight: 700;
}
.form-error[hidden] { display: none; }
[aria-invalid="true"] { border-color: var(--danger) !important; box-shadow: 0 0 0 4px rgba(193,63,77,.1) !important; }
.score-card { border: 1px solid rgba(180,35,60,.22); background: linear-gradient(135deg, #fff, #fff0f3); }
.score-number { color: var(--brand); }
.score-label { color: var(--muted); }
.checklist-category,
.recommendations,
.example-prompts { border-radius: var(--radius-md); }
.checklist-category h3 { color: var(--ink); }
.checklist-item,
.recommendation-item,
.example-prompt { background: #f8f9fc; border: 1px solid var(--line); }
.item-text, .recommendation-text, .example-prompt-text { color: var(--muted); }
.recommendations h3, .recommendation-item strong { color: var(--warning); }
.example-prompts h3 { color: var(--ink); }
.example-prompt-label { color: var(--success); }

/* Library */
.section-tabs { gap: 9px; scrollbar-width: thin; }
.tab-button {
    min-height: 44px;
    color: #536077;
    background: rgba(255,255,255,.72);
    border: 1px solid var(--line);
    border-radius: 12px;
    white-space: nowrap;
    box-shadow: none;
}
.tab-button:hover { color: var(--brand); background: var(--brand-soft); border-color: rgba(180,35,60,.22); }
.tab-button.active { color: #fff; background: var(--brand); border-color: var(--brand); box-shadow: 0 8px 18px rgba(180,35,60,.18); }
.reference-card { padding: 24px; border-radius: 17px; }
.reference-card:hover { border-color: rgba(180,35,60,.2); box-shadow: var(--shadow-md); transform: translateY(-4px); }
.reference-card h3, .table-section h3, .term-title { color: var(--ink); }
.reference-description, .term-description { color: var(--muted); }
.table-section { padding: 24px; border-radius: var(--radius-md); }
table { min-width: 650px; overflow: hidden; }
thead { background: #f0f2f8; }
th { color: #323c50; }
td { color: #536077; border-bottom-color: var(--line); }
tbody tr { background: rgba(255,255,255,.72); }
tbody tr:hover { background: #fff6f8; }
.term-section { border: 1px solid rgba(255,255,255,.95); border-left: 4px solid var(--brand); }
.term-translation { color: var(--success); }

:focus-visible {
    outline: 3px solid rgba(91, 91, 214, 0.35);
    outline-offset: 3px;
}

@media (max-width: 820px) {
    .header-content { position: relative; }
    .mobile-menu-btn { display: grid; }
    nav {
        position: absolute;
        top: calc(100% + 14px);
        left: 18px;
        right: 18px;
        display: flex;
        visibility: hidden;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 10px;
        opacity: 0;
        background: rgba(255,255,255,.96);
        border: 1px solid rgba(255,255,255,.95);
        border-radius: 16px;
        box-shadow: var(--shadow-md);
        transform: translateY(-8px);
        transition: .2s ease;
        pointer-events: none;
        backdrop-filter: blur(16px);
    }
    nav.is-open { visibility: visible; opacity: 1; transform: translateY(0); pointer-events: auto; }
    nav a { width: 100%; }
    .container { width: min(calc(100% - 28px), 1200px); margin-top: 30px; }
    .hero { margin: 28px 14px 18px; padding: 62px 24px 52px; }
    .tools-grid { margin-top: 18px; padding: 0 14px; }
    .features { margin: 54px 14px; padding: 34px 24px; }
    .cta { margin: 54px 14px; padding: 46px 22px; }
    .form-section { padding: 22px; }
}

@media (max-width: 560px) {
    .logo { font-size: 1.12rem; }
    .brand-logo-image { height: 45px; }
    .logo-mark { width: 35px; height: 35px; }
    .hero h1 { font-size: 2.55rem; }
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; }
    .tools-grid, .styles-grid, .reference-grid { grid-template-columns: 1fr; }
    .tool-card { min-height: auto; padding: 24px; }
    .template-selector { grid-template-columns: 1fr; }
    .form-section { padding: 20px 16px; }
    .row { grid-template-columns: 1fr; gap: 0; }
    .prompt-input-section, .score-card, .checklist-category, .recommendations, .example-prompts { padding: 22px 18px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
