/* ============================================================
   Stephen Wanjiru — Firefighter Portfolio
   Modern dark theme with animated bokeh hero
   ============================================================ */

:root {
    --bg: #0a0a0b;
    --bg-elev: #111114;
    --bg-alt: #0d0d10;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-strong: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);

    --text: #f5f3ef;
    --text-muted: #a8a39a;
    --text-dim: #6b675f;

    --accent: #ff6a2c;        /* ember orange */
    --accent-warm: #ffb547;   /* gold */
    --accent-deep: #c43c12;   /* deep flame */
    --accent-glow: rgba(255, 106, 44, 0.35);

    --maxw: 1180px;
    --pad: clamp(1.25rem, 4vw, 2.5rem);
    --radius: 14px;
    --radius-lg: 22px;

    --font-display: "Big Shoulders Display", "Space Grotesk", system-ui, sans-serif;
    --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: "Space Grotesk", ui-monospace, monospace;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: 0; color: inherit; cursor: pointer; }
ul, ol { list-style: none; padding: 0; margin: 0; }

::selection { background: var(--accent); color: #111; }

.skip-link {
    position: absolute; top: -100px; left: 1rem;
    background: var(--accent); color: #111; padding: .6rem 1rem;
    border-radius: 8px; font-weight: 600; z-index: 1000;
    transition: top .2s;
}
.skip-link:focus { top: 1rem; }

/* ============ NAV ============ */
.nav-wrap {
    position: fixed; inset: 0 0 auto 0;
    z-index: 100;
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    background: rgba(10, 10, 11, 0.55);
    border-bottom: 1px solid transparent;
    transition: background .3s var(--ease), border-color .3s var(--ease);
}
.nav-wrap.is-scrolled {
    background: rgba(10, 10, 11, 0.85);
    border-bottom-color: var(--border);
}
.nav {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 1rem var(--pad);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}
.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.nav-brand__mark {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 14px var(--accent-glow), 0 0 30px var(--accent-glow);
    animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.25); opacity: .75; }
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}
.nav-links a {
    font-size: .92rem;
    color: var(--text-muted);
    transition: color .45s var(--ease), text-shadow .45s var(--ease);
    position: relative;
}
.nav-links a:hover {
    color: var(--text);
    text-shadow: 0 0 12px rgba(255, 106, 44, 0.55);
}
.nav-links a.is-active { color: var(--text); }
.nav-links a.is-active::after { transform: scaleX(1); }
.nav-links a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -6px;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .55s var(--ease);
}
.nav-links a:hover::after { transform: scaleX(1); }

.nav-cta {
    padding: .55rem 1.1rem !important;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    color: var(--text) !important;
    transition: all .5s var(--ease);
}
.nav-cta:hover {
    background: var(--accent);
    color: #111 !important;
    border-color: var(--accent);
}
.nav-cta::after { display: none; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; padding: .5rem; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); transition: all .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ HERO ============ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(255, 106, 44, 0.18), transparent 55%),
        radial-gradient(ellipse at 85% 70%, rgba(196, 60, 18, 0.22), transparent 55%),
        linear-gradient(180deg, #050506 0%, #0a0a0b 60%, #0a0a0b 100%);
}
.hero__overlay {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,.55) 100%),
        linear-gradient(180deg, rgba(0,0,0,.4) 0%, transparent 30%, rgba(0,0,0,.5) 100%);
    z-index: -1;
}

