/* ========================================
   ECHOBASEDEV LABS - Experimental Tools
   Warm, sophisticated, intentional
   ======================================== */

:root {
    /* Warm, sophisticated palette */
    --bg: #FAF8F5;
    --bg-warm: #F5F1EB;
    --fg: #1a1a1a;
    --fg-soft: #3d3d3d;
    --muted: #6b6560;
    --accent: #C45D3A;
    --accent-soft: rgba(196, 93, 58, 0.12);
    --rule: #e0dbd4;

    /* Status colors */
    --status-prototype: #C45D3A;
    --status-beta: #1a1a1a;
    --status-stable: #2d5a4a;
    --status-archived: #8a8a8a;

    /* Typography */
    --font-display: "Fraunces", Georgia, serif;
    --font-body: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    /* Spacing */
    --container-max: 1200px;
    --gutter: clamp(24px, 6vw, 80px);

    /* Effects */
    --shadow-soft: 0 4px 24px rgba(26, 26, 26, 0.06);
    --shadow-hover: 0 8px 32px rgba(26, 26, 26, 0.1);
    --grain: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    position: relative;
}

/* Subtle grain texture overlay */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--grain);
    opacity: 0.03;
    pointer-events: none;
    z-index: 1000;
}

a {
    color: inherit;
    text-decoration: none;
}

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* ========================================
   MASTHEAD
   ======================================== */
.masthead {
    padding: clamp(28px, 5vw, 48px) 0;
    position: relative;
}

.masthead-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
}

.brand {
    font-family: var(--font-display);
    font-size: clamp(16px, 2vw, 20px);
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--fg);
    transition: color 0.3s ease;
}

.brand-labs {
    color: var(--accent);
}

.brand:hover {
    color: var(--accent);
}

.nav {
    display: flex;
    gap: clamp(16px, 3vw, 32px);
    align-items: center;
}

.nav-link {
    font-size: 15px;
    font-weight: 400;
    color: var(--muted);
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--fg);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link-external {
    font-size: 13px;
    color: var(--muted);
    opacity: 0.7;
}

.nav-link-external:hover {
    opacity: 1;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 28px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--fg);
    color: var(--bg);
    border: 2px solid var(--fg);
}

.btn-primary:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 93, 58, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--fg);
    border: 2px solid var(--rule);
}

.btn-secondary:hover {
    border-color: var(--fg);
    transform: translateY(-2px);
}

.btn-small {
    padding: 10px 18px;
    font-size: 14px;
}

/* ========================================
   HERO
   ======================================== */
.hero {
    padding: clamp(60px, 12vw, 140px) 0 clamp(80px, 14vw, 160px);
    position: relative;
    overflow: hidden;
}

/* Decorative accent shape */
.hero::before {
    content: "";
    position: absolute;
    top: -20%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    max-width: 600px;
    max-height: 600px;
    background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(-20px, 20px) scale(1.05);
    }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-eyebrow {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 20px;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.2s;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    font-weight: 300;
    line-height: 1.05;
    letter-spacing: -0.025em;
    margin: 0 0 28px;
    max-width: 14ch;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.4s;
}

.hero-title strong {
    font-weight: 600;
    color: var(--accent);
}

.hero-subtitle {
    font-size: clamp(18px, 2.5vw, 22px);
    font-weight: 300;
    color: var(--muted);
    max-width: 52ch;
    line-height: 1.6;
    margin: 0 0 40px;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.6s;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.8s;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   SECTIONS
   ======================================== */
.section {
    padding: clamp(48px, 8vw, 100px) 0;
    border-top: 1px solid var(--rule);
}

.section:first-of-type {
    border-top: none;
}

.section-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: clamp(32px, 6vw, 80px);
    align-items: start;
}

.section-label {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    padding-top: 6px;
}

.section-content {
    max-width: 900px;
}

/* ========================================
   PROJECTS GRID
   ======================================== */
