@font-face {
    font-family: "Libertinus Serif";
    src: url("/static/LibertinusSerif-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --background: #f4f2ed;
    --text: #333;
    --muted: #777;
}

* {
    box-sizing: border-box;
}

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

body {
    min-height: 100vh;
    padding: 0 clamp(16px, 5vw, 48px);
    background: var(--background);
    color: var(--text);

    font-family: "Libertinus Serif", serif;
}

.main {
    width: min(100%, 680px);
    min-height: calc(100vh - 48px);

    margin: 0 auto;
    padding: 4px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    gap: 48px;
}

.image {
    display: block;

    width: min(100%, 600px);
    height: auto;

    border-radius: 12px;
}

.message {
    width: 100%;
    max-width: 650px;

    margin: 0;

    font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: 1.2;

    text-align: center;
}

.source-block {
    width: 100%;
    max-width: 600px;
    margin-top: -32px;
    text-align: right;
}

.source-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: color 160ms ease;
}

.source-label:hover,
.source-label:focus-visible {
    color: #514a40;
}

.source-label:focus-visible {
    outline: 2px solid #86745c;
    outline-offset: 3px;
}

.source-label-copy {
    display: grid;
    justify-items: end;
    gap: 2px;
}

.source-label-main {
    font-size: .95rem;
    line-height: 1.2;
}

.source-label-prompt {
    color: #918675;
    font-size: .78rem;
    line-height: 1.2;
    text-decoration: underline dotted;
    text-underline-offset: 3px;
}

.source-label-chevron {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    color: #918675;
    transition: transform 160ms ease;
}

.source-label[aria-expanded="true"] .source-label-chevron {
    transform: rotate(180deg);
}

.source-details {
    display: grid;
    width: fit-content;
    max-width: 100%;
    margin: 8px 0 0 auto;
    padding: 7px 0 0;
    border-top: 1px solid rgb(70 58 42 / 12%);
    color: var(--text);
    text-align: right;
}

.source-details[hidden] {
    display: none;
}

.source-detail {
    display: grid;
    grid-template-columns: minmax(76px, auto) minmax(0, 1fr);
    gap: 8px 12px;
    align-items: baseline;
    padding: 2px 0;
}

.source-detail dt {
    color: #9a9081;
    font-family: sans-serif;
    font-size: .66rem;
    letter-spacing: .045em;
}

.source-detail dd {
    min-width: 0;
    margin: 0;
    color: #6c655b;
    font-size: .88rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.action {
    width: 32px;
    height: 32px;

    padding: 0;

    border: 0;
    background: transparent;

    color: #555;

    font: inherit;
    font-size: 1.5rem;

    cursor: pointer;

    border-radius: 50%;

    transition:
        background 150ms ease,
        color 150ms ease,
        transform 150ms ease;
}

.action:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #222;
    opacity: 1;
}

.action:active {
    transform: scale(0.92);
    transition: 250ms ease;
}

.next {
    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 6px;

    color: #888;
}

.next-label {
    font-size: 0.7rem;
}

.faded {
    opacity: 0.5;
}

.active {
    opacity: 0.9;
    transition: ease-in 180ms;
    transform: scale(1.2);
}

.active svg {
    border-bottom: 2px solid #333;
}

.active .heart-button {
    stroke: #333;
}

.active .dislike-button {
    stroke: #333;
}

.action.share {
    transition:
        color 180ms ease,
        transform 180ms ease;
}

@keyframes sharePulse {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.action.share.copied {
    animation: sharePulse 900ms ease-in-out;
}

.share-link {
    width: 100%;
    max-width: 500px;
}

.share-link input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.9rem;
}