/* Hero photo — sharp portrait pinned to the right, fades into bokeh on the left */
.hero__photo {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 58%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    /* Soft mask so the left edge dissolves into the dark, top/bottom feather too */
    -webkit-mask-image:
        linear-gradient(90deg, transparent 0%, rgba(0,0,0,.4) 22%, #000 55%),
        linear-gradient(180deg, transparent 0%, #000 14%, #000 86%, transparent 100%);
    -webkit-mask-composite: source-in;
            mask-image:
        linear-gradient(90deg, transparent 0%, rgba(0,0,0,.4) 22%, #000 55%),
        linear-gradient(180deg, transparent 0%, #000 14%, #000 86%, transparent 100%);
            mask-composite: intersect;
}
.hero__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
    /* Warm color grade to harmonize daylight tones with the ember palette */
    filter:
        contrast(1.05)
        saturate(.92)
        brightness(.78)
        sepia(.18)
        hue-rotate(-8deg);
    mix-blend-mode: luminosity;
    opacity: .92;
}
/* Warm orange tint layered over the photo for extra blend */
.hero__photo::after {
    content: "";
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at 70% 40%, rgba(255, 106, 44, 0.22), transparent 60%),
        linear-gradient(180deg, rgba(10,10,11,.25) 0%, transparent 30%, rgba(10,10,11,.55) 100%);
    mix-blend-mode: overlay;
    pointer-events: none;
}
/* Soft inner shadow on the right edge so it feels seated */
.hero__photo::before {
    content: "";
    position: absolute; inset: 0;
    box-shadow: inset -120px 0 180px -80px rgba(10,10,11,.7);
    pointer-events: none;
    z-index: 1;
}

/* Bokeh — drifting amber orbs */
.bokeh {
    position: absolute; inset: 0;
    z-index: -2;
    pointer-events: none;
    filter: blur(32px);
}
.bokeh span {
    position: absolute;
    border-radius: 50%;
    opacity: .65;
    mix-blend-mode: screen;
    animation: drift 24s linear infinite;
}
.bokeh span:nth-child(1) { width: 320px; height: 320px; background: #ff6a2c; left: 8%;  top: 12%; animation-duration: 28s; animation-delay: -2s; }
.bokeh span:nth-child(2) { width: 240px; height: 240px; background: #ffb547; left: 70%; top: 18%; animation-duration: 22s; animation-delay: -7s; }
.bokeh span:nth-child(3) { width: 180px; height: 180px; background: #ff8a2c; left: 40%; top: 60%; animation-duration: 32s; animation-delay: -3s; }
.bokeh span:nth-child(4) { width: 280px; height: 280px; background: #c43c12; left: 80%; top: 65%; animation-duration: 26s; animation-delay: -12s; opacity: .5; }
.bokeh span:nth-child(5) { width: 140px; height: 140px; background: #ffb547; left: 22%; top: 70%; animation-duration: 30s; animation-delay: -9s; }
.bokeh span:nth-child(6) { width: 200px; height: 200px; background: #ff6a2c; left: 55%; top: 8%;  animation-duration: 34s; animation-delay: -1s; opacity: .4; }
.bokeh span:nth-child(7) { width: 120px; height: 120px; background: #ffd089; left: 88%; top: 38%; animation-duration: 20s; animation-delay: -5s; }
.bokeh span:nth-child(8) { width: 360px; height: 360px; background: #7a1f06; left: -8%; top: 55%; animation-duration: 36s; animation-delay: -15s; opacity: .55; }
.bokeh span:nth-child(9) { width: 90px;  height: 90px;  background: #fff0c0; left: 33%; top: 32%; animation-duration: 18s; animation-delay: -4s; opacity: .4; }
.bokeh span:nth-child(10){ width: 160px; height: 160px; background: #ff6a2c; left: 62%; top: 80%; animation-duration: 28s; animation-delay: -10s; }

@keyframes drift {
    0%   { transform: translate(0, 0) scale(1); }
    25%  { transform: translate(40px, -30px) scale(1.08); }
    50%  { transform: translate(-30px, -50px) scale(.95); }
    75%  { transform: translate(-50px, 30px) scale(1.05); }
    100% { transform: translate(0, 0) scale(1); }
}

/* Embers — sparse, slow, drift upward */
.embers {
    position: absolute; inset: 0;
    z-index: -2;
    pointer-events: none;
    overflow: hidden;
}
.embers span {
    position: absolute;
    bottom: -8px;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--accent-warm);
    box-shadow: 0 0 6px var(--accent), 0 0 12px var(--accent-glow);
    opacity: 0;
    animation: ember-rise linear infinite;
}
.embers span:nth-child(1) { left: 8%;  animation-duration: 16s; animation-delay: -2s; }
.embers span:nth-child(2) { left: 18%; animation-duration: 22s; animation-delay: -8s;  width: 3px; height: 3px; }
.embers span:nth-child(3) { left: 30%; animation-duration: 18s; animation-delay: -5s; }
.embers span:nth-child(4) { left: 42%; animation-duration: 24s; animation-delay: -1s;  width: 5px; height: 5px; }
.embers span:nth-child(5) { left: 53%; animation-duration: 17s; animation-delay: -11s; }
.embers span:nth-child(6) { left: 65%; animation-duration: 20s; animation-delay: -3s;  width: 3px; height: 3px; }
.embers span:nth-child(7) { left: 76%; animation-duration: 19s; animation-delay: -7s; }
.embers span:nth-child(8) { left: 87%; animation-duration: 23s; animation-delay: -13s; width: 4px; height: 4px; }
.embers span:nth-child(9) { left: 95%; animation-duration: 18s; animation-delay: -4s; }

@keyframes ember-rise {
    0%   { transform: translate(0, 0) scale(.5);  opacity: 0; }
    8%   { opacity: .85; }
    50%  { transform: translate(18px, -55vh) scale(1); opacity: .55; }
    92%  { opacity: .25; }
    100% { transform: translate(-12px, -110vh) scale(.3); opacity: 0; }
}

/* Soft grain overlay */
.hero::after {
    content: "";
    position: absolute; inset: 0;
    z-index: -1;
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/></svg>");
    opacity: .15;
    mix-blend-mode: overlay;
    pointer-events: none;
}

.hero__content {
    max-width: var(--maxw);
    width: 100%;
    margin: 0 auto;
    padding: 9rem var(--pad) 6rem;
    position: relative;
}
/* When the hero photo is present, keep text on the left half on wide screens */
@media (min-width: 900px) {
    .hero__title,
    .hero__sub,
    .hero__meta { max-width: 56%; }
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    font-family: var(--font-mono);
    font-size: .8rem;
    letter-spacing: .25em;
    text-transform: uppercase;
    color: var(--accent-warm);
    margin: 0 0 1.5rem;
    padding: .4rem .9rem;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface);
    backdrop-filter: blur(8px);
}
.eyebrow::before {
    content: "";
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
}

.hero__title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(2.8rem, 9vw, 6.5rem);
    line-height: 0.95;
    letter-spacing: -0.02em;
    margin: 0 0 1.5rem;
    text-transform: uppercase;
}
.hero__title .accent {
    background: linear-gradient(90deg, var(--accent-warm), var(--accent), var(--accent-deep));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero__sub {
    max-width: 640px;
    font-size: clamp(1rem, 1.4vw, 1.18rem);
    color: var(--text-muted);
    margin: 0 0 2.5rem;
}

.hero__cta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 4rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .95rem 1.6rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: .95rem;
    letter-spacing: .01em;
    transition: all .55s var(--ease);
    border: 1px solid transparent;
    cursor: pointer;
}
.btn--primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    color: #fff;
    box-shadow: 0 10px 30px -8px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.2);
}
.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px -10px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn--ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border-strong);
}
.btn--ghost:hover {
    background: var(--surface-strong);
    border-color: var(--accent);
}

.hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    max-width: 640px;
}
.hero__meta div {
    display: flex;
    flex-direction: column;
}
.hero__meta span {
    font-family: var(--font-mono);
    font-size: .72rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: .25rem;
}
.hero__meta strong {
    font-weight: 500;
    color: var(--text);
    font-size: .95rem;
}

.hero__scroll {
    position: absolute;
    bottom: 2rem; left: 50%;
    transform: translateX(-50%);
    width: 24px; height: 38px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    padding-top: 6px;
}
.hero__scroll span {
    width: 2px; height: 8px;
    background: var(--accent);
    border-radius: 2px;
    animation: scroll-tick 1.8s ease-in-out infinite;
}
@keyframes scroll-tick {
    0%   { transform: translateY(0); opacity: 1; }
    70%  { transform: translateY(14px); opacity: 0; }
    100% { transform: translateY(0); opacity: 0; }
}

/* ============ SECTIONS ============ */
.section {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: clamp(5rem, 10vw, 8rem) var(--pad);
    position: relative;
}
.section--alt {
    max-width: none;
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.section--alt > * {
    max-width: var(--maxw);
    margin-left: auto;
    margin-right: auto;
}
.section--alt > *:first-child { padding-top: clamp(5rem, 10vw, 8rem); }
.section--alt > *:last-child  { padding-bottom: clamp(5rem, 10vw, 8rem); }
.section--alt {
    padding-top: 0;
    padding-bottom: 0;
}
.section--alt .section__head,
.section--alt .cert-grid,
.section--alt .skills-grid {
    padding-left: var(--pad);
    padding-right: var(--pad);
}

.section__head {
    display: flex;
    align-items: baseline;
    gap: 1.25rem;
    margin-bottom: 3rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}
.section__num {
    font-family: var(--font-mono);
    font-size: .85rem;
    letter-spacing: .25em;
    color: var(--accent);
}
.section__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    letter-spacing: -0.01em;
    margin: 0;
    text-transform: uppercase;
}

/* ============ ABOUT ============ */
.about-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 4rem;
    align-items: start;
}
.about-copy .lead {
    font-size: clamp(1.15rem, 1.6vw, 1.35rem);
    color: var(--text);
    line-height: 1.5;
    margin: 0 0 1.5rem;
}
.about-copy p {
    color: var(--text-muted);
    margin: 0 0 1.25rem;
}
.about-copy strong {
    color: var(--accent-warm);
    font-weight: 600;
}

.about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.stat {
    padding: 1.5rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all .6s var(--ease);
}
.stat:hover {
    border-color: var(--accent);
    background: var(--surface-strong);
    transform: translateY(-3px);
    box-shadow: 0 0 24px -6px var(--accent-glow);
}
.stat__num {
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--accent-warm);
    margin-bottom: .35rem;
    line-height: 1;
}
.stat__label {
    font-size: .82rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ============ CERTIFICATIONS ============ */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}
.cert {
    padding: 1.75rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    position: relative;
    transition: all .65s var(--ease);
    overflow: hidden;
}
.cert::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(180deg, var(--accent), transparent);
    opacity: 0;
    transition: opacity .6s var(--ease);
}
.cert:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
    background: var(--surface-strong);
    box-shadow: 0 0 28px -6px var(--accent-glow);
}
.cert:hover::before { opacity: 1; }
.cert__tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: .68rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(255, 106, 44, 0.1);
    padding: .3rem .65rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}
