/* ===========================================
   SpCraft Landing Page — Design System
   =========================================== */

/* --- Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

button { font: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

/* --- Design tokens --- */
:root {
    --bg:           #09111E;
    --surface:      #0F1C30;
    --surface-hi:   #152338;
    --text:         #E8EEFF;
    --text-2:       #6A7BA8;
    --gold:         #F5C842;
    --cobalt:       #3366FF;
    --cobalt-dim:   rgba(51, 102, 255, 0.1);
    --cobalt-border:rgba(51, 102, 255, 0.22);
    --line:         rgba(232, 238, 255, 0.07);
    --line-solid:   #1A2A45;

    --font-display: 'Space Grotesk', system-ui, sans-serif;
    --font-body:    'DM Sans', system-ui, sans-serif;
    --font-mono:    'JetBrains Mono', 'Courier New', monospace;

    --max-w:        1160px;
    --nav-h:        68px;
    --section-py:   6rem;
    --radius:       10px;
}

/* --- Base --- */
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Layout helpers --- */
.lp-container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.lp-section {
    padding: var(--section-py) 0;
}

.lp-section-alt {
    background-color: var(--surface);
}

/* Anchor offset for fixed nav */
#services, #process, #about, #contact {
    scroll-margin-top: calc(var(--nav-h) + 1.5rem);
}

/* --- Nav --- */
.lp-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--nav-h);
    border-bottom: 1px solid transparent;
    transition: background 0.3s, border-color 0.3s;
}

.lp-nav--scrolled {
    background-color: rgba(9, 17, 30, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom-color: var(--line);
}

.lp-nav-inner {
    max-width: var(--max-w);
    height: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.lp-logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}

.lp-logo-craft { color: var(--gold); }

.lp-nav-links {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

.lp-nav-links a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-2);
    transition: color 0.2s;
    white-space: nowrap;
}

.lp-nav-links a:hover { color: var(--text); }

.lp-nav-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--text);
    padding: 0.25rem;
}

/* Mobile nav */
.lp-mobile-nav {
    display: none;
    background-color: rgba(9, 17, 30, 0.97);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    z-index: 99;
    padding: 0 1.5rem;
}

.lp-mobile-nav--open { display: flex; flex-direction: column; }

.lp-mobile-nav a {
    display: block;
    padding: 1rem 0;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text);
    border-bottom: 1px solid var(--line);
}

.lp-mobile-nav a:last-of-type { border-bottom: none; margin-bottom: 1rem; }

/* --- Buttons --- */
.lp-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    border-radius: 7px;
    padding: 0.65rem 1.35rem;
    line-height: 1;
    white-space: nowrap;
    transition: opacity 0.2s, transform 0.15s, background 0.2s, color 0.2s, border-color 0.2s;
}

.lp-btn-primary {
    background-color: var(--cobalt);
    color: #fff;
}
.lp-btn-primary:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    color: #fff;
}

.lp-btn-ghost {
    background: transparent;
    color: var(--text-2);
    border: 1px solid var(--line-solid);
}
.lp-btn-ghost:hover {
    color: var(--text);
    border-color: rgba(232, 238, 255, 0.22);
}

.lp-btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line-solid);
    padding: 0.75rem 1.75rem;
    font-size: 0.95rem;
}
.lp-btn-outline:hover {
    border-color: rgba(232, 238, 255, 0.25);
    background-color: rgba(232, 238, 255, 0.04);
}

/* --- Hero --- */
.lp-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: var(--nav-h);
}

.lp-hero-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 5rem 1.5rem 4rem;
    width: 100%;
}

.lp-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 2rem;
    opacity: 0.9;
}

.lp-eyebrow-slash { opacity: 0.4; }

.lp-hero-h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(3.25rem, 7.5vw, 6.5rem);
    line-height: 0.94;
    letter-spacing: -0.035em;
    color: var(--text);
    margin-bottom: 1.75rem;
}

.lp-hero-highlight { color: var(--gold); }

.lp-cursor {
    display: inline-block;
    color: var(--gold);
    font-weight: 400;
    animation: cursor-blink 1.1s step-end infinite;
    margin-left: 0.04em;
}

@keyframes cursor-blink {
    0%, 49%  { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.lp-hero-sub {
    font-size: 1.1rem;
    color: var(--text-2);
    line-height: 1.7;
    max-width: 500px;
    margin-bottom: 2.5rem;
}

.lp-hero-actions {
    display: flex;
    gap: 0.875rem;
    flex-wrap: wrap;
}

/* --- Ticker --- */
.lp-ticker {
    border-top: 1px solid var(--line);
    overflow: hidden;
    position: relative;
    padding: 1rem 0;
    user-select: none;
}

.lp-ticker::before,
.lp-ticker::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    width: 100px;
    z-index: 1;
    pointer-events: none;
}

.lp-ticker::before { left: 0;  background: linear-gradient(to right, var(--bg) 30%, transparent); }
.lp-ticker::after  { right: 0; background: linear-gradient(to left,  var(--bg) 30%, transparent); }

.lp-ticker-track {
    display: inline-flex;
    width: max-content;
    animation: ticker-run 34s linear infinite;
}

.lp-ticker-item {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-2);
    white-space: nowrap;
    padding: 0 2.5rem;
    flex-shrink: 0;
}

.lp-ticker-item strong {
    color: var(--gold);
    font-weight: 500;
}

@keyframes ticker-run {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* --- Section headings --- */
.lp-section-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--cobalt);
    margin-bottom: 0.875rem;
}

