/* =====================================================
   BTR GROUP — Main Stylesheet
   Clash Display + DM Sans · Dark/Light · All 10 Features
   ===================================================== */

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, video { display: block; max-width: 100%; }
button { font-family: inherit; }
a { color: inherit; }

/* === FONTS === */
/* Clash Display loaded via <link> in layout.php */
/* DM Sans loaded via <link> in layout.php */

/* === CSS VARIABLES (DARK MODE DEFAULT) === */
:root,
[data-theme="dark"] {
    --bg:          #0a0a0a;
    --surface:     #131313;
    --surface-2:   #1c1c1c;
    --border:      rgba(255, 255, 255, 0.07);
    --border-hover:rgba(255, 255, 255, 0.15);
    --text:        #f0ede8;
    --muted:       rgba(240, 237, 232, 0.42);
    --accent:      #0496FF;
    --accent-dim:  rgba(4, 150, 255, 0.15);
    --shadow:      rgba(0, 0, 0, 0.6);
}

[data-theme="light"] {
    --bg:          #ffffff;
    --surface:     #f4f4f4;
    --surface-2:   #e8e8e8;
    --border:      rgba(0, 0, 0, 0.08);
    --border-hover:rgba(0, 0, 0, 0.18);
    --text:        #0a0a0a;
    --muted:       rgba(10, 10, 10, 0.45);
    --accent:      #0496FF;
    --accent-dim:  rgba(4, 150, 255, 0.12);
    --shadow:      rgba(0, 0, 0, 0.15);
}

/* === BASE === */
html { font-size: 16px; scroll-behavior: smooth; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    opacity: 0;
    transition: opacity 0.28s ease, background-color 0.3s ease, color 0.3s ease;
    cursor: none;
}

body.page-loaded { opacity: 1; }

@media (pointer: coarse) {
    body { cursor: auto; }
}

/* === FEATURE 10 — GRAIN TEXTURE OVERLAY === */
.grain {
    position: fixed;
    inset: -50%;
    width: 200%;
    height: 200%;
    pointer-events: none;
    z-index: 9000;
    opacity: 0.038;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    animation: grain 0.45s steps(1) infinite;
}

[data-theme="light"] .grain { opacity: 0.055; }

@keyframes grain {
    0%   { transform: translate(0,    0   ); }
    20%  { transform: translate(-3%,  -4% ); }
    40%  { transform: translate( 4%,   2% ); }
    60%  { transform: translate(-2%,   5% ); }
    80%  { transform: translate( 3%,  -3% ); }
    100% { transform: translate( 0,    0  ); }
}

/* === FEATURE 01 — CUSTOM CURSOR === */
.cursor-dot,
.cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10000;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    will-change: left, top;
}

.cursor-dot {
    width: 7px;
    height: 7px;
    background: var(--text);
    transition: opacity 0.2s ease, background-color 0.3s;
}

.cursor-ring {
    width: 36px;
    height: 36px;
    border: 1.5px solid var(--text);
    opacity: 0.45;
    transition: width 0.25s ease, height 0.25s ease, opacity 0.25s ease,
                border-color 0.25s ease;
}

.cursor-dot.is-hovering { opacity: 0; }

.cursor-ring.is-hovering {
    width: 56px;
    height: 56px;
    opacity: 1;
    border-color: var(--accent);
}

@media (pointer: coarse) {
    .cursor-dot, .cursor-ring { display: none; }
}

/* === FEATURE 02 — DARK/LIGHT TOGGLE (nav button) === */
.nav__theme-btn svg { transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.nav__theme-btn:hover svg { transform: rotate(20deg); }

/* === NAVIGATION BAR === */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 44px;
    transition: padding 0.3s;
}

.nav__logo {
    font-family: 'Clash Display', sans-serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
    color: var(--text);
}

.nav__controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav__theme-btn,
.nav__menu-btn {
    background: none;
    border: none;
    cursor: none;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    opacity: 0.65;
    transition: opacity 0.2s, background 0.2s;
}

.nav__theme-btn:hover,
.nav__menu-btn:hover {
    opacity: 1;
    background: var(--border);
}