.menu-btn {
    z-index: 30;
    position: fixed;
    left: max(16px, env(safe-area-inset-left));
    top: max(16px, env(safe-area-inset-top));
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    background: rgb(255 255 255 / 72%);
    border: 1px solid rgb(40 35 29 / 9%);
    box-shadow: 0 4px 18px rgb(35 29 22 / 8%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.menu-content {
    z-index: 25;
    position: fixed;
    inset: 0 auto 0 0;
    width: min(340px, calc(100vw - 52px));
    padding: max(88px, calc(env(safe-area-inset-top) + 76px)) 28px 28px;
    color: var(--text);
    background: rgb(250 248 244 / 88%);
    border-right: 1px solid rgb(70 58 42 / 9%);
    box-shadow: 20px 0 70px rgb(35 29 22 / 14%);
    backdrop-filter: blur(24px) saturate(125%);
    -webkit-backdrop-filter: blur(24px) saturate(125%);
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform 240ms cubic-bezier(.2,.75,.25,1), visibility 240ms;
}

.menu-content.collapsed {
    transform: translateX(0);
    visibility: visible;
}

.menu-heading {
    margin: 0 0 34px;
    color: #817768;
    font-size: .78rem;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.menu-content ul {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
}

.menu-content li {
    list-style: none;
    color: #4a443b;
    font-size: 1.2rem;
}

.menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease;
}

.menu-item:hover,
.menu-item:focus-visible {
    background: rgb(73 62 46 / 7%);
    transform: translateX(3px);
}

.menu-item:focus-visible {
    outline: 2px solid #86745c;
    outline-offset: 2px;
}

.menu-arrow {
    margin-left: auto;
    color: #8b8172;
    font-family: sans-serif;
    font-size: 1rem;
}

.about-dialog {
    width: min(440px, calc(100vw - 32px));
    padding: 28px;
    border: 1px solid rgb(70 58 42 / 12%);
    border-radius: 20px;
    background: #faf8f4;
    color: var(--text);
    box-shadow: 0 24px 80px rgb(24 22 19 / 22%);
    font-family: "Libertinus Serif", serif;
}

.about-dialog::backdrop {
    background: rgb(24 22 19 / 38%);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.about-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.about-dialog h2 {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 400;
}

.about-dialog p {
    margin: 18px 0 0;
    color: #5f594f;
    font-size: 1.15rem;
    line-height: 1.55;
}

.about-close {
    display: grid;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgb(73 62 46 / 7%);
    color: inherit;
    font: 1.5rem/1 sans-serif;
    cursor: pointer;
}

.about-close:hover,
.about-close:focus-visible {
    background: rgb(73 62 46 / 13%);
}

.feedback-form {
    display: grid;
    gap: 14px;
}

.feedback-label {
    margin-top: 8px;
    color: #5f594f;
    font-size: 1rem;
}

.feedback-form textarea {
    width: 100%;
    min-height: 130px;
    resize: vertical;
    padding: 12px 14px;
    border: 1px solid rgb(70 58 42 / 18%);
    border-radius: 12px;
    background: rgb(255 255 255 / 62%);
    color: var(--text);
    font: inherit;
    font-size: 1rem;
    line-height: 1.5;
}

.feedback-form textarea:focus-visible {
    outline: 2px solid #86745c;
    outline-offset: 2px;
}

.feedback-submit {
    justify-self: end;
    min-height: 44px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: #687761;
    color: white;
    font: inherit;
    cursor: pointer;
}

.feedback-submit:hover {
    background: #56634f;
}

.feedback-submit:disabled {
    cursor: wait;
    opacity: .6;
}

.feedback-status {
    min-height: 1.4em;
    margin: 0;
    color: #687761;
    font-size: .95rem;
}

.feedback-honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.zen-indicator {
    position: relative;
    flex: 0 0 38px;
    width: 38px;
    height: 22px;
    border: 1px solid rgb(70 58 42 / 18%);
    border-radius: 999px;
    background: rgb(70 58 42 / 10%);
    transition: background 180ms ease, border-color 180ms ease;
}

.zen-indicator::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgb(0 0 0 / 20%);
    content: "";
    transition: transform 180ms ease;
}

.zen-toggle[aria-pressed="true"] .zen-indicator {
    border-color: #64735e;
    background: #74836d;
}

.zen-toggle[aria-pressed="true"] .zen-indicator::after {
    transform: translateX(16px);
}

.zen-toggle[aria-pressed="true"] {
    background: rgb(116 131 109 / 12%);
}

.zen-mode .source-block,
.zen-mode .actions,
.zen-mode .share-link,
.zen-mode .next {
    display: none;
}

.menu-backdrop:not([hidden]) {
    position: fixed;
    z-index: 20;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgb(24 22 19 / 28%);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    cursor: default;
}

.menu-btn:focus-visible {
    outline: 2px solid #86745c;
    outline-offset: 3px;
}

@media (max-width: 600px) {
    .main {
        min-height: 100vh;
        min-height: 100svh;
        gap: clamp(22px, 5vh, 38px);
        padding: 76px 0 28px;
    }

    .image {
        border-radius: 10px;
    }

    .message {
        font-size: clamp(1.65rem, 7vw, 2.25rem);
        line-height: 1.25;
    }

    .source-block {
        margin-top: -14px;
    }

    .actions {
        gap: 28px;
    }
}

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

.not-found {
    width: min(100%, 520px);
    gap: 18px;
    text-align: center;
}

.not-found-code {
    margin: -6px 0 0;
    color: #938876;
    font-family: sans-serif;
    font-size: .8rem;
    letter-spacing: .22em;
}

.not-found h1 {
    margin: 0;
    font-size: clamp(2rem, 7vw, 3.25rem);
    font-weight: 400;
    line-height: 1.15;
}

.not-found-copy {
    margin: 0;
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1.5;
}

.error-request-id {
    margin: 0;
    color: var(--muted);
    font-family: sans-serif;
    font-size: .75rem;
    overflow-wrap: anywhere;
}

.not-found-link {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    margin-top: 8px;
    padding: 0 22px;
    border: 1px solid rgb(70 58 42 / 15%);
    border-radius: 999px;
    color: var(--text);
    text-decoration: none;
    transition: background 160ms ease, transform 160ms ease;
}

.not-found-link:hover,
.not-found-link:focus-visible {
    transform: translateY(-1px);
    background: rgb(73 62 46 / 7%);
}

.icon {
    width: 46px;
    height: 46px;
}
