/* ==========================================================================
   Syntro Build AI — Renderer CSS  (Module 4)
   Scoped to sections rendered by the JSON renderer.
   Design tokens are injected per-section via CSS custom properties.
   All properties use var(--rp/rs/ra/rt/rbg/rh/rf) set by BaseRenderer.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Base reset for rendered pages
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body { line-height: 1.6; -webkit-font-smoothing: antialiased; }

img { display: block; max-width: 100%; }

a { color: inherit; }

/* --------------------------------------------------------------------------
   2. Shared section layout
   -------------------------------------------------------------------------- */
.r-section {
    width:    100%;
    overflow: hidden;
}

.r-section__inner {
    max-width: 1200px;
    margin:    0 auto;
    padding:   5rem 1.5rem;
}

.r-section__header {
    text-align:    center;
    margin-bottom: 3rem;
}

.r-section__title {
    font-family: var(--rh);
    font-size:   clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 700;
    color:       var(--rt);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.r-section__sub {
    font-family: var(--rf);
    font-size:   1.1rem;
    color:       color-mix(in srgb, var(--rt) 60%, transparent);
    margin-top:  0.75rem;
    max-width:   640px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.65;
}

/* --------------------------------------------------------------------------
   3. Navbar
   -------------------------------------------------------------------------- */
.r-section--nav {
    position:   sticky;
    top:        0;
    z-index:    100;
    background: var(--rbg);
    border-bottom: 1px solid color-mix(in srgb, var(--rt) 10%, transparent);
    box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}

.r-nav__bar {
    max-width:       1200px;
    margin:          0 auto;
    padding:         0 1.5rem;
    height:          64px;
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    gap:             1rem;
}

.r-nav__logo {
    font-family:     var(--rh);
    font-size:       1.25rem;
    font-weight:     700;
    color:           var(--rp);
    text-decoration: none;
    white-space:     nowrap;
}

.r-nav__menu {
    display:     flex;
    align-items: center;
    list-style:  none;
    gap:         0.25rem;
    flex-wrap:   wrap;
}

.r-nav__link {
    display:         block;
    padding:         0.45rem 0.85rem;
    font-size:       0.9rem;
    font-weight:     500;
    color:           var(--rt);
    text-decoration: none;
    border-radius:   6px;
    transition:      background 150ms, color 150ms;
}

.r-nav__link:hover { background: color-mix(in srgb, var(--rp) 10%, transparent); color: var(--rp); }

.r-nav__cta {
    display:         inline-block;
    padding:         0.45rem 1.1rem;
    background:      var(--rp);
    color:           #fff;
    border-radius:   9999px;
    font-size:       0.875rem;
    font-weight:     600;
    text-decoration: none;
    transition:      opacity 150ms;
}

.r-nav__cta:hover { opacity: 0.88; }

/* Hamburger */
.r-nav__toggle {
    display:        none;
    flex-direction: column;
    gap:            5px;
    padding:        6px;
    background:     none;
    border:         none;
    cursor:         pointer;
}

.r-nav__toggle span {
    display: block;
    width:   22px;
    height:  2px;
    background: var(--rt);
    border-radius: 2px;
    transition: transform 200ms;
}

/* --------------------------------------------------------------------------
   4. Hero
   -------------------------------------------------------------------------- */
.r-section--hero { padding: 0; }

.r-hero__bg {
    min-height:      90vh;
    display:         flex;
    align-items:     center;
    justify-content: center;
    position:        relative;
    padding:         4rem 1.5rem;
}

.r-hero__overlay {
    position:   absolute;
    inset:      0;
    background: rgba(0,0,0,0.45);
}

.r-hero__content {
    position:   relative;
    z-index:    2;
    text-align: center;
    max-width:  760px;
    margin:     0 auto;
}

.r-hero__headline {
    font-family:  var(--rh);
    font-size:    clamp(2.25rem, 6vw, 4rem);
    font-weight:  800;
    color:        #fff;
    line-height:  1.1;
    letter-spacing: -0.03em;
    text-shadow:  0 2px 20px rgba(0,0,0,0.2);
}

.r-hero__sub {
    font-family: var(--rf);
    font-size:   1.15rem;
    color:       rgba(255,255,255,0.88);
    margin-top:  1.25rem;
    line-height: 1.65;
}

.r-hero__actions {
    display:     flex;
    flex-wrap:   wrap;
    gap:         0.75rem;
    justify-content: center;
    margin-top:  2rem;
}

.r-hero__cta {
    display:         inline-block;
    padding:         0.8rem 2rem;
    border-radius:   9999px;
    font-size:       1rem;
    font-weight:     700;
    text-decoration: none;
    transition:      transform 150ms, opacity 150ms;
}

.r-hero__cta:active { transform: scale(0.96); }

.r-hero__cta--primary {
    background: #fff;
    color:      var(--rp);
}

.r-hero__cta--primary:hover { opacity: 0.92; }

.r-hero__cta--sec {
    background: transparent;
    color:      #fff;
    border:     2px solid rgba(255,255,255,0.7);
}

.r-hero__cta--sec:hover { border-color: #fff; }

/* --------------------------------------------------------------------------
   5. Gallery
   -------------------------------------------------------------------------- */
.r-section--gallery,
.r-section--portfolio { background: var(--rs); }

.r-gallery__grid {
    display:               grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap:                   1rem;
}

.r-gallery__item { border-radius: 12px; overflow: hidden; position: relative; aspect-ratio: 4/3; }

.r-gallery__img {
    width:      100%;
    height:     100%;
    object-fit: cover;
    transition: transform 400ms ease;
}

.r-gallery__item:hover .r-gallery__img { transform: scale(1.06); }

.r-gallery__caption {
    position:   absolute;
    bottom:     0;
    left:       0;
    right:      0;
    padding:    0.5rem 0.75rem;
    background: rgba(0,0,0,0.45);
    color:      #fff;
    font-size:  0.8rem;
    backdrop-filter: blur(4px);
}

.r-gallery__item--placeholder .r-gallery__placeholder {
    width:           100%;
    height:          100%;
    background:      color-mix(in srgb, var(--rp) 8%, var(--rs));
    display:         flex;
    flex-direction:  column;
    align-items:     center;
    justify-content: center;
    gap:             0.5rem;
    color:           color-mix(in srgb, var(--rp) 60%, transparent);
    font-size:       0.8rem;
    font-family:     var(--rf);
}

/* --------------------------------------------------------------------------
   6. Pricing
   -------------------------------------------------------------------------- */
.r-pricing__grid {
    display: grid;
    gap:     1.5rem;
}

.r-pricing__grid--1 { grid-template-columns: repeat(1, minmax(0, 420px)); margin: 0 auto; }
.r-pricing__grid--2 { grid-template-columns: repeat(2, 1fr); }
.r-pricing__grid--3 { grid-template-columns: repeat(3, 1fr); }
.r-pricing__grid--4 { grid-template-columns: repeat(4, 1fr); }

.r-pricing__card {
    background:    var(--rbg);
    border:        2px solid color-mix(in srgb, var(--rt) 10%, transparent);
    border-radius: 16px;
    padding:       2rem 1.75rem;
    display:       flex;
    flex-direction: column;
    position:      relative;
    transition:    box-shadow 200ms, transform 200ms;
}

.r-pricing__card:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.1);
    transform:  translateY(-4px);
}

