:root {
    color-scheme: light;
    --bg: #f4eee4;
    --bg-wash: #eadfce;
    --panel: rgba(255, 250, 244, 0.92);
    --panel-strong: #fffdf9;
    --panel-soft: rgba(247, 239, 229, 0.88);
    --ink: #1f2531;
    --muted: #677080;
    --line: rgba(31, 37, 49, 0.1);
    --line-strong: rgba(31, 37, 49, 0.18);
    --accent: #b66745;
    --accent-strong: #8f472c;
    --accent-soft: rgba(182, 103, 69, 0.12);
    --success: #2f7a59;
    --warning: #8d5c1a;
    --danger: #b64848;
    --shadow: 0 24px 60px rgba(103, 88, 66, 0.14);
    --shadow-soft: 0 14px 30px rgba(103, 88, 66, 0.08);
    --radius-xl: 36px;
    --radius-lg: 26px;
    --radius-md: 20px;
    --radius-sm: 14px;
    --ease-soft: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: "Manrope", "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.7), transparent 30%),
        radial-gradient(circle at bottom right, rgba(182, 103, 69, 0.08), transparent 26%),
        linear-gradient(180deg, #efe5d7 0%, var(--bg) 38%, var(--bg-wash) 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0, rgba(255, 255, 255, 0.2) 1px, transparent 1px, transparent 120px),
        linear-gradient(rgba(255, 255, 255, 0.14) 0, rgba(255, 255, 255, 0.14) 1px, transparent 1px, transparent 120px);
    opacity: 0.28;
}

body.app-ready .board-banner,
body.app-ready .architecture-grid,
body.app-ready .notice {
    animation: fadeUp 520ms var(--ease-soft) both;
}

body.app-ready .architecture-grid {
    animation-delay: 70ms;
}

body.is-busy {
    cursor: progress;
}

body.is-modal-open {
    overflow: hidden;
}

.shell {
    width: min(1360px, calc(100% - 40px));
    margin: 24px auto 42px;
    position: relative;
    z-index: 1;
}

.shell > .notice {
    margin-bottom: 24px;
}

.board-banner,
.map-card,
.builder-card,
.summary-card,
.panel,
.notice,
.modal-panel,
.result-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, rgba(255, 253, 249, 0.95) 0%, rgba(248, 241, 231, 0.86) 100%);
    box-shadow: var(--shadow);
}

.board-banner {
    padding: 34px;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.72fr);
    gap: 22px;
    margin-bottom: 24px;
}

.banner-copy,
.banner-metrics {
    display: grid;
    gap: 16px;
}

.eyebrow,
.card-kicker {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(90, 97, 110, 0.78);
}

.board-banner h1,
.section-head h2,
.summary-card strong,
.modal-head h2,
.result-head h3 {
    margin: 0;
    letter-spacing: -0.05em;
}

.board-banner h1 {
    font-size: 30px;
    line-height: 0.94;
}

.lead,
.section-head p,
.summary-card p,
.metric-card p,
.map-card p,
.form-note,
.field-note,
.bullet-list,
.notice p,
.result-copy,
textarea::placeholder,
input[type="text"]::placeholder,
select {
    color: var(--muted);
}

.lead {
    margin: 0;
    font-size: 1.04rem;
    line-height: 1.78;
}

.banner-metrics {
    align-content: start;
}

.metric-card {
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.54);
    box-shadow: var(--shadow-soft);
}

.metric-label {
    display: inline-block;
    margin-bottom: 12px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.76);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.metric-card strong {
    display: block;
    font-size: 1.28rem;
}

.metric-card p {
    margin: 10px 0 0;
    line-height: 1.7;
}

.notice {
    padding: 18px 22px;
    margin-bottom: 24px;
}

.notice strong {
    display: block;
    margin-bottom: 6px;
}

.notice.warning {
    color: var(--warning);
    background: linear-gradient(180deg, rgba(255, 248, 233, 0.96) 0%, rgba(252, 239, 211, 0.88) 100%);
}

