/* ══════════════════════════════════════════════════════════════════
   ARISTO — PREMIUM MOBILE ENHANCEMENTS
   Target: ≤ 768px — does NOT override desktop styles
   Strategy: luxury fintech feel — clean, breathable, smooth
   ══════════════════════════════════════════════════════════════════ */

/* ── GLOBAL MOBILE TOKENS ── */
@media (max-width: 768px) {

  :root {
    --header-h: 68px;
    --section-pad: 72px;
    --card-pad: 24px;
    --radius: 20px;
    --radius-sm: 14px;
    --radius-xs: 10px;
  }

  /* ── BODY & BASE ── */
  html, body {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  /* ── CONTAINER ── */
  .container {
    width: calc(100% - 40px);
    margin-inline: auto;
  }

  /* ── SECTION SPACING ── */
  .section {
    padding: var(--section-pad) 0;
  }

  .section-head {
    margin-bottom: 44px;
  }

  .section-head h2 {
    font-size: clamp(1.85rem, 7.5vw, 2.4rem);
    letter-spacing: -.022em;
    line-height: 1.1;
  }

  .subhead {
    font-size: .93rem;
    line-height: 1.72;
    margin-top: 14px;
  }

  .eyebrow {
    font-size: .70rem;
    letter-spacing: .16em;
  }

  /* ══════════════════════════════════
     HEADER & NAVIGATION
  ══════════════════════════════════ */

  .site-header {
    /* taller safe tap zone, stronger blur */
    backdrop-filter: blur(32px) saturate(2);
    -webkit-backdrop-filter: blur(32px) saturate(2);
  }

  .header-inner {
    height: var(--header-h);
    padding: 0 2px;
  }

  .brand {
    padding-right: 0;
  }

  .brand-logo {
    height: 36px;
    max-width: 148px;
  }

  /* Hide desktop nav elements */
  .nav,
  .nav-right,
  .social-links {
    display: none !important;
  }

  /* Premium hamburger button */
  .nav-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.05);
    color: #fff;
    font-size: 1.05rem;
    cursor: pointer;
    transition: background .2s, border-color .2s, transform .2s;
    flex-shrink: 0;
    padding: 0;
  }

  .nav-toggle:hover,
  .nav-toggle[aria-expanded="true"] {
    background: rgba(110,183,68,.14);
    border-color: rgba(110,183,68,.40);
    transform: scale(1.04);
  }

  /* ── MOBILE MENU PANEL ── */
  .mobile-nav {
    padding: 20px 20px 28px;
    border-top: 1px solid rgba(255,255,255,.07);
    background: rgba(4,6,4,.98);
    backdrop-filter: blur(40px) saturate(1.8);
    -webkit-backdrop-filter: blur(40px) saturate(1.8);
    box-shadow: 0 24px 60px rgba(0,0,0,.50), 0 0 0 1px rgba(110,183,68,.06);
    border-radius: 0 0 26px 26px;

    /* Smooth slide-down open */
    animation: none;
    transition: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    max-height: calc(100dvh - var(--header-h));
  }

  .mobile-nav:not([hidden]) {
    display: block;
    animation: mobile-nav-drop .32s cubic-bezier(.22,.8,.2,1) both;
  }

  @keyframes mobile-nav-drop {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Nav rows */
  .mobile-nav-item {
    border-bottom: 1px solid rgba(255,255,255,.06);
  }

  .mobile-nav-item:last-of-type {
    border-bottom: none;
  }

  .mobile-nav-parent {
    display: flex;
    align-items: center;
    padding: 15px 4px;
    color: rgba(255,255,255,.90);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -.01em;
    transition: color .18s, padding-left .22s;
    border-bottom: none !important;
  }

  .mobile-nav-parent:hover {
    color: var(--green);
    padding-left: 6px !important;
  }

  /* Sub-links */
  .mobile-nav-sub a {
    padding: 9px 12px;
    font-size: .82rem;
    color: rgba(255,255,255,.50);
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
    border-bottom: none;
    transition: color .16s, padding-left .18s;
  }

  .mobile-nav-sub a::after {
    display: none !important;
  }

  .mobile-nav-sub a:hover {
    color: var(--green);
    padding-left: 20px;
  }

  .mobile-nav-sub.open {
    display: block;
    padding-bottom: 10px;
    padding-left: 8px;
  }

  /* CTA button inside nav */
  .mobile-nav > .btn {
    display: flex;
    width: 100%;
    justify-content: center;
    margin-top: 20px;
    padding: 16px 24px;
    border-radius: 16px;
    font-size: .96rem;
    font-weight: 700;
    letter-spacing: .03em;
    box-shadow: 0 10px 32px rgba(110,183,68,.28), 0 2px 8px rgba(110,183,68,.16);
  }

  /* ══════════════════════════════════
     HERO SECTION
  ══════════════════════════════════ */

  .hero {
    padding: 52px 0 64px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .pill {
    font-size: .70rem;
    letter-spacing: .11em;
    padding: 8px 16px;
    gap: 8px;
  }

  .hero h1 {
    font-size: clamp(2.5rem, 10.5vw, 3.4rem);
    line-height: 1.02;
    letter-spacing: -.022em;
    margin: 22px 0 18px;
  }

  .hero .lead {
    font-size: .97rem;
    line-height: 1.78;
    color: rgba(255,255,255,.68);
    margin-bottom: 28px;
  }

  /* Hero CTA */
  .hero-cta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 28px 0 22px;
  }

  .hero-cta .btn,
  .hero-primary-cta {
    width: 100%;
    min-width: 0;
    padding: 17px 24px;
    border-radius: 16px;
    font-size: .97rem;
    font-weight: 700;
    text-align: center;
    justify-content: center;
    letter-spacing: .04em;
  }

  .btn-primary.btn-lg {
    box-shadow: 0 14px 40px rgba(110,183,68,.32), 0 4px 12px rgba(110,183,68,.18);
  }

  /* Licenses bar */
  .licenses {
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,.08);
    font-size: .82rem;
    line-height: 2;
    gap: 2px;
  }

  .licenses::before {
    height: calc(100% - 20px);
    top: 20px;
  }

  /* Photo card */
  .photo-card {
    aspect-ratio: 4 / 4.6;
    border-radius: 22px;
    box-shadow: 0 28px 72px rgba(8,12,9,.55), 0 0 0 1px rgba(255,255,255,.07);
  }

  /* Floating badge – detached below on mobile */
  .floating-badge {
    position: static;
    display: inline-flex;
    margin-top: 14px;
    max-width: 100%;
    padding: 13px 18px;
    border-radius: 16px;
    gap: 13px;
    box-shadow: 0 10px 32px rgba(8,12,9,.20);
  }

  .badge-icon {
    width: 42px;
    height: 42px;
  }

  .badge-title {
    font-size: .88rem;
  }

  /* ══════════════════════════════════
     TRUST BAR
  ══════════════════════════════════ */

  .trust-bar-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .trust-stat {
    max-width: none;
    border-right: none !important;
    border-bottom: 1px solid rgba(255,255,255,.06);
    padding: 26px 16px;
  }

  .trust-stat:nth-child(odd) {
    border-right: 1px solid rgba(255,255,255,.06) !important;
  }

  .trust-val {
    font-size: 2.3rem;
  }

  .trust-lbl {
    font-size: .72rem;
    margin-top: 6px;
  }

  /* ══════════════════════════════════
     CARDS & GRIDS
  ══════════════════════════════════ */

  .cards.two,
  .cards.three,
  .cards.four,
  .cards.five {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .card {
    padding: var(--card-pad);
    border-radius: var(--radius);
  }

  .card:hover {
    transform: none; /* disable lift on touch */
  }

  .card-value {
    font-size: 2.4rem;
  }

  /* ══════════════════════════════════
     SOLUTION CARDS
  ══════════════════════════════════ */

  .solution {
    padding: var(--card-pad);
    border-radius: 22px;
  }

  .solution:hover {
    transform: none;
  }

  .solution-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    margin-bottom: 18px;
    font-size: 1.3rem;
  }

  .solution h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
  }

  .solution p {
    font-size: .91rem;
    line-height: 1.72;
  }

  .checklist li {
    font-size: .88rem;
    gap: 10px;
  }

  /* ══════════════════════════════════
     PROCESS STEPS
  ══════════════════════════════════ */

  .steps-wrapper {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .steps-wrapper::before {
    display: none;
  }

  .steps-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    /* remove connector line */
  }

  .steps-wrapper::before {
    display: none !important;
  }

  .step {
    display: grid;
    grid-template-columns: 54px 1fr;
    grid-template-rows: auto auto;
    column-gap: 18px;
    row-gap: 4px;
    align-items: start;
    text-align: left;
    padding: 20px 0;
    border-bottom: 1px solid rgba(13,20,16,.06);
  }

  .step:last-child {
    border-bottom: none;
  }

  .step-dot {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 54px;
    height: 54px;
    flex-shrink: 0;
    margin-bottom: 0;
    font-size: 1.15rem;
    box-shadow: 0 0 0 5px var(--offwhite), var(--shadow-xs);
    align-self: start;
  }

  /* Step content wraps into col 2 */
  .step h3 {
    grid-column: 2;
    grid-row: 1;
    font-size: .95rem;
    margin-bottom: 0;
    padding-top: 4px;
  }

  .step p {
    grid-column: 2;
    grid-row: 2;
    font-size: .87rem;
    line-height: 1.65;
  }

  /* ══════════════════════════════════
     TESTIMONIALS / QUOTES
  ══════════════════════════════════ */

  .quote {
    padding: var(--card-pad);
    border-radius: 20px;
  }

  .quote:hover {
    transform: none;
  }

  .quote::before {
    font-size: 5.5rem;
    top: -6px;
    right: 16px;
  }

  .review-text {
    font-size: .90rem;
    line-height: 1.72;
    -webkit-line-clamp: 6;
  }

  .review-name {
    font-size: .93rem;
  }

  /* ══════════════════════════════════
     FINAL CTA
  ══════════════════════════════════ */

  .final-cta {
    padding: 80px 0;
  }

  .final-cta-inner {
    flex-direction: column;
    gap: 36px;
    text-align: center;
  }

  .final-cta-text h2 {
    text-align: center;
    font-size: clamp(1.9rem, 8vw, 2.6rem);
  }

  .final-cta-text .lead {
    text-align: center;
    font-size: .94rem;
    line-height: 1.74;
  }

  .final-cta-divider {
    display: none;
  }

  .final-cta-actions {
    width: 100%;
    min-width: 0;
  }

  .final-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .final-buttons .btn,
  .final-cta-actions .btn {
    width: 100%;
    padding: 16px 24px;
    border-radius: 16px;
    font-size: .96rem;
    font-weight: 700;
    justify-content: center;
  }

  .application-note {
    font-size: .82rem;
    text-align: center;
    margin-top: 14px;
  }

  /* ══════════════════════════════════
     CONTACT SECTION
  ══════════════════════════════════ */

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .contact-card,
  .form-card {
    padding: var(--card-pad);
    border-radius: 20px;
  }

  .contact-card:hover,
  .form-card:hover {
    transform: none;
  }

  .contact-card h3,
  .form-card h3 {
    font-family: var(--serif);
    font-size: 1.65rem;
    letter-spacing: -.02em;
    margin-bottom: 6px;
  }

  .contact-list {
    gap: 14px;
    margin-top: 18px;
  }

  .contact-phone-hero {
    font-size: 1.5rem;
  }

  .contact-actions {
    flex-direction: column;
    gap: 10px;
    margin-top: 22px;
  }

  .contact-actions .btn {
    width: 100%;
    padding: 15px 20px;
    border-radius: 14px;
    font-size: .92rem;
    justify-content: center;
  }

  /* Forms */
  form {
    gap: 14px;
    margin-top: 18px;
  }

  label {
    font-size: .86rem;
    gap: 8px;
  }

  input,
  select,
  textarea {
    font-size: 16px; /* prevents iOS zoom */
    padding: 15px 16px;
    border-radius: 13px;
    border-width: 1.5px;
    background: #fdfffe;
  }

  input:focus,
  select:focus,
  textarea:focus {
    border-color: rgba(74,143,43,.5);
    box-shadow: 0 0 0 4px rgba(110,183,68,.10);
  }

  textarea {
    min-height: 120px;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* ══════════════════════════════════
     BUTTONS (GLOBAL)
  ══════════════════════════════════ */

  .btn {
    padding: 14px 22px;
    border-radius: 14px;
    font-size: .9rem;
    font-weight: 600;
    /* Remove hover lift on touch devices */
    -webkit-tap-highlight-color: transparent;
  }

  .btn:hover {
    transform: none;
  }

  .btn:active {
    transform: scale(.97) !important;
    opacity: .9;
  }

  .btn-lg {
    padding: 16px 28px;
    border-radius: 16px;
    font-size: .96rem;
  }

  /* ══════════════════════════════════
     PAGE HERO (INNER PAGES)
  ══════════════════════════════════ */

  .page-hero {
    padding: 52px 0 64px;
  }

  .page-hero h1 {
    font-size: clamp(2.1rem, 9vw, 3rem);
    margin: 18px 0 14px;
    line-height: 1.06;
  }

  .page-hero .lead {
    font-size: .94rem;
    line-height: 1.76;
    color: rgba(255,255,255,.66);
  }

  .page-hero-bg-letter {
    font-size: clamp(5rem, 22vw, 8rem);
    bottom: -10px;
  }

  /* ══════════════════════════════════
     ABOUT PAGE
  ══════════════════════════════════ */

  .about-grid-v2 {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .about-photo-v2 {
    position: static;
    aspect-ratio: 4 / 3.5;
    max-height: 360px;
    border-radius: 22px;
  }

  .about-photo-v2 img {
    object-position: center 18%;
  }

  .about-panel-v2 {
    padding: var(--card-pad);
    border-radius: 20px;
  }

  .about-name {
    font-size: clamp(2rem, 9.5vw, 2.8rem);
    line-height: 1.08;
  }

  .about-intro {
    font-size: .95rem !important;
    line-height: 1.78 !important;
  }

  .stat-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 20px 0;
  }

  .stat-box {
    padding: 18px 14px;
    border-radius: 16px;
  }

  .stat-box .val {
    font-size: 1.9rem;
  }

  .stat-box .lbl {
    font-size: .73rem;
    margin-top: 4px;
  }

  .about-cards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 20px 0;
  }

  .about-info-card {
    padding: 20px;
    border-radius: 18px;
  }

  .about-pillars {
    gap: 10px;
    margin-top: 0;
  }

  .about-pillar {
    padding: 16px 18px;
    border-radius: 14px;
  }

  .pillar-heading {
    font-size: .87rem;
  }

  .pillar-content p {
    font-size: .83rem;
  }

  .magellan-intro-card {
    padding: 22px var(--card-pad);
    border-radius: 18px;
  }

  .about-badge-row {
    flex-wrap: wrap;
    gap: 6px;
  }

  .about-badge-sep {
    display: none;
  }

  /* ══════════════════════════════════
     BROKERS PAGE
  ══════════════════════════════════ */

  .two-col-prose {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .two-col-prose h2 {
    font-size: 1.5rem;
    margin-bottom: 14px;
  }

  .broker-why-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .broker-card {
    padding: var(--card-pad);
    border-radius: 18px;
  }

  .broker-card:hover {
    transform: none;
  }

  .broker-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    font-size: 1.3rem;
    margin-bottom: 14px;
  }

  /* ══════════════════════════════════
     MORTGAGE TOOLS / CALCULATOR
  ══════════════════════════════════ */

  .calc-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .calc-card {
    padding: var(--card-pad);
    border-radius: 20px;
  }

  .calc-card h3 {
    font-size: 1.45rem;
    margin-bottom: 6px;
  }

  .calc-result {
    padding: 22px;
    border-radius: 16px;
    margin-top: 20px;
  }

  .calc-result-amount {
    font-size: 2.6rem;
  }

  .calc-result-breakdown {
    gap: 7px;
    font-size: .84rem;
  }

  .range-val {
    font-size: 1.05rem;
  }

  input[type="range"] {
    height: 6px;
    margin: 12px 0 0;
  }

  input[type="range"]::-webkit-slider-thumb {
    width: 26px;
    height: 26px;
  }

  /* ══════════════════════════════════
     THANK YOU PAGE
  ══════════════════════════════════ */

  .thankyou-section {
    padding: 72px 0;
    min-height: auto;
  }

  .thankyou-card {
    padding: 36px var(--card-pad);
    border-radius: 24px;
  }

  .thankyou-badge {
    width: 68px;
    height: 68px;
    font-size: 1.9rem;
    margin-bottom: 18px;
  }

  .thankyou-card h1 {
    font-size: clamp(1.9rem, 8vw, 2.6rem);
    margin-bottom: 14px;
  }

  .thankyou-info-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 26px;
  }

  .thankyou-info-box {
    padding: 18px;
    border-radius: 16px;
  }

  .thankyou-actions {
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
  }

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

  /* ══════════════════════════════════
     FOOTER
  ══════════════════════════════════ */

  .footer {
    padding: 56px 0 36px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .footer h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
  }

  .footer h4 {
    font-size: .72rem;
    margin-bottom: 14px;
  }

  .footer p.muted {
    font-size: .86rem;
    line-height: 1.72;
  }

  .footer ul {
    gap: 10px;
  }

  .footer a {
    font-size: .86rem;
  }

  .footer-tagline {
    font-size: .70rem;
    padding: 7px 13px;
    margin-top: 14px;
  }

  .footer-social {
    gap: 8px;
    margin-top: 16px;
  }

  .footer-social a {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .footer-bottom {
    margin-top: 40px;
    padding-top: 22px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .footer-bottom p {
    font-size: .76rem;
  }

  /* ══════════════════════════════════
     MODAL
  ══════════════════════════════════ */

  .modal-dialog {
    width: calc(100% - 24px);
    padding: 26px 22px 22px;
    border-radius: 24px;
    max-height: 90dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .modal-close {
    top: 12px;
    right: 14px;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    font-size: 18px;
  }

  #modal-title {
    font-size: 1.55rem;
  }

  .modal-actions {
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
  }

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

  /* ══════════════════════════════════
     BACK TO TOP
  ══════════════════════════════════ */

  .back-to-top {
    bottom: 18px;
    right: 14px;
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  /* ══════════════════════════════════
     SCROLL ANIMATIONS — gentler on mobile
  ══════════════════════════════════ */

  .fade-up {
    transform: translateY(18px);
    transition:
      opacity .55s cubic-bezier(0,.55,.45,1),
      transform .55s cubic-bezier(0,.55,.45,1);
  }

  /* ══════════════════════════════════
     MISC PREMIUM TOUCHES
  ══════════════════════════════════ */

  /* Pill shimmer feels native on mobile */
  .pill::after {
    animation-duration: 4s;
  }

  /* Smooth tap feedback on interactive cards */
  .card, .solution, .quote, .broker-card,
  .about-info-card, .stat-box, .calc-card {
    -webkit-tap-highlight-color: transparent;
    transition:
      box-shadow .3s var(--ease),
      border-color .25s;
    /* remove translateY on mobile — feels wrong on touch */
  }

  /* Trust stat hover line stays off on mobile */
  .trust-stat::after {
    display: none;
  }

  /* Section decorative numbers — smaller on mobile */
  .section-head::before {
    font-size: 4.5rem;
    top: -16px;
    right: 0;
    opacity: .6;
  }

}

/* ── VERY SMALL SCREENS (≤ 390px / iPhone SE etc.) ── */
@media (max-width: 390px) {

  :root {
    --section-pad: 60px;
    --card-pad: 20px;
  }

  .container {
    width: calc(100% - 32px);
  }

  .hero h1 {
    font-size: clamp(2.2rem, 11vw, 3rem);
  }

  .hero-cta .btn,
  .hero-primary-cta {
    font-size: .92rem;
    padding: 15px 18px;
  }

  .trust-bar-inner {
    grid-template-columns: 1fr;
  }

  .trust-stat:nth-child(odd) {
    border-right: none !important;
  }

  .trust-stat {
    padding: 22px 18px;
    border-bottom: 1px solid rgba(255,255,255,.06) !important;
  }

  .trust-stat:last-child {
    border-bottom: none !important;
  }

  .trust-val {
    font-size: 2.1rem;
  }

  .stat-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .about-photo-v2 {
    aspect-ratio: 4 / 3.2;
  }

  .calc-result-amount {
    font-size: 2.3rem;
  }

  .thankyou-card {
    padding: 30px 18px;
  }

  .mobile-nav-parent {
    font-size: .97rem;
  }

  .section-head h2 {
    font-size: clamp(1.7rem, 9.5vw, 2.2rem);
  }

  .floating-badge {
    padding: 11px 15px;
  }

}

/* ── TOUCH DEVICE: disable hover effects that feel broken on tap ── */
@media (hover: none) and (pointer: coarse) {
  .card:hover,
  .solution:hover,
  .quote:hover,
  .broker-card:hover,
  .about-info-card:hover,
  .stat-box:hover,
  .about-pillar:hover,
  .floating-badge:hover {
    transform: none !important;
    box-shadow: var(--shadow-xs) !important;
    border-color: var(--border) !important;
  }

  .card:hover::before,
  .solution:hover::before,
  .solution:hover::after {
    opacity: 0 !important;
  }

  .btn:hover {
    transform: none !important;
  }

  /* Keep active state feedback */
  .btn:active {
    transform: scale(.97) !important;
    opacity: .88 !important;
  }

  .card:active,
  .solution:active,
  .quote:active {
    opacity: .94;
  }
}
