:root {
    --bg-top: #24323a;
    --bg-bottom: #ecdab8;
    --surface: rgba(246, 238, 221, 0.86);
    --surface-strong: #f6ead2;
    --surface-dark: rgba(24, 33, 38, 0.76);
    --text: #1f2529;
    --muted: #50585c;
    --accent: #a16055;
    --accent-strong: #7a4b43;
    --accent-soft: #e6c3a8;
    --border: rgba(84, 68, 58, 0.14);
    --shadow: 0 20px 42px rgba(43, 51, 57, 0.14);
    --shadow-soft: 0 12px 26px rgba(43, 51, 57, 0.1);
    --radius-lg: 22px;
    --radius-md: 16px;
    --max-width: 1120px;
    --focus-ring: #c48263;
    --font-display: "Avenir Next", "Segoe UI", sans-serif;
    --font-body: "Avenir", "Helvetica Neue", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    background:
        radial-gradient(circle at top, rgba(255, 218, 176, 0.16), transparent 34%),
        linear-gradient(180deg, var(--bg-top) 0, #41515a 18%, var(--bg-bottom) 18%, #f1e3c9 100%);
    color: var(--text);
    font-family: var(--font-body);
    margin: 0;
    min-height: 100vh;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
}

[hidden] {
    display: none !important;
}

.site-header {
    backdrop-filter: blur(16px);
    background: rgba(22, 31, 36, 0.68);
    border-bottom: 1px solid rgba(255, 232, 198, 0.08);
    position: sticky;
    top: 0;
    z-index: 20;
}

.site-header__inner {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin: 0 auto;
    max-width: var(--max-width);
    padding: 14px 18px;
}

.site-brand {
    color: #f7ebd7;
    font-family: var(--font-display);
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-decoration: none;
    text-transform: uppercase;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.site-nav a {
    border: 1px solid rgba(255, 232, 201, 0.16);
    border-radius: 999px;
    color: rgba(249, 238, 221, 0.96);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 9px 14px;
    text-decoration: none;
}

.site-nav a[aria-current="page"] {
    background: rgba(161, 96, 85, 0.18);
    border-color: rgba(255, 226, 191, 0.24);
}

.page-shell {
    margin: 0 auto;
    max-width: var(--max-width);
    padding: 24px 18px 36px;
}

.page-header {
    margin-bottom: 20px;
    max-width: 720px;
}

.page-kicker {
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    margin: 0 0 10px;
    text-transform: uppercase;
}

.page-header h1,
.home-hero h1,
.error-shell h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 4rem);
    letter-spacing: -0.03em;
    line-height: 0.95;
    margin: 0;
}

.page-lede,
.home-hero p,
.error-shell p,
.tool-intro {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.55;
    margin: 12px 0 0;
}

.status-message,
.error-message {
    border-radius: 999px;
    display: inline-block;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    margin: 0 0 18px;
    padding: 10px 14px;
}

.status-message {
    background: rgba(246, 238, 221, 0.78);
    border: 1px solid var(--border);
    color: var(--muted);
}

.error-message[data-state="error"] {
    background: rgba(138, 34, 34, 0.1);
    border: 1px solid rgba(138, 34, 34, 0.16);
    color: #7a1f1f;
}

.home-shell {
    padding-top: 34px;
}

.home-hero {
    background:
        linear-gradient(145deg, rgba(247, 239, 223, 0.94), rgba(233, 212, 185, 0.74)),
        linear-gradient(120deg, rgba(161, 96, 85, 0.14), rgba(255, 255, 255, 0));
    border: 1px solid rgba(255, 243, 223, 0.44);
    border-radius: 28px;
    box-shadow: var(--shadow);
    overflow: hidden;
    padding: 34px;
    position: relative;
}

.home-hero::after {
    background: radial-gradient(circle at center, rgba(161, 96, 85, 0.2), transparent 68%);
    content: "";
    inset: auto -12% -42% auto;
    position: absolute;
    width: 340px;
    height: 340px;
}

.home-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-top: 22px;
}

.home-card {
    background: var(--surface);
    border: 1px solid rgba(255, 245, 227, 0.42);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    min-height: 180px;
    padding: 22px;
    position: relative;
    text-decoration: none;
}

.home-card h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    margin: 0;
}

.home-card p {
    color: var(--muted);
    line-height: 1.5;
    margin: 10px 0 0;
}

.home-card span {
    color: var(--accent);
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    margin-top: 18px;
    text-transform: uppercase;
}

.tool-shell,
.error-shell {
    background: var(--surface);
    border: 1px solid rgba(255, 245, 227, 0.45);
    border-radius: 28px;
    box-shadow: var(--shadow);
    margin: 28px auto 0;
    max-width: 760px;
    padding: 28px;
}

.search-form {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.search-form label {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.search-form input,
.search-form button {
    border-radius: 14px;
    font: inherit;
}

.search-form input {
    background: rgba(251, 246, 236, 0.9);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 14px 16px;
}

.search-form button {
    background: var(--accent);
    border: 0;
    color: #f8f3e6;
    cursor: pointer;
    font-weight: 700;
    padding: 14px 18px;
}

.poster-result {
    align-items: center;
    display: grid;
    gap: 16px;
    justify-items: center;
    margin-top: 24px;
}

.poster-frame {
    background: var(--surface-strong);
    border: 1px solid rgba(255, 244, 225, 0.5);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    padding: 12px;
    width: min(100%, 360px);
}

.poster-frame img {
    border-radius: 14px;
    display: block;
    width: 100%;
}

.loading-pill {
    background: rgba(161, 96, 85, 0.08);
    border: 1px solid rgba(161, 96, 85, 0.12);
    border-radius: 999px;
    color: var(--accent);
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 9px 14px;
    text-transform: uppercase;
}

.error-shell__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.button-link {
    background: var(--accent);
    border-radius: 999px;
    color: #f8f3e6;
    display: inline-block;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    text-decoration: none;
}

.button-link.secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--accent);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
[role="button"]:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 4px;
}

@media (max-width: 720px) {
    .site-header__inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .home-hero,
    .tool-shell,
    .error-shell {
        padding: 22px;
    }

    .page-shell {
        padding: 22px 14px 30px;
    }
}