.r-pricing__card--featured {
    border-color: var(--rp);
    background:   linear-gradient(160deg, color-mix(in srgb, var(--rp) 6%, var(--rbg)), var(--rbg));
}

.r-pricing__badge {
    position:      absolute;
    top:           -14px;
    left:          50%;
    transform:     translateX(-50%);
    background:    var(--rp);
    color:         #fff;
    font-size:     0.75rem;
    font-weight:   700;
    padding:       0.25rem 1rem;
    border-radius: 9999px;
    white-space:   nowrap;
}

.r-pricing__name {
    font-family: var(--rh);
    font-size:   1.25rem;
    font-weight: 700;
    color:       var(--rt);
}

.r-pricing__desc {
    font-size:  0.85rem;
    color:      color-mix(in srgb, var(--rt) 60%, transparent);
    margin-top: 0.25rem;
}

.r-pricing__price-wrap {
    display:     flex;
    align-items: baseline;
    gap:         0.25rem;
    margin:      1.25rem 0;
}

.r-pricing__price {
    font-family:    var(--rh);
    font-size:      2.5rem;
    font-weight:    800;
    color:          var(--rp);
    line-height:    1;
}

.r-pricing__period { font-size: 0.9rem; color: color-mix(in srgb, var(--rt) 55%, transparent); }

