/* Reserved Hour — home.php: the one surface in the system where real photography is the
   material (see tokens.css's --radius-lg/--shadow-photo and DESIGN.md's Photographic Elevation
   Rule). Structural chrome (header, cards, footer) stays in the shared flat/hairline language;
   only actual photographs (logo, hero/philosophy stills, portfolio, testimonial avatars) get
   the soft corner + lift. The page's one authored motion layer — a scroll-reveal fade/rise and
   a sticky, blurred header — mirrors booking.php's stamp-settle: progressive enhancement only,
   every element is already present and readable in the markup before any JS runs. */

.hidden { display: none !important; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* anchors land clear of the sticky header rather than tucked underneath it */
main > section[id] { scroll-margin-top: 96px; }

/* -- scroll reveal: applied via JS (reveal()/revealAll()) so a JS failure never hides
   content — elements without the .reveal class stay at their natural opacity/position -- */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}
.pricing-grid > .reveal:nth-child(2n) { transition-delay: 0.08s; }
.photo-grid > .reveal:nth-child(4n+2) { transition-delay: 0.06s; }
.photo-grid > .reveal:nth-child(4n+3) { transition-delay: 0.12s; }
.photo-grid > .reveal:nth-child(4n) { transition-delay: 0.18s; }
.testimonial-grid > .reveal:nth-child(3n+2) { transition-delay: 0.08s; }
.testimonial-grid > .reveal:nth-child(3n) { transition-delay: 0.16s; }
.packages-grid > .reveal:nth-child(3n+2) { transition-delay: 0.06s; }
.packages-grid > .reveal:nth-child(3n) { transition-delay: 0.12s; }
.master-grid > .reveal:nth-child(4n+2) { transition-delay: 0.06s; }
.master-grid > .reveal:nth-child(4n+3) { transition-delay: 0.12s; }
.master-grid > .reveal:nth-child(4n) { transition-delay: 0.18s; }

/* -- header: sticky and quietly glassy, the brand-book gradient rule (§04/§06) still
   stamped once at the canvas edge rather than repeated as a pattern -- */
.home-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--line);
    background: rgba(250, 245, 242, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.home-header.is-scrolled {
    background: rgba(250, 245, 242, 0.98);
    border-bottom-color: var(--line-strong);
}
.home-header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 3px;
    background: var(--gradient-brand);
}
.home-header-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--sp-4) var(--sp-6);
    padding-top: var(--sp-4);
    padding-bottom: var(--sp-4);
}
.home-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-3);
    text-decoration: none;
    color: var(--ink);
    flex-shrink: 0;
}
.home-brand-logo {
    max-height: 40px;
    width: auto;
    border-radius: var(--radius);
}
/* the graphic knak (scissors + flowing strand, brand book §02) — always
   shown beside the wordmark unless an admin-uploaded logo image replaces
   the whole lockup (see loadBrand() in home.php) */
.brand-mark {
    width: 34px;
    height: auto;
    flex-shrink: 0;
}
.home-brand .wordmark { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; }
.home-brand-kicker {
    display: block;
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-top: 1px;
}

/* -- in-page nav: mirrors the section it points to, hiding itself whenever that
   section has no data yet (see setSectionVisible() in home.php) -- */
.home-nav {
    display: flex;
    align-items: center;
    gap: var(--sp-6);
    margin-right: auto;
}
.home-nav-link {
    position: relative;
    padding-bottom: 3px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink-soft);
    text-decoration: none;
    transition: color 0.15s var(--ease);
}
.home-nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s var(--ease);
}
.home-nav-link:hover { color: var(--ink); }
.home-nav-link:hover::after { transform: scaleX(1); }

.home-header-actions {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    margin-left: auto;
}
.home-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}
.home-menu-btn-bar {
    display: block;
    width: 100%;
    height: 1.5px;
    background: var(--ink);
    transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}
.home-menu-btn[aria-expanded="true"] .home-menu-btn-bar:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.home-menu-btn[aria-expanded="true"] .home-menu-btn-bar:nth-child(2) { opacity: 0; }
.home-menu-btn[aria-expanded="true"] .home-menu-btn-bar:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.home-mobile-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
}
.home-mobile-nav.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
.home-mobile-nav-list {
    display: flex;
    flex-direction: column;
    padding: var(--sp-2) var(--sp-5) var(--sp-6);
}
.home-mobile-nav-link {
    display: block;
    padding: var(--sp-3) 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--line);
}
.home-mobile-nav-cta { margin-top: var(--sp-5); }

@media (max-width: 880px) {
    .home-nav { display: none; }
    .home-menu-btn { display: flex; }
}
@media (min-width: 881px) {
    .home-mobile-nav { display: none; }
}

/* -- hero: typographic by default — the page must still read as complete before any
   work/logo has been uploaded — and gains a real editorial still (the portfolio's most
   recent upload) the moment one exists, per loadPortfolio() in home.php -- */
