@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Syne:wght@500;700;800&display=swap');

:root {
    --bg: #f3efe6;
    --bg-strong: #ece5d9;
    --panel: rgba(255, 255, 255, 0.7);
    --panel-strong: rgba(255, 255, 255, 0.9);
    --panel-deep: #0f1729;
    --panel-soft: rgba(255, 255, 255, 0.55);
    --text: #111827;
    --muted: #637185;
    --line: rgba(17, 24, 39, 0.08);
    --line-strong: rgba(17, 24, 39, 0.16);
    --shadow: 0 32px 90px rgba(17, 24, 39, 0.12);
    --shadow-soft: 0 18px 40px rgba(17, 24, 39, 0.08);
    --ocean: #1d90b3;
    --sun: #eb9b3c;
    --mint: #1fae78;
    --ember: #ed6142;
    --ink: #0f1729;
    --hero-glow:
        radial-gradient(circle at 15% 15%, rgba(29, 144, 179, 0.26), transparent 28%),
        radial-gradient(circle at 85% 10%, rgba(235, 155, 60, 0.22), transparent 24%),
        radial-gradient(circle at 50% 80%, rgba(31, 174, 120, 0.16), transparent 26%);
}

html[data-theme='dark'] {
    --bg: #07101c;
    --bg-strong: #0b1422;
    --panel: rgba(11, 20, 34, 0.78);
    --panel-strong: rgba(14, 24, 40, 0.92);
    --panel-deep: #040912;
    --panel-soft: rgba(13, 23, 39, 0.72);
    --text: #eef5ff;
    --muted: #a2b1c6;
    --line: rgba(168, 191, 224, 0.1);
    --line-strong: rgba(168, 191, 224, 0.18);
    --shadow: 0 32px 90px rgba(0, 0, 0, 0.35);
    --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.24);
    --hero-glow:
        radial-gradient(circle at 15% 15%, rgba(29, 144, 179, 0.2), transparent 30%),
        radial-gradient(circle at 85% 10%, rgba(235, 155, 60, 0.18), transparent 26%),
        radial-gradient(circle at 50% 80%, rgba(31, 174, 120, 0.12), transparent 28%);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    color: var(--text);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 24%),
        var(--hero-glow),
        var(--bg);
    overflow-x: hidden;
}

body::before,
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -2;
}

body::before {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 72px 72px;
    opacity: 0.55;
}

body::after {
    background:
        radial-gradient(circle at center, rgba(255, 255, 255, 0.14), transparent 58%);
    z-index: -3;
}

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

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

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
    background: transparent;
}

img,
video,
iframe {
    display: block;
    width: 100%;
}

img,
video {
    max-width: 100%;
}

img {
    image-orientation: from-image;
}

input,
select,
textarea {
    width: 100%;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.54);
    color: var(--text);
    padding: 0.92rem 1rem;
    outline: none;
    transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

html[data-theme='dark'] input,
html[data-theme='dark'] select,
html[data-theme='dark'] textarea {
    background: rgba(6, 12, 20, 0.78);
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(29, 144, 179, 0.48);
    transform: translateY(-1px);
}

textarea {
    resize: vertical;
    min-height: 128px;
}

.site-shell {
    width: min(1480px, calc(100vw - 28px));
    margin: 0 auto;
    padding: 22px 0 56px;
}

.is-editor-mode .site-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 22px;
    align-items: start;
}

.site-stage {
    min-width: 0;
}

.page-stack {
    display: grid;
    gap: 28px;
}

.glass-panel,
.editor-dock,
.login-panel,
.lightbox-panel {
    border: 1px solid var(--line);
    background: var(--panel);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.site-topbar {
    position: sticky;
    top: 16px;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    border-radius: 28px;
}

.site-topbar .topbar-actions {
    justify-content: flex-end;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.brand-mark {
    width: 50px;
    height: 50px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--ocean), var(--sun));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.brand-copy {
    display: grid;
    gap: 3px;
}

.brand-copy strong,
.display-title,
.module-title,
.statement-title,
.lightbox-heading,
.editor-title,
.login-copy h1 {
    font-family: 'Syne', 'Segoe UI', sans-serif;
    letter-spacing: -0.045em;
}

.brand-copy span,
.meta-text,
.module-body,
.hero-note,
.editor-help,
.field-note,
.ticker-chip,
.filter-chip,
.fact-item span,
.module-count,
.footer-copy,
.thumb-meta,
.ghost-caption,
.device-label,
.browser-pill,
.flash-banner {
    color: var(--muted);
}

.topbar-actions,
.hero-actions,
.module-actions,
.editor-button-row,
.device-switch,
.lightbox-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pill-button,
.outline-button,
.soft-button,
.ghost-link,
.mini-button,
.filter-chip,
.eyebrow-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    transition: transform 180ms ease, opacity 180ms ease, background 180ms ease, border-color 180ms ease;
}

