/* ==========================================================================
   TERRA — Home Page V2 Sections & Parallax Styling
   Scoped specifically for index2.php (.home-page-v2 / .home-page--scrollable)
   ========================================================================== */

/* 1. Global Scrollable Home Layout Overrides (HTML5 / Modern CSS Viewport Standards) */
html.is-home:has(body.home-page--scrollable) {
  height: auto !important;
  min-height: 100% !important;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: clip !important;
  scroll-behavior: smooth;
}

body.home-page--scrollable {
  position: relative;
  height: auto !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  max-height: none !important;
  overflow: visible !important;
  overflow-x: clip !important;
}

/* Unified Equal Width Across Every Section on index2.php (Header, Hero, About, Projects, Blog, Footer) */
body.home-page--scrollable .site-header .container,
body.home-page--scrollable .hero-stage,
body.home-page--scrollable .home-section-shell,
body.home-page--scrollable .ruby-footer .ruby-footer-shell {
  width: min(calc(100% - var(--container-pad, 3rem)), var(--max, 1280px)) !important;
  max-width: var(--max, 1280px) !important;
  margin-inline: auto !important;
  box-sizing: border-box !important;
}

body.home-page--scrollable #main {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  position: relative;
}

body.home-page--scrollable .site-footer {
  display: block !important;
  position: relative;
  z-index: 10;
}