.cert h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem;
    margin: 0 0 .65rem;
    letter-spacing: .005em;
}
.cert p {
    color: var(--text-muted);
    font-size: .94rem;
    margin: 0;
    line-height: 1.55;
}
.cert--placeholder {
    background: transparent;
    border-style: dashed;
}
.cert--placeholder .cert__tag {
    color: var(--accent-warm);
    background: rgba(255, 181, 71, 0.08);
}

/* ============ TIMELINE ============ */
.timeline {
    position: relative;
    padding-left: 2rem;
}
.timeline::before {
    content: "";
    position: absolute;
    left: 7px; top: 8px; bottom: 8px;
    width: 1px;
    background: linear-gradient(180deg, var(--accent), var(--border) 50%, transparent);
}
.timeline__item {
    position: relative;
    padding-bottom: 3rem;
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__marker {
    position: absolute;
    left: -2rem;
    top: 8px;
    width: 15px; height: 15px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 4px rgba(255, 106, 44, 0.12);
}
.timeline__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: .75rem;
}
.timeline__where {
    font-family: var(--font-mono);
    font-size: .78rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--accent-warm);
}
.timeline__when {
    font-family: var(--font-mono);
    font-size: .78rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.timeline__when--accent {
    color: var(--accent);
    padding: .2rem .6rem;
    border: 1px solid var(--accent);
    border-radius: 999px;
    background: rgba(255, 106, 44, 0.08);
}
.timeline__item--incoming .timeline__marker {
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(255, 106, 44, 0.18), 0 0 16px var(--accent-glow);
    animation: pulse 2.4s ease-in-out infinite;
}
.timeline__body h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.4rem, 2.4vw, 1.85rem);
    letter-spacing: 0;
    margin: 0 0 .75rem;
}
.timeline__body p {
    color: var(--text-muted);
    margin: 0 0 1rem;
    max-width: 720px;
}
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.chips li {
    font-size: .8rem;
    padding: .35rem .8rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-muted);
    background: var(--surface);
}

