@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg: #08080a;
    --bg-soft: #0e0e12;
    --border: rgba(255, 255, 255, 0.1);
    --border-soft: rgba(255, 255, 255, 0.07);
    --surface: rgba(255, 255, 255, 0.03);
    --text-primary: #f2f1ee;
    --text-muted: #93939c;
    --accent: #7fe3ff;
    --accent-ink: #07080a;
    --violet: #b39dff;
    --pink: #ff9de3;
}

* { box-sizing: border-box; }

body, html {
    margin: 0; padding: 0;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, .wordmark {
    font-family: 'Space Grotesk', sans-serif;
}

a { color: inherit; }

/* ---- Structured grid background texture (very restrained) ---- */

.grid-overlay {
    position: fixed; inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 0%, transparent 75%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 0%, transparent 75%);
}

/* ---- Nav ---- */

.site-nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 22px 6vw;
    position: relative; z-index: 10;
    border-bottom: 1px solid var(--border-soft);
}

.wordmark {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    text-decoration: none;
}

.wordmark .tld {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85em;
}

.wordmark .tld-dot {
    color: var(--accent);
}

.nav-cta {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid var(--border);
    padding: 9px 20px;
    cursor: pointer;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    transition: border-color 0.25s ease, color 0.25s ease;
}

.nav-cta:hover,
.nav-cta:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
    outline: none;
}

.nav-cta:focus-visible {
    outline: 1px solid var(--accent);
    outline-offset: 3px;
}

@media (max-width: 650px) {
    .site-nav { padding: 16px 5vw; }
    .nav-cta { padding: 8px 14px; font-size: 0.78rem; }
}

/* ---- Shared section width ---- */

.section-inner {
    position: relative; z-index: 2;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 6vw;
}

/* ---- Hero ---- */

.hero {
    position: relative; z-index: 2;
    padding: 11vh 0 9vh;
}

.hero-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 6vw;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: 4vw;
}

.eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 22px;
}

.hero h1 {
    font-size: clamp(1.95rem, 4.1vw, 3.25rem);
    line-height: 1.1;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.hero .lead {
    margin: 26px 0 0;
    max-width: 480px;
    font-size: clamp(1rem, 1.3vw, 1.1rem);
    color: var(--text-muted);
    line-height: 1.7;
}

.cta-primary {
    display: inline-block;
    margin-top: 34px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-ink);
    background: var(--accent);
    border: none;
    padding: 15px 30px;
    cursor: pointer;
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    box-shadow: 0 2px 12px rgba(127, 227, 255, 0.08);
}

.cta-primary:hover,
.cta-primary:focus-visible {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow: 0 4px 18px rgba(127, 227, 255, 0.14);
    outline: none;
}

.cta-primary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* ---- Hero visual: faceted digital gem ---- */

.hero-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-visual::before {
    content: '';
    position: absolute;
    inset: -10%;
    background: radial-gradient(ellipse 55% 55% at 50% 48%,
        rgba(127, 227, 255, 0.14) 0%,
        rgba(179, 157, 255, 0.08) 42%,
        rgba(179, 157, 255, 0) 72%);
    filter: blur(28px);
    pointer-events: none;
    z-index: 0;
}

.hero-visual svg {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 500px;
    height: auto;
}

.gem-crystal {
    transform-box: fill-box;
    transform-origin: center;
    animation: gemDrift 16s ease-in-out infinite;
}

.gem-facet {
    animation: facetShimmer 6s ease-in-out infinite;
}
.gem-facet-b { animation-delay: 1.4s; }
.gem-facet-c { animation-delay: 2.8s; }

.gem-node {
    transform-box: fill-box;
    transform-origin: center;
}

.gem-node-active {
    animation: gemPulse 3.2s ease-in-out infinite;
}
.gem-node-active:nth-of-type(2) { animation-delay: 0.6s; }
.gem-node-active:nth-of-type(3) { animation-delay: 1.4s; }

.gem-node-core {
    animation: gemPulse 2.4s ease-in-out infinite;
}

.gem-flow-line {
    stroke-dasharray: 3 7;
    animation: gemFlow 3.5s linear infinite;
}
.gem-flow-line:nth-of-type(2) { animation-delay: 0.6s; }
.gem-flow-line:nth-of-type(3) { animation-delay: 1.2s; }
.gem-flow-line:nth-of-type(4) { animation-delay: 1.8s; }

@keyframes gemDrift {
    0%, 100% { transform: rotate(-1.5deg) scale(1); }
    50%      { transform: rotate(1.5deg) scale(1.015); }
}

@keyframes facetShimmer {
    0%, 100% { fill-opacity: 0.12; }
    50%      { fill-opacity: 0.26; }
}

