/* Vybe Yachts Styles */
:root {
    --bg: #0f0e1f; /* deepened base for contrast */
    --brand: #1c1938; /* dark blue */
    --text: #f7f6f5; /* off white */
    --muted: #d6d4e0; /* slightly lighter for stronger contrast on dark backgrounds */
    --card: #1c1a38;
    --accent: #e6e2da;
    --radius: 14px;
    --shadow-sm: 0 4px 20px rgba(0, 0, 0, .18);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, .22);
}

html {
    scroll-behavior: smooth;
}

/* Honor the hidden attribute even when other rules set display */
[hidden] {
    display: none !important;
}

/* Sections */
.section-alt {
    background: linear-gradient(180deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, 0) 120px);
}

.section .section-head {
    text-align: center;
    margin-bottom: 22px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 28px;
    align-items: start;
}

@media (max-width: 880px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

h2 {
    font-size: clamp(24px, 3.4vw, 36px);
    margin: 0 0 10px;
    letter-spacing: -.01em;
    font-weight: 600;
}

h3 {
    font-size: clamp(18px, 2.2vw, 22px);
    margin: 0 0 10px;
}

@media (max-width: 560px) {
    .spacer {
        margin-top: 80px;
    }

    .spacer img {
        width: 250px;
    }
}

.muted {
    color: var(--muted);
}

.card {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: var(--radius);
    padding: 22px 22px;
    box-shadow: var(--shadow-sm);
}

.bullets {
    padding-left: 18px;
}

.bullets li {
    margin: 6px 0;
}

.product-stats ul {
    margin: 0;
    padding-left: 18px;
}

.product-stats li {
    margin: 6px 0;
}

/* Specifications */
.specs {
    align-items: center;
}

.specs-media picture, .specs-media img {
    display: block;
}

.specs-media {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    aspect-ratio: 16 / 9; /* keep consistent height to avoid layout shift */
}

.specs-media picture {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .35s ease;
    will-change: opacity;
    pointer-events: none;
}

.specs-media picture.is-active {
    opacity: 1;
}

.specs-media picture.is-active {
    pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
    .specs-media picture {
        transition: none;
    }
}

.specs-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Overlay toggle inside picture */
.specs-toggle {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    z-index: 2;
}

.specs-toggle .toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .28);
    background: rgba(28, 25, 56, .55);
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    color: var(--text);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .28), inset 0 0 0 1px rgba(255, 255, 255, .06);
    cursor: pointer;
}

.specs-toggle .toggle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.specs-toggle .toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: .82;
    letter-spacing: .01em;
}

.specs-toggle .toggle[aria-checked="false"] .toggle-label.left,
.specs-toggle .toggle[aria-checked="true"] .toggle-label.right {
    opacity: 1;
}

.toggle-track {
    position: relative;
    width: 40px;
    height: 20px;
    border-radius: 999px;
    background: color-mix(in oklab, var(--brand) 25%, black 75%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .10);
    transition: background .2s ease, box-shadow .2s ease;
}

.toggle-thumb {
    position: absolute;
    top: 50%;
    left: 0;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--text);
    box-shadow: 0 6px 14px rgba(0, 0, 0, .25), inset 0 0 0 1px rgba(0, 0, 0, .06);
    transform: translate(0, -50%);
    transition: transform .22s cubic-bezier(.2, .8, .2, 1);
}

.specs-toggle .toggle[aria-checked="true"] .toggle-thumb {
    transform: translate(24px, -50%);
}

.specs-toggle .toggle:hover .toggle-track {
    background: color-mix(in oklab, var(--brand) 30%, black 70%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}

.specs-toggle .toggle:active .toggle-thumb {
    transform: translate(24px, -50%) scale(.98);
}

.specs-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
}

.specs-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: color-mix(in oklab, var(--card) 78%, black 22%);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 999px;
    padding: 4px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
}

.specs-switch .variant-btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text);
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: .01em;
    cursor: pointer;
}

