:root {
    --glass-bg: rgba(255, 255, 255, 0.55);
    --glass-border: rgba(23, 37, 29, 0.10);
    --glass-shadow: 0 8px 32px rgba(23, 37, 29, 0.12);

    --cream: #f2d0a4;
    --brand: #3e5a44;
    --ink: #17251d;
    --lagoon: #3e5a44;
    --pine: #17251d;

    --font-display: 'UNCAGE', system-ui, -apple-system, 'Segoe UI', sans-serif;
    /* UNCAGE is variable (400–700) and draws caps-only: the lightest
       weight keeps headings airy, in tune with the thin logo lettering */
    --display-weight: 400;
    --display-adjust: none;
    --font-body: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    /* Cormorant has a small x-height: scale it up so small labels stay readable */
    --body-adjust: 0.56;
}

html, body {
    height: 100%;
}

body {
    background:
        radial-gradient(ellipse 70% 50% at 50% -10%, rgba(242, 208, 164, 0.07), transparent 60%),
        radial-gradient(ellipse 60% 50% at 90% 85%, rgba(138, 96, 58, 0.16), transparent 62%),
        linear-gradient(160deg, #0e1712 0%, #15231b 50%, #232a1d 100%);
    background-attachment: fixed;
    overflow-x: hidden;
    font-family: var(--font-body);
    font-size-adjust: var(--body-adjust);
    font-variant-numeric: lining-nums;
    color: var(--ink);
}

/* animated contour background (contours-bg.js); body gradient stays as fallback */
#contour-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
}

#contour-canvas.is-ready {
    opacity: 1;
}

#snow-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

main {
    position: relative;
    z-index: 1;
}

/* ---------------- Glass primitives ---------------- */

.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
}

/* ---------------- Nav ---------------- */

.nav-glass {
    position: relative;
    background:
        linear-gradient(155deg, rgba(23, 37, 29, 0.9), rgba(23, 37, 29, 0.84));
    border: 1px solid rgba(222, 229, 214, 0.18);
    box-shadow: 0 10px 34px rgba(23, 37, 29, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
}

.nav-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.75rem;
    width: 2.75rem;
    border-radius: 0.75rem;
    color: var(--cream);
    background: linear-gradient(135deg, var(--brand), #2c4232);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 6px 18px rgba(62, 90, 68, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.nav-icon-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(62, 90, 68, 0.5);
    filter: brightness(1.08);
}

.nav-icon-btn:active {
    transform: translateY(0) scale(0.96);
}

/* ---------------- 1wtoken deck uses advantages.css; old deck rules removed ---------------- */

/* Dots indicator (booking section helper styles) */

.badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.3rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--brand);
    background: rgba(62, 90, 68, 0.12);
    border: 1px solid rgba(62, 90, 68, 0.3);
}

/* In advantages cards the badge sits on colored gradient */
.adv-card .badge {
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.booking-title {
    margin-top: 1rem;
    font-family: var(--font-display);
    font-size-adjust: var(--display-adjust);
    font-variant-numeric: lining-nums;
    font-size: clamp(1.7rem, 3.5vw, 2.4rem);
    font-weight: var(--display-weight);
    line-height: 1.12;
    color: var(--ink);
}

.booking-desc {
    margin-top: 0.6rem;
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(23, 37, 29, 0.72);
}

.booking-list {
    margin-top: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: rgba(23, 37, 29, 0.85);
}

.booking-list li {
    position: relative;
    padding-left: 1.15rem;
}

.booking-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    height: 0.42rem;
    width: 0.42rem;
    border-radius: 9999px;
    background: var(--lagoon);
    box-shadow: 0 0 8px rgba(33, 104, 105, 0.55);
}

.booking-list b {
    color: var(--ink);
    font-weight: 700;
}

/* ---------------- Buttons & forms ---------------- */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border-radius: 0.9rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--cream);
    background: linear-gradient(135deg, var(--brand), #2c4232 70%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 24px rgba(62, 90, 68, 0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(62, 90, 68, 0.5);
    filter: brightness(1.08);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(23, 37, 29, 0.55);
}

.form-input {
    width: 100%;
    border-radius: 0.9rem;
    border: 1px solid rgba(23, 37, 29, 0.14);
    background: rgba(255, 255, 255, 0.6);
    padding: 0.75rem 1rem;
    font-size: 1rem;              /* не меньше 16px: иначе iOS увеличивает страницу при фокусе */
    min-height: 3rem;
    color: var(--ink);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.form-input::placeholder {
    color: rgba(23, 37, 29, 0.35);
}

.form-input:focus {
    outline: none;
    border-color: rgba(62, 90, 68, 0.65);
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 4px rgba(62, 90, 68, 0.15);
}

/* ---------------- Custom cursor & particles ---------------- */

@media (hover: hover) and (pointer: fine) {
    body.custom-cursor, body.custom-cursor * {
        cursor: none !important;
    }
}

/* Advantage cards keep native cursor for interactive elements */
.adv-card a, .adv-card button, .adv-card input, .adv-card textarea {
    cursor: pointer;
}

#custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    width: 36px;
    height: 36px;
    pointer-events: none;
    opacity: 0;
    transform: translate(-100px, -100px);
    filter: drop-shadow(0 2px 10px rgba(62, 90, 68, 0.6));
    will-change: transform;
}