.r-pricing__features { list-style: none; flex: 1; display: flex; flex-direction: column; gap: 0.65rem; }

.r-pricing__feature {
    display:     flex;
    align-items: center;
    gap:         0.5rem;
    font-size:   0.9rem;
    color:       var(--rt);
}

.r-pricing__check { color: var(--ra); flex-shrink: 0; }

.r-pricing__cta {
    display:         block;
    text-align:      center;
    margin-top:      1.75rem;
    padding:         0.7rem 1.25rem;
    background:      var(--rp);
    color:           #fff;
    border-radius:   9999px;
    font-size:       0.95rem;
    font-weight:     600;
    text-decoration: none;
    transition:      opacity 150ms, transform 150ms;
}

.r-pricing__cta:hover  { opacity: 0.88; }
.r-pricing__cta:active { transform: scale(0.97); }

/* --------------------------------------------------------------------------
   7. Testimonials
   -------------------------------------------------------------------------- */
.r-section--testimonials { background: var(--rs); }

.r-testimonials__grid {
    display:               grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap:                   1.5rem;
}

.r-testimonial__card {
    background:    var(--rbg);
    border:        1px solid color-mix(in srgb, var(--rt) 10%, transparent);
    border-radius: 16px;
    padding:       1.75rem;
    display:       flex;
    flex-direction: column;
    gap:           1rem;
    transition:    box-shadow 200ms, transform 200ms;
}

.r-testimonial__card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    transform:  translateY(-2px);
}

