/*
Theme Name: CruxLedge
Theme URI: https://cruxledge.com
Author: CruxLedge
Author URI: https://cruxledge.com
Description: Custom theme for CruxLedge Online Bookkeeping & Accounting — includes AI chat agent, SEO tools, animated sections, blog, and responsive layout.
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: cruxledge
*/

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  :root {
    --ink: #0e1a14;
    --ink-mid: #2d4035;
    --ink-soft: #5a7366;
    --cream: #f5f0e8;
    --cream-dark: #ede7d9;
    --gold: #c8963e;
    --gold-light: #e8c47a;
    --sage: #3d6e5a;
    --sage-light: #6b9e87;
    --sage-pale: #d4e8df;
    --white: #fdfbf7;
    --shadow: rgba(14,26,20,0.12);
  }

  html { scroll-behavior: smooth; }

  body {
    font-family: 'DM Sans', sans-serif;
    background: var(--cream);
    color: var(--ink);
    overflow-x: hidden;
  }

  /* ── NAV ── */
  nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.25rem 4rem;
    background: rgba(245,240,232,0.88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(200,150,62,0.18);
    animation: slideDown 0.7s ease both;
  }

  .logo {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem; color: #000000;
    letter-spacing: -0.02em;
  }

  .logo span { color: var(--gold); }

  .nav-links { display: flex; gap: 2.5rem; list-style: none; }

  .nav-links a {
    font-size: 0.875rem; font-weight: 500; letter-spacing: 0.04em;
    text-transform: uppercase; color: var(--ink-mid);
    text-decoration: none;
    position: relative; transition: color 0.25s;
  }

  .nav-links a::after {
    content: ''; position: absolute; bottom: -4px; left: 0; right: 0;
    height: 1.5px; background: var(--gold);
    transform: scaleX(0); transition: transform 0.25s;
  }

  .nav-links a:hover { color: var(--gold); }
  .nav-links a:hover::after { transform: scaleX(1); }

  .nav-cta {
    background: var(--sage); color: var(--white) !important;
    padding: 0.55rem 1.4rem; border-radius: 2px;
    transition: background 0.25s !important;
  }

  .nav-cta::after { display: none !important; }
  .nav-cta:hover { background: var(--ink) !important; color: var(--white); }

  /* ── HERO ── */
  .hero {
    min-height: 100vh;
    display: grid; grid-template-columns: 1fr 1fr;
    align-items: center;
    padding: 8rem 4rem 5rem;
    position: relative; overflow: hidden;
  }

  .hero::before {
    content: '';
    position: absolute; top: -20%; right: -5%;
    width: 55%; height: 120%;
    background: var(--sage-pale);
    clip-path: polygon(10% 0, 100% 0, 100% 100%, 0% 100%);
    z-index: 0;
  }

  .hero-text { position: relative; z-index: 1; }

  .hero-eyebrow {
    font-size: 0.8rem; font-weight: 600; letter-spacing: 0.16em;
    text-transform: uppercase; color: var(--gold);
    display: flex; align-items: center; gap: 0.75rem;
    margin-bottom: 1.5rem;
    animation: fadeUp 0.8s 0.2s both;
  }

  .hero-eyebrow::before {
    content: ''; width: 36px; height: 1.5px; background: var(--gold);
  }

  h1 {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(3rem, 5vw, 5rem);
    line-height: 1.1; letter-spacing: -0.03em;
    color: var(--ink); margin-bottom: 1.5rem;
    animation: fadeUp 0.8s 0.35s both;
  }

  h1 em { color: var(--sage); font-style: italic; }

  .hero-body {
    font-size: 1.1rem; line-height: 1.75; color: var(--ink-soft);
    max-width: 480px; margin-bottom: 2.5rem;
    animation: fadeUp 0.8s 0.5s both;
  }

  .hero-actions {
    display: flex; gap: 1rem; align-items: center;
    animation: fadeUp 0.8s 0.65s both;
  }

  .btn-primary {
    background: var(--sage); color: var(--white);
    padding: 0.9rem 2.2rem; border-radius: 2px;
    text-decoration: none; font-weight: 600; font-size: 0.95rem;
    letter-spacing: 0.02em;
    transition: all 0.25s; border: none; cursor: pointer;
    display: inline-block;
  }

  .btn-primary:hover { background: var(--ink); transform: translateY(-2px); }

  .btn-ghost {
    color: var(--ink); font-weight: 500; font-size: 0.95rem;
    text-decoration: none; padding: 0.9rem 1.4rem;
    display: flex; align-items: center; gap: 0.5rem;
    transition: gap 0.25s;
  }

  .btn-ghost:hover { gap: 0.85rem; }

  .arrow { font-size: 1.1rem; }

  .hero-visual {
    position: relative; z-index: 1;
    display: flex; justify-content: center; align-items: center;
    animation: fadeIn 1s 0.5s both;
  }

  /* Floating card cluster */
  .card-cluster { position: relative; width: 360px; height: 420px; }

  .float-card {
    position: absolute;
    background: var(--white);
    border-radius: 6px;
    border: 1px solid rgba(200,150,62,0.2);
    box-shadow: 0 12px 40px var(--shadow);
    padding: 1.25rem 1.5rem;
  }

  .card-main {
    width: 300px; top: 50px; left: 30px;
    animation: float 5s ease-in-out infinite;
  }

  .card-secondary {
    width: 200px; bottom: 20px; right: -20px;
    animation: float 5s 1.5s ease-in-out infinite;
  }

  .card-tertiary {
    width: 160px; top: 0; right: 10px;
    animation: float 5s 0.8s ease-in-out infinite;
  }

  .card-label {
    font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--ink-soft);
    margin-bottom: 0.6rem;
  }

  .card-amount {
    font-family: 'DM Serif Display', serif;
    font-size: 2rem; color: var(--ink);
  }

  .card-amount span { font-size: 1rem; color: var(--gold); }

  .card-bar-row { display: flex; gap: 4px; margin-top: 1rem; align-items: flex-end; }
  .bar {
    flex: 1; border-radius: 2px;
    background: var(--sage-pale);
    position: relative; overflow: hidden;
  }
  .bar-fill {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: var(--sage);
    border-radius: 2px;
    transition: height 1s ease;
  }

  .bar-h1 { height: 60px; } .bar-h2 { height: 44px; } .bar-h3 { height: 70px; }
  .bar-h4 { height: 50px; } .bar-h5 { height: 80px; } .bar-h6 { height: 55px; }

  .pill {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.3rem 0.75rem; border-radius: 20px;
    font-size: 0.72rem; font-weight: 600;
  }

  .pill-up { background: #d4ede1; color: #1a6640; }
  .pill-down { background: #fde8e4; color: #8b2e1e; }

  .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

  .stat-row { display: flex; justify-content: space-between; align-items: center; margin-top: 0.75rem; }

  .mini-label { font-size: 0.72rem; color: var(--ink-soft); }
  .mini-val { font-size: 1rem; font-weight: 600; color: var(--ink); }

  /* ── MARQUEE ── */
  .marquee-strip {
    background: var(--sage);
    padding: 0.9rem 0; overflow: hidden;
    display: flex;
  }

  .marquee-inner {
    display: flex; gap: 3rem; white-space: nowrap;
    animation: marquee 22s linear infinite;
  }

  .marquee-item {
    font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em;
    text-transform: uppercase; color: rgba(255,255,255,0.75);
    display: flex; align-items: center; gap: 1rem;
  }

  .marquee-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }

  /* ── SECTION COMMON ── */
  section { padding: 6rem 4rem; }

  .section-label {
    font-size: 0.78rem; font-weight: 600; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--gold);
    margin-bottom: 1rem;
    display: flex; align-items: center; gap: 0.6rem;
  }

  .section-label::before { content: ''; width: 24px; height: 1.5px; background: var(--gold); }

  h2 {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(2rem, 3.5vw, 3rem);
    line-height: 1.15; letter-spacing: -0.025em;
    color: var(--ink); margin-bottom: 1.25rem;
  }

  h2 em { color: var(--sage); font-style: italic; }

  .section-intro {
    font-size: 1.05rem; line-height: 1.75; color: var(--ink-soft);
    max-width: 600px;
  }

  /* ── SERVICES ── */
  #services { background: var(--white); }

  .services-header { margin-bottom: 4rem; }

  .services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    background: var(--cream-dark);
    border: 1px solid var(--cream-dark);
  }

  .service-card {
    background: var(--white);
    padding: 2.5rem 2rem;
    position: relative; overflow: hidden;
    transition: all 0.35s;
    cursor: default;
  }

  .service-card::after {
    content: '';
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 3px; background: var(--sage);
    transform: scaleX(0); transition: transform 0.35s;
    transform-origin: left;
  }

  .service-card:hover { background: var(--sage); }
  .service-card:hover h3 { color: var(--white); }
  .service-card:hover p { color: rgba(255,255,255,0.75); }
  .service-card:hover .service-icon { background: rgba(255,255,255,0.15); color: var(--white); }
  .service-card:hover::after { transform: scaleX(1); }

  .service-icon {
    width: 52px; height: 52px; border-radius: 4px;
    background: var(--sage-pale); color: var(--sage);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; margin-bottom: 1.5rem;
    transition: all 0.35s;
  }

  .service-card h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.35rem; color: var(--ink);
    margin-bottom: 0.75rem; transition: color 0.35s;
  }

  .service-card p {
    font-size: 0.95rem; line-height: 1.7; color: var(--ink-soft);
    transition: color 0.35s;
  }

  /* ── NUMBERS ── */
  #numbers {
    background: var(--ink);
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 0; padding: 0;
  }

  .numbers-text {
    padding: 6rem 5rem; display: flex; flex-direction: column; justify-content: center;
  }

  .numbers-text .section-label { color: var(--gold-light); }
  .numbers-text .section-label::before { background: var(--gold-light); }
  .numbers-text h2 { color: var(--white); }
  .numbers-text .section-intro { color: rgba(255,255,255,0.6); }

  .numbers-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    padding: 6rem 4rem; gap: 2px;
    background: rgba(255,255,255,0.04);
    align-content: center;
  }

  .stat-box {
    padding: 2.5rem 2rem;
    border: 1px solid rgba(255,255,255,0.06);
    animation: countUp 1s ease both;
  }

  .stat-box:nth-child(1) { animation-delay: 0.1s; }
  .stat-box:nth-child(2) { animation-delay: 0.2s; }
  .stat-box:nth-child(3) { animation-delay: 0.3s; }
  .stat-box:nth-child(4) { animation-delay: 0.4s; }

  .stat-num {
    font-family: 'DM Serif Display', serif;
    font-size: 3rem; color: var(--white); line-height: 1;
  }

  .stat-num sup { font-size: 1.5rem; color: var(--gold); }

  .stat-desc { font-size: 0.85rem; color: rgba(255,255,255,0.5); margin-top: 0.6rem; line-height: 1.5; }

  /* ── PROCESS ── */
  #process { background: var(--cream); }

  .process-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 1px; background: var(--cream-dark);
    margin-top: 4rem;
    border: 1px solid var(--cream-dark);
  }

  .process-step {
    background: var(--cream);
    padding: 2.5rem 1.75rem;
    position: relative;
  }

  .step-num {
    font-family: 'DM Serif Display', serif;
    font-size: 5rem; line-height: 1;
    color: var(--sage-pale); margin-bottom: 1.2rem;
    user-select: none;
  }

  .process-step h3 {
    font-size: 1.15rem; font-weight: 600; color: var(--ink); margin-bottom: 0.75rem;
  }

  .process-step p {
    font-size: 0.9rem; line-height: 1.7; color: var(--ink-soft);
  }

  /* ── TESTIMONIALS ── */
  #testimonials { background: var(--sage-pale); }

  .testimonials-header { margin-bottom: 4rem; }

  .testimonials-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
  }

  .testimonial-card {
    background: var(--white); padding: 2.25rem;
    border-radius: 4px; border: 1px solid rgba(61,110,90,0.12);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
  }

  .testimonial-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(61,110,90,0.15);
  }

  .quote-mark {
    font-family: 'DM Serif Display', serif;
    font-size: 5rem; line-height: 0.5; color: var(--sage-pale);
    margin-bottom: 1rem; display: block;
  }

  .testimonial-text {
    font-size: 0.975rem; line-height: 1.75; color: var(--ink-mid);
    margin-bottom: 1.5rem; font-style: italic;
  }

  .testimonial-author {
    display: flex; align-items: center; gap: 0.875rem;
    padding-top: 1.25rem; border-top: 1px solid var(--cream-dark);
  }

  .avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--sage); display: flex; align-items: center;
    justify-content: center; font-size: 0.85rem; font-weight: 600;
    color: var(--white); flex-shrink: 0;
  }

  .author-name { font-weight: 600; font-size: 0.9rem; color: var(--ink); }
  .author-role { font-size: 0.8rem; color: var(--ink-soft); }

  .stars { color: var(--gold); font-size: 0.85rem; margin-bottom: 0.75rem; }

  /* ── PRICING ── */
  #pricing { background: var(--white); }

  .pricing-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem; margin-top: 4rem;
  }

  .plan-card {
    border: 1px solid var(--cream-dark);
    border-radius: 4px; padding: 2.5rem 2rem;
    position: relative; transition: all 0.3s;
    background: var(--white);
  }

  .plan-card:hover {
    border-color: var(--sage); transform: translateY(-4px);
    box-shadow: 0 16px 40px var(--shadow);
  }

  .plan-card.featured {
    border-color: var(--sage); background: var(--sage);
    transform: scale(1.03);
  }

  .plan-card.featured:hover { transform: scale(1.03) translateY(-4px); }
  .plan-card.featured h3,
  .plan-card.featured .plan-price,
  .plan-card.featured .plan-desc { color: var(--white); }
  .plan-card.featured .plan-feature { color: rgba(255,255,255,0.8); border-color: rgba(255,255,255,0.12); }
  .plan-card.featured .plan-feature::before { color: var(--gold-light); }

  .featured-badge {
    position: absolute; top: -14px; left: 50%;
    transform: translateX(-50%);
    background: var(--gold); color: var(--white);
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em;
    text-transform: uppercase; padding: 0.3rem 1rem; border-radius: 20px;
  }

  .plan-card h3 { font-size: 0.9rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sage); margin-bottom: 1.5rem; }

  .plan-price {
    font-family: 'DM Serif Display', serif;
    font-size: 3rem; color: var(--ink); margin-bottom: 0.25rem;
  }

  .plan-price sup { font-size: 1.4rem; vertical-align: top; margin-top: 0.5rem; }
  .plan-price span { font-size: 1rem; font-family: 'DM Sans', sans-serif; color: var(--ink-soft); }

  .plan-desc { font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--cream-dark); }

  .plan-features { list-style: none; margin-bottom: 2rem; }

  .plan-feature {
    font-size: 0.9rem; color: var(--ink-soft); padding: 0.6rem 0;
    border-bottom: 1px solid var(--cream);
    display: flex; align-items: flex-start; gap: 0.6rem;
  }

  .plan-feature::before { content: '✓'; color: var(--sage); font-weight: 700; flex-shrink: 0; }

  .btn-plan {
    display: block; text-align: center; padding: 0.9rem 1.5rem;
    border-radius: 2px; font-weight: 600; font-size: 0.9rem;
    text-decoration: none; transition: all 0.25s; cursor: pointer; border: none;
  }

  .btn-plan-outline {
    background: transparent; color: var(--sage);
    border: 1.5px solid var(--sage);
  }

  .btn-plan-outline:hover { background: var(--sage); color: var(--white); }

  .btn-plan-solid { background: var(--gold); color: var(--white); border: none; }
  .btn-plan-solid:hover { background: var(--ink); }

  /* ── CTA ── */
  #cta {
    background: var(--ink);
    text-align: center; padding: 8rem 4rem;
    position: relative; overflow: hidden;
  }

  #cta::before {
    content: '';
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 600px; height: 600px; border-radius: 50%;
    background: radial-gradient(circle, rgba(61,110,90,0.2) 0%, transparent 70%);
    pointer-events: none;
  }

  #cta .section-label { color: var(--gold-light); justify-content: center; }
  #cta .section-label::before { background: var(--gold-light); }

  #cta h2 { color: var(--white); max-width: 700px; margin: 0 auto 1.5rem; }

  #cta .section-intro { color: rgba(255,255,255,0.55); margin: 0 auto 3rem; text-align: center; }

  .cta-actions { display: flex; gap: 1rem; justify-content: center; align-items: center; }

  .btn-gold {
    background: var(--gold); color: var(--white);
    padding: 1rem 2.4rem; border-radius: 2px;
    text-decoration: none; font-weight: 700; font-size: 1rem;
    transition: all 0.25s;
  }

  .btn-gold:hover { background: var(--gold-light); color: var(--ink); transform: translateY(-2px); }

  .btn-outline-white {
    border: 1.5px solid rgba(255,255,255,0.3); color: rgba(255,255,255,0.8);
    padding: 1rem 2rem; border-radius: 2px;
    text-decoration: none; font-weight: 500; font-size: 1rem;
    transition: all 0.25s;
  }

  .btn-outline-white:hover { border-color: var(--white); color: var(--white); }

  /* ── FOOTER ── */
  footer {
    background: #081410;
    padding: 4rem 4rem 2.5rem;
    border-top: 1px solid rgba(255,255,255,0.05);
  }

  .footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 4rem; margin-bottom: 3rem;
  }

  .footer-brand .logo { display: block; margin-bottom: 1rem; color: #000000; }

  .footer-brand p {
    font-size: 0.9rem; line-height: 1.7; color: rgba(255,255,255,0.45);
    max-width: 260px;
  }

  .footer-col p.footer-heading {
    font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em;
    text-transform: uppercase; color: rgba(255,255,255,0.3);
    margin-bottom: 1.25rem;
  }

  .footer-col a {
    display: block; font-size: 0.9rem; color: rgba(255,255,255,0.55);
    text-decoration: none; margin-bottom: 0.75rem; transition: color 0.2s;
  }

  .footer-col a:hover { color: var(--white); }

  .footer-bottom {
    padding-top: 2rem; border-top: 1px solid rgba(255,255,255,0.06);
    display: flex; justify-content: space-between; align-items: center;
  }

  .footer-bottom p { font-size: 0.82rem; color: rgba(255,255,255,0.3); }

  /* ── ANIMATIONS ── */
  @keyframes slideDown { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
  @keyframes fadeUp { from { transform: translateY(28px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
  @keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-12px) rotate(0.5deg); }
    66% { transform: translateY(-6px) rotate(-0.5deg); }
  }
  @keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
  @keyframes countUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

  .reveal {
    opacity: 0; transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
  }

  .reveal.visible { opacity: 1; transform: translateY(0); }

  /* ── SOFTWARE ── */
  #software {
    background: var(--white);
    padding: 5rem 4rem;
    text-align: center;
  }

  .software-intro {
    margin-bottom: 3.5rem;
  }

  .software-intro .section-label { justify-content: center; }

  .software-intro p {
    font-size: 1rem; color: var(--ink-soft); max-width: 520px;
    margin: 0 auto; line-height: 1.7;
  }

  .software-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--cream-dark);
    border: 1px solid var(--cream-dark);
    border-radius: 6px;
    overflow: hidden;
    max-width: 1100px;
    margin: 0 auto;
  }

  .software-tile {
    background: var(--white);
    padding: 2rem 1rem 1.75rem;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 0.75rem;
    transition: background 0.3s, transform 0.3s;
    cursor: default;
    position: relative;
    overflow: hidden;
  }

  .software-tile::after {
    content: '';
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 2.5px;
    transform: scaleX(0);
    transition: transform 0.3s;
    transform-origin: center;
  }

  .software-tile:hover { background: var(--cream); transform: translateY(-3px); }
  .software-tile:hover::after { transform: scaleX(1); }

  /* Per-brand accent colors */
  .sw-qb::after  { background: #2CA01C; }
  .sw-xero::after { background: #13B5EA; }
  .sw-fb::after  { background: #F4BC23; }
  .sw-sage::after { background: #00DC82; }
  .sw-wave::after { background: #35A9E0; }
  .sw-zoho::after { background: #E42527; }
  .sw-ns::after  { background: #D4002A; }

  .sw-logo {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
    transition: transform 0.3s;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  }

  .software-tile:hover .sw-logo { transform: scale(1.1) rotate(-3deg); }

  .sw-name {
    font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em;
    color: var(--ink-mid);
  }

  .sw-badge {
    font-size: 0.65rem; font-weight: 600; letter-spacing: 0.08em;
    text-transform: uppercase; padding: 0.2rem 0.6rem;
    border-radius: 20px; background: var(--sage-pale); color: var(--sage);
  }

  .software-note {
    margin-top: 2.5rem;
    font-size: 0.85rem; color: var(--ink-soft);
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  }

  .software-note::before, .software-note::after {
    content: ''; flex: 1; max-width: 80px;
    height: 1px; background: var(--cream-dark);
  }

  /* ── MOBILE HAMBURGER ── */
  .nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 200;
  }

  .nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: all 0.3s ease;
  }

  .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* ── TABLET (≤1024px) ── */
  @media (max-width: 1024px) {
    nav { padding: 1.25rem 2.5rem; }

    .hero { padding: 8rem 2.5rem 5rem; gap: 2rem; }

    section { padding: 5rem 2.5rem; }

    .numbers-text { padding: 5rem 3rem; }
    .numbers-grid { padding: 5rem 2.5rem; }

    .services-grid { grid-template-columns: repeat(2, 1fr); }

    .software-grid { grid-template-columns: repeat(4, 1fr); }

    .footer-grid { grid-template-columns: 1fr 1fr; gap: 2.5rem; }

    .card-cluster { width: 300px; height: 360px; }
    .card-main { width: 250px; }
    .card-secondary { width: 170px; }
    .card-tertiary { width: 140px; }
  }

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

    /* Nav */
    nav {
      padding: 1rem 1.5rem;
      position: fixed;
    }

    .nav-toggle { display: flex; }

    .nav-links {
      position: fixed;
      top: 0; left: 0; right: 0; bottom: 0;
      background: var(--cream);
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 2rem;
      transform: translateX(100%);
      transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
      z-index: 150;
    }

    .nav-links.open { transform: translateX(0); }

    .nav-links a { font-size: 1.2rem; }

    .nav-cta {
      padding: 0.75rem 2rem !important;
      font-size: 1rem !important;
    }

    /* Hero */
    .hero {
      grid-template-columns: 1fr;
      min-height: auto;
      padding: 7rem 1.5rem 3rem;
      text-align: center;
    }

    .hero::before { display: none; }

    .hero-eyebrow { justify-content: center; }

    .hero-body { margin-left: auto; margin-right: auto; }

    .hero-actions {
      flex-direction: column;
      align-items: center;
      gap: 0.75rem;
    }

    .btn-primary { width: 100%; text-align: center; }

    .hero-visual {
      justify-content: center;
      margin-top: 2rem;
    }

    .card-cluster { width: 310px; height: 340px; }
    .card-main { width: 230px; top: 40px; left: 20px; }
    .card-secondary { width: 160px; right: -10px; }
    .card-tertiary { width: 130px; }

    /* Sections */
    section { padding: 4rem 1.5rem; }

    #software { padding: 4rem 1.5rem; }

    /* Services */
    .services-grid { grid-template-columns: 1fr; }

    /* Numbers */
    #numbers {
      grid-template-columns: 1fr;
    }

    .numbers-text { padding: 4rem 1.5rem 2rem; }
    .numbers-grid { padding: 2rem 1.5rem 4rem; grid-template-columns: 1fr 1fr; }

    /* Process */
    .process-grid { grid-template-columns: 1fr 1fr; }

    /* Testimonials */
    .testimonials-grid { grid-template-columns: 1fr; }

    /* Pricing */
    .pricing-grid { grid-template-columns: 1fr; }

    .plan-card.featured { transform: scale(1); }
    .plan-card.featured:hover { transform: translateY(-4px); }

    /* CTA */
    #cta { padding: 5rem 1.5rem; }

    .cta-actions {
      flex-direction: column;
      align-items: center;
    }

    .btn-gold, .btn-outline-white { width: 100%; text-align: center; }

    /* Software */
    .software-grid { grid-template-columns: repeat(3, 1fr); }

    /* Footer */
    footer { padding: 3rem 1.5rem 2rem; }

    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }

    .footer-bottom { flex-direction: column; gap: 0.75rem; text-align: center; }

    /* Chat FAB */
    #chat-fab { bottom: 1.25rem; right: 1.25rem; width: 52px; height: 52px; }

    #chat-window {
      bottom: 5rem;
      right: 1rem;
      left: 1rem;
      width: auto;
      max-height: 70vh;
    }
  }

  /* ── AD VIDEO SECTION ── */
  #ad-section {
    background: var(--ink);
    padding: 5rem 4rem;
    position: relative;
    overflow: hidden;
  }

  #ad-section::before {
    content: '';
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 700px; height: 500px; border-radius: 50%;
    background: radial-gradient(circle, rgba(61,110,90,0.12) 0%, transparent 70%);
    pointer-events: none;
  }

  .ad-section-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 4rem;
    align-items: center;
    position: relative; z-index: 1;
  }

  .ad-text-col .section-label { color: var(--gold-light); }
  .ad-text-col .section-label::before { background: var(--gold-light); }

  .ad-text-col h2 {
    color: var(--white);
    margin-bottom: 1.25rem;
  }

  .ad-text-col h2 em { color: var(--sage-light); font-style: italic; }

  .ad-text-col p {
    font-size: 1rem; line-height: 1.75;
    color: rgba(255,255,255,0.55);
    margin-bottom: 2rem;
    max-width: 380px;
  }

  .ad-perks {
    display: flex; flex-direction: column; gap: 0.85rem;
    margin-bottom: 2.5rem;
  }

  .ad-perk {
    display: flex; align-items: center; gap: 0.75rem;
    font-size: 0.9rem; color: rgba(255,255,255,0.7);
  }

  .ad-perk-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--gold); flex-shrink: 0;
  }

  /* The player card */
  .ad-player-wrap {
    position: relative;
  }

  .ad-player {
    background: #060d18;
    border-radius: 10px;
    border: 1px solid rgba(200,150,62,0.2);
    overflow: hidden;
    position: relative;
    box-shadow: 0 32px 80px rgba(0,0,0,0.5);
  }

  /* Inner stage */
  .ad-stage {
    width: 100%;
    aspect-ratio: 16/9;
    position: relative;
    overflow: hidden;
    font-family: 'DM Serif Display', serif;
  }

  /* Particle canvas bg */
  .ad-bg {
    position: absolute; inset: 0;
    background: #04111f;
  }

  .ad-grid-lines {
    position: absolute; inset: 0;
    background-image:
      linear-gradient(rgba(200,150,62,0.05) 1px, transparent 1px),
      linear-gradient(90deg, rgba(200,150,62,0.05) 1px, transparent 1px);
    background-size: 48px 48px;
    z-index: 1;
  }

  .ad-vignette {
    position: absolute; inset: 0; z-index: 2;
    background: radial-gradient(ellipse at center, transparent 45%, rgba(4,17,31,0.75) 100%);
  }

  /* Slide system */
  .ad-slide {
    position: absolute; inset: 0; z-index: 3;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center;
    padding: 5%;
    opacity: 0;
    pointer-events: none;
  }

  .ad-slide.ad-active {
    animation: adFadeIn 0.8s cubic-bezier(0.16,1,0.3,1) forwards;
    pointer-events: auto;
  }

  .ad-slide.ad-leaving {
    animation: adFadeOut 0.6s ease forwards;
  }

  @keyframes adFadeIn {
    from { opacity: 0; transform: scale(1.04) translateY(8px); filter: blur(4px); }
    to   { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
  }

  @keyframes adFadeOut {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(0.97); }
  }

  .ad-eyebrow {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(7px, 1.2vw, 11px);
    font-weight: 600; letter-spacing: 0.18em;
    text-transform: uppercase; color: var(--gold);
    margin-bottom: 1em;
    animation: adRise 0.7s 0.2s both;
  }

  .ad-title {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(16px, 3.5vw, 38px);
    font-weight: 400; line-height: 1.1;
    color: #f5f0e8; margin-bottom: 0.5em;
    animation: adRise 0.8s 0.35s both;
  }

  .ad-title em {
    color: var(--gold); font-style: italic;
  }

  .ad-sub {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(8px, 1.3vw, 13px);
    line-height: 1.6; color: rgba(245,240,232,0.55);
    max-width: 70%; margin: 0 auto;
    animation: adRise 0.7s 0.55s both;
  }

  @keyframes adRise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Deco line */
  .ad-deco-line {
    width: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 0.6em auto;
    animation: adLine 1.2s 0.4s ease forwards;
  }

  @keyframes adLine { to { width: 140px; } }

  /* Feature chips in slide 2 */
  .ad-chips {
    display: flex; gap: 0.5em; flex-wrap: wrap;
    justify-content: center; margin-top: 0.8em;
    animation: adRise 0.7s 0.6s both;
  }

  .ad-chip {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(7px, 1vw, 10px);
    background: rgba(200,150,62,0.12);
    border: 1px solid rgba(200,150,62,0.3);
    color: rgba(245,240,232,0.7);
    padding: 0.3em 0.85em; border-radius: 20px;
    letter-spacing: 0.04em;
  }

  /* Stats in slide 3 */
  .ad-stats {
    display: flex; gap: 2em;
    animation: adRise 0.8s 0.4s both;
    margin-bottom: 0.6em;
  }

  .ad-stat { text-align: center; }

  .ad-stat-num {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(20px, 4vw, 44px);
    line-height: 1;
    background: linear-gradient(135deg, #e8c47a, var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .ad-stat-lbl {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(6px, 1vw, 10px);
    text-transform: uppercase; letter-spacing: 0.12em;
    color: rgba(245,240,232,0.45);
    margin-top: 0.3em;
  }

  .ad-stat-divider {
    width: 1px; background: rgba(200,150,62,0.2);
    align-self: center; height: 2.5em;
  }

  /* Quote in slide 3 */
  .ad-quote {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(9px, 1.5vw, 14px);
    font-style: italic; color: rgba(245,240,232,0.7);
    max-width: 65%; margin: 0 auto;
    animation: adRise 0.7s 1s both;
    line-height: 1.55;
  }

  .ad-quote-author {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(7px, 1vw, 10px);
    color: var(--gold); letter-spacing: 0.1em;
    text-transform: uppercase; margin-top: 0.5em;
    animation: adRise 0.6s 1.2s both;
  }

  /* Steps slide */
  .ad-steps {
    display: flex; gap: 1.5em;
    animation: adRise 0.8s 0.4s both;
    margin-top: 0.5em;
  }

  .ad-step { text-align: center; flex: 1; }

  .ad-step-num {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(14px, 2.5vw, 26px);
    color: var(--gold); line-height: 1;
    margin-bottom: 0.4em;
  }

  .ad-step-title {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(7px, 1.1vw, 11px);
    font-weight: 600; color: #f5f0e8;
    margin-bottom: 0.25em;
  }

  .ad-step-desc {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(6px, 0.95vw, 9.5px);
    color: rgba(245,240,232,0.5);
    line-height: 1.5;
  }

  .ad-step-sep {
    width: 1px; background: rgba(200,150,62,0.2);
    align-self: center; height: 2.5em;
    flex-shrink: 0;
  }

  /* Progress bar */
  .ad-progress-track {
    height: 3px;
    background: rgba(255,255,255,0.06);
  }

  .ad-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    width: 0%;
    transition: width 0.1s linear;
  }

  /* Dot nav */
  .ad-dots {
    display: flex; gap: 7px; justify-content: center;
    padding: 10px 0;
    background: #060d18;
  }

  .ad-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: rgba(255,255,255,0.18);
    cursor: pointer; transition: all 0.3s;
    border: none;
  }

  .ad-dot.ad-dot-active {
    background: var(--gold);
    width: 18px; border-radius: 3px;
  }

  /* Slide counter */
  .ad-counter {
    position: absolute;
    bottom: 8px; right: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(6px, 0.9vw, 9px);
    color: rgba(200,150,62,0.45);
    z-index: 10;
    letter-spacing: 0.1em;
  }

  /* Logo badge on final slide */
  .ad-logo-badge {
    display: flex; align-items: center; gap: 0.5em;
    margin-bottom: 0.75em;
    animation: adRise 0.7s 0.1s both;
  }

  .ad-logo-icon {
    width: 2em; height: 2em;
    border-radius: 0.4em;
    background: linear-gradient(135deg, var(--gold), #a07428);
    display: flex; align-items: center; justify-content: center;
  }

  .ad-logo-text {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(12px, 2vw, 22px);
    color: #f5f0e8;
  }

  .ad-logo-text span { color: var(--gold); }

  .ad-cta-pill {
    display: inline-block; margin-top: 0.75em;
    padding: 0.4em 1.2em; border-radius: 20px;
    background: linear-gradient(135deg, var(--gold), #a07428);
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(7px, 1.1vw, 11px);
    font-weight: 700; letter-spacing: 0.06em;
    color: var(--ink); text-transform: uppercase;
    animation: adRise 0.7s 1.1s both;
  }

  /* Pulse ring */
  .ad-pulse-ring {
    width: clamp(28px, 4.5vw, 50px); height: clamp(28px, 4.5vw, 50px);
    border-radius: 50%;
    background: rgba(200,150,62,0.12);
    border: 1px solid rgba(200,150,62,0.3);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 0.5em;
    animation: adPulse 2.5s infinite, adRise 0.7s 0.1s both;
  }

  @keyframes adPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(200,150,62,0.35); }
    50% { box-shadow: 0 0 0 8px rgba(200,150,62,0); }
  }

  /* Corner accents on player */
  .ad-corner {
    position: absolute; width: 14px; height: 14px; z-index: 5;
    pointer-events: none;
  }

  .ad-corner-tl { top: 8px; left: 8px; border-top: 1px solid rgba(200,150,62,0.5); border-left: 1px solid rgba(200,150,62,0.5); }
  .ad-corner-tr { top: 8px; right: 8px; border-top: 1px solid rgba(200,150,62,0.5); border-right: 1px solid rgba(200,150,62,0.5); }
  .ad-corner-bl { bottom: 8px; left: 8px; border-bottom: 1px solid rgba(200,150,62,0.5); border-left: 1px solid rgba(200,150,62,0.5); }
  .ad-corner-br { bottom: 8px; right: 8px; border-bottom: 1px solid rgba(200,150,62,0.5); border-right: 1px solid rgba(200,150,62,0.5); }

  /* Responsive */
  @media (max-width: 1024px) {
    .ad-section-inner { grid-template-columns: 1fr; gap: 2.5rem; }
    .ad-text-col p { max-width: 100%; }
    #ad-section { padding: 4rem 2.5rem; }
  }

  @media (max-width: 768px) {
    #ad-section { padding: 3.5rem 1.5rem; }
  }

  /* ── SMALL MOBILE (≤480px) ── */
  /* ── BLOG ── */
  #blog { background: var(--cream); }

  .blog-header {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-bottom: 4rem; flex-wrap: wrap; gap: 1.5rem;
  }

  .blog-header-text { max-width: 520px; }

  .blog-link-all {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-size: 0.875rem; font-weight: 600; color: var(--sage);
    text-decoration: none; letter-spacing: 0.04em;
    border-bottom: 1.5px solid transparent;
    transition: all 0.25s; white-space: nowrap;
  }

  .blog-link-all:hover { border-bottom-color: var(--sage); gap: 0.85rem; }

  .blog-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    grid-template-rows: auto auto;
    gap: 2px;
    background: var(--cream-dark);
    border: 1px solid var(--cream-dark);
  }

  .blog-card {
    background: var(--white);
    padding: 2.5rem;
    position: relative;
    transition: background 0.3s;
    overflow: hidden;
    text-decoration: none;
    display: block;
    cursor: pointer;
  }

  .blog-card::after {
    content: '';
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 2.5px; background: var(--gold);
    transform: scaleX(0); transition: transform 0.35s;
    transform-origin: left;
  }

  .blog-card:hover::after { transform: scaleX(1); }
  .blog-card:hover .blog-arrow { transform: translate(4px, -4px); }

  .blog-card-featured {
    grid-row: span 2;
    padding: 3rem;
    display: flex; flex-direction: column; justify-content: flex-end;
    min-height: 420px;
    background: var(--ink);
    position: relative;
    overflow: hidden;
  }

  .blog-card-featured::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(160deg, rgba(61,110,90,0.15) 0%, rgba(14,26,20,0.9) 65%);
    z-index: 1;
  }

  .blog-card-featured .blog-illustration {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    z-index: 0;
    display: flex; align-items: center; justify-content: center;
    opacity: 0.07;
  }

  .blog-card-featured .blog-illustration svg { width: 80%; height: 80%; }

  .blog-card-featured-content { position: relative; z-index: 2; }

  .blog-tag {
    display: inline-block;
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em;
    text-transform: uppercase; padding: 0.3rem 0.75rem;
    border-radius: 20px; margin-bottom: 1.1rem;
  }

  .blog-tag-gold { background: rgba(200,150,62,0.18); color: var(--gold); }
  .blog-tag-sage { background: var(--sage-pale); color: var(--sage); }
  .blog-tag-ink { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.7); }

  .blog-card h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.25rem; line-height: 1.25;
    color: var(--ink); margin-bottom: 0.75rem;
    letter-spacing: -0.02em; transition: color 0.25s;
  }

  .blog-card-featured h3 {
    font-size: clamp(1.4rem, 2.2vw, 1.9rem);
    color: var(--white);
  }

  .blog-card:hover h3 { color: var(--sage); }
  .blog-card-featured:hover h3 { color: var(--gold-light); }

  .blog-excerpt {
    font-size: 0.9rem; line-height: 1.7;
    color: var(--ink-soft); margin-bottom: 1.5rem;
  }

  .blog-card-featured .blog-excerpt { color: rgba(255,255,255,0.55); }

  .blog-meta {
    display: flex; align-items: center; gap: 1rem;
    padding-top: 1.25rem; border-top: 1px solid var(--cream-dark);
    justify-content: space-between;
  }

  .blog-card-featured .blog-meta { border-top-color: rgba(255,255,255,0.1); }

  .blog-author {
    display: flex; align-items: center; gap: 0.6rem;
  }

  .blog-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--sage); display: flex; align-items: center;
    justify-content: center; font-size: 0.7rem; font-weight: 700;
    color: var(--white); flex-shrink: 0;
  }

  .blog-card-featured .blog-avatar { background: rgba(200,150,62,0.3); color: var(--gold-light); }

  .blog-author-name {
    font-size: 0.8rem; font-weight: 600; color: var(--ink-mid);
  }

  .blog-card-featured .blog-author-name { color: rgba(255,255,255,0.75); }

  .blog-date {
    font-size: 0.75rem; color: var(--ink-soft);
  }

  .blog-card-featured .blog-date { color: rgba(255,255,255,0.4); }

  .blog-arrow {
    font-size: 1.1rem; color: var(--gold);
    transition: transform 0.25s;
    display: inline-block;
  }

  .blog-read-min {
    font-size: 0.72rem; font-weight: 500; color: var(--ink-soft);
    display: flex; align-items: center; gap: 0.35rem;
  }

  .blog-card-featured .blog-read-min { color: rgba(255,255,255,0.4); }

  .blog-read-min::before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); display: inline-block; }

  @media (max-width: 1024px) {
    .blog-grid { grid-template-columns: 1fr 1fr; }
    .blog-card-featured { grid-row: span 1; min-height: 340px; }
  }

  @media (max-width: 768px) {
    .blog-grid { grid-template-columns: 1fr; }
    .blog-card-featured { min-height: 280px; }
    .blog-header { flex-direction: column; align-items: flex-start; }
  }

  @media (max-width: 480px) {
    h1 { font-size: 2.6rem; }
    h2 { font-size: 1.85rem; }

    .card-cluster { width: 280px; height: 310px; }
    .card-main { width: 210px; top: 30px; left: 10px; }
    .card-secondary { width: 145px; right: -5px; }
    .card-tertiary { width: 120px; right: 5px; }

    .process-grid { grid-template-columns: 1fr; }

    .software-grid { grid-template-columns: repeat(2, 1fr); }

    .numbers-grid { grid-template-columns: 1fr; }

    .stat-num { font-size: 2.4rem; }
  }