/* brand name in the header: lettering image (logo-text.webp, 886x96, ~9.2:1).
   Heights are sized so leaf + lettering + two buttons fit each phone width. */
.brand-logo {
    display: block;
    height: 15px;
    width: auto;
    max-width: none;
    filter: drop-shadow(0 1px 6px rgba(5, 10, 7, 0.35));
}

/* narrow phones (320–389px): tighten the whole header row */
@media (max-width: 389px) {
    .brand-logo {
        height: 14px;
    }

    .nav-logo {
        height: 2rem;
    }

    .nav-icon-btn {
        width: 2.4rem;
        height: 2.4rem;
    }
}

@media (max-width: 339px) {
    .brand-logo {
        height: 12px;
    }
}

@media (min-width: 390px) {
    .brand-logo {
        height: 17px;
    }
}

@media (min-width: 420px) {
    .brand-logo {
        height: 20px;
    }
}

@media (min-width: 640px) {
    .brand-logo {
        height: 26px;
    }
}

.nav-logo {
    filter: drop-shadow(0 2px 6px rgba(20, 14, 26, 0.55));
}

/* walnut grain halo that follows the cursor (cursor.js), keeps it visible on dark glass */
#cursor-halo {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9997;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transform: translate(-200px, -200px);
    transition: opacity 0.3s ease;
    will-change: transform;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.15' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.66  0 0 0 0 0.46  0 0 0 0 0.27  1.1 0 0 0 -0.42'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
        radial-gradient(circle, rgba(170, 120, 72, 0.16) 0%, rgba(138, 96, 58, 0.09) 40%, rgba(138, 96, 58, 0) 72%);
    background-size: 90px 90px, 100% 100%;
    /* solid disc with a slightly irregular rim: (noise ∩ outer disc) ∪ solid core; JS drifts the noise */
    -webkit-mask-image:
        radial-gradient(circle, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.62) 40%, rgba(0, 0, 0, 0.4) 52%, transparent 60%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='b'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.09' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  2.6 0 0 0 -0.55'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23b)'/%3E%3C/svg%3E"),
        radial-gradient(circle, #000 0%, rgba(0, 0, 0, 0.8) 46%, rgba(0, 0, 0, 0.45) 60%, transparent 70%);
    mask-image:
        radial-gradient(circle, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.62) 40%, rgba(0, 0, 0, 0.4) 52%, transparent 60%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='b'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.09' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  2.6 0 0 0 -0.55'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23b)'/%3E%3C/svg%3E"),
        radial-gradient(circle, #000 0%, rgba(0, 0, 0, 0.8) 46%, rgba(0, 0, 0, 0.45) 60%, transparent 70%);
    -webkit-mask-size: 100% 100%, 100px 100px, 100% 100%;
    mask-size: 100% 100%, 100px 100px, 100% 100%;
    -webkit-mask-repeat: no-repeat, repeat, no-repeat;
    mask-repeat: no-repeat, repeat, no-repeat;
    -webkit-mask-composite: source-over, source-in;
    mask-composite: add, intersect;
}

body:not(.custom-cursor) #cursor-halo {
    display: none;
}

#particle-canvas {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
}

/* ---------------- Misc ---------------- */

::selection {
    background: rgba(62, 90, 68, 0.3);
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(23, 37, 29, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(62, 90, 68, 0.4);
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(62, 90, 68, 0.6);
}

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

/* ---------------- snow cap (snowcap.js) ----------------
   сугроб на верхней кромке панели: SVG выходит за её верх */
[data-snowcap] {
    position: relative;
}

.snow-cap {
    position: absolute;
    left: 0;
    z-index: 2;
    pointer-events: none;
    overflow: visible;
    filter: drop-shadow(0 2px 3px rgba(5, 10, 7, 0.28));
}

/* место над шапкой под сугроб, чтобы горки не обрезались верхом экрана */
.nav-glass[data-snowcap] {
    margin-top: 1.35rem;
}

@media (min-width: 640px) {
    .nav-glass[data-snowcap] {
        margin-top: 1.6rem;
    }
}

/* ---------------- garland (garland.js) ----------------
   гирлянда свисает дугами из-под нижней кромки шапки */
.garland {
    position: absolute;
    left: 0;
    top: calc(100% - 3px);
    z-index: 1;
    pointer-events: none;
    overflow: visible;
    filter: drop-shadow(0 2px 2px rgba(5, 10, 7, 0.35));
}

.garland-bulb {
    transform-box: fill-box;
    transform-origin: 50% 0;
    animation: garland-sway var(--sway, 3s) ease-in-out var(--delay, 0s) infinite alternate;
}

.garland-glass {
    animation: garland-glass var(--dur, 2.4s) ease-in-out var(--delay, 0s) infinite alternate;
}

.garland-halo {
    animation: garland-halo var(--dur, 2.4s) ease-in-out var(--delay, 0s) infinite alternate;
}

@keyframes garland-sway {
    from { transform: rotate(-5deg); }
    to { transform: rotate(5deg); }
}

@keyframes garland-glass {
    0%, 35% { opacity: 1; }
    100% { opacity: 0.62; }
}

@keyframes garland-halo {
    0%, 35% { opacity: 1; }
    100% { opacity: 0.25; }
}

@media (prefers-reduced-motion: reduce) {
    .garland-bulb,
    .garland-glass,
    .garland-halo {
        animation: none;
    }
}
