/*
Theme Name: CraftCode
Author: CraftCode
Version: 1.0
Description: CraftCode Global Agency Theme
*/


:root {
    --ink: #0B1220;
    --ink-soft: #131C2E;
    --paper: #F4F2EC;
    --amber: #E8A33D;
    --slate: #3A5A78;
    --sage: #8FA88C;
    --line: rgba(244, 242, 236, 0.14);
    --line-strong: rgba(244, 242, 236, 0.28);
    --muted: rgba(244, 242, 236, 0.62);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    background: var(--ink);
    color: var(--paper);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

.wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 32px;
}

h1, h2, h3, h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.12;
}

.eyebrow {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--amber);
    display: flex;
    align-items: center;
    gap: 10px;
}

.eyebrow::before {
    content: '';
    width: 22px;
    height: 1px;
    background: var(--amber);
}

/* ===== Nav ===== */
header.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 18, 32, 0.88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.nav-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 19px;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo .dot { color: var(--amber); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 36px;
    font-size: 14.5px;
    font-weight: 500;
}

.nav-links a {
    color: var(--muted);
    transition: color 0.2s;
    position: relative;
}

.nav-links a:hover, .nav-links a.active { color: var(--paper); }

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -22px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--amber);
}

.nav-cta {
    background: var(--amber);
    color: var(--ink) !important;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
}

.nav-cta:hover { background: #f0b358; }

.menu-toggle { display: none; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 26px;
    border-radius: 6px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s;
    border: 1px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background: var(--amber);
    color: var(--ink);
}
.btn-primary:hover { background: #f0b358; transform: translateY(-1px); }

.btn-outline {
    border-color: var(--line-strong);
    color: var(--paper);
}
.btn-outline:hover { border-color: var(--amber); color: var(--amber); }

/* ===== Footer ===== */
footer {
    border-top: 1px solid var(--line);
    padding: 56px 0 28px;
    margin-top: 120px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-grid h4 {
    font-size: 14px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
    font-weight: 500;
}

.footer-grid p, .footer-grid a {
    font-size: 14.5px;
    color: var(--muted);
    display: block;
    margin-bottom: 10px;
}

.footer-grid a:hover { color: var(--amber); }

.footer-bottom {
    border-top: 1px solid var(--line);
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--muted);
}

/* ===== Section utility ===== */
section { padding: 100px 0; }
.section-tight { padding: 70px 0; }

.section-head {
    max-width: 620px;
    margin-bottom: 56px;
}

.section-head h2 {
    font-size: 38px;
    margin-top: 14px;
}

.section-head p {
    color: var(--muted);
    font-size: 17px;
    margin-top: 16px;
}

/* ===== Responsive ===== */
@media (max-width: 860px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    section { padding: 64px 0; }
    .section-head h2 { font-size: 28px; }
}

@media (max-width: 640px) {
    .nav-links { display: none; }
}

/* ===== Scroll reveal ===== */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1), transform 0.7s cubic-bezier(0.16,1,0.3,1);
}
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===== Project cards ===== */
.project-card {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--ink-soft);
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.16,1,0.3,1), border-color 0.3s;
}
.project-card:hover { transform: translateY(-6px); border-color: var(--line-strong); }
.project-card .pc-visual {
    aspect-ratio: 4/3;
    position: relative;
    overflow: hidden;
}
.project-card .pc-visual::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(11,18,32,0.92) 100%);
}
.project-card .pc-tag {
    position: absolute; top: 14px; left: 14px; z-index: 2;
    font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
    padding: 4px 10px; border-radius: 99px;
    background: rgba(11,18,32,0.7); backdrop-filter: blur(4px);
}
.project-card .pc-body {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
    padding: 18px 20px;
}
.project-card .pc-body h4 { font-size: 17px; }
.project-card .pc-body p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.project-card .pc-arrow {
    position: absolute; top: 14px; right: 14px; z-index: 2;
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(244,242,236,0.1); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transform: translate(-6px,6px);
    transition: opacity 0.3s, transform 0.3s;
}
.project-card:hover .pc-arrow { opacity: 1; transform: translate(0,0); }

/* ===== Testimonial slider ===== */
.t-slider { position: relative; overflow: hidden; }
.t-track { display: flex; transition: transform 0.55s cubic-bezier(0.16,1,0.3,1); }
.t-slide { flex: 0 0 100%; }
.t-dots { display: flex; gap: 8px; justify-content: center; margin-top: 32px; }
.t-dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong);
    border: none; cursor: pointer; transition: background 0.25s, width 0.25s;
}
.t-dot.active { background: var(--amber); width: 22px; border-radius: 4px; }
.t-arrows { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }
.t-arrow {
    width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-strong);
    background: transparent; color: var(--paper); cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: border-color 0.2s, background 0.2s;
}
.t-arrow:hover { border-color: var(--amber); background: rgba(232,163,61,0.08); }

/* ===== Service platform cards ===== */
.platform-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: border-color 0.25s, background 0.25s;
    background: var(--ink);
}
.platform-card:hover { border-color: var(--amber); background: var(--ink-soft); }
.platform-card.active { border-color: var(--amber); background: var(--ink-soft); }
.platform-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.16,1,0.3,1);
}
.platform-detail.open { max-height: 600px; }

/* ===== Hover lift for generic cards ===== */
.lift { transition: transform 0.3s cubic-bezier(0.16,1,0.3,1), border-color 0.3s; }
.lift:hover { transform: translateY(-4px); border-color: var(--line-strong); }

/* ===== Animated underline link ===== */
.u-link { position: relative; display: inline-block; }
.u-link::after {
    content: ''; position: absolute; left: 0; bottom: -2px; width: 0; height: 1px;
    background: var(--amber); transition: width 0.3s;
}
.u-link:hover::after { width: 100%; }