/* 3×3 dot-grid icon */
.nav__menu-btn {
    display: grid;
    grid-template-columns: repeat(3, 4px);
    grid-template-rows: repeat(3, 4px);
    gap: 4px;
    width: 40px;
    height: 40px;
    padding: 10px;
}

.nav__menu-btn span {
    display: block;
    width: 4px;
    height: 4px;
    background: var(--text);
    border-radius: 50%;
    transition: transform 0.25s;
}

.nav__menu-btn:hover span { transform: scale(1.3); }

/* === FEATURE 03 — NAVIGATION DRAWER === */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.drawer-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.drawer {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 700;
    background: #111111;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 22px;
    padding: 28px 36px 36px;
    min-width: 300px;
    transform: translateY(-16px) scale(0.94);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.36s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.25s ease;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
}

.drawer.is-open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.drawer__header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 32px;
}

.drawer__close {
    background: none;
    border: none;
    cursor: none;
    color: rgba(255,255,255,0.4);
    font-size: 22px;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s;
}

.drawer__close:hover { color: #fff; }

.drawer__nav {
    list-style: none;
    margin-bottom: 40px;
}

.drawer__nav li { margin-bottom: 4px; }

.drawer__nav a {
    font-family: 'Clash Display', sans-serif;
    font-size: clamp(36px, 6vw, 52px);
    font-weight: 600;
    letter-spacing: -0.03em;
    color: rgba(255,255,255,0.35);
    text-decoration: none;
    display: block;
    line-height: 1.15;
    transition: color 0.2s;
}

.drawer__nav a:hover { color: #fff; }

.drawer__footer { border-top: 1px solid rgba(255,255,255,0.07); padding-top: 24px; }

.drawer__tagline {
    color: rgba(255,255,255,0.3);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.drawer__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: #fff;
    padding: 13px 28px;
    border-radius: 100px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: opacity 0.2s, transform 0.2s;
}

.drawer__cta:hover { opacity: 0.88; transform: translateY(-1px); }

/* === FEATURE 04 — PAGE TRANSITIONS === */
/* Handled via body opacity (0 → 1 on load, 1 → 0 on leave) */
/* JS toggles .page-loaded class */

/* === FEATURE 05 — HERO SECTION === */
.hero {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 40px 80px;
    position: relative;
    overflow: hidden;
}

.hero__line {
    font-family: 'Clash Display', sans-serif;
    font-weight: 700;
    font-size: clamp(52px, 11.5vw, 176px);
    letter-spacing: -0.04em;
    line-height: 0.92;
    color: var(--text);
    user-select: none;
}

/* === FEATURE 06 — LAYERED MOCKUP COLLAGE (swipeable + pinch-to-expand) === */
.collage {
    position: relative;
    width: clamp(200px, 32vw, 380px);
    height: clamp(140px, 22vw, 260px);
    margin: clamp(20px, 3vw, 36px) auto;
    flex-shrink: 0;
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
    z-index: 1;
}

.collage.is-dragging { cursor: grabbing; }
.collage.is-expanded { z-index: 200; cursor: zoom-out; }

.collage__card {
    position: absolute;
    inset: 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 24px 60px var(--shadow);
    will-change: transform;
    transition: transform 0.42s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.35s;
}

/* Static fallback (no JS) */
.collage__card--1     { transform: rotate(7deg);    z-index: 1; }
.collage__card--2     { transform: rotate(3deg);    z-index: 2; }
.collage__card--front { transform: rotate(-2.5deg); z-index: 3; }

/* JS-driven carousel positions via data-pos */
.collage__card[data-pos="0"] { transform: rotate(-2.5deg); z-index: 3; opacity: 1; }
.collage__card[data-pos="1"] { transform: rotate(3deg);    z-index: 2; opacity: 1; }
.collage__card[data-pos="2"] { transform: rotate(7deg);    z-index: 1; opacity: 0.85; }

/* Expand: hide non-front cards, dim hero text */
.collage.is-expanded .js-card:not([data-pos="0"]) { opacity: 0; pointer-events: none; }
.hero .hero__line { transition: opacity 0.38s ease; }
.hero.collage-expanded .hero__line { opacity: 0.07; }

.collage__card video,
.collage__card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.collage__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Clash Display', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
}

/* === ABOUT SECTION (on homepage) === */
.about {
    padding: clamp(80px, 12vw, 140px) 40px clamp(60px, 8vw, 100px);
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.about__heading {
    font-family: 'Clash Display', sans-serif;
    font-size: clamp(28px, 4.5vw, 56px);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.1;
    margin-bottom: 24px;
}

.about__body {
    color: var(--muted);
    font-size: clamp(16px, 1.8vw, 19px);
    line-height: 1.75;
    margin-bottom: 40px;
}

.about__services {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.about__pill {
    padding: 9px 20px;
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

/* === PAGE HERO (work, contact pages) === */
.page-hero {
    padding: 160px 44px 64px;
}

.page-hero__eyebrow {
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 20px;
}

.page-hero__title {
    font-family: 'Clash Display', sans-serif;
    font-size: clamp(48px, 8.5vw, 110px);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 0.9;
    max-width: 900px;
}

/* === WORK GRID === */
.work-grid {
    padding: 0 44px clamp(80px, 10vw, 120px);
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.work-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    display: block;
    transition: transform 0.3s ease, border-color 0.2s;
}

.work-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover);
}

.work-card__thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.work-card__thumb-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Clash Display', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--border-hover);
}

.work-card__body { padding: 24px; }

.work-card__title {
    font-family: 'Clash Display', sans-serif;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.work-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.work-card__tag {
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.work-card__tag + .work-card__tag::before {
    content: '·';
    margin-right: 8px;
}

.work-empty {
    grid-column: 1 / -1;
    padding: 80px 0;
    text-align: center;
    color: var(--muted);
}

/* === WORK DETAIL === */
.work-detail { padding-top: 100px; }

.work-detail__hero-img {
    width: 100%;
    max-height: 65vh;
    object-fit: cover;
    display: block;
}

.work-detail__content {
    max-width: 780px;
    margin: 0 auto;
    padding: 64px 44px 100px;
}

.work-detail__back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 48px;
    transition: color 0.2s;
}

.work-detail__back:hover { color: var(--text); }

.work-detail__eyebrow {
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
}

.work-detail__title {
    font-family: 'Clash Display', sans-serif;
    font-size: clamp(36px, 5.5vw, 72px);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 20px;
}

.work-detail__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 40px;
}

.work-detail__tag {
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.work-detail__body {
    font-size: 18px;
    line-height: 1.8;
    color: var(--muted);
    white-space: pre-wrap;
}

.work-detail__gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 48px;
}

.work-detail__gallery img {
    width: 100%;
    border-radius: 12px;
    object-fit: cover;
}

/* === CONTACT SECTION / PAGE === */
/* Used both as an inline homepage section (.contact-section wrapper)
   and as the standalone /contact page template. */
.contact-section { border-top: 1px solid var(--border); }

.contact-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(60px,10vw,120px) clamp(24px,5vw,80px) 120px;
    align-items: start;
}