.specs-switch .variant-btn.is-active {
    background: color-mix(in oklab, var(--brand) 35%, black 65%);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .22), inset 0 0 0 1px rgba(255, 255, 255, .06);
}

.specs-sets {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.specs-list {
    margin: 0;
    padding: 10px 14px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
}

.specs-list .spec-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
    padding: 10px 8px;
    border-bottom: 1px dashed rgba(255, 255, 255, .12);
}

.specs-list .spec-row:last-child {
    border-bottom: 0;
}

.specs-list dt {
    margin: 0;
    color: var(--muted);
}

.specs-list dd {
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.specs-list dd .spec-value {
    font-weight: 700;
    font-size: 1.05em;
}

@media (max-width: 560px) {
    .specs-list .spec-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 880px) {
    .specs {
        align-items: start;
    }

    .specs-content {
        height: auto;
    }

    .specs-sets {
        height: auto;
    }
}

/* Mobile fine-tuning */
@media (max-width: 560px) {
    .specs-toggle {
        bottom: 8px;
    }

    .specs-toggle .toggle {
        gap: 8px;
        padding: 6px 10px;
    }

    .specs-toggle .toggle-label {
        font-size: 11px;
    }

    .specs-toggle .toggle-label .icon {
        width: 14px;
        height: 14px;
    }

    .toggle-track {
        width: 52px;
        height: 24px;
    }

    .toggle-thumb {
        left: 3px;
        width: 20px;
        height: 20px;
    }

    .specs-toggle .toggle[aria-checked="true"] .toggle-thumb {
        transform: translate(29px, -50%);
    }
}

/* Gallery */
.gallery-filter {
    display: flex;
    justify-content: center;
    margin: 6px 0 16px;
}

.gallery-grid {
    /* Flex-based horizontal carousel (single row) */
    display: flex;
    flex-wrap: nowrap;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 12px;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: auto; /* allow vertical scroll to chain to the page */
    -webkit-overflow-scrolling: touch;
    /* Hide scrollbar (Firefox/IE/Edge legacy) */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
}

/* Disable snapping when scrolling programmatically to avoid Safari/iOS quirks */
.gallery-grid.no-snap {
    scroll-snap-type: none;
}

/* Hide scrollbar (WebKit) */
.gallery-grid::-webkit-scrollbar {
    display: none;
    height: 0;
}

.gallery-grid img {
    display: block;
    width: 100%;
    border-radius: 10px;
}

/* Fullscreen gallery (PhotoSwipe) hooks */
.gallery-grid a.gallery-item {
    display: block;
    border-radius: 10px;
    overflow: clip;
    text-decoration: none;
    line-height: 0; /* remove extra gap around inline elements in anchors */
    cursor: zoom-in;
}

/* Ensure nested <picture> fills the anchor container */
.gallery-grid a.gallery-item > picture {
    display: block;
    width: 100%;
    height: 100%;
}

.gallery-grid a.gallery-item:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Responsive sizing of carousel items */
.gallery-grid > picture,
.gallery-grid > a.gallery-item {
    flex: 0 0 500px;
    aspect-ratio: 4 / 3; /* ensure item has height even before image loads */
}

@media (max-width: 980px) {
    .gallery-grid > picture,
    .gallery-grid > a.gallery-item {
        flex-basis: 420px;
    }
}

@media (max-width: 560px) {
    .gallery-grid > picture,
    .gallery-grid > a.gallery-item {
        flex-basis: 100%;
    }
}

.gallery-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

/* Normalize picture element as block to avoid inline gaps */
.gallery-grid > picture {
    display: block;
}

/* Scroll snap for each item */
.gallery-grid > picture,
.gallery-grid > a.gallery-item {
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

/* Carousel wrapper & nav */
.carousel {
    position: relative;
}

.carousel-nav {
    position: absolute;
    inset-inline: 0;
    inset-block-start: 50%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 8px;
    pointer-events: none; /* allow clicks to pass except on buttons */
}

.carousel-btn {
    cursor: pointer;
    pointer-events: auto;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .22);
    background: color-mix(in oklab, var(--card) 80%, black 20%);
    color: var(--text);
    display: grid;
    place-items: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .22), inset 0 0 0 1px rgba(255, 255, 255, .06);
}

