@font-face {
    font-family: 'EB Garamond';
    src: url('fonts/EBGaramond-VariableFont_wght.woff2') format('woff2');
    font-weight: 400 800;
    font-display: swap;
}

:root {
    --page: #f6efe2;
    --surface: #fffaf1;
    --ink: #2d2118;
    --muted: #6f5b48;
    --brand: #8c4f2e;
    --brand-strong: #673a24;
    --border: #d8c2a5;
    --error: #8a1738;
    --telegram: #0074a6;
    --telegram-hover: #00618a;
    --vk: #0067dc;
    --vk-hover: #0058bd;
    --sans: system-ui, -apple-system, 'Segoe UI', sans-serif;
    --serif: 'EB Garamond', Georgia, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    margin: 0;
    color: var(--ink);
    background-color: var(--page);
    background-image: linear-gradient(#f6efe2e8, #f6efe2e8), url('img/paper.jpg');
    background-size: auto, 720px 405px;
    font: 16px/1.55 var(--sans);
}

.page { width: min(1080px, calc(100% - 64px)); margin-inline: auto; }
main {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: center;
    min-height: 100svh;
    gap: clamp(36px, 7vw, 96px);
    padding-block: 56px;
}

.brand-logo { display: block; width: 170px; height: auto; margin-bottom: 26px; }
h1, h2 { font: 600 34px/1.05 var(--serif); margin: 0; }
h1 { font-size: clamp(52px, 6.4vw, 88px); max-width: 8.5ch; }
.description { margin: 20px 0 0; max-width: 39ch; color: var(--muted); }
main:has(#form-panel[hidden]) .description { display: none; }

.panel {
    padding: 34px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 12px 40px #673a2410;
}

.form-title { margin-bottom: 24px; }
.field { margin-bottom: 17px; }
label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
input {
    width: 100%;
    min-height: 52px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fffdf8;
    color: var(--ink);
    font: inherit;
}
input::placeholder { color: var(--muted); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

.primary-button, .channel-link {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 52px;
    padding: 12px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
    font: 600 15px/1.5 var(--sans);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 160ms;
}

.primary-button { margin-top: 24px; }
.primary-button:hover:enabled { background: var(--brand-strong); }
.primary-button:disabled { opacity: .65; cursor: default; }
.primary-button span:last-child, .channel-link span { font-size: 19px; }
.privacy, .channel-note { color: var(--muted); font-size: 13px; margin: 16px 0 0; }
.privacy a { color: inherit; text-underline-offset: 3px; }
.honeypot { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
.error { color: var(--error); font-size: 14px; margin: 14px 0 0; }

.success-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 18px;
    border-radius: 50%;
    background: #e9eee1;
    color: #3d542e;
    font-size: 22px;
}
.panel-description { color: var(--muted); margin: 12px 0 22px; }
.channel-links { display: grid; gap: 10px; }
.channel-links:empty { display: none; }
.channel-link[data-channel='telegram'] { background: var(--telegram); }
.channel-link[data-channel='telegram']:hover { background: var(--telegram-hover); }
.channel-link[data-channel='vk'] { background: var(--vk); }
.channel-link[data-channel='vk']:hover { background: var(--vk-hover); }

@media (max-width: 740px) {
    .page { width: min(500px, calc(100% - 36px)); }
    main { grid-template-columns: minmax(0, 1fr); min-height: auto; padding-block: 28px 32px; gap: 24px; }
    .brand-logo { width: 150px; margin-bottom: 16px; }
    h1 { font-size: clamp(43px, 10vw, 58px); }
    .description { margin-top: 12px; }
    .panel { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    .primary-button, .channel-link { transition: none; }
}
