/*
 * ClayDesign public site styles (moved here from an inline <style> block in web_header.php so they are cached and versioned).
 * Linked just BEFORE assets/css/tailwind.css, as the inline block used to precede Tailwind's own <style>: Tailwind
 * utilities must stay later in the cascade so they override these rules. Edit this file directly (no build step).
 */

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

html {
    font-family: 'DM Sans', sans-serif;
}

body {
    background: #fdfaf6;
    color: #0e0d0b;
    overflow-x: hidden;
}

/* Grain texture overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
    opacity: 0.4;
}

/* Nav link underline animation */
.nav-link {
    position: relative;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    color: #4a3529;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #886543;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.nav-link:hover {
    color: #0e0d0b;
}

/* Active Nav Link Styling for Header (Light Background) */
header nav a.active-nav-link,
header nav a.active {
    color: #886543 !important;
    font-weight: 600 !important;
}

header nav a.active-nav-link::after,
header nav a.active::after {
    width: 100% !important;
    background: #886543 !important;
}

/* Glassmorphism Header on Scroll */
#main-nav {
    transition: background-color 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
                backdrop-filter 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
                -webkit-backdrop-filter 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
                border-color 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
                padding 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#main-nav.scrolled {
    background-color: rgba(253, 250, 246, 0.88) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-bottom: 1px solid rgba(228, 217, 200, 0.8) !important;
    padding-top: 0.875rem !important;
    padding-bottom: 0.875rem !important;
    box-shadow: 0 10px 30px -10px rgba(14, 13, 11, 0.06) !important;
}

/* Marquee */
@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.marquee-track {
    display: flex;
    animation: marquee 22s linear infinite;
}

.marquee-track:hover {
    animation-play-state: paused;
}

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.75s cubic-bezier(0.4, 0, 0.2, 1), transform 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible,
#home .reveal,
.no-js .reveal {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.reveal-delay-1 {
    transition-delay: 0.1s;
}

.reveal-delay-2 {
    transition-delay: 0.2s;
}

.reveal-delay-3 {
    transition-delay: 0.3s;
}

.reveal-delay-4 {
    transition-delay: 0.4s;
}

/* Hero background blob */
.hero-blob {
    position: absolute;
    border-radius: 60% 40% 70% 30% / 50% 60% 40% 50%;
    filter: blur(80px);
    opacity: 0.25;
    animation: float 8s ease-in-out infinite;
}

/* Service card hover */
.service-card {
    border: 1px solid #e4d9c8;
    transition: border-color 0.3s, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s;
    background: #fdfaf6;
}

.service-card:hover {
    border-color: #886543;
    transform: translateY(-6px);
    box-shadow: 0 24px 60px rgba(136, 101, 67, 0.12);
}

/* Work card */
.work-card {
    overflow: hidden;
    position: relative;
}

.work-card-img {
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.work-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(14, 13, 11, 0.75) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s;
}

.work-card:hover .work-card-overlay {
    opacity: 1;
}

/* Stats counter */
.stat-num {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(3rem, 6vw, 5rem);
    line-height: 1;
    color: #0e0d0b;
}

/* Button styles */
.btn-primary {
    background: #0e0d0b;
    color: #fdfaf6;
    border: 1px solid #0e0d0b;
    padding: 0.875rem 2.25rem;
    font-size: 0.875rem;
    letter-spacing: 0.04em;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.3s, color 0.3s, transform 0.2s;
    text-transform: uppercase;
}

.btn-primary:hover {
    background: #886543;
    border-color: #886543;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(136, 101, 67, 0.3);
}

.btn-outline {
    background: transparent;
    color: #0e0d0b;
    border: 1px solid #0e0d0b;
    padding: 0.875rem 2.25rem;
    font-size: 0.875rem;
    letter-spacing: 0.04em;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.4s cubic-bezier(0.16, 1, 0.3, 1), color 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s;
    text-transform: uppercase;
}

.btn-outline:hover {
    background: #0e0d0b;
    color: #fdfaf6;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(14, 13, 11, 0.15);
}

/* Section label */
.section-label {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #886543;
    font-weight: 600;
}

/* Divider line */
.ornament-line {
    width: 3rem;
    height: 1px;
    background: #886543;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.75rem;
}

/* Cursor dot */
.cursor-dot {
    width: 6px;
    height: 6px;
    background: #886543;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    transition: transform 0.15s;
}

.cursor-ring {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(136, 101, 67, 0.5);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s, height 0.3s, opacity 0.3s;
}

/* Form input */
.form-input {
    background: transparent;
    border: none;
    border-bottom: 1px solid #d0bc9e;
    padding: 0.75rem 0;
    width: 100%;
    font-size: 0.9375rem;
    color: #0e0d0b;
    outline: none;
    font-family: 'DM Sans', sans-serif;
    transition: border-color 0.3s;
}

.form-input::placeholder {
    color: #a07e54;
    font-size: 0.875rem;
}

.form-input:focus {
    border-color: #0e0d0b;
}

/* Contact section */
.contact-bg {
    background: #0e0d0b;
}

/* Process numbers */
.process-num {
    font-family: 'DM Serif Display', serif;
    font-size: 4rem;
    line-height: 1;
    color: #e4d9c8;
    transition: color 0.3s;
}

.process-item:hover .process-num {
    color: #886543;
}

/* Checkbox style */
input[type="checkbox"] {
    accent-color: #886543;
}



/* TOC */
.toc-link {
    display: block;
    padding: .5rem 1rem;
    font-size: .8125rem;
    color: #5a4030;
    text-decoration: none;
    border-left: 2px solid #e4d9c8;
    transition: border-color .2s, color .2s, padding .2s
}

.toc-link:hover,
.toc-link.active {
    border-color: #886543;
    color: #0e0d0b;
    padding-left: 1.25rem
}

/* Prose */
.legal-prose {
    max-width: 680px
}

.legal-prose p {
    color: #5a4030;
    line-height: 1.85;
    margin-bottom: 1.25rem;
    font-size: .9375rem;
    font-weight: 300
}

.legal-prose h2 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.875rem;
    color: #0e0d0b;
    margin-top: 3.5rem;
    margin-bottom: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e4d9c8
}