.carousel-btn:hover {
    background: color-mix(in oklab, var(--card) 70%, black 30%);
}

.carousel-btn:active {
    transform: scale(.98);
}

.carousel-btn[disabled] {
    opacity: .4;
    cursor: default;
}

/* Journal */
.journal-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

@media (max-width: 980px) {
    .journal-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .journal-list {
        grid-template-columns: 1fr;
    }
}

/* Journal card icons */
.journal-list .card {
    position: relative;
    padding: 22px 22px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.journal-list .card h3 {
    margin: 0;
}

.journal-list .card .icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: radial-gradient(80% 80% at 30% 20%, color-mix(in oklab, var(--brand) 70%, black 30%) 0%, color-mix(in oklab, var(--card) 80%, black 20%) 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), 0 6px 18px rgba(0, 0, 0, .22);
    margin-bottom: 10px;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.journal-list .card .icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .95;
}

.journal-list .card:hover .icon {
    transform: translateY(-2px);
    background: radial-gradient(80% 80% at 50% 30%, color-mix(in oklab, var(--brand) 65%, black 35%) 0%, color-mix(in oklab, var(--card) 78%, black 22%) 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 10px 26px rgba(0, 0, 0, .26);
}

/* Scroll-reveal states (progressive enhancement) */
.js .journal-list .card .icon.reveal-init {
    opacity: 0;
    transform: translateY(22px) scale(.94);
    will-change: transform, opacity;
    transition: transform 1.1s cubic-bezier(.18, .88, .3, 1.2), opacity .9s ease-out;
}

.js .journal-list .card .icon.reveal-init.is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .js .journal-list .card .icon.reveal-init {
        transition: none;
    }
}

/* Contact */
.contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-list li {
    margin: 8px 0;
}

.contact-list a {
    color: var(--text);
    text-decoration: none;
}

.contact-list a:hover {
    text-decoration: underline;
}

/* Flags */
.flags {
    display: inline-flex;
    gap: 6px;
    vertical-align: middle;
    margin: 0 6px;
}

.flag {
    width: 18px;
    height: 12px;
    border-radius: 2px; /* override global img rounding */
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .12);
    display: inline-block;
}

/* Footer */
.site-footer {
    border-top: 1px solid rgba(255, 255, 255, .06);
    margin-top: 20px;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 0;
}

.footer-inner nav {
    display: flex;
    gap: 16px;
}

.footer-inner a {
    color: var(--text);
    text-decoration: none;
}

.footer-inner a:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .footer-inner {
        flex-direction: column;
        gap: 12px;
    }
}

/* Buttons */
.btn:hover {
    background: #ecebe8; /* fallback for older browsers */
    background: color-mix(in oklab, var(--bg) 88%, black 12%);
    box-shadow: 0 0 0 1px rgba(28, 25, 56, .55) inset, 0 10px 24px rgba(0, 0, 0, .22), 0 4px 10px rgba(0, 0, 0, .12);
}

.btn:active {
    background: #e7e5e1; /* fallback for older browsers */
    background: color-mix(in oklab, var(--bg) 82%, black 18%);
    box-shadow: 0 0 0 1px rgba(28, 25, 56, .6) inset, 0 6px 16px rgba(0, 0, 0, .22), 0 3px 8px rgba(0, 0, 0, .12);
}

/* Accessible focus styles */
.btn:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .35);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .14), 0 2px 6px rgba(0, 0, 0, .08);
}

.btn-ghost:active {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .5);
    box-shadow: 0 3px 10px rgba(0, 0, 0, .16), 0 1px 4px rgba(0, 0, 0, .08);
}

.btn-small {
    padding: 9px 14px;
    font-size: 14px;
}

/* Focus visibility for links */
.nav a:not(.btn):focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.contact-list a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.footer-inner a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Utilities */
.section .container > * + * {
    margin-top: 8px;
}