/* Header on Scrollable Home (index2.php): Static at top initially, only goes sticky when scrolled down */
body.home-page--scrollable .site-header {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 96px;
  z-index: 1000;
  background: #ffffff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid transparent !important;
  box-shadow: none !important;
  transition: height 0.25s ease, background 0.3s ease, box-shadow 0.25s ease, border-color 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

body.home-page--scrollable .site-header.is-scrolled {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 84px;
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border-bottom: 1px solid rgba(20, 21, 19, 0.08) !important;
  box-shadow: 0 8px 28px rgba(20, 21, 19, 0.06) !important;
}

/* Active navigation item styling on Home V2 */
body.home-page--scrollable .site-nav a.is-active,
body.home-page--scrollable .site-nav a[aria-current="page"] {
  color: var(--ink, #141513) !important;
  font-weight: 600;
  position: relative;
}

body.home-page--scrollable .site-nav a.is-active::after,
body.home-page--scrollable .site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--yellow, #f6b800);
  border-radius: 2px;
}

/* 2. Hero Section on Scrollable Home (index2.php) — Fluidly Scaled Across All Viewports */
body.home-page--scrollable .hero {
  height: calc(100vh - var(--header-height, 96px));
  height: calc(100dvh - var(--header-height, 96px));
  min-height: clamp(540px, 76dvh, 720px);
  max-height: min(920px, calc(100dvh - var(--header-height, 96px)));
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

body.home-page--scrollable .hero-stage {
  height: 100%;
  max-height: min(860px, calc(100dvh - var(--header-height, 96px)));
  margin-block: auto;
  padding-top: clamp(0.5rem, 1.5vh, 1.25rem);
  padding-bottom: clamp(3.75rem, 7.5vh, 5.25rem);
  display: grid;
  grid-template-columns: minmax(280px, 35%) minmax(0, 65%);
  gap: clamp(1.25rem, 2.2vw, 2.75rem);
  align-items: stretch;
}

body.home-page--scrollable .hero-text-deck {
  padding-top: clamp(1rem, 4.5vh, 3.25rem);
  padding-bottom: 0 !important;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

body.home-page--scrollable .hero-slides-window {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  transform: translateX(-10%);
}

body.home-page--scrollable .hero-slide {
  display: flex !important;
  align-items: flex-end !important;
  justify-content: flex-end !important;
}

/* Hero slider image size reduced by 15%, right-aligned to section edge & bottom-aligned with left icon */
body.home-page--scrollable .hero-slide img,
body.home-page--scrollable .hero-slide.is-active img,
body.home-page--scrollable .hero-slide:first-child img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: right bottom !important;
  transform: scale(0.85) !important;
  scale: 1 !important;
  transform-origin: right bottom !important;
}

/* Align left side icon bottom horizontally with the hero slider bottom on index2.php */
body.home-page--scrollable .hero-vignette-static {
  margin-top: auto !important;
  margin-bottom: -4px !important;
  width: clamp(126px, min(17.85vw, 26.25vh), 231px) !important;
  max-height: min(26.25vh, 205px) !important;
}

body.home-page--scrollable .hero-vignette-static img {
  width: 100% !important;
  max-height: min(26.25vh, 205px) !important;
}

@media (min-width: 1400px) {
  body.home-page--scrollable .hero {
    max-height: min(960px, calc(100dvh - var(--header-height, 96px)));
  }
  body.home-page--scrollable .hero-stage {
    max-height: min(900px, calc(100dvh - var(--header-height, 96px)));
    grid-template-columns: minmax(340px, 35%) minmax(0, 65%);
    gap: clamp(1.75rem, 2.6vw, 3.25rem);
  }
  body.home-page--scrollable .hero-vignette-static {
    width: clamp(157.5px, min(18.9vw, 27.3vh), 262.5px) !important;
    max-height: min(27.3vh, 241.5px) !important;
  }
  body.home-page--scrollable .hero-vignette-static img {
    max-height: min(27.3vh, 241.5px) !important;
  }
}

@media (min-width: 1800px) {
  body.home-page--scrollable .hero {
    max-height: min(1040px, calc(100dvh - var(--header-height, 96px)));
  }
  body.home-page--scrollable .hero-stage {
    max-height: min(960px, calc(100dvh - var(--header-height, 96px)));
    grid-template-columns: minmax(380px, 34%) minmax(0, 66%);
    gap: clamp(2rem, 3vw, 4rem);
  }
  body.home-page--scrollable .hero-vignette-static {
    width: clamp(189px, min(21vw, 31.5vh), 336px) !important;
    max-height: min(31.5vh, 294px) !important;
  }
  body.home-page--scrollable .hero-vignette-static img {
    max-height: min(31.5vh, 294px) !important;
  }
}

@media (max-width: 900px) {
  body.home-page--scrollable .hero {
    height: auto;
    min-height: calc(100svh - var(--header-height, 96px));
    max-height: none;
  }
  body.home-page--scrollable .hero-stage {
    display: flex;
    flex-direction: column;
    height: auto;
    max-height: none;
    padding-top: 0.75rem;
    padding-bottom: 3.5rem;
  }
  body.home-page--scrollable .hero-slides-window {
    aspect-ratio: 16 / 11;
    min-height: 260px;
    transform: none;
  }
  body.home-page--scrollable .hero-slide img,
  body.home-page--scrollable .hero-slide.is-active img,
  body.home-page--scrollable .hero-slide:first-child img {
    object-position: center center !important;
    transform: scale(0.95) !important;
    transform-origin: center center !important;
    scale: 1 !important;
  }
}

body.home-page--scrollable .hero-nav-controls {
  bottom: clamp(0.65rem, 1.8vh, 1.25rem);
}

/* Hide scroll prompt if present */
.hero-scroll-prompt {
  display: none !important;
}

/* 3. General Home Section Styling (Reduced inter-section whitespace) */
.home-section {
  position: relative;
  padding-block: clamp(2.5rem, 3.8vw, 3.5rem);
  scroll-margin-top: calc(var(--header-height, 96px) + 0.5rem);
  overflow: hidden;
}

.home-section-shell {
  width: min(calc(100% - var(--container-pad, 3rem)), var(--max, 1320px));
  margin-inline: auto;
  position: relative;
  z-index: 2;
}

/* Parallax Decorative Background Elements */
.home-parallax-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.parallax-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  transition: transform 0.1s linear;
  will-change: transform;
}

.parallax-blob--yellow {
  background: radial-gradient(circle, rgba(246, 184, 0, 0.18) 0%, rgba(246, 184, 0, 0) 70%);
  width: 550px;
  height: 550px;
}

.parallax-blob--cream {
  background: radial-gradient(circle, rgba(251, 247, 236, 0.85) 0%, rgba(251, 247, 236, 0) 70%);
  width: 700px;
  height: 700px;
}

/* Section Header Typography */
.home-section-header {
  margin-bottom: clamp(1.5rem, 2.4vw, 2.2rem);
}

.home-section-header.text-center {
  text-align: center;
  margin-inline: auto;
  max-width: 820px;
}

.home-section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--body-font), sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #686a63;
  margin-bottom: 0.85rem;
}

