/* ============================================================================
   IRONCLAD VEHICLE WORKS — Public Site Theme
   Industrial / military-grade dark theme with light mode override.
   ========================================================================== */

:root {
    --gunmetal: #1b1f23;
    --gunmetal-light: #262b31;
    --matte-black: #0c0d0f;
    --charcoal: #14171a;
    --olive: #4b5320;
    --olive-bright: #6b7a2e;
    --steel-blue: #3a6ea5;
    --steel-blue-bright: #4f8fce;
    --silver: #c3c8cf;
    --silver-bright: #eef0f2;
    --warn-amber: #d68a1c;

    --bg: var(--matte-black);
    --bg-alt: var(--gunmetal);
    --bg-card: var(--gunmetal-light);
    --text: #e7e9eb;
    --text-muted: #9aa1a8;
    --border: #2c3339;
    --accent: var(--steel-blue-bright);
    --accent-secondary: var(--olive-bright);

    --font-display: 'Oswald', 'Arial Narrow', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --radius: 2px;
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.45);
    --transition: 0.25s ease;
}

:root[data-theme="light"] {
    --bg: #f4f4f2;
    --bg-alt: #e9e9e6;
    --bg-card: #ffffff;
    --text: #1a1d1f;
    --text-muted: #565d63;
    --border: #d8d9d6;
    --accent: var(--steel-blue);
    --accent-secondary: var(--olive);
}

/*
 * The industrial theme is dark by default regardless of OS/browser color-
 * scheme preference — light mode is strictly opt-in via the theme toggle
 * (which sets data-theme="light" and persists it), not auto-detected.
 * See :root[data-theme="light"] above for the light palette.
 */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }

h1, h2, h3, h4, h5 {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.15;
    color: var(--silver-bright, var(--text));
    margin: 0 0 0.5em;
}

:root[data-theme="light"] h1,
:root[data-theme="light"] h2,
:root[data-theme="light"] h3,
:root[data-theme="light"] h4 { color: var(--text); }

p { margin: 0 0 1em; color: var(--text-muted); }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-secondary); }

.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); }
.section-tight { padding: 64px 0; }

.eyebrow {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.8rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--accent);
    border-left: 3px solid var(--accent);
    padding-left: 10px;
    margin-bottom: 14px;
}

.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* -------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 15px 30px;
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
}
.btn:hover { transform: translateY(-2px); }

.btn-primary { background: var(--steel-blue); color: #fff; }
.btn-primary:hover { background: var(--steel-blue-bright); color: #fff; }

.btn-olive { background: var(--olive); color: #fff; }
.btn-olive:hover { background: var(--olive-bright); color: #fff; }

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

/* The hero always sits on a dark photo/gradient regardless of site theme,
   so its outline buttons must stay light-on-dark in both themes — an
   explicit color here (not var(--text)) overrides the theme variable
   unconditionally, so light mode can't darken it into illegibility. */
.hero .btn-outline { border-color: #fff; color: #fff; }
.hero .btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 9px 18px; font-size: 0.78rem; }

/* -------------------------------------------------------------------------
   Navbar
   ------------------------------------------------------------------------- */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 20px 0;
    background: transparent;
    transition: background var(--transition), padding var(--transition), box-shadow var(--transition);
}
.navbar.is-scrolled {
    background: rgba(12, 13, 15, 0.92);
    backdrop-filter: blur(8px);
    padding: 12px 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.4);
}
:root[data-theme="light"] .navbar.is-scrolled { background: rgba(244, 244, 242, 0.95); }

.navbar .container { display: flex; align-items: center; gap: 40px; }

.brand {
    font-family: var(--font-display);
    font-size: 1.3rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: auto;
    white-space: nowrap;
}
.brand .mark { color: var(--accent); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
    list-style: none;
    margin: 0; padding: 0;
}
.nav-links a {
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--silver);
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); }

/* The navbar is transparent (over the hero/page-header) until scrolled,
   and the mobile slide-out panel is always a solid dark background
   regardless of theme — so brand/nav-link text must stay light in both
   cases. Only the desktop *scrolled* navbar, which gets its own solid
   theme-colored background, should follow the site's light/dark theme. */
