:root {
    color-scheme: light;
    --ink: #1f2824;
    --ink-soft: #5e6963;
    --paper: #f4f1e8;
    --paper-deep: #e9e4d7;
    --surface: #fffdf7;
    --line: rgba(31, 40, 36, 0.14);
    --shadow: 0 18px 48px rgba(43, 50, 43, 0.10);
    --idea: #f5d768;
    --idea-soft: #fff3b9;
    --win: #8fcf9e;
    --win-soft: #d9f0da;
    --blocker: #ef8c78;
    --blocker-soft: #fbd8cf;
    --fyi: #87bde7;
    --fyi-soft: #d8ebf8;
    --fun: #b99adf;
    --fun-soft: #eadcf7;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--paper);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 5%, rgba(245, 215, 104, 0.16), transparent 24rem),
        radial-gradient(circle at 92% 26%, rgba(135, 189, 231, 0.13), transparent 26rem),
        var(--paper);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

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

button,
a,
input,
textarea,
select {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(38, 95, 72, 0.28);
    outline-offset: 3px;
}

.site-shell {
    width: min(1240px, calc(100% - 48px));
    margin: 0 auto;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 92px;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.brand-mark {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    width: 28px;
    height: 28px;
    padding: 5px;
    border-radius: 9px;
    background: var(--ink);
}

.brand-mark span {
    width: 4px;
    border-radius: 3px;
    background: var(--paper);
}

.brand-mark span:nth-child(1) { height: 8px; }
.brand-mark span:nth-child(2) { height: 16px; }
.brand-mark span:nth-child(3) { height: 12px; }

.primary-button,
.secondary-button,
.danger-button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.primary-button {
    color: #fffdf7;
    background: var(--ink);
    box-shadow: 0 9px 24px rgba(31, 40, 36, 0.18);
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover {
    transform: translateY(-2px);
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled {
    cursor: wait;
    opacity: 0.6;
    transform: none;
}

.secondary-button {
    color: var(--ink);
    border-color: var(--line);
    background: transparent;
}

.danger-button {
    color: #fff;
    background: #a64032;
}

.hero {
    max-width: 850px;
    padding: 96px 0 84px;
}

.eyebrow,
.section-kicker {
    margin: 0 0 13px;
    color: var(--ink-soft);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero h1 {
    max-width: 800px;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(3.6rem, 8vw, 7.2rem);
    font-weight: 400;
    letter-spacing: -0.065em;
    line-height: 0.88;
}

.hero-copy {
    max-width: 620px;
    margin: 34px 0 0;
    color: var(--ink-soft);
    font-size: clamp(1.08rem, 2vw, 1.35rem);
    line-height: 1.65;
}

.wall-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 38px;
    color: var(--ink-soft);
    font-size: 0.84rem;
    font-weight: 650;
}

.summary-separator {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--ink-soft);
    opacity: 0.55;
}

.wall-section {
    padding: 38px 0 90px;
    border-top: 1px solid var(--line);
}

.wall-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 38px;
}

.wall-toolbar h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 4vw, 3.1rem);
    font-weight: 400;
    letter-spacing: -0.045em;
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.filter-button {
    min-height: 38px;
    padding: 0 14px;
    color: var(--ink-soft);
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.filter-button:hover {
    color: var(--ink);
    border-color: var(--line);
}

.filter-button.is-active {
    color: var(--surface);
    background: var(--ink);
}

.signal-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    align-items: start;
}

.signal-card {
    --category: var(--idea);
    --category-soft: var(--idea-soft);
    position: relative;
    min-width: 0;
    padding: 24px;
    overflow: hidden;
    border: 1px solid rgba(31, 40, 36, 0.12);
    border-radius: 5px 22px 6px 18px;
    background: var(--category-soft);
    box-shadow: 0 10px 28px rgba(58, 61, 48, 0.08);
    transform: rotate(-0.25deg);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.signal-card:nth-child(3n + 2) {
    border-radius: 20px 5px 18px 7px;
    transform: rotate(0.35deg);
}

.signal-card:nth-child(4n) {
    transform: rotate(-0.45deg);
}

.signal-card:hover {
    z-index: 1;
    box-shadow: var(--shadow);
    transform: rotate(0) translateY(-4px);
}

.signal-card.category-win { --category: var(--win); --category-soft: var(--win-soft); }
.signal-card.category-blocker { --category: var(--blocker); --category-soft: var(--blocker-soft); }
.signal-card.category-fyi { --category: var(--fyi); --category-soft: var(--fyi-soft); }
.signal-card.category-fun { --category: var(--fun); --category-soft: var(--fun-soft); }

.signal-card.is-pinned::after {
    position: absolute;
    top: 0;
    left: 24px;
    width: 42px;
    height: 4px;
    border-radius: 0 0 4px 4px;
    background: var(--ink);
    content: "";
}

.signal-card-topline,
.card-footer,
.card-actions {
    display: flex;
    align-items: center;
}

.signal-card-topline {
    justify-content: space-between;
    margin-bottom: 32px;
}

.category-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: rgba(31, 40, 36, 0.76);
    font-size: 0.7rem;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.category-label::before {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--category);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.28);
    content: "";
}

