/* Общие стили: кнопка .button, заголовок h3, комментарий .comment,
   сворачиваемый блок .accordion details. */
:root {
    color-scheme: dark;
    --accent: #00ff6a;
    --line: rgba(255, 255, 255, 0.15);
    --content: 860px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 0; }
body {
    margin: 0;
    background: #000;
    color: #fff;
    font-family: Arial, sans-serif;
    line-height: 1.5;
    padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px));
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }

.header, main, .footer {
    width: min(var(--content), calc(100% - 40px));
    margin-inline: auto;
}
.header {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-block: 16px;
    border-bottom: 1px solid var(--line);
}
.brand { margin: 0; font-size: clamp(28px, 6vw, 40px); line-height: 1.2; font-weight: 700; letter-spacing: -0.6px; }
.brand span { color: var(--accent); }
strong { color: var(--accent); font-weight: 700; }
.section {
    padding-block: clamp(48px, 8vw, 88px);
    border-bottom: 1px solid var(--line);
    min-width: 0;
}
.section-number {
    margin-top: -30px;
    display: block;
    margin-bottom: 28px;
    color: var(--accent);
    font-size: 12px;
    letter-spacing: 2px;
}
h3 {
    margin: 0 0 12px;
    font-size: 24px;
    line-height: 1.3;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.comment-title {
    margin: 0 0 2px;
    padding: 0 8px;
    color: rgba(255, 255, 255);
    font-size: 16px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.comment {
    margin: 0 0 20px;
    padding: 0 8px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 15px;
    font-style: oblique 8deg;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
h3 + .comment { margin-top: -12px; }
.header .comment { margin: 0; }
.button {
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    min-height: 48px;
    padding: 12px 18px 12px 22px;
    background: rgba(18, 18, 18, 0.94);
    border: 2px solid rgba(0, 255, 106, 0.7);
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    color: var(--accent);
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.button:hover { background: #17221b; border-color: var(--accent); }
.button:disabled { opacity: 0.35; cursor: default; }
.hero {
    min-height: calc(100svh - 180px - env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 24px;
}
.hero .section-number { margin-bottom: 0; margin-top: -30px;}
.hero .comment { margin-bottom: 0; }
.hero-copy {
    display: flex;
    flex-direction: column;
    gap: clamp(20px, 4svh, 36px);
    width: 100%;
}
.hero-copy > h3, .hero-copy > .comment { margin: 0; }
.hero-flow {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-block: 12px;
    text-align: center;
}
.hero-flow > .comment-title { margin: 2px; }
.hero-flow .flow-arrow { font-size: 28px; line-height: 1; }
.scroll-cue { align-self: center; color: var(--accent); margin-top: -10px; font-size: 24px; }

/* Изображение и подпись всегда перемещаются одним слайдом. */
.carousel {
    /* Меняйте ширину изображения здесь; 84px — стрелки и промежутки. */
    --image-width: 280px;
    width: min(calc(100% + 24px), calc(var(--image-width) + 84px));
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    gap: 16px 6px;
    align-items: center;
}
.carousel-track {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.9) #101010;
    border-radius: 16px;
}
.slide {
    flex: 0 0 100%;
    min-width: 0;
    margin: 0;
    padding: 4px 0 12px;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    text-align: center;
}
.slide img {
    display: block;
    width: var(--image-width);
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border: 1px solid var(--line);
    border-radius: 16px;
}
.slide .comment { margin: 0; }
.carousel-controls {
    display: contents;
}
.carousel-controls .comment { grid-column: 1 / -1; grid-row: 2; margin: 0; text-align: center; }
.carousel-controls .round-button {
    grid-row: 1;
    z-index: 1;
}
.carousel-controls [data-direction="-1"] { grid-column: 1; }
.carousel-controls [data-direction="1"] { grid-column: 3; }
.features {
    margin: 32px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: feature;
}
.features li {
    counter-increment: feature;
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding-block: 18px;
    border-top: 1px solid var(--line);
}
.features li::before { content: "0" counter(feature); color: var(--accent); font-size: 12px; }
.features .comment { margin: 0; }
.section > .comment + h3 { margin-top: 40px; }
#story { padding-bottom: 16px; }
#installation { padding-top: 16px; }
#installation > .section-number { margin-top: 0; }
#faq { padding-bottom: 20px; }
#faq .accordion > details:last-child { margin-bottom: 0; }
.text-link {
    color: #fff;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Native details сохраняет раскрытие без JavaScript. */
summary { cursor: pointer; }
.accordion details {
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin: 12px 0;
}
.accordion summary { padding: 4px; }
.accordion details[open] { border-color: rgba(0, 255, 106, 0.4); }
.accordion details[open] summary { color: var(--accent); }
.accordion .comment { margin: 16px 0 4px; }
.story-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border: 2px solid #fff;
    border-radius: 10px;
    background: rgba(18, 18, 18, 0.94);
    list-style: none;
    color: #fff;
    font-size: 13px;
    line-height: 1.5;
    cursor: pointer;
}
.story-button:hover { background: #242424; }
.story-button::-webkit-details-marker { display: none; }
.story-rest { padding-top: 24px; }
.story:not([open]) .when-open, .story[open] .when-closed { display: none; }
.footer {
    padding-block: 8px 20px;
    text-align: center;
    font-family: Arial, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    letter-spacing: 0.2px;
    color: rgba(255, 255, 255, 0.85);
}
.sticky-cta {
    position: fixed;
    z-index: 10;
    inset: auto 0 0;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.96) 35%);
    display: flex;
    justify-content: center;
    pointer-events: none;
}
.sticky-cta .button {
    width: min(100%, 420px);
    pointer-events: auto;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 600;
    margin-bottom: -10px;
}

.section-nav {
    position: fixed;
    z-index: 11;
    right: calc(12px + env(safe-area-inset-right, 0px));
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.section-nav button, .round-button {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.section-nav button:disabled, .round-button:disabled { opacity: 0.25; cursor: default; }

@media (max-width: 480px) {
    .header { min-height: 64px; }
    .hero {
        min-height: calc(100svh - 66px);
        padding-block: 24px calc(96px + env(safe-area-inset-bottom, 0px));
        gap: 20px;
    }
    .hero .section-number { margin: 0; }
    .hero-copy { gap: clamp(12px, 2.2svh, 20px); }
    .hero-copy > h3, .hero-copy > p { margin: 0; }
    .section-number { margin-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .button { transition: none; }
}
