@font-face {
    font-family: "P22 Typewriter";
    src: url("/fonts/p22-typewriter-regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --line: rgba(17, 17, 17, 0.1);
    --text: #121212;
    --muted: #626262;
    --shadow-soft: 0 16px 40px rgba(15, 15, 15, 0.05);
    --menu-surface: rgba(255, 255, 255, 0.96);
    --card-surface: #f7f7f4;
    --button-surface: #ffffff;
    --hover-surface: rgba(17, 17, 17, 0.035);
    --accent-surface: linear-gradient(180deg, #fbfbf8 0%, #f1f1ec 100%);
}

body.dark-mode {
    --bg: #0c0c0d;
    --surface: #121214;
    --line: rgba(255, 255, 255, 0.12);
    --text: #f3f3f1;
    --muted: #a8a8a1;
    --shadow-soft: 0 22px 54px rgba(0, 0, 0, 0.42);
    --menu-surface: rgba(18, 18, 20, 0.96);
    --card-surface: #171719;
    --button-surface: #151517;
    --hover-surface: rgba(255, 255, 255, 0.045);
    --accent-surface: linear-gradient(180deg, #171719 0%, #121214 100%);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "P22 Typewriter", monospace;
    scroll-behavior: smooth;
    color: var(--text);
    background: var(--bg);
}

body {
    overflow-x: hidden;
    transition: background-color 180ms ease, color 180ms ease;
}

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

a {
    color: inherit;
}

.page-shell {
    width: min(1280px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 96px 0 24px;
}

.page-nav {
    position: absolute;
    top: 16px;
    right: 16px;
    left: auto;
    width: auto;
    z-index: 1200;
}

.nav-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.menu-toggle {
    display: none;
}

.theme-toggle,
.menu-icon,
.submit-button,
.scroll-top {
    border: 1px solid var(--line);
    background: var(--button-surface);
    color: var(--text);
    box-shadow: var(--shadow-soft);
}

.theme-toggle {
    min-width: 64px;
    padding: 11px 14px;
    cursor: pointer;
}

.menu-icon {
    width: 46px;
    height: 46px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 0 11px;
    cursor: pointer;
}

.menu-icon span {
    display: block;
    width: 100%;
    height: 1.5px;
    background: currentColor;
    transition: transform 180ms ease, opacity 180ms ease;
}

#menu-toggle:checked + .nav-actions .menu-icon span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

#menu-toggle:checked + .nav-actions .menu-icon span:nth-child(2) {
    opacity: 0;
}

#menu-toggle:checked + .nav-actions .menu-icon span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

.menu {
    margin: 12px 0 0;
    padding: 12px;
    list-style: none;
    border: 1px solid var(--line);
    background: var(--menu-surface);
    box-shadow: var(--shadow-soft);
    display: grid;
    gap: 8px;
    min-width: 180px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.menu a {
    display: block;
    padding: 8px 10px;
    text-decoration: none;
}

#menu-toggle:checked ~ .menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.theme-toggle:hover,
.menu-icon:hover,
.menu a:hover,
.submit-button:hover,
.scroll-top:hover,
.detail-link:hover {
    background: var(--hover-surface);
}

.hero {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
    padding: clamp(28px, 5vw, 56px);
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto -10% -40% auto;
    width: clamp(180px, 28vw, 320px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(17, 17, 17, 0.06), transparent 72%);
    pointer-events: none;
}

.hero-copy {
    max-width: 820px;
}

.hero h1 {
    margin: 0;
    font-size: clamp(2.6rem, 8vw, 6.2rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
}

.hero-description {
    margin: 20px 0 0;
    max-width: 62ch;
    font-size: clamp(1rem, 1.8vw, 1.14rem);
    line-height: 1.75;
    color: var(--muted);
}

.contact-layout {
    margin-top: 28px;
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.contact-details,
.contact-panel {
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.contact-details {
    padding: 18px;
    display: grid;
    gap: 18px;
    align-content: start;
}

.feature-card {
    border: 1px solid var(--line);
    background: var(--accent-surface);
    display: grid;
    gap: 0;
    overflow: hidden;
}

.feature-media {
    min-height: 280px;
    border-bottom: 1px solid var(--line);
    background: var(--card-surface);
    display: grid;
    place-items: center;
}

.feature-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

.feature-copy {
    padding: 18px;
    display: grid;
    gap: 12px;
}

.feature-copy h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 400;
}

.detail-card {
    padding: 14px;
    border: 1px solid var(--line);
    background: var(--card-surface);
    display: grid;
    gap: 10px;
}

.detail-label {
    margin: 0;
    font-size: 0.82rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.detail-link,
.detail-text {
    margin: 0;
    font-size: 1rem;
    line-height: 1.7;
    text-decoration: none;
}

.support-link {
    width: fit-content;
    text-decoration: none;
    border: 1px solid var(--line);
    background: var(--button-surface);
    color: var(--text);
    padding: 10px 14px;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
}

.support-link:hover {
    background: var(--hover-surface);
}

.contact-panel {
    padding: 22px;
    display: grid;
    gap: 24px;
    align-content: start;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0)) 0 0 / 100% 100%,
        var(--surface);
}

.panel-copy h2,
.form-status {
    margin: 0;
}

.panel-copy h2 {
    font-size: 1.2rem;
    font-weight: 400;
}

.form-status,
.panel-copy p {
    color: var(--muted);
    line-height: 1.7;
}

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

.contact-direct {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding-top: 6px;
    border-top: 1px solid var(--line);
}

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

.field span {
    font-size: 0.88rem;
}

.field input,
.field textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--button-surface);
    color: var(--text);
    padding: 12px 14px;
    resize: vertical;
    transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: rgba(17, 17, 17, 0.3);
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.06);
}

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

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.submit-button {
    min-height: 44px;
    padding: 10px 16px;
    cursor: pointer;
}

.submit-button:disabled {
    opacity: 0.55;
    cursor: progress;
}

.scroll-top {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1100;
    width: 48px;
    height: 48px;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.scroll-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.qr-modal {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: grid;
    place-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.qr-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.qr-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
}

.qr-modal-panel {
    position: relative;
    z-index: 1;
    width: min(92vw, 420px);
    padding: 24px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    display: grid;
    gap: 14px;
}

.qr-modal-panel h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 400;
}

.qr-modal-image {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
    background: #fff;
}

.qr-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    background: var(--button-surface);
    color: var(--text);
    box-shadow: var(--shadow-soft);
    cursor: pointer;
}

.page-footer {
    margin-top: 48px;
    padding: 20px 0 0;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex-direction: column;
    gap: 12px;
    color: var(--muted);
    font-size: 0.82rem;
}

body.dark-mode .feature-media img {
    background: #101011;
}

body.dark-mode .field input:focus,
body.dark-mode .field textarea:focus {
    border-color: rgba(255, 255, 255, 0.24);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

body.dark-mode .qr-modal-backdrop {
    background: rgba(12, 12, 13, 0.8);
}

body.dark-mode .qr-modal-image {
    background: #fff;
}

.page-footer p {
    margin: 0;
}

@media (max-width: 960px) {
    .page-shell {
        width: min(100vw - 24px, 760px);
    }

    .contact-layout {
        grid-template-columns: 1fr;
    }

    .contact-details {
        order: 1;
    }

    .contact-panel {
        order: 2;
    }
}

@media (max-width: 640px) {
    .page-nav {
        top: 12px;
        right: 12px;
        left: auto;
        width: max-content;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
    }

    .nav-actions {
        gap: 8px;
        align-items: center;
        justify-content: flex-end;
        width: max-content;
    }

    .theme-toggle {
        min-width: 58px;
        padding: 10px 12px;
    }

    .menu {
        min-width: min(78vw, 260px);
    }

    .page-shell {
        width: calc(100vw - 20px);
        padding-top: 84px;
    }

    .hero {
        padding: 22px;
    }

    .hero h1 {
        font-size: clamp(2.1rem, 11vw, 3.8rem);
        line-height: 1;
    }

    .hero-description {
        margin-top: 16px;
        font-size: 0.96rem;
        line-height: 1.65;
    }

    .contact-panel,
    .contact-details {
        padding: 16px;
    }

    .contact-details {
        order: 2;
    }

    .contact-panel {
        order: 1;
    }

    .feature-media {
        min-height: 200px;
    }

    .feature-copy {
        padding: 16px;
        gap: 10px;
    }

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

    .contact-direct {
        grid-template-columns: 1fr;
    }

    .field-full,
    .form-actions {
        grid-column: auto;
    }

    .form-actions {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .submit-button,
    .support-link {
        width: 100%;
        justify-content: center;
    }

    .scroll-top {
        right: 14px;
        bottom: 14px;
    }

    .qr-modal-panel {
        padding: 18px;
        width: min(94vw, 360px);
        max-height: min(88vh, 680px);
        overflow-y: auto;
    }

    .qr-modal-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
    }

    .detail-link,
    .detail-text {
        font-size: 0.95rem;
        line-height: 1.6;
        overflow-wrap: anywhere;
    }
}