.pin-button,
.icon-button,
.lightbox-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.pin-button {
    width: 36px;
    height: 36px;
    color: rgba(31, 40, 36, 0.55);
    border-radius: 50%;
    font-size: 1.25rem;
    transition: background 140ms ease, color 140ms ease;
}

.pin-button:hover,
.pin-button[aria-pressed="true"] {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.38);
}

.card-image-button {
    display: block;
    width: calc(100% + 48px);
    margin: -15px -24px 24px;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.card-image-button[hidden] {
    display: none;
}

.card-image {
    display: block;
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    transition: transform 240ms ease;
}

.card-image-button:hover .card-image {
    transform: scale(1.025);
}

.card-title {
    margin: 0;
    overflow-wrap: anywhere;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.55rem, 3vw, 2.1rem);
    font-weight: 400;
    letter-spacing: -0.035em;
    line-height: 1.08;
}

.card-description {
    margin: 18px 0 0;
    color: rgba(31, 40, 36, 0.72);
    line-height: 1.62;
    white-space: pre-line;
}

.card-description:empty {
    display: none;
}

.card-footer {
    justify-content: space-between;
    gap: 18px;
    margin-top: 34px;
    padding-top: 17px;
    border-top: 1px solid rgba(31, 40, 36, 0.12);
}

.card-author,
.card-time {
    display: block;
    font-size: 0.76rem;
}

.card-author {
    font-weight: 800;
}

.card-time {
    margin-top: 4px;
    color: rgba(31, 40, 36, 0.56);
}

.card-actions {
    gap: 4px;
}

.card-action,
.text-button {
    padding: 6px 7px;
    color: rgba(31, 40, 36, 0.65);
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 0.74rem;
    font-weight: 750;
}

.card-action:hover,
.text-button:hover {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.signal-skeleton {
    min-height: 260px;
    border-radius: 5px 22px 6px 18px;
    background: linear-gradient(100deg, var(--paper-deep) 20%, #f8f5ed 45%, var(--paper-deep) 70%);
    background-size: 220% 100%;
    animation: shimmer 1.5s infinite linear;
}

.signal-skeleton-tall {
    min-height: 360px;
}

@keyframes shimmer {
    to { background-position-x: -220%; }
}

.empty-state {
    max-width: 560px;
    margin: 50px auto 20px;
    padding: 60px 30px;
    text-align: center;
}

.empty-mark {
    display: block;
    margin-bottom: 18px;
    font-size: 2rem;
}

.empty-state h3 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.2rem;
    font-weight: 400;
}

.empty-state p {
    margin: 13px auto 25px;
    color: var(--ink-soft);
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 28px 0 40px;
    color: var(--ink-soft);
    border-top: 1px solid var(--line);
    font-size: 0.76rem;
}

dialog {
    color: var(--ink);
}

dialog::backdrop {
    background: rgba(23, 28, 25, 0.55);
    backdrop-filter: blur(5px);
}

.signal-dialog {
    width: min(680px, calc(100% - 30px));
    max-height: calc(100vh - 30px);
    padding: 0;
    overflow: auto;
    border: 0;
    border-radius: 24px;
    background: var(--surface);
    box-shadow: 0 30px 90px rgba(15, 20, 17, 0.35);
}

.signal-dialog form {
    padding: 30px;
}

.dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.dialog-header h2,
.confirm-dialog h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.8rem, 5vw, 2.7rem);
    font-weight: 400;
    letter-spacing: -0.04em;
    line-height: 1.05;
}

.icon-button {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    color: var(--ink-soft);
    border-radius: 50%;
    background: var(--paper);
    font-size: 1.5rem;
}