.r-stars { color: #f59e0b; font-size: 1rem; letter-spacing: 2px; }

.r-testimonial__quote {
    font-family: var(--rf);
    font-size:   0.95rem;
    color:       color-mix(in srgb, var(--rt) 80%, transparent);
    line-height: 1.65;
    flex:        1;
}

.r-testimonial__author {
    display:     flex;
    align-items: center;
    gap:         0.75rem;
}

.r-testimonial__avatar {
    width:           40px;
    height:          40px;
    border-radius:   9999px;
    overflow:        hidden;
    background:      var(--rp);
    display:         flex;
    align-items:     center;
    justify-content: center;
    flex-shrink:     0;
}

.r-testimonial__avatar-img { width: 100%; height: 100%; object-fit: cover; }

.r-testimonial__avatar-initials {
    color:       #fff;
    font-weight: 700;
    font-size:   0.9rem;
}

.r-testimonial__name  { display: block; font-weight: 700; font-size: 0.9rem; color: var(--rt); }
.r-testimonial__role  { display: block; font-size: 0.78rem; color: color-mix(in srgb, var(--rt) 55%, transparent); }

/* --------------------------------------------------------------------------
   8. FAQ
   -------------------------------------------------------------------------- */
.r-faq__list { max-width: 780px; margin: 0 auto; }

.r-faq__item {
    border-bottom: 1px solid color-mix(in srgb, var(--rt) 10%, transparent);
}

.r-faq__item:first-child { border-top: 1px solid color-mix(in srgb, var(--rt) 10%, transparent); }

.r-faq__question {
    width:           100%;
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    gap:             1rem;
    padding:         1.1rem 0;
    background:      none;
    border:          none;
    cursor:          pointer;
    font-family:     var(--rf);
    font-size:       1rem;
    font-weight:     600;
    color:           var(--rt);
    text-align:      left;
}

.r-faq__chevron {
    flex-shrink: 0;
    color:       var(--rp);
    transition:  transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.r-faq__question[aria-expanded="true"] .r-faq__chevron { transform: rotate(180deg); }

.r-faq__answer {
    overflow:   hidden;
    max-height: 0;
    transition: max-height 280ms cubic-bezier(0.4, 0, 0.2, 1),
                padding 280ms;
}

.r-faq__answer--open { max-height: 600px; padding-bottom: 1.1rem; }

.r-faq__answer p { font-size: 0.95rem; color: color-mix(in srgb, var(--rt) 75%, transparent); line-height: 1.65; }

/* --------------------------------------------------------------------------
   9. Footer
   -------------------------------------------------------------------------- */
.r-section--footer {
    background: color-mix(in srgb, var(--rt) 5%, var(--rbg));
    border-top:  1px solid color-mix(in srgb, var(--rt) 10%, transparent);
}

.r-section--footer .r-section__inner { padding: 4rem 1.5rem 2rem; }

.r-footer__inner { display: flex; flex-direction: column; gap: 2.5rem; }

.r-footer__top {
    display:    grid;
    grid-template-columns: 1fr auto;
    gap:        3rem;
    align-items: start;
}

.r-footer__brand { max-width: 320px; }

.r-footer__logo {
    font-family: var(--rh);
    font-size:   1.25rem;
    font-weight: 700;
    color:       var(--rp);
}

.r-footer__tagline {
    font-size:  0.9rem;
    color:      color-mix(in srgb, var(--rt) 60%, transparent);
    margin-top: 0.5rem;
    line-height: 1.55;
}

.r-footer__socials {
    display:     flex;
    gap:         0.75rem;
    margin-top:  1.25rem;
    flex-wrap:   wrap;
}

.r-footer__social {
    display:          flex;
    align-items:      center;
    justify-content:  center;
    width:            36px;
    height:           36px;
    border-radius:    9999px;
    background:       color-mix(in srgb, var(--rt) 8%, transparent);
    color:            color-mix(in srgb, var(--rt) 70%, transparent);
    text-decoration:  none;
    transition:       background 150ms, color 150ms;
}

.r-footer__social:hover { background: var(--rp); color: #fff; }

.r-footer__col-title {
    font-size:     0.8rem;
    font-weight:   700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color:         color-mix(in srgb, var(--rt) 50%, transparent);
    margin-bottom: 0.75rem;
}

.r-footer__col-links { list-style: none; display: flex; flex-direction: column; gap: 0.45rem; }

.r-footer__link {
    font-size:       0.875rem;
    color:           color-mix(in srgb, var(--rt) 70%, transparent);
    text-decoration: none;
    transition:      color 150ms;
}

.r-footer__link:hover { color: var(--rp); }

.r-footer__bottom {
    border-top:  1px solid color-mix(in srgb, var(--rt) 10%, transparent);
    padding-top: 1.5rem;
}

.r-footer__copy { font-size: 0.8rem; color: color-mix(in srgb, var(--rt) 45%, transparent); }

/* --------------------------------------------------------------------------
   10. Generic section
   -------------------------------------------------------------------------- */
.r-generic__list {
    list-style:  none;
    max-width:   600px;
    margin:      0 auto;
    display:     flex;
    flex-direction: column;
    gap:         0.5rem;
}

.r-generic__item {
    padding:    0.65rem 1rem;
    background: color-mix(in srgb, var(--rp) 6%, var(--rbg));
    border:     1px solid color-mix(in srgb, var(--rp) 15%, transparent);
    border-radius: 8px;
    font-size:  0.95rem;
    color:      var(--rt);
}

/* --------------------------------------------------------------------------
   11. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .r-pricing__grid--3 { grid-template-columns: repeat(2, 1fr); }
    .r-pricing__grid--4 { grid-template-columns: repeat(2, 1fr); }
    .r-footer__top      { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .r-section__inner       { padding: 3rem 1rem; }
    .r-hero__bg             { min-height: 70vh; }
    .r-hero__headline       { font-size: 2rem; }
    .r-pricing__grid--2,
    .r-pricing__grid--3,
    .r-pricing__grid--4     { grid-template-columns: 1fr; }
    .r-gallery__grid        { grid-template-columns: 1fr 1fr; }
    .r-testimonials__grid   { grid-template-columns: 1fr; }

    .r-nav__menu {
        display:          none;
        flex-direction:   column;
        align-items:      flex-start;
        gap:              0;
        position:         absolute;
        top:              64px;
        left:             0;
        right:            0;
        background:       var(--rbg);
        border-top:       1px solid color-mix(in srgb, var(--rt) 10%, transparent);
        padding:          0.5rem 0;
        box-shadow:       0 8px 20px rgba(0,0,0,0.1);
        z-index:          200;
    }

    .r-nav__menu--open { display: flex; }
    .r-nav__menu li    { width: 100%; }

    .r-nav__link {
        padding:       0.75rem 1.5rem;
        border-radius: 0;
        display:       block;
        border-bottom: 1px solid color-mix(in srgb, var(--rt) 6%, transparent);
    }

    .r-nav__cta-item { padding: 0.75rem 1.5rem; }
    .r-nav__toggle   { display: flex; }
    .r-nav__bar      { position: relative; }
}