/* ============ SKILLS ============ */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}
.skill {
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    transition: all .6s var(--ease);
}
.skill:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 0 24px -6px var(--accent-glow);
}
.skill h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    margin: 0 0 .5rem;
}
.skill p {
    color: var(--text-muted);
    font-size: .92rem;
    margin: 0;
}

/* ============ SERVICES ============ */
.section__intro {
    max-width: 780px;
    color: var(--text-muted);
    font-size: clamp(1rem, 1.3vw, 1.1rem);
    margin: -1.5rem 0 2.5rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 1.25rem;
}
.service {
    position: relative;
    padding: 2rem 1.75rem 1.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
    transition: all .6s var(--ease);
    isolation: isolate;
}
.service::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, var(--accent), transparent 40%, transparent 60%, var(--accent-warm));
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    opacity: 0;
    transition: opacity .6s var(--ease);
    pointer-events: none;
    z-index: -1;
}
.service:hover {
    transform: translateY(-4px);
    background: var(--surface-strong);
    box-shadow: 0 0 28px -6px var(--accent-glow);
}
.service:hover::before { opacity: 1; }
.service__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .9rem;
}
.service__num {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: .72rem;
    letter-spacing: .25em;
    color: var(--accent);
}
.service__scope {
    font-family: var(--font-mono);
    font-size: .66rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: .25rem .6rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.02);
}
.service__scope--major {
    color: var(--accent-warm);
    border-color: var(--accent);
    background: rgba(255, 106, 44, 0.12);
}