.hero { padding: var(--sp-9) 0; }
.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: var(--sp-8);
}
.hero--with-photo .hero-grid { grid-template-columns: 1.05fr 0.95fr; }
.hero-kicker {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-5);
}
.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.25rem, 1.5rem + 3.2vw, 3.75rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
    margin-bottom: var(--sp-5);
}
.hero-sub {
    max-width: 34em;
    font-size: 1.125rem;
    color: var(--ink-soft);
    margin-bottom: var(--sp-7);
    font-weight: 300;
}
.btn-lg { padding: 1em 1.75em; font-size: 1.0625rem; }
.hero-figure {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-photo);
    aspect-ratio: 4 / 5;
}
.hero-figure img { display: block; width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 900px) {
    .hero--with-photo .hero-grid { grid-template-columns: 1fr; }
    .hero-figure { aspect-ratio: 16 / 10; }
}

/* -- shared section shell -- */
.site-section { padding: var(--sp-9) 0; }
.site-section--alt { background: var(--paper-alt); }
.site-section--dark { background: var(--ink); color: var(--paper); }
.site-section--dark .row-title { color: var(--paper); }
.site-section--dark .row-list,
.site-section--dark .row { border-color: rgba(253, 248, 245, 0.16); }
.site-section--dark .row:hover, .site-section--dark .row:focus-visible { background: rgba(253, 248, 245, 0.05); }
.site-section--dark .microlabel,
.site-section--dark .row-meta .unit { color: rgba(253, 248, 245, 0.55); }
.site-section--dark .row-meta { color: var(--paper); }
.site-section--dark .row-chevron { color: rgba(253, 248, 245, 0.4); }

.section-kicker {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
}
.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 1.2rem + 1vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.005em;
    margin-bottom: var(--sp-6);
    max-width: 32em;
}

/* -- philosophy: two-column, an image well (or quiet placeholder) beside the pitch -- */
.philosophy-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-9);
    align-items: center;
}
.philosophy-copy p {
    color: var(--ink-soft);
    line-height: 1.7;
    margin-bottom: var(--sp-4);
    font-weight: 300;
}
.philosophy-list {
    list-style: none;
    margin: var(--sp-6) 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-3) var(--sp-6);
}
.philosophy-list li {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    font-size: 0.9375rem;
    color: var(--ink);
}
.philosophy-figure {
    position: relative;
    border: 1px solid var(--line-strong);
    background: var(--paper-alt);
    border-radius: var(--radius-lg);
    aspect-ratio: 4 / 5;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--sp-6);
    overflow: hidden;
}
.philosophy-figure img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.philosophy-figure-empty { color: var(--ink-faint); font-size: 0.875rem; max-width: 20em; }

@media (max-width: 800px) {
    .philosophy-grid { grid-template-columns: 1fr; gap: var(--sp-7); }
    .philosophy-list { grid-template-columns: 1fr; }
}

/* -- services & pricing: real catalog data, grouped by category, reusing the
   same hairline row language as booking.php's own service list -- */
.pricing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-8) var(--sp-9);
}
.pricing-group-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--sp-3);
    padding-bottom: var(--sp-3);
    border-bottom: 1px solid rgba(253, 248, 245, 0.2);
}
.pricing-group .row { cursor: default; padding: var(--sp-3) var(--sp-1); align-items: baseline; gap: var(--sp-3); }
.pricing-group .row:hover { background: transparent; }
.pricing-group .row-title { flex: 0 1 auto; font-weight: 400; font-size: 0.9375rem; }
.pricing-group .row-leader {
    flex: 1 1 auto;
    min-width: 16px;
    border-bottom: 1px dotted rgba(253, 248, 245, 0.28);
    transform: translateY(-0.35em);
}
.pricing-group .row-meta { flex: 0 0 auto; }

@media (max-width: 700px) {
    .pricing-grid { grid-template-columns: 1fr; gap: var(--sp-7); }
}

/* -- faq: native <details>/<summary> disclosure, same hairline-row language as pricing -- */
.faq-list {
    max-width: 42em;
    border-top: 1px solid var(--line);
}
.faq-item {
    border-bottom: 1px solid var(--line);
    padding: var(--sp-4) 0;
}
.faq-question {
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9375rem;
    list-style: none;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::before {
    content: '+';
    display: inline-block;
    width: 1em;
    margin-right: var(--sp-2);
    color: var(--accent);
}
.faq-item[open] .faq-question::before { content: '−'; }
.faq-answer {
    margin: var(--sp-3) 0 0;
    padding-left: calc(1em + var(--sp-2));
    color: var(--ink-soft);
    font-size: 0.9375rem;
}

/* -- packages: bundled-session offers -- */
.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--sp-5);
    margin-bottom: var(--sp-5);
}
.package-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: var(--sp-6);
    transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.package-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.package-card-title {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: var(--sp-2);
}
.package-card-meta { color: var(--ink-soft); font-size: 0.9375rem; }
.packages-note { color: var(--ink-soft); font-size: 0.875rem; }