/* ── CHAT WIDGET ── */
#chat-fab {
    position: fixed; bottom: 2rem; right: 2rem; z-index: 999;
    width: 60px; height: 60px; border-radius: 50%;
    background: #3d6e5a; border: none; cursor: pointer;
    box-shadow: 0 8px 28px rgba(61,110,90,0.45);
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.3s, box-shadow 0.3s;
    animation: fabPop 0.5s 1s cubic-bezier(0.34,1.56,0.64,1) both;
  }
  #chat-fab:hover { transform: scale(1.08); box-shadow: 0 12px 36px rgba(61,110,90,0.55); }
  #chat-fab svg { transition: transform 0.3s; }
  #chat-fab.open svg.icon-chat { display: none; }
  #chat-fab.open svg.icon-close { display: block !important; }

  .fab-pulse {
    position: absolute; width: 100%; height: 100%; border-radius: 50%;
    background: rgba(61,110,90,0.3);
    animation: pulse 2.5s ease-out infinite;
  }

  @keyframes fabPop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
  @keyframes pulse { 0% { transform: scale(1); opacity: 0.6; } 100% { transform: scale(1.7); opacity: 0; } }

  #chat-window {
    position: fixed; bottom: 5.5rem; right: 2rem; z-index: 998;
    width: 380px; height: 540px;
    background: #fdfbf7;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(14,26,20,0.18), 0 0 0 1px rgba(61,110,90,0.12);
    display: flex; flex-direction: column;
    transform: scale(0.85) translateY(20px); opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.34,1.56,0.64,1);
    transform-origin: bottom right;
    overflow: hidden;
  }

  #chat-window.open {
    transform: scale(1) translateY(0); opacity: 1; pointer-events: all;
  }

  .chat-header {
    background: #3d6e5a;
    padding: 1.1rem 1.25rem;
    display: flex; align-items: center; gap: 0.875rem;
    flex-shrink: 0;
  }

  .chat-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem; flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.25);
  }

  .chat-header-info { flex: 1; }
  .chat-header-name { font-size: 0.95rem; font-weight: 700; color: #fff; }
  .chat-header-status { font-size: 0.75rem; color: rgba(255,255,255,0.7); display: flex; align-items: center; gap: 0.35rem; }
  .status-dot { width: 7px; height: 7px; border-radius: 50%; background: #7de8a0; animation: blink 2s ease-in-out infinite; }
  @keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

  .chat-messages {
    flex: 1; overflow-y: auto; padding: 1.25rem;
    display: flex; flex-direction: column; gap: 0.85rem;
    scroll-behavior: smooth;
  }

  .chat-messages::-webkit-scrollbar { width: 4px; }
  .chat-messages::-webkit-scrollbar-track { background: transparent; }
  .chat-messages::-webkit-scrollbar-thumb { background: #d4e8df; border-radius: 2px; }

  .msg { display: flex; gap: 0.6rem; align-items: flex-end; max-width: 100%; }
  .msg.user { flex-direction: row-reverse; }

  .msg-avatar {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    background: #3d6e5a; display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; color: white; font-weight: 600;
  }

  .msg-bubble {
    max-width: 80%; padding: 0.65rem 0.95rem;
    border-radius: 14px; font-size: 0.875rem; line-height: 1.55;
    animation: msgIn 0.3s cubic-bezier(0.34,1.4,0.64,1) both;
  }

  @keyframes msgIn { from { transform: translateY(10px) scale(0.95); opacity: 0; } to { transform: none; opacity: 1; } }

  .msg.bot .msg-bubble {
    background: #fff; color: #0e1a14;
    border: 1px solid #ede7d9;
    border-bottom-left-radius: 4px;
  }

  .msg.user .msg-bubble {
    background: #3d6e5a; color: #fff;
    border-bottom-right-radius: 4px;
  }

  .msg-time { font-size: 0.68rem; color: #9bb8ae; margin-top: 0.25rem; text-align: right; }

  .typing-indicator {
    display: flex; gap: 4px; padding: 0.65rem 0.95rem;
    background: #fff; border: 1px solid #ede7d9;
    border-radius: 14px; border-bottom-left-radius: 4px;
    width: fit-content; align-items: center;
  }

  .typing-dot {
    width: 7px; height: 7px; border-radius: 50%; background: #9bb8ae;
    animation: typingBounce 1.2s ease-in-out infinite;
  }
  .typing-dot:nth-child(2) { animation-delay: 0.2s; }
  .typing-dot:nth-child(3) { animation-delay: 0.4s; }
  @keyframes typingBounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }

  .quick-replies {
    display: flex; flex-wrap: wrap; gap: 0.5rem;
    padding: 0 1.25rem 0.75rem; flex-shrink: 0;
  }

  .qr-btn {
    font-size: 0.78rem; font-weight: 500; padding: 0.4rem 0.85rem;
    border-radius: 20px; border: 1.5px solid #3d6e5a; color: #3d6e5a;
    background: transparent; cursor: pointer; transition: all 0.2s;
    font-family: 'DM Sans', sans-serif;
  }
  .qr-btn:hover { background: #3d6e5a; color: #fff; }

  .chat-input-area {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid #ede7d9;
    display: flex; gap: 0.6rem; align-items: center;
    flex-shrink: 0; background: #fff;
  }

  #chat-input {
    flex: 1; border: 1px solid #ede7d9; border-radius: 24px;
    padding: 0.6rem 1rem; font-size: 0.875rem;
    font-family: 'DM Sans', sans-serif; background: #fdfbf7;
    color: #0e1a14; outline: none; resize: none;
    transition: border-color 0.2s;
  }
  #chat-input:focus { border-color: #3d6e5a; }
  #chat-input::placeholder { color: #9bb8ae; }

  #chat-send {
    width: 38px; height: 38px; border-radius: 50%; border: none;
    background: #3d6e5a; color: white; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, transform 0.2s; flex-shrink: 0;
  }
  #chat-send:hover { background: #0e1a14; transform: scale(1.05); }

  .chat-branding {
    text-align: center; padding: 0.5rem;
    font-size: 0.68rem; color: #b8cfc8; flex-shrink: 0;
  }

/* ── SEO PANEL ── */
#seo-fab {
    position: fixed; bottom: 5.5rem; right: 1.75rem; z-index: 999;
    width: 54px; height: 54px; border-radius: 50%; border: none;
    background: #c8963e; color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 24px rgba(200,150,62,0.45);
    transition: all 0.25s; font-size: 1.4rem;
  }
  #seo-fab:hover { background: #0e1a14; transform: scale(1.08); }
  #seo-fab .fab-tooltip {
    position: absolute; right: 62px; top: 50%; transform: translateY(-50%);
    background: #0e1a14; color: #fff; font-size: 0.72rem; font-weight: 600;
    letter-spacing: 0.06em; text-transform: uppercase;
    padding: 0.3rem 0.75rem; border-radius: 4px; white-space: nowrap;
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
  }
  #seo-fab:hover .fab-tooltip { opacity: 1; }

  #seo-panel {
    position: fixed; bottom: 10rem; right: 1.75rem; z-index: 998;
    width: 420px; max-height: 80vh;
    background: #fdfbf7; border-radius: 10px;
    border: 1px solid rgba(200,150,62,0.25);
    box-shadow: 0 20px 60px rgba(14,26,20,0.18);
    display: none; flex-direction: column; overflow: hidden;
    font-family: 'DM Sans', sans-serif;
    animation: seoSlideUp 0.3s cubic-bezier(0.34,1.4,0.64,1) both;
  }
  #seo-panel.open { display: flex; }
  @keyframes seoSlideUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

  .seo-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem; background: #0e1a14;
    border-radius: 10px 10px 0 0;
  }
  .seo-header-left { display: flex; align-items: center; gap: 0.75rem; }
  .seo-header-icon { font-size: 1.3rem; }
  .seo-header-title { font-size: 0.9rem; font-weight: 600; color: #fdfbf7; }
  .seo-header-sub { font-size: 0.7rem; color: rgba(255,255,255,0.45); }
  .seo-close { background: none; border: none; color: rgba(255,255,255,0.5); cursor: pointer; font-size: 1.2rem; line-height: 1; padding: 2px; transition: color 0.2s; }
  .seo-close:hover { color: #fff; }

  .seo-tabs { display: flex; border-bottom: 1px solid #ede7d9; background: #f5f0e8; flex-shrink: 0; }
  .seo-tab {
    flex: 1; padding: 0.6rem 0.4rem; font-size: 0.72rem; font-weight: 600;
    letter-spacing: 0.04em; text-transform: uppercase; border: none;
    background: none; cursor: pointer; color: #5a7366;
    border-bottom: 2px solid transparent; transition: all 0.2s;
    font-family: 'DM Sans', sans-serif;
  }
  .seo-tab.active { color: #3d6e5a; border-bottom-color: #3d6e5a; background: #fdfbf7; }
  .seo-tab:hover:not(.active) { color: #0e1a14; }

  .seo-body { padding: 1.25rem; overflow-y: auto; flex: 1; }

  .seo-panel-section { display: none; }
  .seo-panel-section.active { display: block; }

  .seo-label { font-size: 0.78rem; color: #5a7366; margin-bottom: 0.4rem; display: block; }
  .seo-textarea {
    width: 100%; min-height: 80px; padding: 0.65rem 0.85rem;
    font-size: 0.82rem; font-family: 'DM Sans', sans-serif;
    border: 1px solid #ede7d9; border-radius: 4px;
    background: #f5f0e8; color: #0e1a14; resize: vertical; outline: none;
    transition: border-color 0.2s; line-height: 1.55;
  }
  .seo-textarea:focus { border-color: #3d6e5a; }
  .seo-input {
    width: 100%; padding: 0.6rem 0.85rem; font-size: 0.82rem;
    font-family: 'DM Sans', sans-serif; border: 1px solid #ede7d9;
    border-radius: 4px; background: #f5f0e8; color: #0e1a14; outline: none;
    transition: border-color 0.2s; margin-bottom: 0.75rem;
  }
  .seo-input:focus { border-color: #3d6e5a; }

  .seo-btn {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    width: 100%; padding: 0.7rem; margin-top: 0.75rem;
    background: #3d6e5a; color: #fff; border: none; border-radius: 4px;
    font-size: 0.85rem; font-weight: 600; cursor: pointer;
    font-family: 'DM Sans', sans-serif; transition: background 0.2s;
  }
  .seo-btn:hover { background: #0e1a14; }
  .seo-btn:disabled { background: #d4e8df; color: #6b9e87; cursor: not-allowed; }

  .seo-output {
    margin-top: 0.85rem; background: #0e1a14;
    border-radius: 4px; overflow: hidden; display: none;
  }
  .seo-output-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.5rem 0.85rem; border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .seo-output-label { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.4); }
  .seo-copy-btn {
    font-size: 0.7rem; font-weight: 600; padding: 0.25rem 0.65rem;
    background: rgba(200,150,62,0.15); color: #c8963e;
    border: 1px solid rgba(200,150,62,0.3); border-radius: 3px;
    cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all 0.2s;
  }
  .seo-copy-btn:hover { background: rgba(200,150,62,0.3); }
  .seo-output-content {
    padding: 0.85rem; font-size: 0.75rem; color: #a8c8b8;
    font-family: 'Courier New', monospace; line-height: 1.6;
    white-space: pre-wrap; max-height: 200px; overflow-y: auto;
  }
  .seo-output-content.prose { font-family: 'DM Sans', sans-serif; white-space: normal; color: #fdfbf7; }

  .seo-spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: seoSpin 0.7s linear infinite; }
  @keyframes seoSpin { to { transform: rotate(360deg); } }

  .seo-status { font-size: 0.75rem; color: #6b9e87; display: none; align-items: center; gap: 0.5rem; margin-top: 0.6rem; }
  .seo-dot { width: 7px; height: 7px; border-radius: 50%; background: #3d6e5a; animation: seoPulse 1.2s ease-in-out infinite; }
  @keyframes seoPulse { 0%,100% { opacity:1; } 50% { opacity:0.3; } }

  .score-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 0.85rem; }
  .score-box { background: #f5f0e8; border-radius: 4px; padding: 0.65rem; text-align: center; }
  .score-num { font-family: 'DM Serif Display', serif; font-size: 1.6rem; }
  .score-lbl { font-size: 0.65rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #5a7366; margin-top: 2px; }

  .tip-item { display: flex; gap: 0.5rem; padding: 0.5rem 0; border-bottom: 1px solid #ede7d9; font-size: 0.8rem; color: #2d4035; line-height: 1.5; }
  .tip-item:last-child { border-bottom: none; }
  .tip-ico { flex-shrink: 0; font-size: 0.85rem; margin-top: 1px; }

  .kw-section { margin-bottom: 0.85rem; }
  .kw-section-label { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #5a7366; margin-bottom: 0.4rem; }
  .kw-chip { display: inline-flex; align-items: center; gap: 3px; background: #d4e8df; color: #1a5c3e; font-size: 0.72rem; padding: 3px 9px; border-radius: 20px; margin: 2px; font-weight: 500; }

  @media (max-width: 480px) {
    #seo-panel { width: calc(100vw - 2rem); right: 1rem; bottom: 9rem; }
    #seo-fab { bottom: 5rem; right: 1rem; }
  }