/* ==========================================================================
   Dentiva — design system
   Pattern : Bento Grid Showcase + Trust & Authority
   Contrast: every token below was measured; ratios noted inline (WCAG AA = 4.5:1)
   ========================================================================== */

:root {
    /* brand */
    --orange:        #F97316;   /* accent only — 2.80:1 with white, never a text bg */
    --orange-light:  #FB923C;   /* 7.84:1 on --surface — safe for accent text */
    --orange-pale:   #FDBA74;   /* 10.52:1 on --surface */
    --orange-solid:  #C2410C;   /* 5.18:1 with white — solid buttons live here */
    --orange-solid-h:#9A3412;   /* 7.31:1 with white — hover */

    /* surfaces, dark but not pure-OLED black (pure black measures low on conversion) */
    --page:      #0A0A0A;
    --page-2:    #0E1117;
    --surface:   #111827;
    --surface-2: #161F30;
    --line:      #232C3D;
    --line-2:    #2E3950;

    /* text — all measured against --surface */
    --text:       #FFFFFF;   /* 17.4:1 */
    --text-soft:  #D1D5DB;   /* 12.0:1 */
    --text-muted: #9CA3AF;   /*  7.0:1 — replaces #6B7280 which was 3.67:1 */

    --green:   #22C55E;
    --green-d: #15803D;

    /* bento tokens */
    --card-radius: 24px;
    --grid-gap: 16px;
    --hover-scale: 1.02;
    --badge-height: 48px;
    --tap: 44px;             /* minimum touch target */

    --shadow-card:  0 4px 14px rgba(0,0,0,.35);
    --shadow-lift:  0 18px 46px rgba(0,0,0,.5);
    --shadow-glow:  0 0 0 1px rgba(249,115,22,.18), 0 18px 46px rgba(249,115,22,.14);
}

* { font-family: 'Vazirmatn', sans-serif; }
html { scroll-behavior: smooth; }
body { background: var(--page); color: var(--text); }

::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: var(--page-2); }
::-webkit-scrollbar-thumb { background: var(--orange-solid); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--orange); }
::selection { background: rgba(249,115,22,.32); }

/* --------------------------------------------------------------------------
   Tailwind's default greys fail contrast on this dark surface. These four
   utilities are used throughout the markup, so they are remapped once here
   rather than edited at every call site.
   -------------------------------------------------------------------------- */
.text-gray-400 { color: var(--text-muted) !important; }  /* was 4.10:1 */
.text-gray-500 { color: var(--text-muted) !important; }  /* was 3.67:1 */
.text-gray-600 { color: var(--text-muted) !important; }  /* was 2.66:1 */
.text-gray-700 { color: var(--text-muted) !important; }  /* was 2.04:1 */
.text-gray-300 { color: var(--text-soft)  !important; }

/* ---------- focus: visible for keyboard, quiet for mouse ---------- */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid var(--orange-light);
    outline-offset: 3px;
    border-radius: 8px;
}
:where(a, button):focus:not(:focus-visible) { outline: none; }

.skip-link {
    position: absolute; inset-inline-start: -9999px; top: 8px; z-index: 999;
    background: var(--orange-solid); color: #fff;
    padding: 12px 20px; border-radius: 10px; font-weight: 700; font-size: .875rem;
}
.skip-link:focus { inset-inline-start: 8px; }