@keyframes gemPulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50%      { opacity: 1; transform: scale(1.35); }
}

@keyframes gemFlow {
    to { stroke-dashoffset: -40; }
}

@keyframes markerGlow {
    0%, 100% { opacity: 0.45; }
    50%      { opacity: 0.9; }
}

@keyframes markerGlowStrong {
    0%, 100% { opacity: 0.65; }
    50%      { opacity: 1; }
}

@media (max-width: 860px) {
    .hero-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero .lead { margin-left: auto; margin-right: auto; }
    .hero-visual { margin-top: 6vh; }
    .hero-visual svg { max-width: 320px; }
}

@media (max-width: 600px) {
    .hero { padding: 8vh 0 6vh; }
}

/* ---- Capabilities ---- */

.capabilities {
    position: relative; z-index: 2;
    padding: 7vh 0;
    border-top: 1px solid var(--border-soft);
}

.cap-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 32px;
    padding: 27px 0;
    border-bottom: 1px solid var(--border-soft);
    transition: border-color 0.35s ease, background-color 0.35s ease;
}

.cap-row:first-child { border-top: 1px solid var(--border-soft); }

.cap-row:hover {
    border-bottom-color: rgba(127, 227, 255, 0.22);
    background-color: rgba(255, 255, 255, 0.012);
}

.cap-row:hover .cap-facet {
    animation-play-state: paused;
    opacity: 0.9;
}

.cap-index {
    display: flex;
    align-items: center;
    gap: 9px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--accent);
    letter-spacing: 0.05em;
    padding-top: 3px;
}

.cap-facet {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: linear-gradient(135deg, var(--accent), var(--violet));
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    animation: markerGlow 7s ease-in-out infinite;
}

.cap-row:nth-child(2) .cap-facet { animation-delay: 1.6s; }
.cap-row:nth-child(3) .cap-facet { animation-delay: 3.2s; }

.cap-body h3 {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0 0 10px;
    color: var(--text-primary);
}

.cap-body p {
    margin: 0;
    max-width: 620px;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.7;
}

@media (max-width: 600px) {
    .cap-row { grid-template-columns: 1fr; gap: 10px; padding: 26px 0; }
}

/* ---- Approach ---- */

.approach {
    position: relative; z-index: 2;
    padding: 9vh 0;
    border-top: 1px solid var(--border-soft);
}

.approach-inner {
    max-width: 720px;
    text-align: center;
}

.approach-facet {
    display: inline-block;
    width: 13px;
    height: 13px;
    margin-bottom: 22px;
    background: linear-gradient(135deg, var(--accent), var(--pink));
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    filter: drop-shadow(0 0 6px rgba(127, 227, 255, 0.3));
    animation: markerGlowStrong 7s ease-in-out infinite;
}

.approach h2 {
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 20px;
    color: var(--text-primary);
}

.approach p {
    margin: 0;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.75;
}

/* ---- Final CTA ---- */

.final-cta {
    position: relative; z-index: 2;
    padding: 9vh 0 11vh;
    border-top: 1px solid var(--border-soft);
    text-align: center;
}

.final-cta-inner {
    max-width: 640px;
}

.final-cta h2 {
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 22px;
    color: var(--text-primary);
}

/* ---- Footer ---- */

.site-footer {
    position: relative; z-index: 2;
    padding: 30px 6vw 40px;
    border-top: 1px solid var(--border-soft);
}

.footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-brand {
    color: var(--text-primary);
    font-weight: 500;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.footer-link:hover,
.footer-link:focus-visible {
    color: var(--accent);
}

/* ---- Modal (matches egemnetwork.com contact modal conventions) ---- */

.egem-modal-content {
    background: #0a0a0c;
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--text-primary);
}

.egem-modal-header {
    border-bottom: 1px solid var(--border-soft);
    padding: 24px 28px 20px;
}

.egem-modal-title {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-primary);
    margin: 0;
}

.egem-modal-body {
    padding: 28px;
}

.egem-form-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: block;
}

.egem-form-control {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    color: var(--text-primary) !important;
    font-size: 0.9rem;
    padding: 12px 14px;
    transition: border-color 0.3s;
}

.egem-form-control::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.egem-form-control:focus {
    outline: none;
    box-shadow: none !important;
    border-color: var(--accent) !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

.egem-form-submit {
    display: block;
    width: 100%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-primary);
    padding: 14px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 0;
    margin-top: 8px;
}

.egem-form-submit:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

.egem-form-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-status {
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.85rem;
}

.form-status.success {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: #4ade80;
}

.form-status.error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: #f87171;
}

/* ---- Reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