@media (min-width: 961px) {
    :root[data-theme="light"] .navbar.is-scrolled .brand,
    :root[data-theme="light"] .navbar.is-scrolled .nav-links a { color: var(--text); }
}

.nav-actions { display: flex; align-items: center; gap: 14px; }
.nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 1.6rem; cursor: pointer; }
.theme-toggle {
    background: none; border: 1px solid var(--border); color: var(--text);
    width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
/* Same transparent-until-scrolled issue as the brand/nav-links above:
   .nav-toggle defaults to white (correct while unscrolled) but needs to
   darken once the scrolled navbar has a light solid background; .theme-toggle
   defaults to the theme color (correct once scrolled) but needs to stay
   light while unscrolled, over the dark hero/page-header. */
:root[data-theme="light"] .navbar.is-scrolled .nav-toggle { color: var(--text); }
:root[data-theme="light"] .navbar:not(.is-scrolled) .theme-toggle { color: #fff; border-color: rgba(255,255,255,0.4); }

@media (max-width: 960px) {
    .nav-links {
        position: fixed; top: 0; right: -320px; height: 100vh; width: 300px;
        background: var(--matte-black); flex-direction: column; justify-content: center;
        transition: right var(--transition); box-shadow: -10px 0 40px rgba(0,0,0,0.5);
    }
    .nav-links.is-open { right: 0; }
    .nav-toggle { display: block; }
}

/* -------------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------------- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background:
        linear-gradient(180deg, rgba(12,13,15,0.55) 0%, rgba(12,13,15,0.85) 65%, var(--matte-black) 100%),
        repeating-linear-gradient(115deg, #14171a 0px, #14171a 2px, #1b1f23 2px, #1b1f23 60px),
        radial-gradient(circle at 80% 20%, #22283066 0%, transparent 55%);
    overflow: hidden;
}
.hero.has-bg-image {
    background-image:
        linear-gradient(180deg, rgba(10,11,13,0.47) 0%, rgba(10,11,13,0.65) 55%, rgba(10,11,13,0.83) 100%),
        radial-gradient(circle at 80% 20%, rgba(34,40,48,0.4) 0%, transparent 55%),
        var(--hero-image);
    background-size: cover, cover, cover;
    background-position: center, center, center;
    background-repeat: no-repeat, no-repeat, no-repeat;
}
.hero::after {
    content: "";
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 44px 44px;
    pointer-events: none;
}
.hero .container { position: relative; z-index: 2; padding-top: 90px; }
.hero-tag {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-display); font-size: 0.78rem; letter-spacing: 0.3em; text-transform: uppercase;
    color: var(--accent); border: 1px solid var(--border); padding: 8px 16px; margin-bottom: 26px;
    background: rgba(10, 11, 13, 0.55);
    backdrop-filter: blur(2px);
}
.hero-tag .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-secondary); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.hero h1 {
    font-size: clamp(2.4rem, 6vw, 4.6rem);
    color: #fff;
    max-width: 950px;
    margin-bottom: 22px;
}
.hero h1 .accent-word { color: var(--accent); }
/* :root itself carries specificity weight, so the generic light-theme
   heading rule ([data-theme="light"] h1) actually outranks plain ".hero
   h1" despite coming first in the file — pin it explicitly so light mode
   can't darken the headline against the photo. */
:root[data-theme="light"] .hero h1 { color: #fff; }
.hero p.lead {
    font-size: 1.15rem; max-width: 640px; color: var(--silver);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 36px; }

.hero-scroll {
    position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
    color: var(--silver); font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.hero-scroll .bar { width: 1px; height: 34px; background: linear-gradient(var(--accent), transparent); animation: scrolldown 1.8s infinite; }
@keyframes scrolldown { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* -------------------------------------------------------------------------
   Stats
   ------------------------------------------------------------------------- */
.stats {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}
.stat-item {
    padding: 44px 20px;
    text-align: center;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.stat-item:nth-child(4n) { border-right: none; }
.stat-value {
    font-family: var(--font-display);
    font-size: 2.6rem;
    color: var(--accent);
    display: block;
}
.stat-label {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}
@media (max-width: 860px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-item:nth-child(4n) { border-right: 1px solid var(--border); }
    .stat-item:nth-child(2n) { border-right: none; }
}

/* -------------------------------------------------------------------------
   Cards — services / projects / news
   ------------------------------------------------------------------------- */
.grid { display: grid; gap: 28px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 960px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    display: flex;
    flex-direction: column;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--accent); }

.card-media {
    position: relative;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #20262b, #14171a);
    overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.card:hover .card-media img { transform: scale(1.08); }
.card-media .badge {
    position: absolute; top: 14px; left: 14px;
    background: var(--accent); color: #fff; font-family: var(--font-display);
    font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; padding: 5px 12px;
}

.card-body { padding: 26px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { font-size: 1.2rem; margin-bottom: 10px; }
.card-body p { font-size: 0.92rem; flex: 1; }
.card-link {
    font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase;
    display: inline-flex; align-items: center; gap: 8px; margin-top: 10px;
}
.card-link::after { content: "→"; transition: transform var(--transition); }
.card-link:hover::after { transform: translateX(5px); }

/* -------------------------------------------------------------------------
   Forms
   ------------------------------------------------------------------------- */
.form-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 40px;
    border-radius: var(--radius);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 720px) { .form-row { grid-template-columns: 1fr; } }
.field { margin-bottom: 20px; }
.field label {
    display: block; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--text-muted); margin-bottom: 8px;
}
.field input, .field select, .field textarea {
    width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text);
    padding: 13px 14px; border-radius: var(--radius); font-family: var(--font-body); font-size: 0.95rem;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 130px; }
.field-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 6px; }
.field-error { font-size: 0.78rem; color: #e5644d; margin-top: 6px; }

.alert { padding: 16px 20px; border-radius: var(--radius); margin-bottom: 24px; font-size: 0.92rem; border: 1px solid transparent; }
.alert-success { background: rgba(75, 83, 32, 0.18); border-color: var(--olive-bright); color: #b7c17e; }
.alert-error { background: rgba(229, 100, 77, 0.12); border-color: #e5644d; color: #e5644d; }

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */
.site-footer { background: var(--matte-black); border-top: 1px solid var(--border); padding: 70px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 40px; margin-bottom: 50px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.site-footer h4 { color: var(--silver-bright); font-size: 0.9rem; letter-spacing: 0.12em; margin-bottom: 18px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 10px; }
.site-footer a { color: var(--text-muted); font-size: 0.92rem; }
.site-footer a:hover { color: var(--accent); }
.footer-bottom {
    border-top: 1px solid var(--border); padding-top: 24px;
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
    font-size: 0.82rem; color: var(--text-muted);
}

/* -------------------------------------------------------------------------
   Floating actions
   ------------------------------------------------------------------------- */
.floating-actions {
    position: fixed; bottom: 24px; right: 24px; z-index: 900;
    display: flex; flex-direction: column; gap: 12px;
}
.fab {
    width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.3rem; box-shadow: var(--shadow-lg); border: none; cursor: pointer;
}
.fab-whatsapp { background: #25D366; }
.fab-call { background: var(--steel-blue); }
.fab-top { background: var(--gunmetal-light); border: 1px solid var(--border); opacity: 0; pointer-events: none; transition: opacity var(--transition); }
.fab-top.is-visible { opacity: 1; pointer-events: auto; }

/* -------------------------------------------------------------------------
   Reveal animations
   ------------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* -------------------------------------------------------------------------
   Misc
   ------------------------------------------------------------------------- */
.breadcrumb { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }

.tag-pill {
    display: inline-block; padding: 5px 12px; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
    border: 1px solid var(--border); border-radius: 20px; color: var(--text-muted); margin: 0 8px 8px 0;
}

.page-header {
    padding: 150px 0 60px;
    background: linear-gradient(180deg, var(--gunmetal) 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
}

.faq-item { border-bottom: 1px solid var(--border); padding: 20px 0; }
.faq-item summary { cursor: pointer; font-family: var(--font-display); letter-spacing: 0.03em; color: var(--text); list-style: none; display: flex; justify-content: space-between; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin-top: 14px; }