.home-section-kicker::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 2px;
  background: var(--yellow, #f6b800);
}

.home-section-title {
  font-family: var(--body-font), sans-serif;
  font-size: clamp(2rem, 3.2vw, 3.1rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--ink, #141513);
  margin: 0 0 1rem;
}

.home-section-title em {
  font-style: italic;
  font-family: serif;
  color: var(--ink, #141513);
}

.home-section-intro {
  font-family: var(--body-font), sans-serif;
  font-size: clamp(0.96rem, 1.08vw, 1.04rem) !important;
  line-height: 1.6 !important;
  color: #55574e;
  max-width: 68ch;
  margin: 0;
}

.home-section-header.text-center .home-section-intro {
  margin-inline: auto;
}

/* Focused Section Accent Animation (Triggered on Menu Jump) */
.home-section.is-focused {
  animation: sectionFocusGlow 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes sectionFocusGlow {
  0% {
    background-color: rgba(246, 184, 0, 0.06);
  }
  100% {
    background-color: transparent;
  }
}

/* Universal "View More" Button */
.home-view-more-wrap {
  margin-top: clamp(1.5rem, 2.4vw, 2.2rem);
  display: flex;
  align-items: center;
}

.home-view-more-wrap.justify-center {
  justify-content: center;
}

.home-view-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 2.2rem;
  border-radius: 999px;
  background: var(--ink, #141513);
  color: #ffffff;
  font-family: var(--body-font), sans-serif;
  font-size: 0.94rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(20, 21, 19, 0.15);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.home-view-more-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--yellow, #f6b800);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
}

.home-view-more-btn span,
.home-view-more-btn svg {
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease;
}

.home-view-more-btn:hover {
  color: var(--ink, #141513);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(246, 184, 0, 0.32);
}

.home-view-more-btn:hover::before {
  transform: translateY(0);
}

.home-view-more-btn:hover span.arrow-icon {
  transform: translateX(5px);
}

/* ==========================================================================
   4. ABOUT TEASER SECTION (.home-about-section)
   ========================================================================== */
.home-about-section {
  background: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.home-about-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2.5rem, 5.5vw, 6rem);
  align-items: center;
}

.home-about-copy {
  display: flex;
  flex-direction: column;
}

.home-about-narrative {
  margin-bottom: 2rem;
}

.home-about-narrative p {
  font-family: var(--body-font), sans-serif;
  font-size: clamp(0.96rem, 1.08vw, 1.04rem) !important;
  line-height: 1.65 !important;
  color: #55574e;
  margin: 0 0 1rem;
}

/* 3 Core Highlight Cards */
.home-about-pillars {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.home-pillar-item {
  display: flex;
  align-items: flex-start;
  gap: 1.15rem;
  padding: 1.15rem 1.35rem;
  border-radius: 8px;
  background: #faf8f3;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.home-pillar-item:hover {
  background: #ffffff;
  border-color: rgba(246, 184, 0, 0.4);
  transform: translateX(4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}

.home-pillar-num {
  font-family: var(--body-font), sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: #f6b800;
  background: rgba(246, 184, 0, 0.12);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.home-pillar-content h4 {
  font-family: var(--body-font), sans-serif;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink, #141513);
  margin: 0 0 0.25rem;
}

.home-pillar-content p {
  font-family: var(--body-font), sans-serif;
  font-size: 0.9rem !important;
  line-height: 1.5 !important;
  color: #686a63;
  margin: 0;
}

/* Layered Visual Side — Flush Right Alignment so About Section Matches Full Container Width */
.home-about-visual-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
}

.home-about-photo-main {
  width: 100%;
  max-width: 100%;
  max-height: clamp(500px, 58vh, 680px);
  aspect-ratio: 4 / 4.6;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
  position: relative;
  background: #fbf7ec;
}

.home-about-photo-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.home-about-visual-wrap:hover .home-about-photo-main img {
  transform: scale(1.04);
}

/* Floating Founder Quote Card */
.home-about-quote-card {
  position: absolute;
  bottom: -25px;
  left: -25px;
  width: min(340px, 85%);
  padding: 1.5rem 1.65rem;
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.09);
  border-left: 3px solid var(--yellow, #f6b800);
  z-index: 3;
  transition: transform 0.4s ease;
}

.home-about-quote-card p {
  font-family: var(--body-font), sans-serif;
  font-style: italic;
  font-size: 0.94rem !important;
  line-height: 1.45 !important;
  color: var(--ink, #141513);
  margin: 0 0 0.5rem;
}

.home-about-quote-author {
  font-family: var(--body-font), sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #686a63;
}

/* Floating Stamp Badge (Removed) */
.home-about-stamp-badge {
  display: none !important;
}

.home-about-stamp-badge:hover {
  transform: rotate(0deg) scale(1.05);
}

/* ==========================================================================
   5. PROJECTS SHOWCASE SECTION (.home-projects-section)
   ========================================================================== */
.home-projects-section {
  background: #faf8f3;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.home-projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.75rem, 3vw, 2.75rem);
}

.home-project-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.04);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  color: inherit;
}

.home-project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.09);
  border-color: rgba(246, 184, 0, 0.5);
}

.home-project-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #f0ebe1;
}

.home-project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.home-project-card:hover .home-project-media img {
  transform: scale(1.05);
}

/* Card Badge on top of image */
.home-project-badge-pill {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: var(--body-font), sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink, #141513);
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.home-project-body {
  padding: 1.65rem 1.85rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.home-project-title {
  font-family: var(--body-font), sans-serif;
  font-size: clamp(1.15rem, 1.4vw, 1.35rem);
  font-weight: 600;
  color: var(--ink, #141513);
  margin: 0 0 0.35rem;
  letter-spacing: -0.015em;
  transition: color 0.25s ease;
}

.home-project-card:hover .home-project-title {
  color: #b58400;
}

.home-project-subtitle {
  font-family: var(--body-font), sans-serif;
  font-size: 0.92rem !important;
  line-height: 1.5 !important;
  color: #55574e;
  margin: 0 0 1.15rem;
}

.home-project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.home-project-tag {
  font-family: var(--body-font), sans-serif;
  font-size: 0.75rem;
  color: #686a63;
  background: #f4efe4;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
}

/* ==========================================================================
   6. BLOG / JOURNAL TEASER SECTION (.home-blog-section)
   ========================================================================== */
.home-blog-section {
  background: #ffffff;
}

.home-blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 2.5vw, 2.25rem);
}

.home-blog-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  color: inherit;
}

.home-blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.08);
  border-color: rgba(246, 184, 0, 0.5);
}

