/* ═══════════════════════════════════════════════════════
   ROOMFURNISH — Design System v3
   Direction: Japandi Craft Studio
   ═══════════════════════════════════════════════════════ */

/* ===== TOKENS ===== */
:root {
    --bg: #FAFAF7;
    --bg-alt: #F0EDE8;
    --dark: #2B2B2B;
    --dark-soft: #3D3D3D;
    --sand: #C4A882;
    --sand-light: #D4BC9A;
    --sand-dark: #A8895E;
    --sage: #8B9D83;
    --muted: #8A8A8A;
    --border: #E0DDD6;
    --white: #FFFFFF;
    --radius: 16px;
    --radius-sm: 8px;
    --radius-pill: 40px;
    --transition: 350ms cubic-bezier(0.22, 1, 0.36, 1);
    --shadow-sm: 0 2px 12px rgba(0,0,0,0.06);
    --shadow-md: 0 8px 32px rgba(0,0,0,0.08);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.12);
    --font-th: 'Noto Sans Thai', sans-serif;
    --font-en: 'Inter', sans-serif;
    --section-py: 120px;
    --section-py-m: 72px;
    --max-w: 1200px;
}

/* ===== BASE ===== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-th);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.75;
    color: var(--dark);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-th);
    font-weight: 600;
    color: var(--dark);
    line-height: 1.25;
    letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.5rem); }

a { color: var(--dark); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--sand-dark); }

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

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ===== NAVBAR ===== */
.rb-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 20px 0;
    transition: all var(--transition);
    background: transparent;
}

.rb-nav.scrolled {
    background: rgba(250, 250, 247, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 12px 0;
    box-shadow: var(--shadow-sm);
}

.rb-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
}

.rb-logo {
    font-family: var(--font-en);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.15em;
    color: var(--dark);
    text-decoration: none;
}

.rb-nav-links {
    display: flex;
    align-items: center;
    gap: 36px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.rb-nav-link {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--dark-soft);
    text-decoration: none;
    position: relative;
    transition: color var(--transition);
}

.rb-nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--sand);
    transition: width var(--transition);
}

.rb-nav-link:hover,
.rb-nav-link.active {
    color: var(--dark);
}

.rb-nav-link.active::after,
.rb-nav-link:hover::after {
    width: 100%;
}

/* Mobile toggle */
.rb-nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
}

.rb-nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--dark);
    transition: all var(--transition);
}

.rb-nav-spacer { height: 80px; }

/* ===== BUTTONS ===== */
.rb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-th);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 14px 32px;
    border-radius: var(--radius-pill);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.rb-btn-dark {
    background: var(--dark);
    color: var(--white);
    border-color: var(--dark);
}

.rb-btn-dark:hover {
    background: var(--dark-soft);
    border-color: var(--dark-soft);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.rb-btn-ghost {
    background: transparent;
    color: var(--dark);
    border-color: var(--border);
}

.rb-btn-ghost:hover {
    border-color: var(--dark);
    color: var(--dark);
    transform: translateY(-2px);
}

.rb-btn-sand {
    background: var(--sand);
    color: var(--white);
    border-color: var(--sand);
}

.rb-btn-sand:hover {
    background: var(--sand-dark);
    border-color: var(--sand-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.rb-btn-sm {
    padding: 10px 24px;
    font-size: 0.85rem;
}

/* ===== SECTION ===== */
.rb-section {
    padding: var(--section-py) 0;
}

.rb-section-alt {
    background: var(--bg-alt);
}

.rb-label {
    font-family: var(--font-en);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--sand);
    margin-bottom: 12px;
    display: block;
}

.rb-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 56px;
    gap: 24px;
}

.rb-section-header h2 { margin: 0; }

.rb-link {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--dark);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition);
    white-space: nowrap;
}

.rb-link:hover {
    color: var(--sand-dark);
    gap: 10px;
}

/* ===== HERO ===== */
.rb-hero {
    position: relative;
    width: 100%;
    min-height: 540px;
    height: 75vh;
    max-height: 760px;
    margin-top: 80px;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.rb-hero-img {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.rb-hero-img::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0.8) 0%,
        rgba(255, 255, 255, 0.5) 40%,
        rgba(255, 255, 255, 0.05) 75%
    );
    pointer-events: none;
}