.form-alert {
    margin: 0 0 22px;
    padding: 13px 15px;
    color: #7b2e24;
    border-radius: 12px;
    background: #fbe2dc;
    font-size: 0.84rem;
    line-height: 1.5;
}

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

.field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 8px;
}

.field-wide {
    grid-column: 1 / -1;
}

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

.field em {
    color: var(--ink-soft);
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 500;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fffefb;
}

.field input,
.field select {
    min-height: 48px;
    padding: 0 13px;
}

.field textarea {
    min-height: 112px;
    padding: 13px;
    resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
    color: #939b96;
}

.field small {
    color: var(--ink-soft);
    font-size: 0.72rem;
    line-height: 1.4;
}

.image-drop {
    display: grid;
    min-height: 132px;
    place-items: center;
    align-content: center;
    gap: 5px;
    padding: 18px;
    border: 1px dashed rgba(31, 40, 36, 0.3);
    border-radius: 14px;
    background: var(--paper);
    cursor: pointer;
    text-align: center;
    transition: border-color 150ms ease, background 150ms ease;
}

.image-drop:hover {
    border-color: var(--ink);
    background: #efebe0;
}

.image-drop input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.image-drop-icon {
    font-size: 1.5rem;
}

.image-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
}

.image-preview[hidden] {
    display: none;
}

.image-preview img {
    width: 86px;
    height: 68px;
    border-radius: 10px;
    object-fit: cover;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 30px;
}

.confirm-dialog {
    width: min(450px, calc(100% - 30px));
    padding: 0;
    border: 0;
    border-radius: 22px;
    background: var(--surface);
    box-shadow: 0 30px 90px rgba(15, 20, 17, 0.35);
}

.confirm-content {
    padding: 34px;
}

.confirm-mark {
    display: grid;
    width: 44px;
    height: 44px;
    margin-bottom: 24px;
    place-items: center;
    color: #862f24;
    border-radius: 50%;
    background: #fbd8cf;
    font-size: 1.35rem;
}

.confirm-dialog p:not(.section-kicker) {
    margin: 15px 0 0;
    color: var(--ink-soft);
    line-height: 1.55;
}

.lightbox {
    max-width: calc(100% - 30px);
    max-height: calc(100vh - 30px);
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
}

.lightbox img {
    display: block;
    max-width: min(1100px, calc(100vw - 46px));
    max-height: calc(100vh - 46px);
    border-radius: 16px;
    object-fit: contain;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
}

.lightbox-close {
    position: absolute;
    z-index: 1;
    top: -14px;
    right: -14px;
    width: 38px;
    height: 38px;
    color: var(--ink);
    border-radius: 50%;
    background: var(--surface);
    font-size: 1.3rem;
}

.toast-region {
    position: fixed;
    z-index: 20;
    right: 22px;
    bottom: 22px;
    display: grid;
    gap: 9px;
    width: min(360px, calc(100% - 44px));
}

.toast {
    padding: 14px 16px;
    color: var(--surface);
    border-radius: 13px;
    background: var(--ink);
    box-shadow: var(--shadow);
    font-size: 0.84rem;
    font-weight: 650;
    animation: toast-in 180ms ease both;
}

.toast.is-error {
    background: #8d382d;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
}

@media (max-width: 900px) {
    .signal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wall-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .category-filters {
        justify-content: flex-start;
    }
}

@media (max-width: 620px) {
    .site-shell {
        width: min(100% - 28px, 1240px);
    }

    .site-header {
        min-height: 76px;
    }

    .site-header .primary-button {
        min-height: 40px;
        padding: 0 14px;
        font-size: 0.78rem;
    }

    .hero {
        padding: 70px 0 62px;
    }

    .hero h1 {
        font-size: clamp(3.2rem, 17vw, 5rem);
    }

    .hero-copy {
        margin-top: 25px;
        font-size: 1rem;
    }

    .wall-summary,
    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .summary-separator {
        display: none;
    }

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

    .category-filters {
        width: 100%;
        flex-wrap: nowrap;
        justify-content: flex-start;
        padding-bottom: 5px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .category-filters::-webkit-scrollbar {
        display: none;
    }

    .filter-button {
        flex: 0 0 auto;
    }

    .signal-dialog form,
    .confirm-content {
        padding: 23px;
    }

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

    .field-wide {
        grid-column: auto;
    }

    .dialog-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .site-footer {
        gap: 7px;
    }
}

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