.pill-button,
.outline-button,
.soft-button {
    min-height: 46px;
    padding: 0 18px;
}

.pill-button:hover,
.outline-button:hover,
.soft-button:hover,
.mini-button:hover,
.filter-chip:hover,
.ghost-link:hover {
    transform: translateY(-1px);
}

.pill-button {
    color: #fff;
    background: linear-gradient(135deg, var(--ocean), #10627a);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.outline-button {
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.24);
    color: var(--text);
}

.soft-button,
.filter-chip {
    background: rgba(29, 144, 179, 0.12);
    color: var(--ocean);
}

.mini-button {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.2);
    color: var(--text);
}

.ghost-link {
    color: var(--text);
    opacity: 0.82;
}

.eyebrow-chip {
    width: fit-content;
    padding: 0.5rem 0.9rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--line);
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.hero-section {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 24px;
    padding: 14px 0 6px;
}

.hero-copy,
.hero-preview,
.ticker-band,
.filter-bar,
.statement-card,
.showcase-card,
.footer-panel {
    border-radius: 34px;
}

.hero-copy,
.hero-preview {
    padding: 28px;
    position: relative;
    overflow: hidden;
}

.hero-copy::before,
.hero-preview::before,
.statement-card::before,
.showcase-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.22), transparent 38%),
        linear-gradient(140deg, rgba(255, 255, 255, 0.06), transparent 48%);
    pointer-events: none;
}

.hero-copy {
    display: grid;
    gap: 18px;
    min-height: 540px;
    align-content: end;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.34), transparent 46%),
        linear-gradient(180deg, rgba(15, 23, 41, 0.02), rgba(15, 23, 41, 0.08)),
        var(--panel);
}

.display-title {
    margin: 0;
    font-size: clamp(2.8rem, 6vw, 6rem);
    line-height: 0.92;
}

.hero-subtitle {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.7;
    max-width: 62ch;
    color: var(--muted);
}

.hero-subtitle p,
.module-body p,
.statement-body p,
.quote-box p,
.hero-note p {
    margin: 0;
}

.hero-subtitle p + p,
.module-body p + p,
.statement-body p + p,
.quote-box p + p,
.hero-note p + p {
    margin-top: 0.85rem;
}

.hero-note {
    display: inline-flex;
    width: fit-content;
    padding: 0.75rem 0.95rem;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.22);
    max-width: 54ch;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.stat-card {
    padding: 16px;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.34);
    min-height: 108px;
    display: grid;
    align-content: space-between;
    gap: 10px;
}

.stat-card strong {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

.hero-preview {
    background:
        radial-gradient(circle at 84% 16%, rgba(235, 155, 60, 0.24), transparent 22%),
        radial-gradient(circle at 12% 82%, rgba(29, 144, 179, 0.28), transparent 24%),
        linear-gradient(155deg, rgba(255, 255, 255, 0.2), transparent 48%),
        var(--panel);
    min-height: 540px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(180px, 1fr));
    gap: 16px;
}

.preview-card {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06)),
        rgba(9, 15, 26, 0.34);
    box-shadow: var(--shadow-soft);
    transform: translateY(calc(var(--lift, 0) * -8px));
}

.preview-card:nth-child(1) {
    --lift: 1;
}

.preview-card:nth-child(3) {
    --lift: 2;
}

.preview-card img,
.preview-card video {
    height: 100%;
    object-fit: cover;
}

.preview-card iframe {
    height: 100%;
    border: 0;
}

.preview-card-site {
    background: rgba(9, 15, 26, 0.42);
}