.projects-intro {
    font-size: 17px;
    color: var(--fg-soft);
    line-height: 1.75;
    margin: 0 0 32px;
    max-width: 60ch;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.project-card {
    padding: 28px 32px;
    background: var(--bg-warm);
    border-radius: 12px;
    border: 1px solid transparent;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    background: white;
    border-color: var(--rule);
    box-shadow: var(--shadow-soft);
    transform: translateY(-2px);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.project-name {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--fg);
    margin: 0;
}

.project-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 4px;
    flex-shrink: 0;
}

.project-badge-prototype {
    background: var(--status-prototype);
    color: white;
}

.project-badge-beta {
    background: var(--status-beta);
    color: white;
}

.project-badge-stable {
    background: var(--status-stable);
    color: white;
}

.project-badge-archived {
    background: transparent;
    color: var(--status-archived);
    border: 1px solid var(--rule);
}

.project-desc {
    font-size: 15px;
    color: var(--muted);
    line-height: 1.65;
    margin: 0 0 16px;
    flex-grow: 1;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.project-tag {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    background: var(--bg);
    padding: 4px 10px;
    border-radius: 4px;
}

.project-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.project-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--accent);
    transition: opacity 0.2s ease;
}

.project-link:hover {
    opacity: 0.7;
}

.project-link-disabled {
    color: var(--muted);
    cursor: default;
}

.project-link-disabled:hover {
    opacity: 1;
}

/* ========================================
   ABOUT / PRINCIPLES
   ======================================== */
.about-intro {
    font-family: var(--font-display);
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 400;
    line-height: 1.4;
    color: var(--fg);
    margin: 0 0 24px;
}

.principles-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
}

.principle-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--rule);
}

.principle-item:first-child {
    padding-top: 0;
}

.principle-item::before {
    content: "";
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 10px;
}

.principle-text {
    font-size: 16px;
    color: var(--fg-soft);
    line-height: 1.6;
}

.disclaimer {
    font-size: 14px;
    color: var(--muted);
    font-style: italic;
    padding: 16px 20px;
    background: var(--bg-warm);
    border-radius: 8px;
    border-left: 3px solid var(--accent);
}

/* ========================================
   PRIVACY
   ======================================== */
.privacy-intro {
    font-family: var(--font-display);
    font-size: clamp(20px, 2.5vw, 26px);
    font-weight: 400;
    line-height: 1.4;
    color: var(--fg);
    margin: 0 0 16px;
}

.privacy-body {
    font-size: 16px;
    color: var(--fg-soft);
    line-height: 1.75;
    margin: 0 0 20px;
}

.privacy-body strong {
    color: var(--fg);
    font-weight: 500;
}

.privacy-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.privacy-link:hover {
    opacity: 0.7;
}

/* ========================================
   UPDATES / SUBSCRIBE
   ======================================== */
.updates-intro {
    font-family: var(--font-display);
    font-size: clamp(20px, 2.5vw, 26px);
    font-weight: 400;
    line-height: 1.4;
    color: var(--fg);
    margin: 0 0 12px;
}

.updates-body {
    font-size: 16px;
    color: var(--fg-soft);
    line-height: 1.75;
    margin: 0 0 24px;
}

.newsletter-embed {
    max-width: 480px;
    margin-top: 8px;
}

.newsletter-embed iframe {
    background: white;
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    padding: clamp(40px, 6vw, 64px) 0;
    border-top: 1px solid var(--rule);
    margin-top: clamp(48px, 8vw, 100px);
}

.footer-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.footer-brand {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--fg);
    margin: 0;
}

.footer-nav {
    display: flex;
    gap: 24px;
}

.footer-nav a {
    font-size: 14px;
    color: var(--muted);
    transition: color 0.3s ease;
}

.footer-nav a:hover {
    color: var(--accent);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copy {
    font-size: 14px;
    color: var(--muted);
    margin: 0;
}

.footer-tagline {
    font-size: 13px;
    color: var(--muted);
    font-style: italic;
    margin: 0;
}

/* ========================================
   SCROLL ANIMATIONS
   ======================================== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 900px) {
    .section-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .section-label {
        padding-top: 0;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .masthead-inner {
        flex-direction: column;
        gap: 20px;
    }

    .nav {
        gap: 16px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero::before {
        top: -10%;
        right: -30%;
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-actions .btn {
        text-align: center;
        justify-content: center;
    }

    .footer-main {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .footer-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}