.rb-hero-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 8s ease;
}

.rb-hero:hover .rb-hero-img img {
    transform: scale(1.03);
}

.rb-hero-content {
    position: relative;
    z-index: 2;
    padding: 0 72px;
    max-width: 780px;
}

.rb-hero-title {
    font-size: clamp(2.2rem, 4.5vw, 3.8rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 12px;
    letter-spacing: 0.05em;
    color: var(--dark);
}

.rb-hero-title span {
    color: var(--sand);
}

.rb-hero-desc {
    font-size: 1.1rem;
    color: var(--dark-soft);
    margin-bottom: 28px;
    max-width: 500px;
    line-height: 1.7;
}

.rb-hero-actions {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.rb-hero-actions .rb-btn {
    padding: 13px 32px;
    font-size: 1rem;
}

/* ===== PROJECT CARDS ===== */
.rb-project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.rb-project-card {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.rb-project-card-img {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    aspect-ratio: 4/3;
    width: 100%;
}

.rb-project-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.rb-project-card:hover .rb-project-card-img img {
    transform: scale(1.08);
}

.rb-project-card-body {
    padding: 16px 4px 0;
}

.rb-project-card-title {
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--dark);
}

.rb-project-card-cat {
    font-size: 0.8rem;
    color: var(--muted);
    font-family: var(--font-th);
}

/* Featured hero card */
.rb-project-hero {
    grid-column: span 2;
    grid-row: span 2;
    display: flex;
    flex-direction: column;
}

.rb-project-hero .rb-project-card-img {
    aspect-ratio: auto;
    flex: 1;
    min-height: 380px;
}

/* ===== CATEGORY STRIP ===== */
.rb-category-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.rb-category-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 3/4;
    text-decoration: none;
    display: block;
}

.rb-category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.rb-category-card:hover img {
    transform: scale(1.06);
}

.rb-category-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px 24px;
    background: linear-gradient(0deg, rgba(43,43,43,0.85) 0%, transparent 100%);
    color: var(--white);
}

.rb-category-overlay h3 {
    color: var(--white);
    font-size: 1.15rem;
    margin-bottom: 4px;
}

.rb-category-overlay p {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.75);
    margin: 0;
    line-height: 1.5;
}

/* ===== TIMELINE / PROCESS ===== */
.rb-timeline {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    position: relative;
}

.rb-timeline::before {
    content: '';
    position: absolute;
    top: 24px;
    left: 12.5%;
    right: 12.5%;
    height: 2px;
    background: var(--border);
}

/* Timeline with 5 steps */
.rb-timeline.rb-timeline-5 {
    grid-template-columns: repeat(5, 1fr);
}

.rb-timeline.rb-timeline-5::before {
    left: 10%;
    right: 10%;
}

.rb-timeline-step {
    text-align: center;
    position: relative;
    padding: 0 14px;
    transition: transform var(--transition);
}

.rb-timeline-step:hover {
    transform: translateY(-4px);
}

.rb-timeline-dot {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--dark);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-en);
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0 auto 20px;
    position: relative;
    z-index: 1;
    transition: all var(--transition);
}

.rb-timeline-step:hover .rb-timeline-dot {
    background: var(--sand-dark);
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(168, 137, 94, 0.35);
}

.rb-timeline-title {
    font-size: 0.98rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark);
    line-height: 1.4;
}

.rb-timeline-desc {
    font-size: 0.84rem;
    color: var(--muted);
    line-height: 1.6;
}

/* ===== ABOUT PREVIEW / SPLIT ===== */
.rb-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 360px;
    max-height: 360px;
    overflow: hidden;
}

.rb-split-img {
    position: relative;
    overflow: hidden;
    height: 360px;
}

.rb-split-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rb-split-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 64px;
    background: var(--dark);
    color: var(--white);
}

.rb-split-content .rb-label { color: var(--sand-light); }
.rb-split-content h2 { color: var(--white); margin-bottom: 16px; }
.rb-split-content p { color: rgba(255,255,255,0.7); margin-bottom: 32px; line-height: 1.8; }

.rb-split-content .rb-link {
    color: var(--sand-light);
}