.preview-site-shell {
    height: 100%;
    display: grid;
    grid-template-rows: 34px 1fr;
    background: #eef3f7;
}

.preview-site-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    background: rgba(7, 16, 28, 0.08);
}

.preview-site-toolbar span {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(7, 16, 28, 0.24);
}

.preview-site-viewport {
    position: relative;
    overflow: hidden;
    background: #fff;
}

.preview-site-viewport iframe {
    width: calc(100% / 0.44);
    height: calc(100% / 0.44);
    transform: scale(0.44);
    transform-origin: top left;
    pointer-events: none;
}

.preview-card-fallback,
.browser-fallback {
    height: 100%;
    padding: 16px;
    display: grid;
    align-content: space-between;
    background:
        linear-gradient(180deg, rgba(7, 16, 28, 0.12), transparent 56%),
        linear-gradient(135deg, rgba(29, 144, 179, 0.3), rgba(237, 97, 66, 0.16));
}

.preview-meta {
    position: absolute;
    inset-inline: 14px;
    bottom: 14px;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(7, 16, 28, 0.62);
    color: #eff5ff;
    display: grid;
    gap: 4px;
}

.ticker-band,
.filter-bar,
.footer-panel,
.statement-card,
.showcase-card {
    padding: 24px;
    position: relative;
    overflow: hidden;
    background: var(--panel);
}

.ticker-band {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.ticker-chip {
    padding: 0.8rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.32);
    white-space: nowrap;
}

.ticker-divider {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--sun), var(--ocean));
    flex: 0 0 auto;
}

.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-chip.is-active,
.mini-button.is-active {
    background: linear-gradient(135deg, rgba(29, 144, 179, 0.16), rgba(235, 155, 60, 0.16));
    border-color: rgba(29, 144, 179, 0.24);
    color: var(--text);
}

.showcase-stack {
    display: grid;
    gap: 22px;
}

.statement-card {
    display: grid;
    gap: 18px;
}

.statement-title {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.8rem);
    line-height: 0.98;
    max-width: 14ch;
}

.statement-body {
    margin: 0;
    max-width: 72ch;
    color: var(--muted);
    line-height: 1.78;
}

.quote-box {
    max-width: 72ch;
    padding: 18px 20px;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.24);
    font-size: 1rem;
    line-height: 1.68;
}

.showcase-card {
    display: grid;
    grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
    gap: 22px;
}

.showcase-card.is-standard {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
}

.showcase-card.is-hero {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
}

.module-meta {
    display: grid;
    align-content: start;
    gap: 16px;
}

.meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.section-index {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-weight: 700;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.26);
}

.module-title {
    margin: 0;
    font-size: clamp(1.9rem, 3vw, 3rem);
    line-height: 1.02;
}

.module-body {
    margin: 0;
    line-height: 1.74;
}

.chip-row,
.fact-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-chip,
.fact-item {
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.22);
}

.tag-chip {
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
}

.fact-item {
    min-width: 124px;
    padding: 0.9rem 1rem;
    display: grid;
    gap: 4px;
}

.fact-item strong {
    font-size: 1.05rem;
}

.module-visual {
    min-width: 0;
    display: grid;
    gap: 16px;
}

.stage-button {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 50%),
        rgba(10, 18, 31, 0.06);
    min-height: 420px;
    box-shadow: var(--shadow-soft);
    padding: 0;
    text-align: left;
}

.stage-button img,
.stage-button video {
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.media-fit-contain .stage-button img,
.media-fit-contain .stage-button video,
.media-fit-contain .thumb-button img,
.media-fit-contain .thumb-button video {
    object-fit: contain;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(7, 16, 28, 0.08));
}

.stage-overlay {
    position: absolute;
    inset-inline: 16px;
    bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 20px;
    background: rgba(7, 16, 28, 0.66);
    color: #f0f6ff;
    backdrop-filter: blur(12px);
}

.stage-overlay strong {
    font-size: 1rem;
}

.media-strip-shell {
    display: grid;
    gap: 10px;
}

.strip-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.strip-arrow {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.2);
    color: var(--text);
    font-size: 1rem;
    font-weight: 800;
}

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

.media-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    cursor: grab;
    scrollbar-width: none;
    touch-action: pan-x;
}

