/* ============================================
   BRIGGITY | Software That Ships
   Dark theme, red accent - r4d2 aesthetic
   ============================================ */

:root {
    --bg: #050508;
    --bg-elevated: #0a0a0f;
    --bg-card: #0d0d14;
    --surface: rgba(20, 20, 30, 0.6);

    --text: #f0f0f5;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;

    --accent: #8b1a1a;
    --accent-light: #b32828;
    --accent-glow: rgba(139, 26, 26, 0.4);
    --accent-subtle: rgba(139, 26, 26, 0.15);

    --border: rgba(255, 255, 255, 0.06);
    --border-accent: rgba(139, 26, 26, 0.3);

    --font-display: 'Space Grotesk', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;

    --radius: 8px;
    --radius-lg: 16px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }

/* Noise texture */
.noise-overlay {
    position: fixed; inset: 0;
    pointer-events: none; z-index: 1000; opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- NAV ---- */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.25rem 2.5rem;
    background: linear-gradient(to bottom, var(--bg) 0%, transparent 100%);
    transition: background 0.3s, backdrop-filter 0.3s;
}
.navbar.scrolled {
    background: rgba(5, 5, 8, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}
.nav-brand {
    font-family: var(--font-display);
    font-size: 1.25rem; font-weight: 700;
    letter-spacing: 0.15em; color: var(--text);
}
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a {
    font-size: 0.875rem; color: var(--text-secondary);
    text-decoration: none; transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
    padding: 0.625rem 1.25rem !important;
    border: 1px solid var(--border) !important;
    border-radius: 9999px;
    transition: all 0.25s !important;
}
.nav-cta:hover {
    border-color: var(--border-accent) !important;
    background: var(--accent-subtle) !important;
    color: var(--text) !important;
}
.nav-toggle {
    display: none; background: none; border: none; cursor: pointer;
    flex-direction: column; gap: 5px; padding: 4px;
}
.nav-toggle span {
    display: block; width: 24px; height: 2px;
    background: var(--text); transition: all 0.3s;
}

/* ---- HERO ---- */
.hero {
    min-height: 100vh; display: flex; flex-direction: column;
    justify-content: center; position: relative;
    padding: 8rem 2.5rem 4rem;
}
.hero-inner {
    display: grid; grid-template-columns: 1fr 1.1fr;
    gap: 4rem; align-items: center;
    max-width: 1200px; margin: 0 auto; width: 100%;
}
.hero-badge {
    display: inline-block; font-size: 0.75rem; font-weight: 500;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--accent-light);
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-accent);
    border-radius: 9999px;
    background: var(--accent-subtle);
    margin-bottom: 2rem;
}
.hero-title { margin-bottom: 1.5rem; }
.title-line {
    display: block; font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 600; letter-spacing: 0.05em;
    color: var(--text); line-height: 1.1;
}
.title-line.accent { color: var(--accent-light); }
.title-divider {
    display: block; width: 60px; height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
    margin: 0.75rem 0;
}
.hero-desc {
    font-size: 1.125rem; color: var(--text-secondary);
    line-height: 1.8; margin-bottom: 2.5rem; max-width: 500px;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Buttons */
.btn-primary {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 1rem 1.75rem;
    font-family: var(--font-body); font-size: 1rem; font-weight: 500;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    border: none; color: var(--text); border-radius: var(--radius);
    cursor: pointer; text-decoration: none; transition: all 0.25s;
    white-space: nowrap;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
}
.btn-primary .arrow { transition: transform 0.2s; }
.btn-primary:hover .arrow { transform: translateX(4px); }
.btn-ghost {
    display: inline-flex; align-items: center;
    padding: 1rem 1.75rem;
    font-size: 1rem; font-weight: 500;
    color: var(--text-secondary); background: none;
    border: 1px solid var(--border); border-radius: var(--radius);
    text-decoration: none; transition: all 0.25s;
}
.btn-ghost:hover {
    color: var(--text); border-color: var(--border-accent);
    background: var(--accent-subtle);
}

/* Code block */
.code-block {
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 40px var(--accent-glow);
}
.code-header {
    display: flex; align-items: center; gap: 8px;
    padding: 1rem 1.25rem;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--border);
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }
.code-filename {
    margin-left: auto; font-size: 0.8rem;
    color: var(--text-muted); font-family: 'SF Mono', 'Fira Code', monospace;
}
.code-body {
    padding: 1.5rem; font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.875rem; line-height: 1.8; color: var(--text-secondary);
    overflow-x: auto; white-space: pre;
}
.code-keyword { color: #c678dd; }
.code-var { color: #e06c75; }
.code-fn { color: #61afef; }
.code-prop { color: #e5c07b; }
.code-string { color: #98c379; }
.code-num { color: #d19a66; }
.code-comment { color: #5c6370; font-style: italic; }
.code-accent { color: var(--accent-light); font-style: normal; }

/* Scroll indicator */
.scroll-indicator {
    position: absolute; bottom: 2rem; left: 50%;
    transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
    color: var(--text-muted); font-size: 0.75rem;
    letter-spacing: 0.1em; text-transform: uppercase;
    animation: float 2s ease-in-out infinite;
}
.scroll-line {
    width: 1px; height: 40px;
    background: linear-gradient(to bottom, var(--text-muted), transparent);
}
@keyframes float {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* ---- STATS ---- */
.stats-bar {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
}
.stats-inner {
    max-width: 900px; margin: 0 auto;
    display: flex; justify-content: center; align-items: center;
    padding: 3rem 2rem; gap: 3rem;
}
.stat-item { text-align: center; }
.stat-num {
    display: block; font-family: var(--font-display);
    font-size: 2.5rem; font-weight: 600; color: var(--accent-light);
    letter-spacing: 0.05em;
}
.stat-label {
    display: block; font-size: 0.8rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.1em; margin-top: 0.25rem;
}
.stat-divider {
    width: 1px; height: 40px;
    background: linear-gradient(to bottom, transparent, var(--border-accent), transparent);
}

/* ---- SECTIONS ---- */
.section {
    padding: 7rem 0;
    opacity: 0; transform: translateY(30px);
    transition: opacity 0.6s, transform 0.6s;
}
.section.visible { opacity: 1; transform: translateY(0); }
.section-label {
    display: block; font-size: 0.75rem; font-weight: 500;
    letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--accent-light); margin-bottom: 1rem;
}
.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 500; letter-spacing: 0.02em;
    color: var(--text); margin-bottom: 1rem;
}
.section-title em { color: var(--accent-light); font-style: normal; }
.section-desc {
    font-size: 1.125rem; color: var(--text-secondary);
    line-height: 1.7; max-width: 600px; margin-bottom: 3rem;
}

/* ---- SERVICES ---- */
.services { background: linear-gradient(180deg, var(--bg) 0%, var(--bg-elevated) 50%, var(--bg) 100%); }
.service-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.service-card {
    padding: 2rem; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    transition: all 0.3s;
    opacity: 0; transform: translateY(20px);
}
.service-card.visible { opacity: 1; transform: translateY(0); }
.service-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.service-icon {
    width: 56px; height: 56px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-subtle);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius);
    color: var(--accent-light); margin-bottom: 1.5rem;
}
.service-card h3 {
    font-family: var(--font-display);
    font-size: 1.25rem; font-weight: 500;
    color: var(--text); margin-bottom: 0.75rem;
}
.service-card p { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.7; }

/* ---- ABOUT ---- */
.about { background: var(--bg); }
.about-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 4rem; align-items: center;
}
.about-content p {
    font-size: 1rem; color: var(--text-secondary);
    line-height: 1.8; margin-bottom: 1.5rem;
}
.about-values { margin-top: 2rem; }
.value-item {
    display: flex; gap: 1rem; align-items: flex-start;
    margin-bottom: 1.5rem;
    opacity: 0; transform: translateX(-20px);
    transition: opacity 0.5s, transform 0.5s;
}
.value-item.visible { opacity: 1; transform: translateX(0); }
.value-marker {
    width: 4px; height: 100%; min-height: 50px;
    background: linear-gradient(to bottom, var(--accent-light), transparent);
    border-radius: 2px; flex-shrink: 0;
}
.value-item strong {
    display: block; font-size: 1rem; color: var(--text);
    margin-bottom: 0.25rem;
}
.value-item p { font-size: 0.875rem; color: var(--text-muted); margin: 0; }

/* Terminal */
.terminal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 30px rgba(139, 26, 26, 0.1);
}
.terminal-header {
    display: flex; align-items: center; gap: 8px;
    padding: 0.875rem 1.25rem;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--border);
}
.terminal-title {
    margin-left: auto; font-size: 0.8rem;
    color: var(--text-muted); font-family: 'SF Mono', monospace;
}
.terminal-body {
    padding: 1.5rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.9rem; line-height: 2;
}
.terminal-body p { color: var(--text-secondary); }
.t-green { color: #28c840; }
.t-accent { color: var(--accent-light); font-weight: 500; }
.t-glow {
    color: var(--accent-light);
    text-shadow: 0 0 10px var(--accent-glow);
    animation: glow 2s ease-in-out infinite;
}
@keyframes glow {
    0%, 100% { text-shadow: 0 0 10px var(--accent-glow); }
    50% { text-shadow: 0 0 20px var(--accent-glow), 0 0 40px rgba(139,26,26,0.2); }
}
.cursor { animation: blink 1s step-end infinite; }
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

/* ---- TEAM ---- */
.team {
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-elevated) 100%);
}
.team-grid {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 2rem; max-width: 700px;
}
.team-card {
    padding: 2.5rem; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    text-align: center; transition: all 0.3s;
    opacity: 0; transform: translateY(20px);
}
.team-card.visible { opacity: 1; transform: translateY(0); }
.team-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.team-avatar {
    width: 80px; height: 80px; margin: 0 auto 1.5rem;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-size: 1.5rem; font-weight: 600; color: var(--accent-light);
    background: var(--accent-subtle);
    border: 2px solid var(--border-accent);
    border-radius: 50%;
}
.team-card h3 {
    font-family: var(--font-display);
    font-size: 1.25rem; font-weight: 500; color: var(--text);
    margin-bottom: 0.25rem;
}
.team-role {
    display: block; font-size: 0.8rem; font-weight: 500;
    color: var(--accent-light); text-transform: uppercase;
    letter-spacing: 0.1em; margin-bottom: 1rem;
}
.team-card p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.7; }

