/* Mobile navigation and responsive layout */
.mobile-nav-toggle,
.mobile-nav-cta,
.mobile-header-consult {
  display: none;
}

section[id] {
  scroll-margin-top: 78px;
}

@media (max-width: 980px) {
  .header-inner {
    position: relative;
    padding: 12px 20px;
    gap: 14px;
  }

  .btn-header {
    display: none;
  }

  .mobile-nav-toggle {
    width: 44px;
    height: 44px;
    margin-left: auto;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-s);
    background: rgba(255, 255, 255, 0.48);
    position: relative;
    z-index: 3;
  }

  .mobile-nav-toggle span {
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: var(--text-0);
    transition: transform 0.28s var(--ease), opacity 0.2s ease;
  }

  .site-header.nav-open .mobile-nav-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .site-header.nav-open .mobile-nav-toggle span:nth-child(2) {
    opacity: 0;
  }

  .site-header.nav-open .mobile-nav-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .main-nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 8px;
    max-height: calc(100svh - 86px);
    overflow-y: auto;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-m);
    background: rgba(243, 239, 227, 0.99);
    box-shadow: 0 20px 50px rgba(20, 22, 12, 0.2);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s var(--ease),
      visibility 0.25s ease;
    z-index: 2;
  }

  .site-header.nav-open .main-nav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .main-nav a {
    width: 100%;
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 15px;
  }

  .main-nav a::after {
    display: none;
  }

  .main-nav a:last-child {
    border-bottom: 0;
  }

  .mobile-nav-cta {
    display: flex;
    justify-content: center;
    margin-top: 8px;
    border: 1px solid var(--accent) !important;
    border-radius: var(--radius-s);
    background: var(--accent);
    color: #f7f5ec;
    text-align: center;
  }

  body.mobile-nav-open {
    overflow: hidden;
  }
}