.media-strip::-webkit-scrollbar,
.editor-dock::-webkit-scrollbar,
.library-grid::-webkit-scrollbar {
    height: 10px;
    width: 10px;
}

.media-strip::-webkit-scrollbar-thumb,
.editor-dock::-webkit-scrollbar-thumb,
.library-grid::-webkit-scrollbar-thumb {
    background: rgba(99, 113, 133, 0.28);
    border-radius: 999px;
}

.thumb-button {
    flex: 0 0 clamp(156px, 23vw, 220px);
    padding: 0;
    border-radius: 22px;
    overflow: hidden;
    min-height: 0;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.22);
    position: relative;
    scroll-snap-align: start;
    touch-action: pan-x;
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
}

.thumb-button img,
.thumb-button video {
    height: 100%;
    object-fit: cover;
    object-position: center center;
    pointer-events: none;
    -webkit-user-drag: none;
}

.thumb-meta {
    position: absolute;
    inset-inline: 10px;
    bottom: 10px;
    padding: 8px 10px;
    border-radius: 14px;
    background: rgba(7, 16, 28, 0.64);
    color: #eef6ff;
    font-size: 0.84rem;
    pointer-events: none;
}

.more-thumb {
    display: grid;
    place-items: center;
    text-align: center;
    color: var(--text);
    background:
        linear-gradient(135deg, rgba(29, 144, 179, 0.12), rgba(235, 155, 60, 0.16)),
        rgba(255, 255, 255, 0.16);
    font-weight: 700;
}

.browser-shell {
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: rgba(7, 16, 28, 0.86);
    box-shadow: var(--shadow-soft);
}

.browser-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #dce7f7;
}

.browser-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.browser-controls span {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.34);
}

.browser-url {
    min-width: 0;
    flex: 1;
    padding: 0.75rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
}

.browser-pill,
.device-label {
    padding: 0.7rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.14);
}

.browser-viewport {
    background: #fff;
    aspect-ratio: 16 / 10;
}

.browser-shell.is-mobile {
    width: min(420px, 100%);
    justify-self: center;
    border-radius: 34px;
}

.browser-shell.is-mobile .browser-viewport {
    aspect-ratio: 9 / 18;
}

.browser-shell.is-tablet .browser-viewport {
    aspect-ratio: 4 / 5;
}

.browser-viewport iframe {
    height: 100%;
    border: 0;
    background: #fff;
}

.browser-viewport .stage-button,
.browser-viewport .browser-fallback {
    min-height: 100%;
    border: 0;
    border-radius: 0;
}

.module-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

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

.footer-copy {
    max-width: 68ch;
    line-height: 1.7;
}

.accent-ocean {
    --accent-color: var(--ocean);
}

.accent-sun {
    --accent-color: var(--sun);
}

.accent-mint {
    --accent-color: var(--mint);
}

.accent-ember {
    --accent-color: var(--ember);
}

.accent-ocean .section-index,
.accent-ocean .eyebrow-chip,
.accent-ocean .mini-button.is-active {
    border-color: rgba(29, 144, 179, 0.22);
}

.accent-sun .section-index,
.accent-sun .eyebrow-chip,
.accent-sun .mini-button.is-active {
    border-color: rgba(235, 155, 60, 0.24);
}

.accent-mint .section-index,
.accent-mint .eyebrow-chip,
.accent-mint .mini-button.is-active {
    border-color: rgba(31, 174, 120, 0.24);
}

.accent-ember .section-index,
.accent-ember .eyebrow-chip,
.accent-ember .mini-button.is-active {
    border-color: rgba(237, 97, 66, 0.24);
}

.editor-dock {
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    padding: 20px;
    border-radius: 30px;
    overflow: auto;
    display: grid;
    gap: 18px;
}

.editor-title {
    margin: 0;
    font-size: 2rem;
    line-height: 0.95;
}

.editor-section {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.18);
}

.editor-nav {
    display: grid;
    gap: 8px;
}

.editor-nav-button {
    width: 100%;
    text-align: left;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.16);
    color: var(--text);
    display: grid;
    gap: 6px;
}