/* ---- CTA ---- */
.cta { background: var(--bg-elevated); }
.cta-card {
    text-align: center; padding: 4rem;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(139,26,26,0.05) 100%);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-lg);
}
.cta-card h2 {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 500; color: var(--text); margin-bottom: 0.75rem;
}
.cta-card > p {
    font-size: 1.125rem; color: var(--text-secondary);
    margin-bottom: 2.5rem;
}
.cta-form { max-width: 480px; margin: 0 auto; }
.form-row { display: flex; gap: 0.75rem; }
.form-input {
    flex: 1; padding: 1rem 1.25rem;
    font-family: var(--font-body); font-size: 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border); color: var(--text);
    border-radius: var(--radius); transition: all 0.25s;
}
.form-input:focus {
    outline: none; border-color: var(--border-accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}
.form-input::placeholder { color: var(--text-muted); }
.form-note {
    font-size: 0.8rem; color: var(--text-muted);
    margin-top: 1rem;
}

/* ---- FOOTER ---- */
.footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border);
    background: var(--bg);
}
.footer-inner {
    display: flex; flex-direction: column;
    align-items: center; gap: 1.5rem;
}
.footer-brand { text-align: center; }
.footer-logo {
    display: block; font-family: var(--font-display);
    font-size: 1.25rem; font-weight: 700;
    letter-spacing: 0.15em; color: var(--text);
}
.footer-tagline {
    font-size: 0.8rem; color: var(--text-muted);
    letter-spacing: 0.1em;
}
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a {
    font-size: 0.875rem; color: var(--text-muted);
    text-decoration: none; transition: color 0.2s;
}
.footer-links a:hover { color: var(--text-secondary); }
.footer-copy { font-size: 0.75rem; color: var(--text-muted); }