.lp-h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.75rem, 3.5vw, 2.75rem);
    line-height: 1.1;
    letter-spacing: -0.028em;
    color: var(--text);
    margin-bottom: 0.875rem;
}

.lp-section-sub {
    font-size: 1.05rem;
    color: var(--text-2);
    line-height: 1.65;
    max-width: 460px;
}

/* --- Services --- */
.lp-services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background-color: var(--line-solid);
    border: 1px solid var(--line-solid);
    border-radius: var(--radius);
    overflow: hidden;
    gap: 1px;
    margin-top: 3.5rem;
}

.lp-service-card {
    background-color: var(--surface);
    padding: 2.25rem 2rem;
    transition: background-color 0.2s;
}

.lp-service-card:hover { background-color: var(--surface-hi); }

.lp-svc-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: var(--cobalt-dim);
    border: 1px solid var(--cobalt-border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    color: var(--cobalt);
    flex-shrink: 0;
}

.lp-svc-icon svg { width: 18px; height: 18px; }

.lp-svc-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: -0.015em;
    color: var(--text);
    margin-bottom: 0.6rem;
}

.lp-svc-desc {
    font-size: 0.925rem;
    color: var(--text-2);
    line-height: 1.65;
    margin-bottom: 1.5rem;
}

.lp-svc-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.lp-tag {
    font-family: var(--font-mono);
    font-size: 0.67rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--text-2);
    background-color: var(--bg);
    border: 1px solid var(--line-solid);
    border-radius: 4px;
    padding: 0.2rem 0.55rem;
}

/* --- Process --- */
.lp-process-grid {
    display: flex;
    margin-top: 3.5rem;
}

.lp-step {
    flex: 1;
    position: relative;
}

.lp-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 23px;
    left: 48px;
    right: -1px;
    height: 1px;
    background-color: var(--line-solid);
    z-index: 0;
}

.lp-step-dot {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--surface);
    border: 1px solid var(--line-solid);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--gold);
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.lp-step-pad {
    padding-right: 2rem;
}

.lp-step-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.015em;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.lp-step-desc {
    font-size: 0.9rem;
    color: var(--text-2);
    line-height: 1.6;
}

/* --- Why --- */
.lp-why-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3.5rem;
}

.lp-why-card {
    border-top: 2px solid var(--cobalt);
    padding-top: 1.5rem;
}

.lp-why-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: -0.015em;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.lp-why-desc {
    font-size: 0.925rem;
    color: var(--text-2);
    line-height: 1.65;
}

/* --- CTA --- */
.lp-cta-wrap {
    padding: var(--section-py) 0;
}

.lp-cta {
    text-align: center;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.lp-cta-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold);
    background-color: rgba(245, 200, 66, 0.08);
    border: 1px solid rgba(245, 200, 66, 0.2);
    border-radius: 100px;
    padding: 0.35rem 0.85rem;
    margin-bottom: 1.75rem;
}

.lp-cta-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--gold);
    animation: pulse-dot 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.4; transform: scale(0.7); }
}

.lp-cta-h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 4.5vw, 3.75rem);
    line-height: 1.07;
    letter-spacing: -0.035em;
    color: var(--text);
    margin-bottom: 1.25rem;
}

.lp-cta-sub {
    font-size: 1.05rem;
    color: var(--text-2);
    line-height: 1.65;
    max-width: 420px;
    margin: 0 auto 2.5rem;
}

.lp-cta-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Footer --- */
.lp-footer {
    border-top: 1px solid var(--line);
    padding: 1.75rem 0;
}

.lp-footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.lp-footer-logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.02em;
}

.lp-footer-copy {
    font-size: 0.8rem;
    color: var(--text-2);
}

.lp-footer-links {
    display: flex;
    gap: 1.5rem;
}

.lp-footer-links a {
    font-size: 0.8rem;
    color: var(--text-2);
    transition: color 0.2s;
}

.lp-footer-links a:hover { color: var(--text); }

/* --- Responsive --- */
@media (max-width: 960px) {
    .lp-services-grid { grid-template-columns: 1fr; }
    .lp-why-grid      { grid-template-columns: 1fr; gap: 1.5rem; }
}

@media (max-width: 768px) {
    :root { --section-py: 4rem; }

    .lp-nav-links,
    .lp-nav .lp-btn { display: none; }

    .lp-nav-hamburger { display: flex; }

    .lp-process-grid {
        flex-wrap: wrap;
        gap: 2rem 1.5rem;
    }

    .lp-step {
        flex: 0 0 calc(50% - 0.75rem);
    }

    .lp-step:not(:last-child)::after { display: none; }

    .lp-step-pad { padding-right: 0; }

    .lp-footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .lp-step { flex: 0 0 100%; }
}

/* --- Accessibility --- */
@media (prefers-reduced-motion: reduce) {
    .lp-ticker-track  { animation-play-state: paused; }
    .lp-cursor        { animation: none; opacity: 1; }
    .lp-cta-badge::before { animation: none; }
}

:focus-visible {
    outline: 2px solid var(--cobalt);
    outline-offset: 3px;
    border-radius: 3px;
}

/* ===========================================
   Blazor framework styles (keep intact)
   =========================================== */

#blazor-error-ui {
    color-scheme: light only;
    background: #1a2a45;
    color: #e8eeff;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.4);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-family: var(--font-body, sans-serif);
    font-size: 0.9rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after { content: "An error has occurred." }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #1A2A45;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #3366FF;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    color: #6A7BA8;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
}

.loading-progress-text:after { content: var(--blazor-load-percentage-text, "Loading"); }

.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid red; }
.validation-message { color: red; }