/* Info panel */
.contact-info__eyebrow {
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 20px;
    display: block;
}
.contact-info__title {
    font-family: 'Clash Display', sans-serif;
    font-size: clamp(52px, 7vw, 96px);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 0.92;
    margin-bottom: 32px;
}
.contact-info__body {
    color: var(--muted);
    font-size: 17px;
    line-height: 1.75;
    margin-bottom: 36px;
    max-width: 320px;
}
.contact-info__email {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 11px 20px;
    margin-bottom: 32px;
    transition: border-color 0.2s, background 0.2s;
}
.contact-info__email:hover { border-color: var(--accent); background: var(--accent-dim); }
.contact-info__services {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.contact-info__services span {
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 100px;
}

/* Form */
.contact-form { display: flex; flex-direction: column; gap: 24px; }

.cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.cf-group { display: flex; flex-direction: column; gap: 8px; }

.cf-label {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}
.cf-optional { text-transform: none; letter-spacing: 0; font-size: 11px; opacity: 0.7; }

.cf-input,
.cf-textarea {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 15px 18px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    width: 100%;
}
.cf-input::placeholder, .cf-textarea::placeholder { color: var(--muted); opacity: 0.6; }
.cf-input:focus, .cf-textarea:focus { border-color: var(--accent); background: var(--surface-2); }

.cf-textarea { min-height: 140px; resize: vertical; line-height: 1.65; }

/* Service pills */
.cf-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.cf-pill {
    padding: 9px 18px;
    border: 1px solid var(--border);
    border-radius: 100px;
    background: transparent;
    color: var(--muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    cursor: none;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.cf-pill:hover { border-color: var(--border-hover); color: var(--text); }
.cf-pill.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Submit */
.cf-footer { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: 4px; }
.cf-submit {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 15px 32px;
    border-radius: 100px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 500;
    cursor: none;
    transition: opacity 0.2s, transform 0.2s;
    white-space: nowrap;
}
.cf-submit:hover { opacity: 0.88; transform: translateY(-1px); }
.cf-submit:disabled { opacity: 0.5; transform: none; }
.cf-submit__spinner { display: none; animation: cf-spin 0.8s linear infinite; }
.cf-submit.is-loading .cf-submit__arrow { display: none; }
.cf-submit.is-loading .cf-submit__spinner { display: block; }
@keyframes cf-spin { to { transform: rotate(360deg); } }

.cf-fallback { font-size: 13px; color: var(--muted); }
.cf-fallback a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* Feedback message */
.cf-msg { border-radius: 12px; font-size: 14px; padding: 0; max-height: 0; overflow: hidden; transition: max-height 0.3s, padding 0.3s; }
.cf-msg.is-success { max-height: 80px; padding: 14px 18px; background: rgba(4,200,100,0.1); color: #04c864; border: 1px solid rgba(4,200,100,0.2); }
.cf-msg.is-error   { max-height: 80px; padding: 14px 18px; background: rgba(255,60,60,0.1);  color: #ff5252; border: 1px solid rgba(255,60,60,0.2); }

/* Responsive */
@media (max-width: 900px) {
    .contact-wrap { grid-template-columns: 1fr; gap: 48px; }
    .contact-info__title { font-size: clamp(44px, 10vw, 72px); }
}
@media (max-width: 600px) {
    .cf-row { grid-template-columns: 1fr; }
    .cf-footer { flex-direction: column; align-items: flex-start; }
    .cf-submit { width: 100%; justify-content: center; }
}

/* === FEATURE 07+08+09 — CHAT WIDGET === */
.chat-pill {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 800;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 13px 22px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: none;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 8px 32px var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s;
    user-select: none;
}

.chat-pill:hover {
    transform: scale(1.04);
    box-shadow: 0 12px 40px var(--shadow);
}

.chat-pill__icon {
    width: 20px;
    height: 20px;
    display: grid;
    grid-template-columns: repeat(3, 4px);
    grid-template-rows: repeat(3, 4px);
    gap: 3px;
}

.chat-pill__icon span {
    display: block;
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
}

.chat-panel {
    position: fixed;
    bottom: 88px;
    right: 28px;
    z-index: 799;
    width: 360px;
    max-height: 540px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px) scale(0.96);
    transform-origin: bottom right;
    transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 24px 80px var(--shadow);
}

.chat-panel.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Chat tabs */
.chat-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-tab-btn {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: none;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -1px;
}

.chat-tab-btn.is-active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

/* Chat body */
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.chat-body::-webkit-scrollbar { width: 4px; }
.chat-body::-webkit-scrollbar-track { background: transparent; }
.chat-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.chat-avatar {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    height: 150px;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.chat-avatar video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-avatar__vignette {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%);
}

.chat-avatar__name {
    position: absolute;
    bottom: 12px;
    left: 14px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}

.chat-bubble {
    max-width: 82%;
    padding: 11px 15px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.55;
}

.chat-bubble--bot {
    background: var(--surface-2);
    border-radius: 4px 18px 18px 18px;
    align-self: flex-start;
}

.chat-bubble--user {
    background: var(--accent);
    color: #fff;
    border-radius: 18px 18px 4px 18px;
    align-self: flex-end;
}

.chat-typing {
    display: flex;
    gap: 5px;
    padding: 12px 16px;
    background: var(--surface-2);
    border-radius: 4px 18px 18px 18px;
    width: fit-content;
    align-self: flex-start;
    flex-shrink: 0;
}

.chat-typing span {
    width: 6px;
    height: 6px;
    background: var(--muted);
    border-radius: 50%;
    animation: typing-dot 1.2s ease-in-out infinite;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-dot {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50%       { opacity: 1;   transform: translateY(-4px); }
}

.chat-suggestions {
    display: flex;
    flex-direction: column;
    gap: 7px;
    align-self: flex-start;
    width: 100%;
}

.chat-suggestion {
    padding: 9px 16px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 100px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: var(--text);
    cursor: none;
    text-align: left;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.chat-suggestion:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.chat-input-row {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 9px 16px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus { border-color: var(--accent); }
.chat-input::placeholder { color: var(--muted); }

.chat-send-btn {
    background: var(--accent);
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: none;
    flex-shrink: 0;
    color: #fff;
    transition: opacity 0.2s, transform 0.2s;
}

.chat-send-btn:hover { opacity: 0.88; transform: scale(1.08); }

/* === CHAT — CONTACT TAB (mini form) === */
.hidden { display: none !important; }

.chat-contact-pane {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.chat-contact-form { display: flex; flex-direction: column; gap: 12px; }

.chat-contact-intro {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.55;
    margin-bottom: 2px;
}

.chat-contact-input,
.chat-contact-textarea {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-contact-input::placeholder,
.chat-contact-textarea::placeholder { color: var(--muted); opacity: 0.6; }

.chat-contact-input:focus,
.chat-contact-textarea:focus { border-color: var(--accent); }

.chat-contact-textarea { min-height: 90px; resize: none; line-height: 1.5; }

.chat-contact-submit {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 100px;
    padding: 11px 20px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    transition: opacity 0.2s, transform 0.2s;
}

.chat-contact-submit:hover { opacity: 0.88; transform: translateY(-1px); }
.chat-contact-submit:disabled { opacity: 0.5; transform: none; }

.chat-contact-msg {
    font-size: 13px;
    border-radius: 8px;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s, padding 0.3s;
}

.chat-contact-msg.is-success {
    max-height: 60px;
    padding: 10px 14px;
    background: rgba(4,200,100,0.1);
    color: #04c864;
    border: 1px solid rgba(4,200,100,0.2);
}

.chat-contact-msg.is-error {
    max-height: 60px;
    padding: 10px 14px;
    background: rgba(255,60,60,0.1);
    color: #ff5252;
    border: 1px solid rgba(255,60,60,0.2);
}

/* === FOOTER === */
.footer {
    border-top: 1px solid var(--border);
    padding: 48px 44px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: auto;
}

.footer__copy {
    color: var(--muted);
    font-size: 13px;
}

.footer__links {
    display: flex;
    gap: 28px;
    list-style: none;
}

.footer__links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.footer__links a:hover { color: var(--text); }

/* === 404 === */
.notfound {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 44px;
    gap: 20px;
}

.notfound__code {
    font-family: 'Clash Display', sans-serif;
    font-size: clamp(80px, 18vw, 200px);
    font-weight: 700;
    letter-spacing: -0.05em;
    line-height: 1;
    color: var(--border-hover);
}

.notfound__msg { color: var(--muted); font-size: 18px; }

.notfound__link {
    color: var(--accent);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
}

/* === SCROLL REVEAL === */
.reveal {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.75s ease, transform 0.75s ease;
    transition-delay: var(--reveal-delay, 0s);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === MARQUEE STRIP === */
.marquee-strip {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    padding: 18px 0;
    white-space: nowrap;
    user-select: none;
}

.marquee-track {
    display: inline-flex;
    gap: 32px;
    align-items: center;
    animation: marquee-scroll 22s linear infinite;
}

.marquee-track span {
    font-family: 'Clash Display', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

.marquee-dot { color: var(--accent) !important; }

@keyframes marquee-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* === WORK SECTION (homepage featured) === */
.work-home {
    padding: clamp(60px, 10vw, 120px) clamp(24px, 5vw, 60px);
    max-width: 1320px;
    margin: 0 auto;
}

.work-home__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 48px;
    flex-wrap: wrap;
    gap: 16px;
}

.work-home__eyebrow {
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
}

.work-home__title {
    font-family: 'Clash Display', sans-serif;
    font-size: clamp(28px, 4vw, 56px);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.05;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 10px 24px;
    font-size: 14px;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.btn-outline:hover {
    border-color: var(--text);
    background: var(--text);
    color: var(--bg);
}

.work-home__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Work card (homepage) */
.wc {
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, border-color 0.2s;
    background: var(--surface);
}

.wc:hover { transform: translateY(-5px); border-color: var(--border-hover); }

.wc__thumb {
    aspect-ratio: 4/3;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.wc--wide { grid-column: 1 / -1; }
.wc--wide .wc__thumb { aspect-ratio: 21/8; }

.wc__bg-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Clash Display', sans-serif;
    font-size: clamp(80px, 10vw, 130px);
    font-weight: 700;
    color: rgba(255,255,255,0.15);
    letter-spacing: -0.05em;
    user-select: none;
}

.wc__body { padding: 22px 24px; }

.wc__title {
    font-family: 'Clash Display', sans-serif;
    font-size: clamp(18px, 2vw, 22px);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.wc__tags { display: flex; flex-wrap: wrap; gap: 8px; }

.wc__tags span {
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 100px;
}

/* === ABOUT STATS === */
.about__stats {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 56px;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 36px;
}

.about__stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 90px;
}

.about__stat-num {
    font-family: 'Clash Display', sans-serif;
    font-size: clamp(26px, 4vw, 44px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
}

.about__stat-label {
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: 6px;
}

.about__stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border);
    flex-shrink: 0;
    margin: 0 24px;
}

/* === UTILITY === */
/* .hidden defined in chat contact pane section above */
.sr-only { position: absolute; width: 1px; height: 1px; clip: rect(0,0,0,0); overflow: hidden; }
.accent { color: var(--accent); }
.btn-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: #fff;
    padding: 14px 32px;
    border-radius: 100px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: opacity 0.2s, transform 0.2s;
}

.btn-pill:hover { opacity: 0.88; transform: translateY(-1px); }

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .work-grid { padding: 0 24px 80px; }
    .work-home__grid { grid-template-columns: 1fr; }
    .wc--wide { grid-column: 1 / -1; }
    .wc__thumb { aspect-ratio: 16/9; }
    .wc--wide .wc__thumb { aspect-ratio: 16/9; }
}

@media (max-width: 768px) {
    .nav { padding: 20px 24px; }
    .hero { padding: 100px 24px 60px; }
    .about { padding: 60px 24px 60px; }
    .page-hero { padding: 120px 24px 48px; }
    .contact-page { padding: 0 24px 80px; }
    .work-detail__content { padding: 48px 24px 80px; }
    .footer { padding: 36px 24px; flex-direction: column; text-align: center; }
    .chat-panel { width: calc(100vw - 32px); right: 16px; bottom: 82px; }
    .chat-pill { right: 16px; bottom: 16px; }
    .drawer { min-width: calc(100vw - 32px); }
    .work-home { padding: 60px 20px; }
    .work-home__head { flex-direction: column; align-items: flex-start; }
    .about__stats { padding: 20px 24px; flex-wrap: wrap; gap: 16px; }
    .about__stat-divider { display: none; }
    .about__stat { flex: 0 0 auto; min-width: 80px; }
}

@media (max-width: 480px) {
    .work-grid { grid-template-columns: 1fr; }
    .hero__line { font-size: clamp(40px, 13vw, 76px); }
    .collage { width: clamp(180px, 70vw, 300px); height: clamp(120px, 47vw, 200px); }
}
