/* ============================================================
   CODE CLAW SDN. BHD. — Professional stylesheet
   ============================================================ */

/* ===== Reset ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    /* Brand */
    --accent: #d9060a;
    --accent-dark: #b00408;
    --accent-soft: rgba(217, 6, 10, 0.08);

    /* Neutrals */
    --bg: #ffffff;
    --light: #ffffff;
    --soft: #f6f7f9;
    --soft-2: #eef0f3;
    --line: #e6e8ec;
    --dark: #11141b;          /* primary text */
    --body: #3c4350;          /* secondary text */
    --muted: #6b7280;         /* tertiary text */

    /* Dark surfaces (footer) */
    --ink: #0f1117;
    --ink-2: #161a23;
    --ink-line: rgba(255, 255, 255, 0.08);
    --ink-muted: #9aa0ad;

    /* Typography */
    --font-display: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    --font-body: 'Inter', 'Segoe UI', sans-serif;

    /* Layout */
    --maxw: 1200px;
    --gutter: 1.5rem;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 2px rgba(17, 20, 27, 0.04), 0 1px 3px rgba(17, 20, 27, 0.06);
    --shadow-md: 0 10px 30px rgba(17, 20, 27, 0.06), 0 4px 12px rgba(17, 20, 27, 0.04);
    --shadow-lg: 0 28px 60px rgba(17, 20, 27, 0.10), 0 10px 24px rgba(17, 20, 27, 0.06);
    --shadow-accent: 0 12px 28px rgba(217, 6, 10, 0.28);

    /* Motion */
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--body);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--accent-dark); }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--dark);
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-weight: 700;
}

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ===== Eyebrow labels ===== */
.eyebrow {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
}
.eyebrow.dark { color: var(--accent); }
.eyebrow.light { color: rgba(255, 255, 255, 0.85); }

/* ===== Header / Nav ===== */
#header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}
#header.scrolled {
    border-bottom-color: var(--line);
    box-shadow: 0 4px 24px rgba(17, 20, 27, 0.05);
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo-link {
    display: inline-flex;
    align-items: center;
    color: var(--dark);
    text-decoration: none;
    flex-shrink: 0;
}
.logo-link:hover { color: var(--dark); }
.logo-svg { height: 26px; width: auto; display: block; }

#nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--line);
    color: var(--dark);
    font-size: 1.1rem;
    cursor: pointer;
    width: 42px; height: 42px;
    border-radius: 8px;
    transition: background 0.2s, border-color 0.2s;
}
#nav-toggle:hover { background: var(--soft); border-color: var(--soft-2); }

#nav ul { display: flex; gap: 2.25rem; list-style: none; }
#nav a {
    color: var(--dark);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    padding: 0.25rem 0;
    transition: color 0.2s var(--ease);
}
#nav a::after {
    content: "";
    position: absolute;
    left: 0; bottom: -4px;
    width: 0; height: 2px;
    background: var(--accent);
    transition: width 0.25s var(--ease);
}
#nav a:hover { color: var(--accent); }
#nav a:hover::after { width: 100%; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.95rem 1.9rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.25s var(--ease);
}
.btn:hover {
    background: var(--accent-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-accent);
}
.btn-ghost {
    background: transparent;
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, 0.45);
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
    box-shadow: none;
}
.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
}
.btn-outline:hover { background: var(--accent); color: #fff; }

/* ===== Hero ===== */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    color: #fff;
    text-align: center;
    background:
        linear-gradient(rgba(15, 17, 23, 0.74), rgba(15, 17, 23, 0.82)),
        url('../img/hero_banner.png') center/cover no-repeat;
    padding-top: 72px;
    overflow: hidden;
}
#hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(217, 6, 10, 0.18), transparent 55%);
    pointer-events: none;
}
.hero-inner { position: relative; max-width: 760px; }
#hero h1 {
    color: #fff;
    font-size: clamp(2.4rem, 6vw, 3.75rem);
    margin-bottom: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}
#hero .tagline {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.86);
    margin: 0 auto 2rem;
    max-width: 620px;
}
#hero .eyebrow { color: rgba(255, 255, 255, 0.85); }
.hero-cta {
    display: flex;
    gap: 0.85rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Section base ===== */
section { padding: 6rem 0; }
section h2 {
    font-size: clamp(1.85rem, 4vw, 2.6rem);
    margin-bottom: 1.25rem;
}
section .lead {
    font-size: 1.1rem;
    color: var(--muted);
    max-width: 620px;
    line-height: 1.65;
}

/* ===== About ===== */
#about { background: var(--bg); }
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    gap: 4rem;
    align-items: center;
}
.about-media { position: relative; }
.about-media img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.about-media::before {
    content: "";
    position: absolute;
    top: -20px; left: -20px;
    width: 110px; height: 110px;
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    z-index: -1;
}
.about-media .badge {
    position: absolute;
    bottom: -20px; right: -20px;
    background: var(--accent);
    color: #fff;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-accent);
    text-align: left;
}
.about-media .badge strong { display: block; font-family: var(--font-display); font-size: 1.6rem; line-height: 1; font-weight: 800; }
.about-media .badge span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.85; }
.about-copy h2 { margin-bottom: 1.5rem; }
.about-copy p { color: var(--body); margin-bottom: 1.1rem; }
.company-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1.1rem 2rem;
    margin: 2.25rem 0;
    padding: 1.5rem 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.company-details > div { border-left: 3px solid var(--accent); padding-left: 0.9rem; }