.rb-split-content .rb-link:hover {
    color: var(--white);
}

/* ===== CTA BAR ===== */
.rb-cta {
    background: var(--sand);
    padding: 72px 0;
    text-align: center;
}

.rb-cta h2 {
    color: var(--white);
    margin-bottom: 12px;
}

.rb-cta p {
    color: rgba(255,255,255,0.8);
    margin-bottom: 32px;
    font-size: 1rem;
}

.rb-cta .rb-btn-dark {
    background: var(--dark);
    border-color: var(--dark);
}

.rb-cta .rb-btn-dark:hover {
    background: var(--white);
    color: var(--dark);
    border-color: var(--white);
}

.rb-cta .rb-btn-ghost {
    border-color: rgba(255,255,255,0.5);
    color: var(--white);
}

.rb-cta .rb-btn-ghost:hover {
    border-color: var(--white);
    color: var(--white);
}

/* ===== FOOTER ===== */
.rb-footer {
    background: var(--dark);
    color: rgba(255,255,255,0.7);
    padding: 80px 0 40px;
}

.rb-footer-brand {
    font-family: var(--font-en);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.15em;
    color: var(--white);
    margin-bottom: 12px;
}

.rb-footer-desc {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.7;
    margin-bottom: 20px;
}

.rb-footer-social {
    display: flex;
    gap: 16px;
}

.rb-footer-social a {
    color: rgba(255,255,255,0.5);
    font-size: 1.1rem;
    transition: color var(--transition);
}

.rb-footer-social a:hover { color: var(--sand-light); }

.rb-footer-heading {
    font-size: 0.72rem;
    font-family: var(--font-en);
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--sand-light);
    margin-bottom: 16px;
}

.rb-footer-link {
    display: block;
    font-size: 0.88rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 8px;
    text-decoration: none;
    transition: color var(--transition);
}

.rb-footer-link:hover { color: var(--white); }

.rb-footer-contact-val {
    font-weight: 500;
    color: var(--white);
    font-size: 0.95rem;
}

.rb-footer-contact-note {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.4);
    margin-top: 2px;
}

.rb-footer-bottom {
    margin-top: 56px;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.35);
    padding-bottom: 48px;
}

.rb-footer-bottom a {
    color: rgba(255,255,255,0.35);
    text-decoration: none;
}

.rb-footer-bottom a:hover { color: rgba(255,255,255,0.7); }

/* ===== FLOATING LINE BUTTON ===== */
.rb-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--dark);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    z-index: 999;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition);
    text-decoration: none;
}

.rb-fab:hover {
    background: var(--sand);
    color: var(--white);
    transform: translateY(-4px);
    box-shadow: 0 20px 48px rgba(0,0,0,0.2);
}

/* ===== FILTER PILLS ===== */
.rb-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 48px;
}

.rb-filter {
    padding: 8px 24px;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--border);
    background: transparent;
    font-family: var(--font-th);
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--muted);
    cursor: pointer;
    transition: all var(--transition);
}

.rb-filter:hover {
    border-color: var(--dark);
    color: var(--dark);
}

.rb-filter.active {
    background: var(--dark);
    border-color: var(--dark);
    color: var(--white);
}

/* ===== PROJECT DETAIL ===== */
.rb-detail-hero {
    width: 100%;
    aspect-ratio: 21/9;
    overflow: hidden;
    border-radius: 0 0 var(--radius) var(--radius);
}

.rb-detail-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rb-detail-thumbs {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.rb-detail-thumb {
    width: 80px;
    height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition);
}

.rb-detail-thumb.active,
.rb-detail-thumb:hover {
    border-color: var(--sand);
}

.rb-detail-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rb-detail-info {
    background: var(--bg-alt);
    border-radius: var(--radius);
    padding: 32px;
}

.rb-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.rb-detail-row:last-child { border-bottom: none; }
.rb-detail-row span:first-child { color: var(--muted); }
.rb-detail-row span:last-child { font-weight: 500; }

.rb-detail-cta {
    background: var(--bg-alt);
    border-radius: var(--radius);
    padding: 32px;
    margin-top: 48px;
}

/* ===== INFO CARDS ===== */
.rb-info-card {
    background: var(--bg-alt);
    border-radius: var(--radius);
    padding: 32px;
}

