/* Spangler Development — shared styles across all pages */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #0a0e1a;
    --secondary: #0d1224;
    --hero-bg: #080b15;
    --accent: #c17a4f;       /* copper — primary accent */
    --accent-hi: #e8a878;
    --accent-lo: #a8623d;
    --teal: #5fb8ac;         /* teal — used sparingly */
    --text: #eef0f7;
    --text-muted: #8891ab;
    --border: #1c2236;
    --border-copper: #4a2f1f;
}

body {
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 20% 30%, rgba(193, 122, 79, 0.10) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(95, 184, 172, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container { position: relative; z-index: 1; max-width: 1000px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(10, 14, 26, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 20px;
}
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-mark { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.logo-text { font-size: 23px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.logo-text .dim { color: var(--text-muted); font-weight: 500; }

.nav-links { display: flex; gap: 6px; list-style: none; }
.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: color 0.25s, background 0.25s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active {
    background: #21150f;
    color: var(--accent-hi);
    border-color: var(--border-copper);
}

/* ---------- Page scaffolding ---------- */
main { position: relative; z-index: 1; }
.page-head { padding: 72px 0 12px; }
.eyebrow { font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); font-weight: 500; margin-bottom: 14px; }
.page-title { font-size: clamp(30px, 5vw, 44px); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 16px; }
.lead { color: var(--text-muted); max-width: 640px; font-size: 17px; }

/* ---------- Hero (Home) ---------- */
.hero { padding: 60px 0 100px; animation: fadeInUp 0.8s ease-out; }
.hero-layout { display: grid; grid-template-columns: 1fr 0.9fr; gap: 30px; align-items: center; }
.hero h1 { font-size: clamp(40px, 7vw, 66px); font-weight: 700; margin-bottom: 20px; line-height: 1.1; letter-spacing: -0.02em; }
.hero-highlight { color: var(--accent); }
.hero p { font-size: 18px; color: var(--text-muted); max-width: 600px; margin-bottom: 40px; line-height: 1.7; }

.hero-visual { position: relative; }
.hero-visual .scope-grid {
    position: absolute;
    inset: -6% -4%;
    background-image:
        repeating-linear-gradient(0deg, rgba(95,184,172,0.30) 0 1px, transparent 1px 28px),
        repeating-linear-gradient(90deg, rgba(95,184,172,0.30) 0 1px, transparent 1px 28px);
    opacity: 0.30;
    -webkit-mask-image: radial-gradient(ellipse 65% 60% at 50% 45%, #000 25%, transparent 75%);
    mask-image: radial-gradient(ellipse 65% 60% at 50% 45%, #000 25%, transparent 75%);
    pointer-events: none;
}
.hero-visual img { position: relative; display: block; width: 100%; height: auto; border-radius: 12px; }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Home v2: Hubtown-inspired bold hub ---------- */
.hero-xl {
    position: relative;
    padding: 80px 0 90px;
    overflow: hidden;
}
.hero-xl-inner {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    min-height: 62vh;
}
.hero-xl-copy { max-width: 640px; }
.hero-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 26px;
}
.display {
    font-size: clamp(46px, 9vw, 104px);
    font-weight: 700;
    line-height: 0.98;
    letter-spacing: -0.03em;
    margin-bottom: 28px;
}
.display .hero-highlight { color: var(--accent); }
.hero-xl-copy p.sub { font-size: 18px; color: var(--text-muted); max-width: 480px; margin-bottom: 36px; line-height: 1.7; }

.hero-xl-visual { position: relative; }
.hero-xl-visual img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: auto;
    border-radius: 14px;
    filter: drop-shadow(0 24px 60px rgba(193, 122, 79, 0.18));
}
.hero-xl-visual .glow {
    position: absolute;
    inset: 6% 6%;
    background: radial-gradient(circle at 50% 45%, rgba(193,122,79,0.22), transparent 62%);
    filter: blur(30px);
    z-index: 0;
}

/* Ambient heart loop — fixed centered backdrop behind all content */
.heart-video {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: min(94vh, 1000px);    /* native portrait aspect; never stretched */
    width: auto;
    z-index: 0;
    opacity: 0.55;                /* blends into the navy as atmosphere */
    pointer-events: none;
    /* fade the video edges into the navy so it reads as atmosphere */
    -webkit-mask-image: radial-gradient(ellipse 62% 68% at 50% 50%, #000 45%, transparent 92%);
    mask-image: radial-gradient(ellipse 62% 68% at 50% 50%, #000 45%, transparent 92%);
}

/* River of cubes — copper→teal drift */
.river {
    position: relative;
    height: 84px;
    margin: 8px 0 30px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.river .cube {
    position: absolute;
    top: 50%;
    width: 12px; height: 12px;
    border-radius: 2px;
    transform: translateY(-50%) rotate(0deg);
    animation: drift linear infinite;
    opacity: 0.85;
}
@keyframes drift {
    from { left: -4%; transform: translateY(-50%) rotate(0deg); }
    to   { left: 104%; transform: translateY(-50%) rotate(180deg); }
}

/* Hub tiles */
.hub { padding: 40px 0 30px; }
.hub-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.hub-head h2 { font-size: clamp(24px, 3.5vw, 34px); font-weight: 700; letter-spacing: -0.01em; }
.hub-head .mono { font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); }
.hub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.hub-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 220px;
    padding: 26px;
    background: rgba(13, 18, 36, 0.55);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    text-decoration: none;
    overflow: hidden;
    transition: border-color 0.3s, transform 0.3s;
}
.hub-tile:hover { border-color: var(--accent); transform: translateY(-6px); }

/* Shared cursor-reveal glow across interactive cards */
.hub-tile, .portfolio-item, .contact-card { position: relative; overflow: hidden; }
.hub-tile::before, .portfolio-item::before, .contact-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(193,122,79,0.16), transparent 60%);
    opacity: 0;
    transition: opacity 0.35s;
    pointer-events: none;
    z-index: 0;
}
.hub-tile:hover::before, .portfolio-item:hover::before, .contact-card:hover::before { opacity: 1; }
.hub-tile > *, .portfolio-item > *, .contact-card > * { position: relative; z-index: 1; }

/* Scroll-reveal (only when JS is active, so no-JS content stays visible) */
.js [data-reveal] { opacity: 0; transform: translateY(24px); }
[data-reveal].in { opacity: 1; transform: none; transition: opacity 0.6s ease, transform 0.6s ease; }
@media (prefers-reduced-motion: reduce) { .js [data-reveal] { opacity: 1; transform: none; } }
.hub-tile .num { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--accent); letter-spacing: 0.1em; }
.hub-tile h3 { font-size: 26px; font-weight: 700; margin-top: 10px; letter-spacing: -0.01em; color: var(--text); }
.hub-tile p { color: var(--text-muted); font-size: 14px; margin-top: 10px; flex: 1; }
.hub-tile .go { font-size: 22px; color: var(--accent); transition: transform 0.3s; }
.hub-tile:hover .go { transform: translateX(6px); }

@media (max-width: 768px) {
    .hero-xl { padding: 24px 0 50px; }
    .hero-xl-inner { grid-template-columns: 1fr; gap: 24px; min-height: 56vh; }
    .heart-video { height: min(64vh, 560px); opacity: 0.45; }
    .hub-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .river .cube { animation: none; }
    .hub-tile:hover { transform: none; }
}

/* ---------- Buttons ---------- */
.cta-button {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-lo) 100%);
    color: #16120e;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.25s, box-shadow 0.25s;
}
.cta-button:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(193, 122, 79, 0.3); }
.btn-outline {
    display: inline-block;
    padding: 12px 28px;
    border: 2px solid var(--accent);
    color: var(--accent);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.25s, color 0.25s;
}
.btn-outline:hover { background: var(--accent); color: #16120e; }

/* ---------- About ---------- */
.about {
    margin: 40px 0 100px;
    padding: 56px 40px;
    background: rgba(13, 18, 36, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    animation: fadeInUp 1s ease-out;
}
.about h2 { font-size: 26px; margin-bottom: 18px; color: var(--accent); }
.about p { color: var(--text-muted); margin-bottom: 14px; }
.about p:last-child { margin-bottom: 0; }

/* ---------- Cards (Services) ---------- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin: 48px 0 60px;
}
.portfolio-item {
    background: rgba(13, 18, 36, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
    transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
    animation: fadeInUp 1s ease-out;
}
.portfolio-item:hover { border-color: var(--accent); transform: translateY(-6px); box-shadow: 0 18px 40px rgba(0,0,0,0.35); }
.portfolio-item h3 { font-size: 19px; margin-bottom: 12px; color: var(--text); }
.portfolio-item p { color: var(--text-muted); font-size: 14px; margin-bottom: 18px; line-height: 1.6; }
.portfolio-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tag {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    background: rgba(193, 122, 79, 0.08);
    color: var(--accent-hi);
    padding: 4px 11px;
    border-radius: 6px;
    font-size: 12px;
    border: 1px solid var(--border-copper);
}
.portfolio-link { color: var(--accent); text-decoration: none; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; transition: gap 0.25s, color 0.25s; }
.portfolio-link:hover { gap: 12px; color: var(--accent-hi); }

/* ---------- ECG monitor band (Services) ---------- */
.ecg-band {
    position: relative;
    height: 92px;
    margin: 6px 0 26px;
    overflow: hidden;
}
.ecg-band svg { width: 100%; height: 100%; display: block; }
.ecg-track {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    opacity: 0.14;
}
.ecg-trace {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 300 1300;
    stroke-dashoffset: 1600;
    animation: ecgSweep 5.5s linear infinite;
    filter: drop-shadow(0 0 5px rgba(193, 122, 79, 0.55));
}
@keyframes ecgSweep { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
    .ecg-trace { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; filter: none; }
}

/* ---------- Large pulse mark (Contact) ---------- */
.contact-pulse {
    display: flex;
    justify-content: center;
    margin: 4px 0 8px;
}
.contact-pulse svg { width: 130px; height: 130px; overflow: visible; }
.contact-pulse path {
    fill: none;
    stroke: var(--accent);
    stroke-width: 4.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 180;
    stroke-dashoffset: 180;
    animation: draw 1.6s ease-out forwards, glow 3.2s ease-in-out 1.8s infinite;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes glow {
    0%, 100% { filter: drop-shadow(0 0 0 rgba(193,122,79,0)); }
    50%      { filter: drop-shadow(0 0 8px rgba(193,122,79,0.6)); }
}
@media (prefers-reduced-motion: reduce) {
    .contact-pulse path { animation: none; stroke-dashoffset: 0; }
}

/* ---------- Artery map (Products) ---------- */
.artery-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1000 / 520;
    margin: 34px 0 70px;
}
.artery-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.artery { fill: none; stroke: var(--border-copper); stroke-width: 2.5; transition: stroke 0.3s; }
.artery-flow {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 9 15;
    animation: flow 2.4s linear infinite;
    transition: stroke 0.3s, stroke-width 0.3s;
}
@keyframes flow { to { stroke-dashoffset: -96; } }
.artery.active { stroke: var(--accent); }
.artery-flow.active { stroke: var(--accent-hi); stroke-width: 3.4; }

/* Nodes overlaid on the SVG (percent-positioned to match viewBox mapping) */
.node { position: absolute; transform: translate(-50%, -50%); text-align: center; }
.heart-hub { width: 30%; max-width: 240px; }
.heart-hub img {
    width: 100%; height: auto;
    border-radius: 50%;
    aspect-ratio: 1; object-fit: cover;
    border: 1px solid var(--border-copper);
    box-shadow: 0 0 40px rgba(193,122,79,0.25);
}
.heart-hub .hub-label {
    display: block; margin-top: 10px;
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
    letter-spacing: 0.16em; text-transform: uppercase; color: var(--teal);
}
.prod-node {
    display: block;
    min-width: 150px;
    padding: 14px 18px;
    background: rgba(13, 18, 36, 0.85);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    backdrop-filter: blur(4px);
    transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.prod-node:hover { border-color: var(--accent); transform: translate(-50%, -50%) scale(1.05); box-shadow: 0 12px 30px rgba(0,0,0,0.4); }
.prod-node .nlabel { display: block; color: var(--text); font-weight: 700; font-size: 16px; }
.prod-node .nstatus { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.prod-node .nstatus .dot { width: 6px; height: 6px; border-radius: 50%; }
.nstatus.live .dot { background: var(--teal); box-shadow: 0 0 6px rgba(95,184,172,0.7); }
.nstatus.dev .dot { background: var(--accent); }

.status-badge {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
    margin-bottom: 16px;
}
.status-badge.live { color: var(--teal); }
.status-badge.dev { color: var(--accent-hi); }

@media (max-width: 768px) {
    .artery-wrap { display: none; }  /* map collapses; detail cards carry the page on mobile */
}
@media (prefers-reduced-motion: reduce) {
    .artery-flow { animation: none; }
}

/* ---------- Featured (Products) ---------- */
.featured-project {
    background: linear-gradient(135deg, rgba(193, 122, 79, 0.10) 0%, rgba(95, 184, 172, 0.06) 100%);
    border: 1px solid var(--border-copper);
    border-radius: 16px;
    padding: 52px 44px;
    margin: 48px 0 80px;
    text-align: center;
    animation: fadeInUp 1s ease-out;
}
.featured-project .badge {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--teal); margin-bottom: 16px;
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 6px rgba(95,184,172,0.7); animation: pulseDot 2.2s ease-in-out infinite; }
@keyframes pulseDot { 0%,100%{opacity:1;} 50%{opacity:0.35;} }
.featured-project h2 { font-size: 30px; margin-bottom: 16px; color: var(--accent); }
.featured-project .desc { color: var(--text-muted); max-width: 620px; margin: 0 auto 20px; font-size: 16px; }
.featured-disclaimer { color: var(--text-muted); opacity: 0.7; font-size: 13px; font-style: italic; max-width: 600px; margin: 0 auto 28px; }

/* ---------- Contact ---------- */
.contact-methods { display: flex; flex-wrap: wrap; gap: 16px; margin: 40px 0 80px; }
.contact-card {
    flex: 1 1 220px;
    background: rgba(13, 18, 36, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 26px;
    text-decoration: none;
    transition: border-color 0.25s, transform 0.25s;
}
.contact-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.contact-card .label { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.contact-card .value { color: var(--text); font-size: 16px; font-weight: 600; }

/* ---------- Footer ---------- */
footer { position: relative; z-index: 1; border-top: 1px solid var(--border); padding: 50px 0; text-align: center; margin-top: 40px; }
.social-links { display: flex; justify-content: center; gap: 22px; margin-bottom: 24px; flex-wrap: wrap; }
.social-links a { color: var(--text-muted); text-decoration: none; font-size: 14px; transition: color 0.25s; }
.social-links a:hover { color: var(--accent); }
.footer-text { color: var(--text-muted); font-size: 13.5px; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .header-content { justify-content: center; }
    .nav-links { gap: 4px; font-size: 13px; flex-wrap: wrap; justify-content: center; }
    .nav-links a { padding: 7px 12px; }
    .hero { padding: 30px 0 60px; }
    .hero-layout { grid-template-columns: 1fr; }
    .hero-visual { order: -1; max-width: 400px; margin: 0 auto; }
    .hero h1 { font-size: 40px; }
    .about { padding: 36px 24px; }
    .featured-project { padding: 34px 22px; }
    .portfolio-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .hero, .about, .portfolio-item, .featured-project { animation: none; }
    .live-dot { animation: none; }
    .portfolio-item:hover, .cta-button:hover, .contact-card:hover { transform: none; }
}