.notice.success {
    color: var(--success);
    background: linear-gradient(180deg, rgba(232, 246, 239, 0.96) 0%, rgba(220, 240, 229, 0.9) 100%);
}

.notice.error {
    color: var(--danger);
    background: linear-gradient(180deg, rgba(255, 235, 235, 0.96) 0%, rgba(252, 223, 223, 0.88) 100%);
}

.hidden {
    display: none !important;
}

.architecture-grid {
    display: grid;
    grid-template-columns: minmax(250px, 0.72fr) minmax(0, 1.4fr) minmax(320px, 0.8fr);
    gap: 24px;
    align-items: start;
}

.map-column,
.builder-column,
.insight-column {
    display: grid;
    gap: 22px;
}

.map-card,
.builder-card,
.summary-card,
.panel {
    padding: 28px;
}

.map-card h2,
.section-head h2 {
    font-size: clamp(2rem, 3vw, 2.8rem);
    line-height: 0.96;
}

.map-card p,
.section-head p,
.summary-card p {
    margin: 12px 0 0;
    line-height: 1.72;
}

.map-list {
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 12px;
}

.map-list li {
    padding: 14px 16px;
    border: 1px solid rgba(31, 37, 49, 0.08);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.56);
    line-height: 1.6;
}

.map-card-accent {
    background: linear-gradient(180deg, rgba(189, 111, 73, 0.98) 0%, rgba(141, 72, 44, 0.94) 100%);
    color: #fff8f4;
}

.map-card-accent .card-kicker,
.map-card-accent p {
    color: rgba(255, 243, 236, 0.82);
}

.builder-card {
    background:
        linear-gradient(180deg, rgba(255, 253, 250, 0.97) 0%, rgba(249, 243, 233, 0.92) 100%);
}

.section-head {
    display: grid;
    gap: 10px;
    margin-bottom: 24px;
}

.section-head.compact h2 {
    font-size: 1.7rem;
}

.landing-form {
    display: grid;
    gap: 20px;
}

.field {
    display: grid;
    gap: 10px;
}

.field > span {
    font-size: 0.94rem;
    font-weight: 800;
}

.field-note {
    font-size: 0.88rem;
    line-height: 1.5;
}

.field-lg textarea {
    min-height: 240px;
}

.strategy-band,
.grid-two {
    display: grid;
    gap: 18px;
}

.strategy-band {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

textarea,
input[type="text"],
select {
    width: 100%;
    min-height: 58px;
    padding: 17px 18px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    font: inherit;
    color: var(--ink);
    transition: border-color 160ms var(--ease-soft), box-shadow 160ms var(--ease-soft), transform 160ms var(--ease-soft), background 160ms var(--ease-soft);
}

textarea {
    resize: vertical;
    line-height: 1.65;
}

textarea:focus,
input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: rgba(182, 103, 69, 0.42);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.94),
        0 0 0 4px rgba(182, 103, 69, 0.1);
    background: rgba(255, 255, 255, 0.94);
    transform: translateY(-1px);
}

button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-weight: 800;
    letter-spacing: -0.02em;
    cursor: pointer;
    transition: transform 180ms var(--ease-soft), box-shadow 180ms var(--ease-soft), background 180ms var(--ease-soft), opacity 180ms var(--ease-soft);
}

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

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#generate-button,
.copy-button {
    color: #fff9f5;
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
    box-shadow: 0 14px 26px rgba(143, 71, 44, 0.22);
}

.ghost-button {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--line);
}

.ghost-button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.96);
}

.builder-actions {
    display: grid;
    gap: 14px;
    padding-top: 4px;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.form-note {
    margin: 0;
    font-size: 0.93rem;
    line-height: 1.6;
}

.summary-card {
    gap: 8px;
    display: grid;
    background: linear-gradient(180deg, rgba(255, 252, 248, 0.98) 0%, rgba(245, 236, 223, 0.92) 100%);
}

.summary-card strong {
    font-size: 1.75rem;
    line-height: 1.02;
}

.summary-card-muted {
    background: linear-gradient(180deg, rgba(244, 234, 220, 0.88) 0%, rgba(236, 225, 208, 0.92) 100%);
}

.ad-shell {
    display: grid;
    gap: 20px;
}

.ad-slot,
.ad-placeholder {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 250, 244, 0.8);
}

