/* =========================================================
   Gulecha CPA — responsive layer (tablet & mobile)
   Loaded last on every page. Desktop (1280px+) is unchanged;
   rules below only adapt the layout for narrower screens.
   ========================================================= */

html, body { overflow-x: clip; }
body { min-width: 0; }
.wrap { width: min(var(--wrap), calc(100% - 48px)); }
img { height: auto; }
.hx img, .xp-item img, .fo > img, .serve-card img, .res .thumb img, .feature-post .img img,
.cm-photo img, .video-card img, .menu-feature img, .tab-panel .img img, .portrait-photo img,
.member .ph img, .signature .avatar img, .map-card img { height: 100%; }

/* mobile menu button (inserted by main.js, hidden on desktop) */
.nav-toggle { display: none; width: 46px; height: 46px; border-radius: 14px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); backdrop-filter: blur(8px); position: relative; flex: none; }
.nav-toggle span { position: absolute; left: 13px; right: 13px; height: 2px; border-radius: 2px; background: #fff; transition: transform .35s var(--ease), opacity .25s, background .3s; }
.nav-toggle span:nth-child(1) { top: 15px; } .nav-toggle span:nth-child(2) { top: 22px; } .nav-toggle span:nth-child(3) { top: 29px; }
.header.scrolled .nav-toggle { border-color: var(--line-2); background: #fff; }
.header.scrolled .nav-toggle span { background: var(--ink); }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-extra { display: none; }

/* ---------------------------------------------------------
   ≤ 1279px — small laptops / large tablets landscape
   --------------------------------------------------------- */
@media (max-width: 1279px) {
  .home .header .wrap, .home .topbar .wrap { padding: 0 24px; }
  .hx-inner { padding-left: 24px; padding-right: 24px; }
  .hx-foot { left: 24px; right: 24px; }
  .home .header .nav > li > a { padding: 10px 11px; font-size: 15px; }
  .topbar .group { gap: 20px; }
  .topbar .group:last-child > span:first-child { display: none; }   /* "Portland, OR · Serving the West Coast" */
}

/* ---------------------------------------------------------
   ≤ 1200px — switch to the mobile menu
   --------------------------------------------------------- */
@media (max-width: 1200px) {
  .nav-toggle { display: block; }
  .nav-cta { gap: 10px; }
  .nav-cta .portal-link { display: none; }
  .header .wrap { gap: 12px; }
  .header nav { display: none; position: fixed; left: 0; right: 0; bottom: 0; top: 130px; z-index: 60; background: #06140E; overflow-y: auto; padding: 18px 24px 40px; -webkit-overflow-scrolling: touch; }
  .nav-open { overflow: hidden; }
  .nav-open .header nav { display: block; animation: navIn .35s var(--ease); }
  @keyframes navIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
  .nav-open .header, .nav-open .header.scrolled { background: #06140E; box-shadow: none; }
  .nav-open .header .logo-light { opacity: 1; }
  .nav-open .header .logo-dark { opacity: 0; }
  .nav-open .header .nav-toggle { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.25); }
  .nav-open .header .nav-toggle span { background: #fff; }

  .header .nav { flex-direction: column; align-items: stretch; gap: 0; max-width: 720px; margin: 0 auto; }
  .header .nav > li { border-bottom: 1px solid rgba(255,255,255,.1); }
  .home .header .nav > li > a, .home .header.scrolled .nav > li > a { display: flex; justify-content: space-between; padding: 18px 4px; font-size: 20px; font-weight: 600; color: #fff; border-radius: 0; background: none; }
  .home .header .nav > li > a.active { color: var(--leaf); }
  .home .header .nav > li:hover > a { background: none; }
  .header .nav > li > a .icon { width: 20px; height: 20px; transition: transform .3s; }
  .header .nav > li:hover > a .icon { transform: none; }
  .header .nav > li.open > a .icon { transform: rotate(180deg); }

  .header .menu, .header .menu.mega, .header .menu.mega.mega-4 { position: static; transform: none; opacity: 1; visibility: visible; display: none; width: auto; box-shadow: none; border: 0; border-radius: 0; background: transparent; padding: 0 0 14px; grid-template-columns: 1fr 1fr; gap: 4px; }
  .header .menu::before { display: none; }
  .nav > li:hover .menu, .nav > li:hover .menu.mega.mega-4 { transform: none; }
  .header .nav > li.open > .menu { display: grid; }
  .header .menu-feature { display: none; }
  .header .menu-item { padding: 12px 10px; }
  .header .menu-item:hover { background: rgba(255,255,255,.06); }
  .header .menu-item strong { color: #fff; }
  .header .menu-item small { color: rgba(255,255,255,.6); }
  .header .menu-item .ico { background: rgba(47,191,122,.14); color: var(--leaf); }
  .nav-extra { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 720px; margin: 26px auto 0; }
  .nav-extra .btn { justify-content: center; padding: 0 16px; }
  .nav-extra .icon { width: 17px; height: 17px; }

  /* mega menus on desktop-width tablets keep working by hover above this width only */
  .menu.mega, .menu.mega.mega-4 { left: 0; }
}

/* ---------------------------------------------------------
   ≤ 1024px — tablets
   --------------------------------------------------------- */
@media (max-width: 1024px) {
  .home .section, .home.inner .section { padding: 90px 0; }
  .home .section.tight { padding: 70px 0; }
  .home .h2 { font-size: 46px !important; }
  .section-head { grid-template-columns: 1fr; gap: 18px; margin-bottom: 44px; }
  .home .lead { font-size: 18px; }

  /* top bar */
  .topbar .group:first-child > a[href^="mailto"] { display: none; }

  /* hero (home) */
  .hx { height: auto; min-height: 0; }
  .hx-inner, .hx:not(.ph) .hx-inner { grid-template-columns: 1fr; height: auto; gap: 44px; padding-top: 170px; padding-bottom: 130px; }
  .hx-copy { padding-top: 0; }
  .hx h1 { font-size: 64px; max-width: 760px; }
  .hx-card { max-width: 560px; animation: none; }
  .hx-scroll { display: none; }

  /* inner page banner */
  .hx.ph { min-height: 0; }
  .hx.ph .hx-inner { grid-template-columns: 1fr; padding: 170px 24px 80px; gap: 36px; }
  .hx.ph h1 { font-size: 56px; }
  .ph-facts { max-width: 620px; }
  .hx.ph.contact .hx-inner { padding-bottom: 170px; }

  /* homepage sections */
  .intro2 { grid-template-columns: 1fr; gap: 18px; }
  .statement { font-size: 42px; }
  .bento-stats { grid-template-columns: 1fr 1fr; margin-top: 60px; }
  .xp { height: 520px; }
  .xp-item.active .xp-body h3 { font-size: 36px; }
  .bento { grid-template-columns: repeat(2, 1fr); grid-auto-rows: auto !important; }
  .bx, .bx.s3, .bx.s4, .bx.s6 { grid-column: span 1; grid-row: auto; min-height: 230px; }
  .bx.feat { grid-column: span 2; grid-row: auto; min-height: 460px; }
  .nm { grid-template-columns: 1fr; gap: 50px; }
  .process { grid-template-columns: 1fr 1fr; gap: 40px 24px; }
  .process::before, .process::after, .home .process::before, .home .process::after { display: none; }
  .fo { height: auto; padding: 110px 0; }
  .fo-card { width: auto; max-width: 640px; }
  .split { grid-template-columns: 1fr; gap: 50px; }
  .video-card { aspect-ratio: 16 / 11; }
  .cm { grid-template-columns: 1fr 1fr; grid-auto-rows: auto; }
  .cm-photo { grid-column: span 2; grid-row: auto; min-height: 380px; }
  .cm-card, .cm-split { grid-column: span 2; }
  .testi-grid { grid-template-columns: 1fr 1fr; }
  .testi.big { grid-column: span 2; }
  .lx { grid-template-columns: 1fr; gap: 50px; }
  .map-wrap { max-width: 480px; margin: 0 auto; }
  .res-grid { grid-template-columns: 1fr 1fr; }
  .faq-wrap { grid-template-columns: 1fr; gap: 40px; }
  .faq-wrap .sticky { position: static; }
  .fcta { padding: 110px 0; }
  .fcta h2 { font-size: 60px; }

  /* shared inner-page components */
  .deliver, .founder, .booking, .contact-grid, .article-layout { grid-template-columns: 1fr; gap: 50px; }
  .booking .side, .aside-stick { position: static; }
  .portrait { max-width: 460px; width: 100%; margin: 0 auto; }
  .included, .mvv, .why-grid, .team-grid, .giving { grid-template-columns: 1fr 1fr; }
  .mvv .card:last-child, .giving .give:last-child { grid-column: span 2; }
  .timeline { grid-template-columns: 1fr 1fr; }
  .related { grid-template-columns: 1fr 1fr; }
  .loc-grid { grid-template-columns: 1fr 1fr !important; }
  .action-cards { grid-template-columns: 1fr; max-width: 640px; margin-left: auto; margin-right: auto; }
  .tab-panel { grid-template-columns: 1fr; padding: 22px; gap: 30px; }
  .tab-panel .img { height: 320px; }
  .tabs { width: 100%; overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; flex: none; }
  .feature-post { grid-template-columns: 1fr; }
  .feature-post .img { min-height: 300px; }
  .check-grid { grid-template-columns: 1fr 1fr; }
  .calc, .calc.active { grid-template-columns: 1fr; }
  .dl-row { grid-template-columns: 140px 1fr; }
  .dl-row .tag { grid-column: 2; justify-self: start; }

  /* footer */
  .footer-top { grid-template-columns: 1fr 1fr 1fr; gap: 40px; }
  .footer .f-brand { grid-column: 1 / -1; }
  .footer .f-portal a, .footer .f-contact li span, .footer a { white-space: normal; }
}

/* ---------------------------------------------------------
   ≤ 760px — phones
   --------------------------------------------------------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { width: calc(100% - 40px); }
  .home .section, .home.inner .section { padding: 72px 0; }
  .home .section.tight { padding: 56px 0; }
  .home .h2 { font-size: 36px !important; line-height: 1.08; }
  .home .lead { font-size: 17px; }
  .section-head { margin-bottom: 34px; }
  .btn { height: 52px; font-size: 15.5px; }

  /* top bar: phone + client portal only */
  .home .topbar .wrap { padding: 0 16px; }
  .topbar .wrap { height: 38px; font-size: 12.5px; }
  .topbar .group { gap: 14px; }
  .topbar .group:first-child > .hours-top, .topbar .group:last-child > a[data-soon], .topbar .group:last-child > a[href="#"] { display: none; }
  .home .header { top: 38px; }
  .home .header.scrolled { top: 0; }

  /* header */
  .home .header .wrap { padding: 0 16px; height: 72px; }
  .home .brand, .home .brand img { height: 44px; }
  .nav-cta .btn-sm { height: 42px; font-size: 13.5px; padding: 0 16px; }
  .nav-cta .btn-sm .arrow { display: none; }
  .nav-toggle { width: 42px; height: 42px; border-radius: 12px; }
  .nav-toggle span { left: 12px; right: 12px; }
  .nav-toggle span:nth-child(1) { top: 13px; } .nav-toggle span:nth-child(2) { top: 20px; } .nav-toggle span:nth-child(3) { top: 27px; }
  .header nav { padding: 10px 20px 40px; }
  .header .menu, .header .menu.mega, .header .menu.mega.mega-4 { grid-template-columns: 1fr; }
  .nav-extra { grid-template-columns: 1fr; }

  /* hero (home) */
  .hx-inner, .hx:not(.ph) .hx-inner { padding: 140px 20px 120px; gap: 36px; }
  .hx h1 { font-size: 44px; line-height: 1.02; margin: 22px 0 20px; }
  .chip { font-size: 12.5px; }
  .rotator { flex-direction: column; align-items: flex-start; gap: 4px; font-size: 18px; }
  .rotator .rot-wrap { min-width: 0; width: 100%; }
  .hx-actions { flex-direction: column; align-items: stretch; margin-top: 30px; }
  .hx-actions .btn { justify-content: center; }
  .hx .btn-primary, .hx .btn-glass { height: 54px; }
  .hx-proof { gap: 18px; flex-wrap: wrap; margin-top: 34px; }
  .hx-proof div { padding-left: 12px; }
  .hx-proof b { font-size: 22px; }
  .hx-proof span { font-size: 12.5px; }
  .hx-card { padding: 22px; border-radius: 22px; }
  .hx-card .big b { font-size: 56px; }
  .hx-card li em { display: none; }
  .hx-foot { left: 20px; right: 20px; bottom: 22px; }
  .hx-loc { flex-wrap: wrap; gap: 10px; font-size: 13px; }
  .hx-loc .lbl { min-width: 200px; }
  .hx-bars button { width: 26px; }
  .hx-grid { background-size: 56px 56px; }

  /* inner page banner */
  .hx.ph .hx-inner { padding: 140px 20px 64px; gap: 30px; }
  .hx.ph h1 { font-size: 40px; line-height: 1.05; margin: 20px 0 18px; }
  .ph-lead { font-size: 17px; }
  .hx.ph .crumbs { font-size: 12.5px; flex-wrap: wrap; border-radius: 16px; }
  .ph-facts { padding: 22px; }
  .hx.ph.contact .hx-inner { padding-bottom: 140px; }
  .meta-row { flex-wrap: wrap; gap: 12px 20px; }

  /* band */
  .band { height: 60px; }
  .band-track span { font-size: 19px; gap: 20px; padding-right: 20px; }

  /* homepage sections */
  .statement { font-size: 30px; line-height: 1.18; }
  .bento-stats { gap: 12px; }
  .bs { padding: 22px; min-height: 160px; border-radius: 20px; }
  .bs b { font-size: 44px; }
  .bs b small { font-size: 24px; }
  .bs .lb { font-size: 13.5px; }
  .xp { flex-direction: column; height: auto; gap: 12px; }
  .xp-item { flex: none !important; height: 96px; transition: height .7s cubic-bezier(.2,.8,.2,1); border-radius: 22px; }
  .xp-item.active { height: 500px; }
  .xp-item:not(.active) .xp-body { left: 24px; right: 70px; bottom: 50%; transform: translateY(50%); }
  .xp-item:not(.active) .xp-body h3 { writing-mode: horizontal-tb; transform: none; font-size: 22px; }
  .xp-item:not(.active) .xp-num { display: none; }
  .xp-plus { top: 50%; transform: translateY(-50%); right: 20px; }
  .xp-item.active .xp-plus { top: 22px; transform: rotate(45deg); }
  .xp-item.active .xp-body { left: 22px; right: 22px; bottom: 22px; }
  .xp-item.active .xp-body h3 { font-size: 30px; }
  .xp-more p { font-size: 15px; }
  .bento { grid-template-columns: 1fr; gap: 12px; }
  .bx, .bx.feat { grid-column: auto; min-height: 0; padding: 26px; }
  .bx h3 { margin-top: 26px; font-size: 22px; }
  .bx.feat h3 { font-size: 32px; margin-top: 22px; }
  .bx.feat .bars { height: 110px; margin-top: 26px; }
  .bx.feat .feat-foot { flex-direction: column; align-items: flex-start; gap: 10px; }
  .switch { display: flex; width: 100%; }
  .switch button { flex: 1; padding: 13px 10px; font-size: 14px; }
  .nm-card { padding: 28px; min-height: 0; border-radius: 24px; }
  .nm-state { inset: 28px; }
  .nm-state h3 { font-size: 26px; }
  .nm-state li { font-size: 15px; }
  .home .year-bar { padding: 22px 16px 18px; }
  .year-bar-head { flex-direction: column; gap: 4px; }
  .months { gap: 3px; }
  .month label { font-size: 10px; }
  .month .you { font-size: 10.5px; padding: 4px 7px; }
  .process { grid-template-columns: 1fr; gap: 30px; }
  .step { display: grid; grid-template-columns: 60px 1fr; column-gap: 18px; }
  .step .n, .home .step .n { width: 56px; height: 56px; font-size: 19px; grid-row: span 2; }
  .step h3, .home .step h3 { margin: 4px 0 6px; font-size: 21px; }
  .fo { padding: 80px 0; }
  .fo-card { padding: 28px; border-radius: 24px; }
  .fo-card h2 { font-size: 34px; }
  .fo-card ul { grid-template-columns: 1fr; }
  .video-card { aspect-ratio: 4 / 3.4; border-radius: 22px; }
  .video-card .play { width: 74px; height: 74px; }
  .video-card .vc-cap { left: 22px; right: 22px; bottom: 20px; }
  .video-card .vc-cap b { font-size: 22px; }
  .quote-block, .home .quote-block { font-size: 20px; padding-left: 18px; }
  .cm { grid-template-columns: 1fr; gap: 12px; }
  .cm-photo, .cm-card, .cm-split { grid-column: auto; }
  .cm-photo { min-height: 320px; padding: 26px; }
  .cm-photo h3 { font-size: 28px; }
  .cm-card { grid-template-columns: 1fr; gap: 16px; padding: 26px; }
  .cm-card h4 { font-size: 22px; }
  .cm-split { grid-template-columns: 1fr; gap: 12px; }
  .testi-grid { grid-template-columns: 1fr; }
  .testi.big { grid-column: auto; }
  .testi { padding: 28px; }
  .home .testi.big blockquote { font-size: 20px; }
  .google-strip { flex-direction: column; align-items: flex-start; gap: 12px; padding: 20px; }
  .google-strip .g { flex-wrap: wrap; gap: 8px; }
  .lx-state { padding: 20px; }
  .res-grid { grid-template-columns: 1fr; }
  .faq summary, .home .faq summary { font-size: 18px; padding: 22px 0; gap: 16px; }
  .faq summary .pm { width: 34px; height: 34px; }
  .faq .ans { padding-right: 0; font-size: 15.5px; }
  .fcta { padding: 90px 0; }
  .fcta h2 { font-size: 40px; line-height: 1.04; }
  .fcta p { font-size: 17px; }
  .fcta .acts { flex-direction: column; align-items: stretch; }
  .fcta .acts .btn { justify-content: center; }
  .fcta .mark { width: 560px; }
  .float-book { right: 14px; bottom: 14px; height: 50px; padding-left: 20px; font-size: 14.5px; }

  /* shared inner-page components */
  .included, .mvv, .why-grid, .team-grid, .giving, .timeline, .related, .check-grid { grid-template-columns: 1fr; }
  .mvv .card:last-child, .giving .give:last-child { grid-column: auto; }
  .loc-grid { grid-template-columns: 1fr !important; }
  .inc, .mvv .card, .give, .why, .q, .rel, .check-col, .action { padding: 26px; }
  .roadmap-mock { padding: 24px; border-radius: 22px; }
  .rm-head { flex-wrap: wrap; gap: 8px; }
  .rm-row { font-size: 14px; flex-wrap: wrap; gap: 4px; }
  .dl-item { grid-template-columns: 44px 1fr; gap: 14px; padding: 18px; }
  .dl-item .n { width: 44px; height: 44px; }
  .founder h2, .home .founder h2 { font-size: 40px; }
  .portrait-photo { width: 180px; height: 180px; }
  .tab-panel .img { height: 220px; }
  .tab-panel h3 { font-size: 26px; }
  .action-cards { margin-top: -90px; }
  .home.inner .action-cards { margin-top: -90px; }
  .form-card { padding: 26px; border-radius: 24px; }
  .form-card h2 { font-size: 32px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-foot { flex-direction: column; align-items: stretch; }
  .form-foot .btn { justify-content: center; }
  .office-card { padding: 28px; }
  .hours { grid-template-columns: 1fr; width: auto; }
  .hours span:nth-child(odd) { margin-top: 6px; color: rgba(255,255,255,.6); font-size: 13.5px; }
  .map-card { min-height: 260px; }
  .book-points { justify-content: flex-start; flex-direction: column; gap: 10px; }
  .cal-direct, .cal-direct .calendly-inline-widget { height: 1040px; min-height: 1040px; }
  .feature-post .body { padding: 28px; }
  .feature-post .body h2 { font-size: 28px; }
  .prose { font-size: 16.5px; }
  .prose .lead-p { font-size: 18.5px; }
  .prose h2 { font-size: 27px; margin-top: 44px; }
  .dl-row { grid-template-columns: 1fr; gap: 8px; padding: 22px; }
  .dl-row .tag { grid-column: auto; }
  .calc-form, .calc-out { padding: 26px; border-radius: 22px; }
  .calc-fields { grid-template-columns: 1fr; }
  .calc-out .big { font-size: 46px; }
  .calc-rows div { font-size: 14.5px; gap: 12px; }

  /* footer */
  .footer { padding-top: 64px; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 34px 20px; padding-bottom: 46px; }
  .footer .f-portal { flex-wrap: wrap; }
  .footer-top > div:last-child { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; gap: 12px; }
}

/* ---------------------------------------------------------
   ≤ 400px — small phones
   --------------------------------------------------------- */
@media (max-width: 400px) {
  .wrap { width: calc(100% - 32px); }
  .hx h1 { font-size: 38px; }
  .hx.ph h1 { font-size: 34px; }
  .home .h2 { font-size: 31px !important; }
  .statement { font-size: 26px; }
  .nav-cta .btn-sm { padding: 0 12px; font-size: 13px; }
  .home .brand, .home .brand img { height: 38px; }
  .fcta h2 { font-size: 34px; }
  .footer-top { grid-template-columns: 1fr; }
}

/* ---------- fixes from device testing ---------- */
.calc-form h3 { line-height: 1.15; }
@media (max-width: 1200px) {
  .header .wrap { justify-content: flex-start; }
  .header .nav-cta { margin-left: auto; }
}
@media (max-width: 1024px) {
  .topbar .group:last-child > a[data-soon] { display: none; }
  .float-book { display: none !important; }
}

/* mobile menu: the scrolled header blur (backdrop-filter) would trap the fixed menu inside the header box */
@media (max-width: 1200px) {
  .nav-open .header, .nav-open .home .header, .home.nav-open .header.scrolled { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .nav-open .header .logo-light { opacity: 1 !important; }
  .nav-open .header .logo-dark { opacity: 0 !important; }
  .nav-open .header nav { top: var(--nav-top, 72px); }
}
@media (max-width: 1200px) { .nav-open .header .nav > li > a.active { color: var(--leaf) !important; } }
@media (max-width: 760px) { .home .year-bar .months { margin-top: 34px; } }

/* ---------- header "Discovery" pill: even padding at every size ---------- */
.header .nav-cta .btn.btn-discovery { padding: 0 28px; height: 48px; font-size: 15.5px; justify-content: center; }
@media (max-width: 760px) { .header .nav-cta .btn.btn-discovery { padding: 0 22px; height: 44px; font-size: 14.5px; } }
@media (max-width: 400px) { .header .nav-cta .btn.btn-discovery { padding: 0 18px; height: 42px; font-size: 14px; } }