/* ---------- brand bar : logo spans the whole width ---------- */
.brandbar {
    background: linear-gradient(180deg, #0E1117, var(--page));
    padding: 18px 0; text-align: center; position: relative; overflow: hidden;
}
.brandbar::after {
    content: ''; position: absolute; inset-inline: 0; bottom: 0; height: 3px;
    background: linear-gradient(90deg, var(--orange), var(--orange-pale), var(--orange-solid), var(--orange));
    background-size: 300% 100%;
    animation: brandsheen 6s linear infinite;
}
@keyframes brandsheen { to { background-position: 300% 0; } }
.brandbar img { width: 100%; max-width: 940px; height: auto; padding-inline: 16px; display: block; margin-inline: auto; }

/* ---------- nav ---------- */
.navbar {
    position: sticky; top: 0; z-index: 50;
    background: rgba(10,10,10,.94);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(249,115,22,.16);
    transition: box-shadow .3s ease;
}
.navbar.stuck { box-shadow: 0 8px 30px rgba(0,0,0,.55); }

.nav-link {
    position: relative;
    display: inline-flex; align-items: center;
    min-height: var(--tap);           /* was 20px — below the 44px target */
    padding-inline: 4px;
}
.nav-link::after {
    content: ''; position: absolute; bottom: 12px; inset-inline-end: 4px;
    width: 0; height: 2px; background: var(--orange);
    transition: width .3s ease;
}
.nav-link:hover::after, .nav-link.active::after { width: calc(100% - 8px); }

/* every inline link in the footer / contact rows also needs a real tap area */
.tap { display: inline-flex; align-items: center; min-height: var(--tap); padding-inline: 6px; }
/* inline links inside a sentence are an allowed exception to the 44px rule */

/* ---------- decorative ---------- */
.bg-dots {
    background-image: radial-gradient(circle at 1px 1px, rgba(249,115,22,.14) 1px, transparent 0);
    background-size: 28px 28px;
}
.bg-grid {
    background-image:
        linear-gradient(rgba(249,115,22,.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(249,115,22,.055) 1px, transparent 1px);
    background-size: 56px 56px;
}
.text-gradient {
    background: linear-gradient(135deg, var(--orange), var(--orange-pale));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.section-divider {
    width: 60px; height: 4px; border-radius: 2px;
    background: linear-gradient(135deg, var(--orange), var(--orange-solid));
}
.blob { position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none; animation: blobdrift 18s ease-in-out infinite; }
@keyframes blobdrift { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(24px,-30px) scale(1.12); } }

.sec-head { display: flex; align-items: center; gap: 12px; }
.sec-head .bar { width: 4px; height: 34px; border-radius: 99px; background: linear-gradient(180deg, var(--orange), var(--orange-solid)); }

/* ---------- cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-card);
    transition: transform .35s cubic-bezier(.2,.8,.3,1), border-color .35s ease, box-shadow .35s ease, background .35s ease;
}
.card:hover {
    transform: scale(var(--hover-scale));
    background: var(--surface-2);
    border-color: rgba(249,115,22,.5);
    box-shadow: var(--shadow-glow);
}

/* ---------- bento grid ---------- */
.bento {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--grid-gap);
}
.bento > .span-2 { grid-column: span 2; }
@media (max-width: 1024px) {
    .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bento > .span-2 { grid-column: span 2; }
}
@media (max-width: 640px) {
    .bento { grid-template-columns: 1fr; }
    .bento > .span-2 { grid-column: span 1; }
}

/* product tile */
.tile { position: relative; overflow: hidden; display: flex; flex-direction: column; text-align: right; }
.tile .shot {
    height: 240px; background: #fff;
    padding: 14px; overflow: hidden;
}
.tile.span-2 .shot { height: 260px; }
/* explicit width+height is what makes object-fit:contain actually contain —
   with only max-* the image kept its natural size and overflowed the box */
.tile .shot img {
    width: 100%; height: 100%;
    object-fit: contain;
    transition: transform .45s cubic-bezier(.2,.8,.3,1);
}
.tile:hover .shot img { transform: scale(1.05); }
.tile .flag {
    position: absolute; top: 12px; inset-inline-end: 12px; z-index: 2;
    background: var(--orange-solid); color: #fff;      /* 5.18:1 */
    font-size: .7rem; font-weight: 700; padding: 6px 12px; border-radius: 99px;
    box-shadow: 0 4px 14px rgba(0,0,0,.45);
}

/* ---------- category circles ---------- */
.cat-card {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 28px 16px 24px;
    border-radius: var(--card-radius);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    transition: transform .35s cubic-bezier(.2,.8,.3,1), border-color .35s ease, background .35s ease, box-shadow .35s ease;
}
.cat-card:hover {
    transform: translateY(-8px) scale(var(--hover-scale));
    border-color: rgba(249,115,22,.5);
    background: var(--surface-2);
    box-shadow: var(--shadow-glow);
}
.cat-ring { position: relative; width: 118px; height: 118px; display: grid; place-items: center; margin-bottom: 16px; }
.cat-ring::before {
    content: ''; position: absolute; inset: -9px; border-radius: 50%;
    border: 2px dashed rgba(249,115,22,.55); opacity: 0; transition: opacity .35s ease;
}
.cat-card:hover .cat-ring::before { opacity: 1; animation: spin 9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cat-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; transition: transform .35s cubic-bezier(.2,.8,.3,1), box-shadow .35s ease; }
.cat-card:hover .cat-img { transform: scale(1.06); box-shadow: 0 12px 34px rgba(249,115,22,.35); }
.cat-title { font-size: 1.05rem; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.cat-sub   { font-size: .74rem; color: var(--text-muted); margin-bottom: 12px; min-height: 2.2em; }
.cat-go    { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 700; color: var(--orange-light); transition: gap .3s ease; }
.cat-card:hover .cat-go { gap: 11px; }

/* ---------- trust badges ---------- */
.trust-badge {
    display: flex; align-items: center; gap: 12px;
    min-height: var(--badge-height);
    padding: 12px 16px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 14px;
    transition: border-color .3s ease, background .3s ease;
}
.trust-badge:hover { border-color: rgba(249,115,22,.45); background: var(--surface-2); }
.trust-badge i { color: var(--orange-light); font-size: 1.1rem; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: var(--tap);                 /* touch target */
    padding: 12px 26px; border-radius: 14px;
    font-size: .9rem; font-weight: 700;
    border: 0; cursor: pointer; text-align: center;
    transition: transform .2s ease, background .25s ease, box-shadow .25s ease, color .25s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--orange-solid); color: #fff; }      /* 5.18:1 */
.btn-primary:hover { background: var(--orange-solid-h); box-shadow: 0 10px 28px rgba(194,65,12,.45); }
.btn-ghost { background: var(--line); color: var(--text-soft); }    /* 8.9:1 */
.btn-ghost:hover { background: var(--line-2); color: #fff; }
.btn-wa { background: var(--green-d); color: #fff; }                /* 4.9:1 */
.btn-wa:hover { background: #166534; box-shadow: 0 10px 28px rgba(21,128,61,.4); }
.btn-sm { padding: 10px 18px; font-size: .8rem; border-radius: 12px; }  /* still 44px tall via min-height */

/* pill badge — needs an opaque bg, the translucent one measured 1.24:1 */
.pill {
    display: inline-flex; align-items: center; gap: 8px;
    background: #2A1508; border: 1px solid rgba(249,115,22,.4);
    color: var(--orange-pale);                                      /* 9.6:1 on #2A1508 */
    padding: 7px 16px; border-radius: 99px; font-size: .78rem; font-weight: 700;
}

/* ---------- marquee ---------- */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: 56px; width: max-content; animation: slide 26s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes slide { to { transform: translateX(50%); } }
.marquee-item { color: var(--text-muted); font-weight: 800; font-size: 1.15rem; letter-spacing: .06em; white-space: nowrap; transition: color .3s ease; }
.marquee-item:hover { color: var(--orange-light); }

/* ---------- tables ---------- */
.ptable { width: 100%; border-collapse: collapse; }
.ptable th { text-align: right; font-size: .72rem; color: var(--text-muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.ptable td { padding: 12px 14px; font-size: .82rem; border-bottom: 1px solid var(--line); }
.ptable tbody tr { transition: background .25s ease; }
.ptable tbody tr:hover { background: rgba(249,115,22,.09); }
.ptable tbody tr:last-child td { border-bottom: 0; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.82); backdrop-filter: blur(6px); animation: fadein .25s ease; }
.modal-panel {
    position: relative; width: 100%; max-width: 960px; max-height: 90vh; overflow-y: auto;
    background: var(--page-2); border: 1px solid var(--line);
    border-radius: var(--card-radius);
    animation: popin .32s cubic-bezier(.2,.9,.3,1);
}
@keyframes fadein { from { opacity: 0; } }
@keyframes popin { from { opacity: 0; transform: translateY(22px) scale(.97); } }

.modal-close {
    position: absolute; top: 14px; inset-inline-start: 14px; z-index: 3;
    width: var(--tap); height: var(--tap); border-radius: 50%;
    background: rgba(0,0,0,.65); color: #fff; border: 1px solid rgba(255,255,255,.2);
    display: grid; place-items: center; cursor: pointer;
    transition: background .25s ease, transform .25s ease;
}
.modal-close:hover { background: var(--orange-solid); transform: rotate(90deg); }
body.modal-open { overflow: hidden; }

/* ---------- floating whatsapp ---------- */
.wa-float { position: fixed; bottom: 26px; inset-inline-start: 26px; z-index: 120; }
.wa-float a {
    display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%;
    background: var(--green-d); color: #fff;
    box-shadow: 0 6px 24px rgba(21,128,61,.5);
    animation: wapulse 2.6s ease-in-out infinite;
    transition: background .2s ease;
}
.wa-float a:hover { background: #166534; }
@keyframes wapulse { 0%,100% { box-shadow: 0 6px 24px rgba(21,128,61,.5); } 50% { box-shadow: 0 6px 38px rgba(21,128,61,.8); } }

/* ---------- motion : Standard tier — 400-600ms, power2-style ease ---------- */
.reveal {
    opacity: 0; transform: translateY(24px);
    transition: opacity .5s cubic-bezier(.22,.61,.36,1) var(--d, 0s),
                transform .5s cubic-bezier(.22,.61,.36,1) var(--d, 0s);
    will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: none; }

.floaty { animation: floaty 6s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .floaty, .wa-float a, .blob, .marquee-track, .brandbar::after { animation: none; }
    .card:hover, .cat-card:hover, .tile:hover .shot img { transform: none; }
    html { scroll-behavior: auto; }
}

@media (max-width: 640px) {
    .brandbar { padding: 10px 0; }
    .wa-float { bottom: 18px; inset-inline-start: 18px; }
    .modal-panel { max-height: 92vh; border-radius: 18px; }
    .btn { width: 100%; }
    .btn.w-auto { width: auto; }
}

/* ─────────────── mobile bottom navigation (shared, all pages) ─────────────── */
.dv-bottomnav { display: none; }
@media (max-width: 1000px) {
    .dv-bottomnav {
        display: grid; grid-template-columns: repeat(4, 1fr);
        position: fixed; inset-inline: 0; bottom: 0; z-index: 300;
        background: rgba(12, 11, 9, 0.94);
        -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        padding-bottom: env(safe-area-inset-bottom, 0);
        box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.35);
    }
    .dv-bn-item {
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 3px; min-height: 58px; text-decoration: none;
        color: #a9a199; font-size: 11px; font-weight: 600;
        transition: color .2s, background .2s;
    }
    .dv-bn-item i { font-size: 19px; }
    .dv-bn-item span { line-height: 1; }
    .dv-bn-item:hover, .dv-bn-item:active { text-decoration: none; background: rgba(255, 255, 255, 0.05); }
    .dv-bn-item.is-active { color: #F97316; }
    .dv-bn-item.dv-bn-wa { color: #25D366; }
    body.has-bottomnav { padding-bottom: 62px; }
    /* the floating WhatsApp button is redundant once the bottom bar carries it */
    .wa-float { display: none; }
}