/* ---- RESPONSIVE ---- */
@media (max-width: 968px) {
    .hero-inner { grid-template-columns: 1fr; text-align: center; }
    .hero-content { order: 1; }
    .hero-visual { order: 2; }
    .hero-desc { margin-left: auto; margin-right: auto; }
    .hero-actions { justify-content: center; }
    .title-divider { margin: 0.75rem auto; }
    .service-grid { grid-template-columns: repeat(2, 1fr); }
    .about-grid { grid-template-columns: 1fr; }
    .about-content { text-align: left; }
}

@media (max-width: 768px) {
    .nav-links {
        display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(5,5,8,0.97); flex-direction: column;
        justify-content: center; align-items: center; gap: 2rem;
    }
    .nav-links.active { display: flex; }
    .nav-toggle { display: flex; }
    .nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
    .nav-toggle.active span:nth-child(2) { opacity: 0; }
    .nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
    .nav-links a { font-size: 1.25rem; }

    .hero { padding: 6rem 1.5rem 3rem; }
    .stats-inner { flex-direction: column; gap: 2rem; }
    .stat-divider { width: 40px; height: 1px; }
    .service-grid { grid-template-columns: 1fr; }
    .team-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
    .form-row { flex-direction: column; }
    .cta-card { padding: 2.5rem 1.5rem; }
    .scroll-indicator { display: none; }
}

/* Selection */
::selection { background: var(--accent); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 2px; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