@media (max-width: 620px) {
  html {
    scroll-padding-top: 72px;
  }

  .grid-field {
    background-size: 48px 48px;
    opacity: 0.55;
  }

  .header-inner {
    min-height: 64px;
    padding: 10px 16px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 42px;
    align-items: center;
    gap: 8px;
  }

  .brand {
    min-width: 0;
    gap: 8px;
  }

  .brand-mark {
    width: 26px;
    height: 26px;
  }

  .site-header .brand {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 4px 14px 4px 70px;
    gap: 8px;
  }

  .site-header .brand::before {
    border-radius: 13px 8px 8px 13px;
    clip-path: polygon(0 0, 100% 0, calc(100% - 18px) 100%, 0 100%);
  }

  .site-header .brand::after {
    right: 13px;
  }

  .site-header .brand-mark {
    left: 2px;
    width: 62px;
    height: 62px;
  }

  .site-header .brand-text {
    width: auto;
    min-width: 0;
    transform: none;
    font-size: clamp(10.5px, 3.15vw, 12.5px);
    line-height: 1.05;
  }

  .brand-text {
    overflow: hidden;
    font-size: 12px;
    letter-spacing: 0;
    text-overflow: ellipsis;
  }

  .mobile-header-consult {
    position: relative;
    z-index: 3;
    height: 38px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(86, 104, 47, 0.68);
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
    background: linear-gradient(100deg, var(--accent), var(--accent-soft));
    color: #f8f6ec;
    box-shadow: 0 6px 16px rgba(86, 104, 47, 0.2);
    font-size: 10.5px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    animation: consultButtonPulse 2.8s ease-in-out infinite;
    transform-origin: center;
    transition: filter 0.2s ease, box-shadow 0.2s ease;
  }

  .mobile-header-consult:active {
    filter: brightness(0.96);
    box-shadow: 0 3px 10px rgba(86, 104, 47, 0.18);
  }

  .mobile-nav-toggle {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    margin-left: 0;
  }

  .main-nav {
    left: 12px;
    right: 12px;
    top: calc(100% + 6px);
    padding: 6px;
  }

  .main-nav a {
    min-height: 46px;
    display: flex;
    align-items: center;
    padding: 11px 12px;
    font-size: 14.5px;
  }

  .hero {
    min-height: auto;
    padding: 84px 16px 32px;
  }

  .hero-photo {
    object-position: 86% 30%;
  }

  .hero-photo-overlay {
    background:
      linear-gradient(90deg, rgba(243, 239, 227, 0.97) 0%,
        rgba(243, 239, 227, 0.91) 38%, rgba(243, 239, 227, 0.52) 68%,
        rgba(243, 239, 227, 0.16) 100%),
      linear-gradient(180deg, rgba(243, 239, 227, 0.18) 0%,
        rgba(243, 239, 227, 0.06) 54%, rgba(60, 58, 42, 0.44) 100%);
  }

  .hero-title {
    max-width: 100%;
    font-size: clamp(2rem, 9.5vw, 2.6rem);
    line-height: 1.03;
    overflow-wrap: break-word;
  }

  .hero-slogan-wrap {
    min-height: 1.45em;
    margin-top: 8px;
  }

  .hero-slogan {
    font-size: 0.58em;
    line-height: 1.2;
  }

  .hero-sub {
    margin-top: 6px;
    font-size: 14.5px;
    line-height: 1.5;
  }

  .hero-stats {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 22px;
  }

  .hero-stat {
    width: 100%;
    min-height: 0;
    padding: 12px 14px;
    gap: 10px;
  }

  .hero-stat-icon {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
  }

  .hero-stat-text {
    font-size: 13.5px;
    line-height: 1.4;
  }

  .hero-stat-break-desktop {
    display: none;
  }

  .hero-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 22px;
  }

  .hero-actions .btn-primary,
  .hero-actions .btn-secondary {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    text-align: center;
  }

  .hero-actions .btn-secondary {
    padding: 12px 10px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-s);
    background: rgba(243, 239, 227, 0.72);
  }

  .directions,
  .benefits,
  .social-benefits,
  .terms,
  .payments,
  .faq,
  .apply,
  .documents,
  .timeline,
  .gallery {
    padding: 20px 16px;
  }

  .section-head {
    margin-bottom: 16px;
    padding: 0;
  }

  .section-title {
    width: min(100%, 22ch);
    margin-inline: auto;
    font-size: clamp(1.55rem, 7vw, 1.85rem);
    line-height: 1.1;
    letter-spacing: 0;
    text-wrap: balance;
  }

  .section-desc {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.5;
  }

  .payment-tabs {
    position: relative;
    overflow: hidden;
  }

  .payment-tabs::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    width: 32px;
    height: 48px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--bg-0));
  }

  .payment-tabs-nav {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .payment-tabs-nav::-webkit-scrollbar {
    display: none;
  }

  .payment-tab {
    flex: 0 0 auto;
    min-width: max-content;
    padding: 4px 14px 15px;
    font-size: 14px;
    scroll-snap-align: start;
  }

  .payment-tab::after {
    left: 14px;
    right: 14px;
  }

  .payment-tabs-content {
    min-height: 126px;
    padding-top: 20px;
  }

  .payment-tab-panel {
    min-height: 240px;
    padding: 22px 18px 132px;
  }

  .payment-tab-panel::before {
    top: auto;
    right: 0;
    bottom: 72px;
    width: 100%;
    height: 50px;
    background: linear-gradient(
      180deg,
      rgba(243, 239, 227, 1) 0%,
      rgba(243, 239, 227, 0.92) 24%,
      rgba(243, 239, 227, 0.62) 52%,
      rgba(243, 239, 227, 0.2) 78%,
      rgba(243, 239, 227, 0) 100%
    );
  }

  .payment-tab-panel::after {
    inset: auto 0 0;
    width: 100%;
    height: 112px;
    background-position: var(--payment-visual-position, center 38%);
  }

  .payment-tab-panel > * {
    max-width: none;
  }

  .payment-tab-panel-title {
    font-size: 1.35rem;
  }

  .payment-tab-panel-intro {
    margin-bottom: 16px !important;
  }

  .payment-detail-row {
    grid-template-columns: 14px minmax(0, 1fr);
    gap: 8px 12px;
    padding: 16px 0;
  }

  .payment-detail-row::before {
    grid-column: 1;
    grid-row: 1;
    width: 8px;
    height: 8px;
    margin-top: 6px;
  }

  .payment-detail-amount {
    grid-column: 2;
    grid-row: 1;
    font-size: 1.45rem;
  }

  .payment-detail-row > p,
  .payment-detail-copy {
    grid-column: 2;
  }

  .payment-detail-row p {
    font-size: 14px;
  }


  .benefit-grid,
  .docs-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .benefit-card p {
    font-size: 13.5px;
  }

  .benefit-card {
    padding: 24px 20px;
  }

  .benefit-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 15px;
  }

  .benefit-card h3 {
    margin-bottom: 7px;
  }

  .doc-card {
    padding: 21px 18px;
  }

  .faq-list {
    padding: 0;
  }

  .faq-question {
    gap: 14px;
    padding: 19px 0;
    font-size: 14.5px;
    line-height: 1.35;
  }

  .faq-item.is-open .faq-answer {
    padding-bottom: 20px;
  }

  .faq-answer p {
    font-size: 13.5px;
  }

  .apply-frame {
    padding: 28px 14px;
    border-radius: var(--radius-m);
  }

  .apply-inner .section-head {
    margin-bottom: 20px;
  }

  .apply-form {
    gap: 16px;
    padding: 20px 14px;
    border-radius: var(--radius-m);
  }

  .form-field input,
  .form-field select,
  .form-field textarea {
    font-size: 16px;
  }

  .form-checkbox {
    gap: 10px;
    font-size: 12.5px;
    line-height: 1.4;
  }

  .btn-submit {
    width: 100%;
    justify-content: center;
  }

  .footer-inner {
    padding: 30px 16px 24px;
  }

  .footer-top {
    align-items: flex-start;
    gap: 20px;
    padding-bottom: 18px;
  }

  .footer-nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
  }

  .footer-nav a {
    padding: 9px 8px 9px 0;
    font-size: 12.5px;
  }

  .footer-bottom {
    gap: 12px;
    padding-top: 12px;
    font-size: 11.5px;
  }

  .footer-legal {
    width: 100%;
    justify-content: flex-start;
    gap: 10px 16px;
    text-align: left;
  }

  .footer-contact-phone {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

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

  .hero-slogan.is-changing {
    transform: none;
  }
}