/* The "major project" card gets a permanent subtle gradient outline + tint so it weighs more */
.service--major {
    background:
        radial-gradient(ellipse at top right, rgba(255, 106, 44, 0.08), transparent 60%),
        var(--surface);
}
.service--major::before {
    opacity: 0.6;
}
.service--major:hover::before { opacity: 1; }
.service h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 0;
    margin: 0 0 .65rem;
    line-height: 1.15;
}
.service p {
    color: var(--text-muted);
    font-size: .94rem;
    line-height: 1.55;
    margin: 0;
}

/* ============ CONTACT ============ */
.section--contact { padding-bottom: 6rem; }
.contact-card {
    padding: clamp(2rem, 5vw, 3.5rem);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background:
        radial-gradient(ellipse at top right, rgba(255, 106, 44, 0.15), transparent 60%),
        var(--surface);
    text-align: center;
}
.contact-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-family: var(--font-mono);
    font-size: .76rem;
    letter-spacing: .25em;
    text-transform: uppercase;
    color: var(--accent-warm);
    margin: 0 auto 1.25rem;
    padding: .4rem .9rem;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface);
}
.contact-eyebrow::before {
    content: "";
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
    animation: pulse 2.4s ease-in-out infinite;
}

.contact-card .lead {
    font-size: clamp(1.2rem, 2.1vw, 1.55rem);
    line-height: 1.45;
    color: var(--text);
    max-width: 720px;
    margin: 0 auto 1.5rem;
    text-align: center;
}

.contact-creds {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
    margin: 0 0 1.5rem;
    padding: 0;
    list-style: none;
}
.contact-creds li {
    font-family: var(--font-mono);
    font-size: .78rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--text);
    padding: .45rem .9rem;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface);
}

.contact-services {
    font-size: clamp(.95rem, 1.4vw, 1.05rem);
    color: var(--text-muted);
    max-width: 720px;
    margin: 0 auto 2.5rem;
    line-height: 1.55;
}
.contact-services strong {
    color: var(--accent-warm);
    font-weight: 600;
}