.editor-nav-button.is-active {
    background: linear-gradient(135deg, rgba(29, 144, 179, 0.14), rgba(235, 155, 60, 0.16));
    border-color: rgba(29, 144, 179, 0.22);
}

.editor-nav-button small {
    color: var(--muted);
}

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

.field-grid.single {
    grid-template-columns: 1fr;
}

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

.field span {
    font-weight: 700;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.14);
}

.toggle-row input {
    width: auto;
    margin: 0;
    transform: scale(1.12);
}

.editor-save-bar {
    display: grid;
    gap: 10px;
}

.status-pill {
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.14);
    font-size: 0.92rem;
}

.status-pill.is-dirty {
    color: var(--ember);
    border-color: rgba(237, 97, 66, 0.22);
}

.status-pill.is-saved {
    color: var(--mint);
    border-color: rgba(31, 174, 120, 0.22);
}

.library-grid {
    display: grid;
    gap: 10px;
    max-height: 460px;
    overflow: auto;
    padding-right: 4px;
}

.library-group {
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.14);
    overflow: hidden;
}

.library-group summary {
    list-style: none;
    cursor: pointer;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.library-group summary::-webkit-details-marker {
    display: none;
}

.library-items {
    display: grid;
    gap: 10px;
    padding: 0 1rem 1rem;
}

.library-item {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.08);
}

.library-thumb {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.12);
}

.library-thumb img,
.library-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.library-copy {
    max-width: 120px;
}

.inline-edit-button {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 4;
}

.overlay-root:empty {
    display: none;
}

.lightbox-shell {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: grid;
    place-items: center;
    padding: 18px;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 5, 12, 0.72);
    backdrop-filter: blur(14px);
}

.lightbox-panel {
    position: relative;
    width: min(1280px, calc(100vw - 32px));
    max-height: calc(100vh - 36px);
    overflow: auto;
    padding: 18px;
    border-radius: 32px;
    display: grid;
    gap: 14px;
}

.lightbox-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.lightbox-heading {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.lightbox-media {
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: rgba(7, 16, 28, 0.24);
    min-height: 60vh;
}

.lightbox-media img,
.lightbox-media video {
    height: min(74vh, 880px);
    object-fit: contain;
    object-position: center center;
    background: rgba(7, 16, 28, 0.12);
}

.lightbox-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    cursor: grab;
    scrollbar-width: none;
    touch-action: pan-x;
}

.lightbox-strip::-webkit-scrollbar,
.media-strip::-webkit-scrollbar {
    display: none;
}

.lightbox-thumb {
    flex: 0 0 148px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.12);
    padding: 0;
    min-height: 0;
    aspect-ratio: 4 / 3;
    scroll-snap-align: start;
    touch-action: pan-x;
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
}

.lightbox-thumb.is-active {
    border-color: rgba(29, 144, 179, 0.32);
}

.lightbox-thumb img,
.lightbox-thumb video {
    height: 100%;
    object-fit: cover;
    object-position: center center;
    pointer-events: none;
    -webkit-user-drag: none;
}

.lightbox-strip-shell .strip-controls {
    justify-content: space-between;
}

.media-strip.is-dragging,
.lightbox-strip.is-dragging,
.media-strip.is-dragging .thumb-button,
.lightbox-strip.is-dragging .lightbox-thumb {
    cursor: grabbing;
}

.reveal {
    opacity: 0;
    transform: translateY(34px) scale(0.985);
    transition: opacity 720ms ease, transform 720ms ease;
}

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

.parallax {
    transform: translateY(var(--parallax-offset, 0px));
    transition: transform 120ms linear;
}

.login-page {
    display: grid;
    place-items: center;
    padding: 28px;
}

.login-shell {
    width: min(1120px, 100%);
}

.login-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
    gap: 24px;
    padding: 28px;
    border-radius: 34px;
}

.login-copy {
    display: grid;
    align-content: center;
    gap: 18px;
}

.login-copy h1 {
    margin: 0;
    font-size: clamp(2.4rem, 5vw, 4.6rem);
    line-height: 0.92;
}

.login-copy p {
    margin: 0;
    max-width: 56ch;
    line-height: 1.75;
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 14px;
    padding: 22px;
    border-radius: 30px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.14);
}