@media (max-width: 370px) {
  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto 40px;
    gap: 6px;
  }

  .site-header .brand {
    padding-right: 10px;
    padding-left: 64px;
  }

  .site-header .brand-mark {
    width: 58px;
    height: 58px;
  }

  .brand-text {
    font-size: 10.5px;
  }

  .mobile-header-consult {
    height: 36px;
    padding: 0 8px;
    font-size: 9.5px;
  }

  .mobile-nav-toggle {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .hero-title {
    font-size: 1.85rem;
  }

  .footer-nav {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  /* Keep decorative stars from participating in mobile title wrapping. */
  .section-title::before {
    display: block;
    width: 0.72em;
    height: 0.72em;
    margin: 0 auto 0.32em;
    vertical-align: initial;
  }

  .section-title::after {
    display: none;
  }
}

@media (max-width: 620px) {
  /* Keep the contract terms readable on phone widths without changing desktop. */
  .terms-stage {
    padding: 18px;
    border-radius: 22px 8px 22px 8px;
  }

  .terms-criteria-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .terms-criterion {
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 20px 18px;
  }

  .terms-criterion-icon {
    position: relative;
    right: auto;
    bottom: auto;
    order: 2;
    width: 84px;
    height: 84px;
    margin: 2px auto 10px;
    transform: none;
  }

  .terms-criterion::before {
    right: 50%;
    top: 42px;
    bottom: auto;
    width: 132px;
    height: 132px;
    transform: translateX(50%);
  }

  .terms-criterion::after {
    right: 50%;
    top: 52px;
    bottom: auto;
    width: 108px;
    height: 108px;
    transform: translateX(50%);
  }

  .terms-criterion-topline {
    position: relative;
    z-index: 3;
    order: 1;
    justify-content: center;
    margin-bottom: 8px;
  }

  .terms-criterion h3,
  .terms-cta h3,
  .doc-card h4,
  .timeline-step-copy h4 {
    text-align: center;
  }

  .terms-criterion h3 {
    position: relative;
    z-index: 3;
    order: 3;
    font-size: 1.22rem;
    line-height: 1.16;
  }

  .terms-criterion-main {
    position: relative;
    z-index: 3;
    order: 4;
  }

  .terms-criterion-detail {
    position: relative;
    z-index: 3;
    order: 5;
  }

  .terms-criterion-main,
  .terms-criterion:first-child .terms-criterion-main,
  .terms-criterion-detail {
    max-width: none;
  }

  .terms-criterion:first-child .terms-criterion-main {
    font-size: 15px;
    line-height: 1.52;
  }

  .terms-cta {
    gap: 16px;
    margin-top: 14px;
    padding: 22px 18px;
    text-align: center;
  }

  .terms-cta-eyebrow,
  .terms-cta p {
    text-align: center;
  }

  .terms-cta p {
    margin-inline: auto;
  }

  .terms-cta-actions {
    width: 100%;
  }

  /* Mobile timeline uses content-driven row heights to prevent text overlap. */
  .timeline {
    padding-bottom: 42px;
  }

  .documents {
    padding-top: 32px;
  }

  .timeline .section-head {
    margin-bottom: 24px;
  }

  .timeline-route {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 100%;
    padding: 4px 0 0;
  }

  .timeline-route::before {
    left: 27px;
    top: 31px;
    bottom: 31px;
    transform: none;
  }

  .timeline-step {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    grid-template-rows: auto;
    align-items: start;
    height: auto;
    min-height: 0;
    column-gap: 14px;
    padding: 0 0 28px;
  }

  .timeline-step:last-child {
    padding-bottom: 0;
  }

  .timeline-step-copy,
  .timeline-step--with-note .timeline-step-copy,
  .timeline-step--left .timeline-step-copy,
  .timeline-step--right .timeline-step-copy {
    grid-column: 2;
    grid-row: 1;
    justify-self: stretch;
    align-self: start;
    width: 100%;
    max-width: none;
    padding: 0;
    text-align: left;
  }

  .timeline-step-node {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    width: 54px;
    height: 54px;
    margin: 0;
  }

  .timeline-step-node img {
    width: 40px;
    height: 40px;
  }

  .timeline-step-copy h4 {
    margin-bottom: 7px;
    font-size: 1.05rem;
    line-height: 1.24;
  }

  .timeline-step-copy p {
    max-width: none;
    font-size: 14px;
    line-height: 1.5;
  }

  .timeline-step-note {
    grid-column: 2;
    grid-row: 2;
    justify-self: stretch;
    width: 100%;
    max-width: none;
    min-height: 0;
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 14px;
  }

  .timeline-step-note::before {
    display: none;
  }

  .timeline-step-note p {
    max-width: none;
    font-size: 0.94rem;
    line-height: 1.3;
  }

  /* Center FAQ labels relative to the whole expandable frame, not the icon. */
  .faq-question {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 10px;
    min-height: 70px;
    padding: 14px 12px;
    text-align: center;
  }

  .faq-question::before {
    content: "";
    grid-column: 1;
    width: 34px;
    height: 34px;
  }

  .faq-question > span:not(.faq-icon) {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    text-align: center;
    text-wrap: balance;
  }

  .faq-question > .faq-icon {
    grid-column: 3;
    grid-row: 1;
  }

  /* Privacy modal: stack summary content and preserve readable line lengths. */
  .privacy-modal {
    padding: 10px;
  }

  .privacy-modal-dialog {
    width: 100%;
    max-height: calc(100dvh - 20px);
    padding: 22px 16px 26px;
    border-radius: 24px 8px 24px 8px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .privacy-modal-close {
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
  }

  .privacy-modal-header {
    max-width: none;
    margin-bottom: 20px;
    padding-right: 0;
  }

  .privacy-modal-kicker {
    max-width: calc(100% - 8px);
    margin-bottom: 7px;
    padding-right: 48px;
    font-size: 9.5px;
    line-height: 1.4;
    letter-spacing: 0.08em;
  }

  .privacy-modal-header h2 {
    margin-bottom: 10px;
    font-size: clamp(1.55rem, 7.2vw, 1.85rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
  }

  .privacy-modal-header > p:last-child {
    font-size: 13.5px;
    line-height: 1.5;
  }

  .privacy-modal-summary {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 20px;
  }

  .privacy-modal-summary > div {
    padding: 13px 14px;
  }

  .privacy-modal-summary strong {
    font-size: 13px;
  }

  .privacy-modal-summary span {
    font-size: 12.5px;
    line-height: 1.5;
  }

  .privacy-policy-body {
    gap: 10px;
  }

  .privacy-policy-section {
    padding: 16px 14px;
  }

  .privacy-policy-section h3 {
    font-size: 1.05rem;
  }

  .privacy-policy-section p,
  .privacy-policy-section li {
    font-size: 13px;
    line-height: 1.55;
  }

  .privacy-operator-card {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
  }

  .privacy-policy-links {
    overflow-wrap: anywhere;
  }
}