/* ===== Marquee ===== */
.marquee-wrap { overflow: hidden; }
.marquee-track {
    display: flex; gap: 60px; width: max-content;
    animation: marquee 28s linear infinite;
}
@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
    .marquee-track { animation: none; }
}

/* ===== Custom cursor ===== */
@media (hover: hover) and (pointer: fine) {
    body { cursor: none; }
    a, button, input, textarea, select, .lift, .project-card, .platform-card { cursor: none; }

    #cc-dot {
        position: fixed;
        width: 7px; height: 7px;
        border-radius: 50%;
        background: var(--amber);
        pointer-events: none;
        z-index: 9999;
        transform: translate(-50%, -50%);
        opacity: 0;
        transition: opacity 0.2s, width 0.2s, height 0.2s, background 0.2s;
    }
    #cc-ring {
        position: fixed;
        width: 34px; height: 34px;
        border-radius: 50%;
        border: 1.5px solid var(--amber);
        pointer-events: none;
        z-index: 9998;
        transform: translate(-50%, -50%);
        opacity: 0;
        transition: opacity 0.2s, border-color 0.2s;
    }
    #cc-dot.active, #cc-ring.active { opacity: 1; }
    #cc-ring.hovering {
        width: 50px; height: 50px;
        border-color: var(--paper);
    }
    #cc-dot.hovering {
        width: 5px; height: 5px;
    }
}
@media (hover: none), (pointer: coarse) {
    #cc-dot, #cc-ring { display: none; }
}

/* ===================================================== */
/* ===== RESPONSIVE FIXES (override inline styles) ===== */
/* ===================================================== */

/* ---- Tablet & below (≤ 900px) ---- */
@media (max-width: 900px) {
    .wrap { padding: 0 24px; }

    [style*="grid-template-columns:repeat(4,1fr)"],
    [style*="grid-template-columns:repeat(3,1fr)"],
    [style*="grid-template-columns:repeat(2,1fr)"],
    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns:1fr 1.2fr"],
    [style*="grid-template-columns: 1.15fr 0.85fr"],
    [style*="grid-template-columns: 1.4fr"] {
        grid-template-columns: 1fr !important;
    }

    #work [style*="grid-template-columns:repeat(4,1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    #work .project-card[style*="span 2"] {
        grid-column: span 2 !important;
    }

    h1[style*="font-size:56px"] { font-size: 38px !important; }
    h1[style*="font-size:46px"] { font-size: 32px !important; }
    h1[style*="font-size:44px"] { font-size: 30px !important; }

    h2[style*="font-size:38px"] { font-size: 28px !important; }
    h2[style*="font-size:36px"] { font-size: 26px !important; }
    h2[style*="font-size:34px"] { font-size: 26px !important; }
    h2[style*="font-size:32px"] { font-size: 24px !important; }

    .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }

    section [style*="position:absolute; top:19px; left:60px; right:60px"] {
        display: none !important;
    }

    section { padding: 56px 0; }
    .section-tight { padding: 48px 0; }
}

/* ---- Mobile (≤ 640px) ---- */
@media (max-width: 640px) {
    .wrap { padding: 0 18px; }

    .nav-inner { padding: 16px 18px; }
    .logo { font-size: 17px; }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: var(--paper);
        padding: 6px;
        cursor: pointer;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--ink);
        border-bottom: 1px solid var(--line);
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 8px 18px 18px;
    }
    .nav-links.open { display: flex; }
    .nav-links a {
        width: 100%;
        padding: 13px 0;
        border-bottom: 1px solid var(--line);
        font-size: 15px;
    }
    .nav-links a:last-child { border-bottom: none; }
    .nav-links a.active::after { display: none; }
    .nav-cta {
        margin-top: 10px;
        text-align: center;
        border-bottom: none !important;
    }

    .site-nav { position: sticky; }

    [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    .project-card[style*="span 2"] { grid-column: span 1 !important; }

    h1[style*="font-size:56px"] { font-size: 30px !important; }
    h1[style*="font-size:46px"] { font-size: 27px !important; }
    h1[style*="font-size:44px"] { font-size: 25px !important; }
    h2[style*="font-size:38px"] { font-size: 23px !important; }
    h2[style*="font-size:36px"] { font-size: 22px !important; }
    h2[style*="font-size:34px"] { font-size: 22px !important; }
    h2[style*="font-size:32px"] { font-size: 21px !important; }
    h2[style*="font-size:30px"] { font-size: 20px !important; }

    p[style*="font-size:18px"] { font-size: 15px !important; }
    p[style*="font-size:17px"] { font-size: 15px !important; }

    div[style*="font-size:34px"] { font-size: 24px !important; }
    div[style*="font-size:28px"] { font-size: 22px !important; }

    div[style*="display:flex; gap:14px; margin-top:34px"] {
        flex-direction: column !important;
    }
    div[style*="display:flex; gap:14px; margin-top:34px"] .btn {
        width: 100%;
        justify-content: center;
    }

    div[style*="display:flex; gap:36px"] {
        flex-wrap: wrap;
        gap: 20px !important;
    }

    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }

    .t-slide p[style*="font-size:24px"] { font-size: 18px !important; }

    .platform-card { padding: 18px; }

    section { padding: 44px 0; }
    .section-tight { padding: 36px 0; }

    #cc-dot, #cc-ring { display: none !important; }
    body, a, button { cursor: auto !important; }
}

/* ---- Very small phones (≤ 380px) ---- */
@media (max-width: 380px) {
    h1[style*="font-size:56px"],
    h1[style*="font-size:46px"],
    h1[style*="font-size:44px"] { font-size: 23px !important; }

    .wrap { padding: 0 14px; }
}