/* ===== PAGE HEADERS ===== */
.rb-page-header {
    padding: 56px 0 40px;
    text-align: center;
}

.rb-page-header h1 {
    margin-bottom: 12px;
}

.rb-page-header p {
    color: var(--muted);
    max-width: 520px;
    margin: 0 auto;
    font-size: 1rem;
}

/* ===== ABOUT PAGE ===== */
.rb-values-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.rb-value-card {
    text-align: center;
    padding: 40px 24px;
}

.rb-value-num {
    font-family: var(--font-en);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--sand);
    margin-bottom: 12px;
    line-height: 1;
}

.rb-value-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.rb-value-desc {
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.7;
}

/* ===== SERVICES ===== */
.rb-service-card {
    padding: 40px 32px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all var(--transition);
    background: var(--white);
}

.rb-service-card:hover {
    border-color: var(--sand);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.rb-service-num {
    font-family: var(--font-en);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--sand);
    margin-bottom: 16px;
}

.rb-service-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.rb-service-desc {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.7;
}

/* ===== CONTACT ===== */
.rb-contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
}

.rb-contact-item {
    margin-bottom: 32px;
}

.rb-contact-label {
    font-size: 0.72rem;
    font-family: var(--font-en);
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--sand);
    margin-bottom: 8px;
}

.rb-contact-value {
    font-size: 1.1rem;
    font-weight: 500;
}

.rb-contact-note {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 4px;
}

/* ===== LIGHTBOX ===== */
.rb-lightbox .modal-dialog { max-width: 90vw; }
.rb-lightbox .modal-content { background: transparent; border: none; }
.rb-lightbox .modal-body { padding: 0; display: flex; align-items: center; justify-content: center; }
.rb-lightbox .modal-body img { max-width: 100%; max-height: 90vh; object-fit: contain; border-radius: var(--radius); }
.rb-lightbox .btn-close { position: absolute; top: 12px; right: 12px; z-index: 10; filter: invert(1); opacity: 0.8; }