.company-details dt {
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.25rem;
    font-weight: 600;
}
.company-details dd { font-size: 0.95rem; color: var(--dark); font-weight: 600; }

/* ===== Services ===== */
#services { background: var(--soft); }
.services-head { text-align: center; margin-bottom: 4rem; }
.services-head .eyebrow { display: block; }
.services-head .lead { margin: 0 auto; }
.section-line { width: 56px; height: 3px; background: var(--accent); margin: 0.85rem auto 1.25rem; border-radius: 2px; }

.service-list { display: flex; flex-direction: column; gap: 2.5rem; }
.service-item {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2.25rem;
    align-items: center;
    background: var(--light);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.75rem;
    transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.service-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    border-color: transparent;
}
.service-item:nth-child(even) .service-media { order: 2; }
.service-media {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.service-media img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform 0.5s var(--ease);
}
.service-item:hover .service-media img { transform: scale(1.06); }
.service-index {
    position: absolute;
    top: 12px; left: 12px;
    background: rgba(15, 17, 23, 0.78);
    color: #fff;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    backdrop-filter: blur(6px);
}
.service-body .code {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.72rem;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    letter-spacing: 0.08em;
    margin-bottom: 0.85rem;
    font-weight: 700;
}
.service-body h3 {
    font-size: 1.4rem;
    margin-bottom: 0.65rem;
    color: var(--dark);
}
.service-body p { color: var(--body); margin: 0; }

/* ===== CTA ===== */
#cta {
    position: relative;
    color: #fff;
    text-align: center;
    background:
        linear-gradient(rgba(15, 17, 23, 0.82), rgba(15, 17, 23, 0.92)),
        url('../img/cta-bg.svg') center/cover no-repeat;
    overflow: hidden;
}
#cta::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(217, 6, 10, 0.22), transparent 55%);
    pointer-events: none;
}
.cta-inner { position: relative; max-width: 680px; }
#cta h2 { color: #fff; font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: 1.25rem; }
#cta p { color: rgba(255, 255, 255, 0.88); font-size: 1.1rem; margin: 0 auto 2rem; max-width: 580px; }

/* ===== Footer widgets ===== */
#footer-widgets {
    background: var(--ink);
    color: var(--ink-muted);
    padding: 5rem 0 2.5rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1.4fr;
    gap: 3rem;
}
.footer-col h4 {
    font-size: 0.85rem;
    margin-bottom: 1.4rem;
    color: #fff;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
}
.footer-logo {
    font-size: 1.5rem;
    margin-bottom: 1.1rem;
    color: #fff;
    letter-spacing: -0.01em;
    font-weight: 800;
}
.footer-logo span { color: var(--accent); font-weight: 600; }
.footer-col p { color: var(--ink-muted); margin-bottom: 0.55rem; font-size: 0.92rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.7rem; }
.footer-col ul a {
    color: var(--ink-muted);
    text-decoration: none;
    font-size: 0.92rem;
    transition: color 0.2s var(--ease), padding-left 0.2s var(--ease);
}
.footer-col ul a:hover { color: var(--accent); padding-left: 4px; }
.contact-info li {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    color: var(--ink-muted);
    font-size: 0.92rem;
    margin-bottom: 1.1rem;
}
.contact-info .icon {
    color: var(--accent);
    font-size: 1.05rem;
    line-height: 1.5;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}
.contact-info address { font-style: normal; line-height: 1.55; }
.contact-info a { color: var(--ink-muted); }
.contact-info a:hover { color: var(--accent); }

/* ===== Credit footer ===== */
.credit-footer {
    background: #08090e;
    color: #5d6270;
    padding: 1.4rem 0;
    text-align: center;
    font-size: 0.82rem;
    border-top: 1px solid var(--ink-line);
}
.credit-footer a { color: #8a8fa3; }

/* ===== Scroll reveal ===== */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .about-grid { grid-template-columns: 1fr; gap: 3.5rem; }
    .about-media { max-width: 480px; margin: 0 auto; }
    .service-item { grid-template-columns: 200px 1fr; gap: 1.75rem; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
}
@media (max-width: 768px) {
    section { padding: 4.5rem 0; }
    #nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
    #nav {
        position: fixed;
        top: 72px; right: -100%;
        width: 280px;
        height: calc(100vh - 72px);
        background: #fff;
        padding: 1.75rem;
        transition: right 0.32s var(--ease);
        border-left: 1px solid var(--line);
        box-shadow: -12px 0 36px rgba(17, 20, 27, 0.08);
        overflow-y: auto;
    }
    #nav.open { right: 0; }
    #nav ul { flex-direction: column; gap: 1.5rem; }
    #nav a { font-size: 1.05rem; }
    #nav a::after { display: none; }
    .logo-svg { height: 22px; }
    .hero-cta { flex-direction: column; align-items: stretch; max-width: 280px; margin: 0 auto; }
    .footer-grid { grid-template-columns: 1fr; gap: 2.5rem; }
    .about-media::before { display: none; }
}
@media (max-width: 560px) {
    .service-item {
        grid-template-columns: 1fr;
        padding: 1.25rem;
    }
    .service-item:nth-child(even) .service-media { order: 0; }
    .service-media { margin-bottom: 1rem; }
    .service-media img { aspect-ratio: 16 / 10; }
    .about-media .badge { right: 12px; bottom: 12px; padding: 0.75rem 1rem; }
    .about-media .badge strong { font-size: 1.3rem; }
}