/* ============ Contact form (redesigned) ============ */
.contact-form {
    max-width: 560px;
    margin: 0 auto;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Honeypot */
.cf-honeypot {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

/* --- Chips (inquiry type) --- */
.cf-chips {
    border: 0;
    padding: 0;
    margin: 0;
}
.cf-chips legend {
    font-family: var(--font-mono);
    font-size: .7rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: .6rem;
    padding: 0;
}
.cf-chips__group {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.cf-chip {
    position: relative;
    cursor: pointer;
    user-select: none;
}
.cf-chip input {
    position: absolute;
    opacity: 0;
    inset: 0;
    cursor: pointer;
}
.cf-chip span {
    display: inline-block;
    padding: .45rem .9rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: .84rem;
    color: var(--text-muted);
    background: var(--surface);
    transition: all .4s var(--ease);
}
.cf-chip:hover span {
    color: var(--text);
    border-color: var(--border-strong);
}
.cf-chip input:checked + span {
    color: var(--text);
    border-color: var(--accent);
    background: rgba(255, 106, 44, 0.12);
    box-shadow: 0 0 18px -4px var(--accent-glow);
}
.cf-chip input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* --- Floating-label fields --- */
.cf-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.cf-field {
    position: relative;
}
.cf-field input,
.cf-field textarea {
    width: 100%;
    font: inherit;
    font-size: .95rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.15rem .9rem .45rem;
    transition: border-color .4s var(--ease), background .4s var(--ease), box-shadow .4s var(--ease);
}
.cf-field textarea {
    resize: vertical;
    min-height: 96px;
    padding-top: 1.25rem;
    line-height: 1.5;
    font-family: var(--font-sans);
}
.cf-field label {
    position: absolute;
    left: .95rem;
    top: .78rem;
    font-size: .95rem;
    color: var(--text-muted);
    pointer-events: none;
    transform-origin: left top;
    transition: transform .35s var(--ease), color .35s var(--ease);
}
.cf-field input:focus,
.cf-field textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 106, 44, 0.04);
    box-shadow: 0 0 0 3px rgba(255, 106, 44, 0.14);
}
.cf-field input:focus + label,
.cf-field input:not(:placeholder-shown) + label,
.cf-field textarea:focus + label,
.cf-field textarea:not(:placeholder-shown) + label {
    transform: translateY(-.5rem) scale(.78);
    color: var(--accent-warm);
}
.cf-field input:invalid:not(:placeholder-shown),
.cf-field textarea:invalid:not(:placeholder-shown) {
    border-color: rgba(220, 90, 90, 0.45);
}

/* --- Submit + status --- */
.cf-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-top: .4rem;
}
.cf-submit {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .75rem 1.4rem;
    border: 0;
    border-radius: 999px;
    font-weight: 600;
    font-size: .92rem;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    box-shadow:
        0 8px 24px -8px var(--accent-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    cursor: pointer;
    transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.cf-submit:hover {
    transform: translateY(-2px);
    box-shadow:
        0 16px 40px -10px var(--accent-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.cf-submit__arrow {
    display: inline-block;
    transition: transform .45s var(--ease);
}
.cf-submit:hover .cf-submit__arrow { transform: translateX(5px); }
.cf-submit[disabled] {
    opacity: .6;
    cursor: progress;
    transform: none;
}

.cf-status {
    margin: 0;
    font-size: .9rem;
    color: var(--text-muted);
    min-height: 1.2em;
    flex: 1;
}
.cf-status.is-success { color: var(--accent-warm); }
.cf-status.is-error   { color: #ff7a7a; }
@media (max-width: 560px) {
    .cf-row { grid-template-columns: 1fr; }
    .cf-submit { width: 100%; justify-content: center; }
}

/* ============ FLOATING SOCIALS FAN-OUT ============ */
.socials-fab {
    position: fixed;
    right: clamp(1rem, 3vw, 2rem);
    bottom: clamp(1rem, 3vw, 2rem);
    width: 56px;
    height: 56px;
    z-index: 90;
}

.socials-fab__trigger {
    position: absolute;
    inset: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 106, 44, 0.22), transparent 60%),
        var(--bg-elev);
    color: var(--text);
    cursor: pointer;
    box-shadow:
        0 10px 30px -8px rgba(0, 0, 0, 0.5),
        0 0 0 0 var(--accent-glow);
    transition: transform .55s var(--ease), border-color .5s var(--ease), box-shadow .5s var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.socials-fab__trigger:hover {
    transform: scale(1.06);
    border-color: var(--accent);
    box-shadow:
        0 14px 36px -8px rgba(0, 0, 0, 0.55),
        0 0 26px -4px var(--accent-glow);
}
.socials-fab__trigger:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}
.socials-fab__plus {
    color: var(--accent);
    transition: transform .55s var(--ease), color .35s var(--ease);
}
.socials-fab.is-open .socials-fab__trigger {
    transform: rotate(135deg);
    border-color: var(--accent);
}

/* Fan-out items */
.socials-fab__item {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transform: translate(0, 0) scale(.4);
    pointer-events: none;
    box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.55);
    transition:
        transform .6s cubic-bezier(.34, 1.56, .64, 1),
        opacity .35s var(--ease),
        box-shadow .4s var(--ease);
    z-index: 1;
}
.socials-fab__item:hover {
    box-shadow:
        0 12px 26px -6px rgba(0, 0, 0, 0.6),
        0 0 22px -4px currentColor;
}

/* Brand colors */
.socials-fab__item--ig   { background: linear-gradient(45deg, #f09433, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888); }
.socials-fab__item--li   { background: #0a66c2; }
.socials-fab__item--mail { background: linear-gradient(135deg, var(--accent), var(--accent-deep)); }
.socials-fab__item--ai   { background: linear-gradient(135deg, #5b3df5, #8e2bf0); }

/*
   Arc positions: 4 items spread evenly across the 90°→180° quarter
   (90, 120, 150, 180), radius 120px from trigger center.
*/
.socials-fab.is-open .socials-fab__item {
    opacity: 1;
    pointer-events: auto;
}
.socials-fab.is-open .socials-fab__item--ig   { transform: translate(0,     -120px) scale(1); transition-delay: .04s; }
.socials-fab.is-open .socials-fab__item--li   { transform: translate(-60px, -104px) scale(1); transition-delay: .10s; }
.socials-fab.is-open .socials-fab__item--mail { transform: translate(-104px, -60px) scale(1); transition-delay: .16s; }
.socials-fab.is-open .socials-fab__item--ai   { transform: translate(-120px,  0) scale(1);   transition-delay: .22s; }

@media (max-width: 480px) {
    .socials-fab,
    .socials-fab__trigger { width: 50px; height: 50px; }
    .socials-fab__item { width: 40px; height: 40px; bottom: 5px; right: 5px; }
    .socials-fab.is-open .socials-fab__item--ig   { transform: translate(0,    -100px) scale(1); }
    .socials-fab.is-open .socials-fab__item--li   { transform: translate(-50px, -87px) scale(1); }
    .socials-fab.is-open .socials-fab__item--mail { transform: translate(-87px, -50px) scale(1); }
    .socials-fab.is-open .socials-fab__item--ai   { transform: translate(-100px, 0)    scale(1); }
}

/* ============ FOOTER ============ */
.footer {
    border-top: 1px solid var(--border);
    padding: 2rem var(--pad);
    background: var(--bg-alt);
}
.footer__inner {
    max-width: var(--maxw);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    color: var(--text-dim);
    font-size: .88rem;
}
.footer__tag { font-style: italic; }

/* ============ REVEAL ANIMATIONS ============ */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal:nth-child(2) { transition-delay: .08s; }
.reveal:nth-child(3) { transition-delay: .16s; }
.reveal:nth-child(4) { transition-delay: .24s; }
.reveal:nth-child(5) { transition-delay: .32s; }
.reveal:nth-child(6) { transition-delay: .40s; }

/* ============ RESPONSIVE ============ */
@media (max-width: 860px) {
    .nav-toggle { display: flex; }
    .nav-links {
        position: fixed;
        inset: 64px 0 auto 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 1rem var(--pad) 2rem;
        background: rgba(10, 10, 11, 0.97);
        backdrop-filter: blur(18px);
        border-bottom: 1px solid var(--border);
        transform: translateY(-120%);
        transition: transform .35s var(--ease);
    }
    .nav-links.is-open { transform: translateY(0); }
    .nav-links li { border-bottom: 1px solid var(--border); }
    .nav-links a {
        display: block;
        padding: 1rem 0;
        font-size: 1.05rem;
        color: var(--text);
    }
    .nav-cta {
        margin-top: 1rem;
        text-align: center;
        border-radius: 999px !important;
        padding: .9rem 1.5rem !important;
    }

    .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
    .hero__meta { gap: 1.5rem; }
    .hero__content { padding-top: 7rem; padding-bottom: 5rem; }

    /* Mobile: photo goes full-bleed behind text with extra darkening */
    .hero__photo {
        width: 100%;
        opacity: .55;
        -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.5) 0%, #000 30%, #000 70%, transparent 100%);
                mask-image: linear-gradient(180deg, rgba(0,0,0,.5) 0%, #000 30%, #000 70%, transparent 100%);
    }
    .hero__photo img { object-position: center 18%; }
}

@media (max-width: 480px) {
    .hero__cta { flex-direction: column; align-items: stretch; }
    .btn { width: 100%; }
    .about-stats { grid-template-columns: 1fr; }
    .timeline { padding-left: 1.5rem; }
    .timeline__marker { left: -1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; }
}