.home-blog-media {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #fbf7ec;
}

.home-blog-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.home-blog-card:hover .home-blog-media img {
  transform: scale(1.05);
}

.home-blog-body {
  padding: 1.5rem 1.65rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.home-blog-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.home-blog-category {
  font-family: var(--body-font), sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #b58400;
}

.home-blog-time {
  font-family: var(--body-font), sans-serif;
  font-size: 0.78rem;
  color: #88867e;
}

.home-blog-title {
  font-family: var(--body-font), sans-serif;
  font-size: clamp(1.08rem, 1.3vw, 1.25rem);
  font-weight: 600;
  color: var(--ink, #141513);
  line-height: 1.3;
  margin: 0 0 0.65rem;
  letter-spacing: -0.015em;
  transition: color 0.25s ease;
}

.home-blog-card:hover .home-blog-title {
  color: #b58400;
}

.home-blog-excerpt {
  font-family: var(--body-font), sans-serif;
  font-size: clamp(0.9rem, 0.98vw, 0.94rem) !important;
  line-height: 1.55 !important;
  color: #55574e;
  margin: 0 0 1.25rem;
}

.home-blog-read-link {
  margin-top: auto;
  font-family: var(--body-font), sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink, #141513);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: color 0.25s ease, gap 0.25s ease;
}

.home-blog-card:hover .home-blog-read-link {
  color: #b58400;
  gap: 0.65rem;
}

/* ==========================================================================
   7. Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .home-about-grid {
    grid-template-columns: 1fr;
    gap: 3.5rem;
  }
  .home-about-photo-main {
    max-width: 100%;
    aspect-ratio: 16 / 10;
  }
  .home-projects-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .home-blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .home-blog-grid {
    grid-template-columns: 1fr;
  }
  .hero-scroll-prompt {
    display: none;
  }
  .home-about-quote-card {
    position: static;
    width: 100%;
    margin-top: 1rem;
  }
  .home-about-stamp-badge {
    top: 10px;
    right: 10px;
    width: 65px;
    height: 65px;
    font-size: 0.6rem;
  }
}

/* ==========================================================================
   8. Auto-Hiding "Get In Touch" Modal Popup (index2.php)
   ========================================================================== */
.home-popup-modal {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s ease;
}

.home-popup-modal[hidden] {
  display: none !important;
}

.home-popup-modal.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.home-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 21, 19, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.home-popup-dialog {
  position: relative;
  z-index: 2;
  width: min(100%, 480px);
  background: #ffffff;
  border-radius: 14px;
  padding: 2.75rem 2.5rem 2.15rem;
  box-shadow: 0 24px 64px rgba(20, 21, 19, 0.22), 0 4px 16px rgba(20, 21, 19, 0.08);
  border: 1px solid rgba(20, 21, 19, 0.08);
  text-align: center;
  overflow: hidden;
  transform: translateY(16px) scale(0.96);
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

.home-popup-modal.is-visible .home-popup-dialog {
  transform: translateY(0) scale(1);
}

.home-popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(20, 21, 19, 0.12);
  background: #fbf7ec;
  color: #141513;
  font-size: 1.35rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.home-popup-close:hover,
.home-popup-close:focus-visible {
  background: var(--yellow, #f6b800);
  border-color: var(--yellow, #f6b800);
  transform: scale(1.06);
}

.home-popup-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.home-popup-title {
  font-family: var(--body-font), sans-serif;
  font-size: clamp(1.35rem, 2vw, 1.65rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #141513;
  margin: 0;
}

.home-popup-text {
  font-family: var(--body-font), sans-serif;
  font-size: 0.96rem !important;
  line-height: 1.55 !important;
  color: #55574e;
  margin: 0;
  max-width: 38ch;
}

.home-popup-action {
  margin-top: 0.65rem;
  display: flex;
  justify-content: center;
}

.home-popup-btn.button {
  min-width: 190px;
}

.home-popup-timer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(20, 21, 19, 0.06);
  overflow: hidden;
}

.home-popup-timer-bar {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--yellow, #f6b800);
  transform-origin: left center;
}

.home-popup-modal.is-visible .home-popup-timer-bar {
  animation: homePopupCountdown var(--popup-duration, 5s) linear forwards;
}

@keyframes homePopupCountdown {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

