/* ==========================================================================
   D1 Consulting — "Decisions in The Wild"
   Dark, modern one-page theme with gradient accents
   ========================================================================== */

:root {
    /* Color tokens — tweak the whole site here */
    --bg:          #0b1120;   /* deep navy page background */
    --bg-alt:      #0e1629;   /* slightly lighter band for alternating sections */
    --card:        #131e36;   /* card surface */
    --card-edge:   #1e2c4d;   /* card border */
    --text:        #e6ecf7;
    --muted:       #93a1b8;
    --accent:      #38bdf8;   /* electric sky blue */
    --accent-2:    #818cf8;   /* indigo */
    --gradient:    linear-gradient(100deg, var(--accent), var(--accent-2));
    --radius:      14px;
    --container:   1120px;
    --header-h:    72px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 24px;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3 { line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; }

h1 { font-size: clamp(2.6rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h3 { font-size: 1.15rem; font-weight: 700; }

.kicker {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 14px;
}

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.section-lede { color: var(--muted); max-width: 640px; margin-top: 12px; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    cursor: pointer;
    border: none;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }

.btn-primary {
    background: var(--gradient);
    color: #071018;
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.25);
}
.btn-primary:hover { box-shadow: 0 12px 32px rgba(56, 189, 248, 0.4); }

.btn-ghost {
    color: var(--text);
    border: 1px solid var(--card-edge);
    background: rgba(255, 255, 255, 0.03);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-small { padding: 9px 20px; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* --------------------------------------------------------------------------
   Header / nav
   -------------------------------------------------------------------------- */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    height: var(--header-h);
    display: flex;
    align-items: center;
    transition: background 0.25s ease, box-shadow 0.25s ease;
}
.site-header.scrolled {
    background: rgba(11, 17, 32, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 var(--card-edge);
}

.nav-wrap {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--gradient);
    color: #071018;
    font-size: 0.95rem;
}

.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav > a:not(.btn) {
    color: var(--muted);
    font-weight: 500;
    font-size: 0.95rem;
}
.site-nav > a:not(.btn):hover { color: var(--text); text-decoration: none; }

/* Hamburger (mobile) */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
}
.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
    position: relative;
    min-height: 92vh;
    display: flex;
    align-items: center;
    padding: calc(var(--header-h) + 48px) 0 72px;
    overflow: hidden;
}

/* Glow + topographic contour lines: the "wild" in Decisions in The Wild */
.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 70% 20%, rgba(129, 140, 248, 0.16), transparent 70%),
        radial-gradient(ellipse 50% 45% at 20% 80%, rgba(56, 189, 248, 0.13), transparent 70%);
}
.hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.35;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420' viewBox='0 0 420 420'%3E%3Cg fill='none' stroke='%231e2c4d' stroke-width='1.2'%3E%3Cpath d='M0 90 C 90 30, 180 150, 270 90 S 420 30, 420 90'/%3E%3Cpath d='M0 150 C 90 90, 180 210, 270 150 S 420 90, 420 150'/%3E%3Cpath d='M0 210 C 90 150, 180 270, 270 210 S 420 150, 420 210'/%3E%3Cpath d='M0 270 C 90 210, 180 330, 270 270 S 420 210, 420 270'/%3E%3Cpath d='M0 330 C 90 270, 180 390, 270 330 S 420 270, 420 330'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 420px 420px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent 85%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent 85%);
}

.hero-inner { position: relative; max-width: 780px; }

.hero-subhead {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    color: var(--muted);
    margin: 24px 0 36px;
    max-width: 640px;
}

.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { margin-bottom: 48px; }

/* --------------------------------------------------------------------------
   Services cards
   -------------------------------------------------------------------------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.card {
    background: var(--card);
    border: 1px solid var(--card-edge);
    border-radius: var(--radius);
    padding: 28px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
    transform: translateY(-4px);
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 16px 40px rgba(3, 7, 18, 0.5);
}

.card-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent);
    margin-bottom: 18px;
}
.card-icon svg { width: 24px; height: 24px; }

.card h3 { margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 0.95rem; }

/* --------------------------------------------------------------------------
   Process
   -------------------------------------------------------------------------- */
.process-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    list-style: none;
    counter-reset: step;
}

.process-step {
    position: relative;
    padding: 24px 20px 0;
    border-top: 2px solid var(--card-edge);
}

.step-number {
    display: block;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    margin-bottom: 10px;
}

.process-step h3 { margin-bottom: 8px; }
.process-step p { color: var(--muted); font-size: 0.95rem; }

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 48px;
    align-items: start;
}

.contact-info { display: grid; gap: 28px; }

.contact-line { display: flex; gap: 16px; align-items: flex-start; }

.contact-icon {
    flex: none;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(129, 140, 248, 0.12);
    color: var(--accent-2);
}
.contact-icon svg { width: 22px; height: 22px; }

.contact-label {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin-bottom: 2px;
}

.contact-strong {
    display: block;
    font-weight: 600;
}

/* Form */
.contact-form {
    background: var(--card);
    border: 1px solid var(--card-edge);
    border-radius: var(--radius);
    padding: 32px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-field { margin-bottom: 18px; }

.form-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.form-field input,
.form-field textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--card-edge);
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: 0.95rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}
.form-field [aria-invalid="true"] { border-color: #f87171; }

.field-error { color: #f87171; font-size: 0.82rem; margin-top: 5px; }

textarea { resize: vertical; min-height: 120px; }

/* Honeypot — visually removed, still in the DOM for bots to find */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 32px;
    font-weight: 500;
}
.alert-success {
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.4);
    color: #6ee7b7;
}
.alert-error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.4);
    color: #fca5a5;
}
.alert a { color: inherit; text-decoration: underline; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
    border-top: 1px solid var(--card-edge);
    padding: 32px 0;
}
.footer-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.9rem;
}
.footer-wrap a { color: var(--muted); }
.footer-wrap a:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   Scroll-reveal animation (elements fade/rise in as they enter the viewport)
   -------------------------------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .btn, .card { transition: none; }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .process-grid { grid-template-columns: repeat(2, 1fr); }
    .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .section { padding: 64px 0; }
    .card-grid, .process-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }

    /* Mobile nav: slide-down panel */
    .nav-toggle { display: flex; }
    .site-nav {
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: rgba(11, 17, 32, 0.97);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--card-edge);
        padding: 8px 24px 20px;
        transform: translateY(-8px);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.2s ease, opacity 0.2s ease, visibility 0.2s;
    }
    .site-nav.open { transform: none; opacity: 1; visibility: visible; }
    .site-nav > a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--card-edge); }
    .site-nav .btn { margin-top: 16px; text-align: center; }
}