/* ===== ANIMATIONS ===== */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1), transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.revealed {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Staggered children */
.stagger > * {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1), transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.stagger.revealed > * {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.stagger.revealed > *:nth-child(1) { transition-delay: 0.02s; }
.stagger.revealed > *:nth-child(2) { transition-delay: 0.06s; }
.stagger.revealed > *:nth-child(3) { transition-delay: 0.10s; }
.stagger.revealed > *:nth-child(4) { transition-delay: 0.14s; }
.stagger.revealed > *:nth-child(5) { transition-delay: 0.18s; }
.stagger.revealed > *:nth-child(6) { transition-delay: 0.22s; }

/* ===== RESPONSIVE ===== */

/* --- Tablet (≤991px) --- */
@media (max-width: 991px) {
    :root {
        --section-py: 80px;
        --section-py-m: 56px;
    }

    /* Navbar */
    .rb-nav-links { display: none; }
    .rb-nav-toggle { display: flex; }

    .rb-nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg);
        padding: 24px;
        gap: 20px;
        box-shadow: var(--shadow-md);
        animation: slideDown 0.35s ease;
    }

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

    /* Hero */
    .rb-hero { min-height: 60vh; }
    .rb-hero-content { padding: 0 24px 48px; max-width: 100%; }
    .rb-hero-img::after {
        background: linear-gradient(
            to right,
            rgba(255, 255, 255, 0.85) 0%,
            rgba(255, 255, 255, 0.55) 40%,
            rgba(255, 255, 255, 0) 70%
        );
    }

    /* Split */
    .rb-split {
        grid-template-columns: 1fr;
        height: auto;
        max-height: none;
    }
    .rb-split-img {
        aspect-ratio: 16/9;
        height: auto;
    }
    .rb-split-content { padding: 48px 24px; }

    /* Timeline */
    .rb-timeline { grid-template-columns: 1fr 1fr; gap: 32px; }
    .rb-timeline::before { display: none; }
    .rb-timeline-5 { grid-template-columns: 1fr 1fr; gap: 32px; }
    .rb-timeline-5 .rb-timeline-step:last-child {
        grid-column: 1 / -1;
        max-width: 320px;
        margin: 0 auto;
    }

    /* Contact */
    .rb-contact-grid { grid-template-columns: 1fr; gap: 48px; }

    /* Values */
    .rb-values-grid { grid-template-columns: 1fr 1fr; gap: 24px; }

    /* Section */
    .rb-section { padding: var(--section-py-m) 0; }

    /* Category Strip */
    .rb-category-strip { grid-template-columns: 1fr 1fr; }
    .rb-category-card { aspect-ratio: 4/3; }

    /* Project Grid */
    .rb-project-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .rb-project-hero {
        grid-column: span 2;
        grid-row: span 1;
    }
    .rb-project-hero .rb-project-card-img { aspect-ratio: 16/9; height: auto; }

    /* Detail page */
    .rb-detail-hero { aspect-ratio: 16/9; }
    .rb-detail-thumbs { flex-wrap: wrap; }

    /* Footer */
    .rb-footer { padding: 56px 0 32px; }
    .rb-footer-bottom { gap: 12px; }

    /* CTA */
    .rb-cta { padding: 56px 0; }

    /* Page header */
    .rb-page-header { padding: 40px 0 32px; }

    /* Info card */
    .rb-info-card { padding: 24px; }
    .rb-detail-info { padding: 24px; }

    /* Section header */
    .rb-section-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* --- Small Tablet / Large Phone (≤767px) --- */
@media (max-width: 767px) {
    /* Project grid → single column */
    .rb-project-grid { grid-template-columns: 1fr; }
    .rb-project-hero { grid-column: span 1; grid-row: span 1; }
    .rb-project-hero .rb-project-card-img { aspect-ratio: 16/9; }

    /* Category → single column */
    .rb-category-strip { grid-template-columns: 1fr; }
    .rb-category-card { aspect-ratio: 16/9; }

    /* Timeline → single column */
    .rb-timeline { grid-template-columns: 1fr; gap: 24px; }
    .rb-timeline-5 { grid-template-columns: 1fr; gap: 24px; }
    .rb-timeline-5 .rb-timeline-step:last-child {
        grid-column: auto;
        max-width: none;
    }

    /* Values → single column */
    .rb-values-grid { grid-template-columns: 1fr; gap: 16px; }
    .rb-value-card { padding: 24px 16px; }
    .rb-value-num { font-size: 2rem; }

    /* Hero */
    .rb-hero-title { font-size: 1.8rem; }
    .rb-hero-desc { font-size: 1rem; }
    .rb-hero-content { padding: 0 20px 32px; }

    /* Detail page */
    .rb-detail-hero { aspect-ratio: 16/9; border-radius: 0; }
    .rb-detail-thumb { width: 64px; height: 48px; }

    /* Footer */
    .rb-footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
    .rb-footer-bottom .d-flex { justify-content: center; }

    /* Service cards */
    .rb-service-card { padding: 28px 20px; }

    /* Filters */
    .rb-filters { gap: 8px; margin-bottom: 32px; }
    .rb-filter { padding: 6px 18px; font-size: 0.82rem; }

    /* Contact grid */
    .rb-contact-grid { gap: 32px; }

    /* Container */
    .container { padding: 0 16px; }

    /* CTA */
    .rb-cta { padding: 48px 0; }
    .rb-cta h2 { font-size: 1.4rem; }
    .rb-cta p { font-size: 0.9rem; margin-bottom: 24px; }

    /* Split */
    .rb-split-content { padding: 36px 20px; }
    .rb-split-content h2 { font-size: 1.4rem; }

    /* Page header */
    .rb-page-header { padding: 32px 0 24px; }
    .rb-page-header h1 { font-size: 1.6rem; }
    .rb-page-header p { font-size: 0.9rem; }

    /* Nav spacer */
    .rb-nav-spacer { height: 64px; }
}

/* --- Mobile (≤576px) --- */
@media (max-width: 576px) {
    /* Hero */
    .rb-hero { min-height: 50vh; margin-top: 64px; }
    .rb-hero-content { padding: 24px 16px; }
    .rb-hero-title { font-size: 1.5rem; }
    .rb-hero-desc { font-size: 0.9rem; margin-bottom: 20px; max-width: 100%; }
    .rb-hero-actions { flex-direction: column; gap: 12px; }
    .rb-hero-actions .rb-btn { width: 100%; padding: 12px 24px; font-size: 0.9rem; }
    .rb-hero-img::after {
        background: linear-gradient(
            to top,
            rgba(255, 255, 255, 0.92) 0%,
            rgba(255, 255, 255, 0.6) 40%,
            rgba(255, 255, 255, 0) 70%
        );
    }

    /* Buttons */
    .rb-btn { padding: 12px 24px; font-size: 0.85rem; }

    /* FAB */
    .rb-fab { width: 48px; height: 48px; font-size: 1.1rem; bottom: 20px; right: 20px; }

    /* Navbar */
    .rb-nav { padding: 12px 0; }
    .rb-logo { font-size: 1rem; }
    .rb-nav-links.open { padding: 16px; gap: 14px; }

    /* Section */
    .rb-section { padding: 48px 0; }
    .rb-label { font-size: 0.65rem; margin-bottom: 8px; }

    /* Project cards */
    .rb-project-card-img { border-radius: var(--radius-sm); }
    .rb-project-card-body { padding: 12px 2px 0; }
    .rb-project-card-title { font-size: 0.95rem; }
    .rb-project-card-cat { font-size: 0.75rem; }

    /* Detail page */
    .rb-detail-hero { aspect-ratio: 4/3; }
    .rb-detail-thumbs { gap: 8px; }
    .rb-detail-thumb { width: 56px; height: 42px; }
    .rb-detail-info { padding: 20px; }
    .rb-detail-row { font-size: 0.82rem; padding: 10px 0; }

    /* Split */
    .rb-split-content { padding: 28px 16px; }
    .rb-split-content h2 { font-size: 1.25rem; margin-bottom: 12px; }
    .rb-split-content p { font-size: 0.88rem; margin-bottom: 20px; line-height: 1.7; }

    /* Footer */
    .rb-footer { padding: 40px 0 24px; }
    .rb-footer-brand { font-size: 0.95rem; }
    .rb-footer-desc { font-size: 0.82rem; }
    .rb-footer-heading { margin-bottom: 12px; }
    .rb-footer-link { font-size: 0.82rem; }
    .rb-footer-contact-val { font-size: 0.88rem; }
    .rb-footer-bottom { margin-top: 32px; padding-top: 20px; font-size: 0.72rem; padding-bottom: 24px; }

    /* CTA */
    .rb-cta { padding: 40px 0; }
    .rb-cta h2 { font-size: 1.25rem; }

    /* Contact page */
    .rb-contact-value { font-size: 1rem; }
    .rb-info-card { padding: 20px; }
    .rb-info-card h3 { font-size: 1.1rem; }

    /* Service cards */
    .rb-service-card { padding: 24px 16px; }
    .rb-service-title { font-size: 1.05rem; }
    .rb-service-desc { font-size: 0.85rem; }

    /* Timeline */
    .rb-timeline-dot { width: 40px; height: 40px; font-size: 0.8rem; }
    .rb-timeline-step { padding: 0 8px; }
    .rb-timeline-title { font-size: 0.9rem; }
    .rb-timeline-desc { font-size: 0.8rem; }

    /* Lightbox */
    .rb-lightbox .modal-dialog { max-width: 95vw; margin: 8px; }

    /* Values */
    .rb-value-num { font-size: 1.75rem; }
    .rb-value-title { font-size: 0.95rem; }
    .rb-value-desc { font-size: 0.82rem; }

    /* Page header */
    .rb-page-header { padding: 24px 0 20px; }
    .rb-page-header h1 { font-size: 1.35rem; }
    .rb-page-header p { font-size: 0.85rem; }

    /* Section header */
    .rb-section-header { margin-bottom: 32px; }
}

/* --- Very Small Phone (≤480px) --- */
@media (max-width: 480px) {
    .rb-hero-title { font-size: 1.3rem; }
    .rb-hero-desc { font-size: 0.85rem; }
    .container { padding: 0 12px; }
    .rb-split-content { padding: 24px 12px; }
    .rb-cta h2 { font-size: 1.1rem; }
    .rb-cta p { font-size: 0.82rem; }
    .rb-footer-bottom .d-flex { flex-direction: column; gap: 8px; }
}