.legal-prose h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.25rem;
    color: #0e0d0b;
    margin-top: 2rem;
    margin-bottom: .75rem
}

.legal-prose ul {
    list-style: none;
    padding: 0;
    margin-bottom: 1.25rem
}

.legal-prose ul li {
    padding: .35rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #5a4030;
    font-size: .9375rem;
    font-weight: 300
}

.legal-prose ul li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: #a07e54;
    font-size: .5rem;
    top: .6rem
}

.legal-prose a {
    color: #886543;
    text-decoration: underline;
    transition: color .2s
}

.legal-prose a:hover {
    color: #0e0d0b
}

.highlight-box {
    background: #f2ede4;
    border-left: 3px solid #a07e54;
    border-radius: 0 .75rem .75rem 0;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0
}

.highlight-box p {
    margin-bottom: 0 !important
}

.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .6s, transform .6s
}

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

/* ─── Page-load transition ─── */
main, section:first-of-type {
    animation: pageIn 0.5s ease-out;
}
@keyframes pageIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Accessibility focus styles ─── */
.form-input:focus, .form-field:focus, select:focus, textarea:focus, input:focus {
    outline: 2px solid rgba(136, 101, 67, 0.4);
    outline-offset: 2px;
}
button:focus-visible, a:focus-visible {
    outline: 2px solid #886543;
    outline-offset: 2px;
}

/* ─── Toastr clay-theme overrides ─── */
.toast-bottom-right { bottom: 24px; right: 24px; }
#toast-container > .toast { opacity: 1; border-radius: 12px; box-shadow: 0 12px 40px rgba(14,13,11,0.15); font-family: 'DM Sans', sans-serif; }
#toast-container > .toast-success { background-color: #0e0d0b; }
#toast-container > .toast-error   { background-color: #7f1d1d; }
#toast-container > .toast-info    { background-color: #886543; }
#toast-container > .toast-warning { background-color: #92400e; }
.toast-message { font-size: 0.875rem; font-weight: 400; letter-spacing: 0.01em; }
.toast-title   { font-weight: 600; font-size: 0.8125rem; letter-spacing: 0.04em; text-transform: uppercase; }

/* ─── Back-to-top button ─── */
#back-to-top {
    position: fixed;
    bottom: 28px;
    left: 28px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #0e0d0b;
    color: #fdfaf6;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s, transform 0.4s, background 0.3s;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(14,13,11,0.2);
}
#back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}
#back-to-top:hover {
    background: #886543;
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(136,101,67,0.3);
}

/* ─── WhatsApp floating button ─── */
#whatsapp-fab {
    position: fixed;
    bottom: 28px;
    right: 80px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #25D366;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    box-shadow: 0 8px 24px rgba(37,211,102,0.3);
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
}
#whatsapp-fab:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 12px 32px rgba(37,211,102,0.4);
}
#whatsapp-fab svg { width: 26px; height: 26px; }

/* ─── Disabled button state ─── */
.btn-primary:disabled, .btn-outline:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ─── Spin animation for loaders ─── */
@keyframes spin { to { transform: rotate(360deg); } }
.animate-spin { animation: spin 0.8s linear infinite; }

/* ─── Custom scrollbar ─── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #fdfaf6; }
::-webkit-scrollbar-thumb { background: #d0bc9e; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a07e54; }

/* ─── Text selection color ─── */
::selection { background: #e4d9c8; color: #0e0d0b; }

/* ─── Image load ───
   Lazy images must never be hidden by CSS: a rule that set opacity:0 until JS added a `.loaded`
   class left every loading="lazy" image invisible, because nothing ever added the class. */
img { transition: opacity 0.4s; }

/* ─── Mobile hamburger bar transitions ─── */
#bar1, #bar2, #bar3 { transition: transform 0.3s ease, opacity 0.3s ease; }

/* ─── Mobile menu transition ─── */
#mobile-menu { transition: opacity 0.3s, transform 0.3s; }

/* ─── Client login page styles ─── */
.login-card {
    border: 1px solid #e4d9c8;
    border-radius: 1.25rem;
    background: #ffffff;
    box-shadow: 0 30px 80px rgba(136,101,67,0.08);
    padding: 2.5rem;
}
.login-input {
    background: #fdfaf6;
    border: 1px solid #e4d9c8;
    padding: 0.875rem 1rem;
    width: 100%;
    font-size: 0.9375rem;
    color: #0e0d0b;
    outline: none;
    font-family: 'DM Sans', sans-serif;
    border-radius: 0.75rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.login-input::placeholder { color: #b89b72; font-size: 0.875rem; }
.login-input:focus {
    border-color: #886543;
    box-shadow: 0 0 0 3px rgba(136,101,67,0.1);
}
.login-label {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #886543;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.login-alert {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    font-size: 0.85rem;
    color: #991b1b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