.ad-placeholder {
    padding: 12px;
}

.ad-mockup {
    position: relative;
    overflow: hidden;
    min-height: 420px;
    border-radius: 22px;
    border: 1px solid rgba(182, 103, 69, 0.12);
    background: linear-gradient(180deg, rgba(255, 250, 242, 0.94) 0%, rgba(247, 237, 222, 0.94) 100%);
}

.ad-mockup-top,
.ad-mockup-media,
.ad-mockup-lines span {
    position: absolute;
    left: 18px;
    right: 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.34);
}

.ad-mockup-top {
    top: 18px;
    width: 34%;
    right: auto;
    height: 34px;
}

.ad-mockup-media {
    top: 92px;
    height: 150px;
}

.ad-mockup-lines {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 22px;
    display: grid;
    gap: 12px;
}

.ad-mockup-lines span:first-child,
.ad-mockup-lines span:last-child {
    position: static;
    height: 18px;
}

.ad-mockup-lines span:first-child {
    width: 62%;
    background: rgba(182, 103, 69, 0.16);
}

.ad-mockup-lines span:last-child {
    width: 44%;
    background: rgba(182, 103, 69, 0.11);
}

.ad-mockup-badge {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    width: 184px;
    height: 184px;
    margin: auto;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(182, 103, 69, 0.96) 0%, rgba(143, 71, 44, 0.96) 100%);
    color: #fff;
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 0.06em;
}

.modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    z-index: 30;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(25, 21, 18, 0.54);
    backdrop-filter: blur(12px);
}

.modal-panel {
    position: relative;
    width: min(1080px, 100%);
    max-height: min(88vh, 980px);
    overflow: auto;
    padding: 28px;
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.modal-head h2 {
    font-size: 2rem;
}

.modal-head p {
    margin: 10px 0 0;
    line-height: 1.7;
}

.result-stack {
    display: grid;
    gap: 18px;
}

.result-card {
    padding: 22px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(255, 254, 251, 0.98) 0%, rgba(249, 243, 234, 0.94) 100%);
    box-shadow: var(--shadow-soft);
}

.result-card-primary {
    background: linear-gradient(180deg, rgba(255, 248, 241, 0.98) 0%, rgba(249, 233, 216, 0.92) 100%);
}

.result-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.result-head h3 {
    font-size: 1.34rem;
}

.result-copy {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.95rem;
    line-height: 1.72;
}

.bullet-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
}

.copy-button.is-copied {
    background: linear-gradient(180deg, #3d875d 0%, #2e6747 100%);
}

.notice.is-visible,
.result-stack.is-entering,
.modal.is-visible .modal-panel {
    animation: fadeUp 360ms var(--ease-soft) both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    .insight-column {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .ad-shell {
        grid-column: 1 / -1;
    }
}

@media (max-width: 860px) {
    .board-banner,
    .strategy-band,
    .grid-two,
    .insight-column,
    .modal-head,
    .result-head {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .board-banner,
    .map-card,
    .builder-card,
    .summary-card,
    .panel,
    .modal-panel {
        padding: 22px;
    }

    .action-row {
        align-items: stretch;
    }

    button,
    .ghost-button,
    #generate-button {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .shell {
        width: min(100% - 20px, 100%);
        margin: 16px auto 24px;
    }

    .board-banner h1 {
        font-size: 30px;
    }

    .field-lg textarea {
        min-height: 200px;
    }
}
h1 {
    font-size: 30px;
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 54px;
    background-image:
        linear-gradient(45deg, transparent 50%, #6f7784 50%),
        linear-gradient(135deg, #6f7784 50%, transparent 50%);
    background-position:
        calc(100% - 24px) calc(50% - 3px),
        calc(100% - 18px) calc(50% - 3px);
    background-size: 7px 7px, 7px 7px;
    background-repeat: no-repeat;
    cursor: pointer;
}