.primary-button {
    min-height: 50px;
    padding: 0 20px;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--ocean), #0d647d);
}

.wide-button {
    width: 100%;
}

.flash-banner {
    padding: 0.95rem 1rem;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.18);
}

.flash-banner.is-error {
    color: var(--ember);
    border-color: rgba(237, 97, 66, 0.24);
}

.empty-state {
    padding: 18px;
    border-radius: 20px;
    border: 1px dashed var(--line-strong);
    text-align: center;
    color: var(--muted);
}

@media (max-width: 1180px) {
    .is-editor-mode .site-shell {
        grid-template-columns: 1fr;
    }

    .editor-dock {
        position: static;
        max-height: none;
    }

    .hero-section,
    .showcase-card,
    .login-panel {
        grid-template-columns: 1fr;
    }

    .showcase-card.is-website-layout {
        grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    }
}

@media (max-width: 860px) {
    .site-shell {
        width: min(100vw - 18px, 100%);
        padding: 12px 0 32px;
    }

    .site-topbar {
        top: 8px;
        border-radius: 24px;
        padding: 16px;
    }

    .hero-copy,
    .hero-preview,
    .ticker-band,
    .filter-bar,
    .statement-card,
    .showcase-card,
    .footer-panel,
    .editor-dock {
        border-radius: 28px;
        padding: 18px;
    }

    .hero-copy,
    .hero-preview {
        min-height: auto;
    }

    .hero-preview {
        grid-template-columns: 1fr;
        grid-template-rows: none;
    }

    .showcase-card.is-website-layout .module-toolbar {
        justify-content: flex-start;
    }

    .showcase-card.is-website-layout {
        grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr);
    }

    .stage-button {
        min-height: 320px;
    }

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

    .filter-bar {
        align-items: flex-start;
    }

    .field-grid {
        grid-template-columns: 1fr;
    }

    .lightbox-panel {
        width: min(100vw - 14px, 100%);
        padding: 14px;
        border-radius: 26px;
    }

    .lightbox-media {
        min-height: 0;
    }

    .lightbox-media img,
    .lightbox-media video {
        height: min(58vh, 620px);
    }
}

@media (max-width: 560px) {
    .topbar-actions,
    .hero-actions,
    .module-actions,
    .editor-button-row,
    .device-switch,
    .lightbox-head,
    .footer-panel {
        align-items: stretch;
    }

    .pill-button,
    .outline-button,
    .soft-button,
    .primary-button {
        width: 100%;
    }

    .site-shell {
        width: min(100vw - 12px, 100%);
        padding-top: 8px;
    }

    .site-topbar {
        top: 8px;
        z-index: 60;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 14px;
        padding: 14px;
        border-radius: 22px;
    }

    .site-topbar .brand-lockup {
        width: 100%;
        gap: 12px;
    }

    .site-topbar .brand-mark {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }

    .site-topbar .topbar-actions {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
        scroll-snap-type: x proximity;
    }

    .site-topbar .topbar-actions > * {
        flex: 0 0 auto;
        scroll-snap-align: start;
    }

    .site-topbar .outline-button,
    .site-topbar .soft-button {
        width: auto;
        min-width: max-content;
    }

    .hero-stats {
        grid-template-columns: 1fr;
    }

    .module-toolbar {
        align-items: flex-start;
    }

    .device-switch {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .device-switch .mini-button {
        flex: 0 0 auto;
    }

    .stage-button {
        min-height: 240px;
        border-radius: 22px;
    }

    .stage-overlay {
        inset-inline: 12px;
        bottom: 12px;
        padding: 12px 14px;
    }

    .media-strip {
        gap: 10px;
    }

    .showcase-card.is-website-layout {
        grid-template-columns: 1fr;
    }

    .thumb-button {
        flex-basis: 164px;
    }

    .lightbox-thumb {
        flex-basis: 132px;
    }

    .browser-shell.is-mobile {
        width: 100%;
    }

    .browser-top {
        padding: 12px;
    }

    .browser-url {
        font-size: 0.84rem;
        padding: 0.65rem 0.8rem;
    }

    .library-item {
        grid-template-columns: 48px minmax(0, 1fr);
    }

    .library-copy {
        grid-column: 1 / -1;
        max-width: none;
    }
}