/* -- messengers: QR (MAX) + deep-link (Telegram), server-rendered in home.php -- */
.messengers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--sp-5);
    max-width: 620px;
    margin: 0 auto;
}
.messenger-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-3);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: var(--sp-6);
    text-align: center;
    transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.messenger-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.messenger-qr {
    width: 160px;
    height: 160px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.messenger-card-title {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
}
.messenger-card-sub { color: var(--ink-soft); font-size: 0.9375rem; max-width: 280px; }

/* -- portfolio: an editorial masonry rhythm — the Photographic Elevation Rule in
   practice, with the caption living as a permanent quiet gradient (readable without
   hover, since a caption a touch-device visitor can never see isn't a caption) -- */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 220px;
    grid-auto-flow: dense;
    gap: var(--sp-5);
}
.photo-card--wide { grid-column: span 2; }
.photo-card--tall { grid-row: span 2; }
.photo-card {
    position: relative;
    margin: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow-photo);
}
.photo-card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease);
}
.photo-card:hover img, .photo-card:focus-within img { transform: scale(1.06); }
.photo-card figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: var(--sp-6) var(--sp-4) var(--sp-3);
    font-size: 0.875rem;
    color: var(--paper);
    background: linear-gradient(180deg, rgba(46, 43, 51, 0) 0%, rgba(46, 43, 51, 0.72) 100%);
    transition: padding-top 0.3s var(--ease);
}
.photo-card:hover figcaption, .photo-card:focus-within figcaption { padding-top: var(--sp-8); }

@media (max-width: 800px) {
    .photo-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 200px; }
    .photo-card--tall { grid-row: span 1; }
}
@media (max-width: 560px) {
    .photo-grid { grid-template-columns: 1fr; grid-auto-rows: 260px; }
    .photo-card--wide, .photo-card--tall { grid-column: auto; grid-row: auto; }
}

/* -- testimonials: structural card stays flat/hairline; only the avatar photo gets elevation -- */
.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--sp-5);
}
.testimonial-card {
    position: relative;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    padding: var(--sp-7) var(--sp-6) var(--sp-6);
    transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.testimonial-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.testimonial-quote-mark {
    position: absolute;
    top: var(--sp-3);
    left: var(--sp-5);
    font-family: var(--font-display);
    font-size: 4rem;
    line-height: 1;
    color: var(--accent);
    opacity: 0.16;
    pointer-events: none;
}
.testimonial-head {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
}
.testimonial-avatar {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}
.testimonial-avatar--seal {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ink);
    font-weight: 700;
    font-size: 1.0625rem;
    background: var(--paper);
}
.testimonial-author { font-weight: 700; }
.testimonial-author-meta { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.stars { display: inline-flex; gap: 2px; margin-top: 2px; }
.stars .star { width: 0.875em; height: 0.875em; stroke: var(--line-strong); }
.stars .star-filled { stroke: var(--accent); fill: var(--accent); }
.testimonial-text {
    position: relative;
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    font-size: 1.125rem;
    color: var(--ink);
    line-height: 1.5;
}

/* -- команда: портретная карточка мастера, тот же принцип, что у отзывов — реальное фото несёт
   --shadow-photo, отсутствующее фото заменяется типографской монограммой без тени -- */
.master-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--sp-6);
}
.master-photo {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    border-radius: var(--radius-lg);
    object-fit: cover;
    box-shadow: var(--shadow-photo);
}
.master-photo--seal {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ink);
    box-shadow: none;
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--ink-soft);
    background: var(--paper-alt);
}
.master-name { margin-top: var(--sp-3); font-weight: 700; }
.master-spec { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); margin-top: 2px; }
.master-bio { margin-top: var(--sp-2); font-size: 0.9375rem; color: var(--ink-soft); line-height: 1.5; }

/* -- contacts -- */
.contacts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-9);
    align-items: center;
}
.contacts-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    margin-top: var(--sp-4);
    font-size: 1.0625rem;
}
.contacts-phone { color: var(--ink); font-weight: 700; text-decoration: none; }
.contacts-phone:hover { text-decoration: underline; }
.contacts-address { color: var(--ink-soft); }
.contacts-map-box {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
}
.contacts-map-box iframe { display: block; border: 0; width: 100%; }
@media (max-width: 800px) {
    .contacts-grid { grid-template-columns: 1fr; gap: var(--sp-6); }
}

/* -- closing CTA -- */
.cta-section {
    padding: var(--sp-9) 0;
    text-align: center;
    border-top: 1px solid var(--line);
    background: var(--paper-alt);
}
.cta-section .container { max-width: 640px; }
.cta-section .hero-sub { margin-left: auto; margin-right: auto; font-weight: 300; }
.cta-section .section-title { margin: 0 auto var(--sp-3); }
.cta-section .btn-lg { margin-top: var(--sp-2); }

/* -- footer -- */
.home-footer {
    border-top: 1px solid var(--line);
    position: relative;
}
.home-footer::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -1px;
    height: 3px;
    background: var(--gradient-brand);
}
.home-footer-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    padding: var(--sp-6) 0;
    font-size: 0.875rem;
    color: var(--ink-soft);
}
.home-footer-row a { color: var(--ink-soft); }
.home-footer-row a:hover { color: var(--ink); }
