/* ============================================
   SocialDebug.Org — Styles
   Humanist vernacular meets analog warmth
   ============================================ */

/* --- Custom Properties --- */
:root {
    --color-foundation: #F7F2EC;
    --color-surface: #EDE4D8;
    --color-text-primary: #2D2319;
    --color-text-secondary: #6B5E52;
    --color-accent-primary: #C4623A;
    --color-accent-secondary: #6B8F71;
    --color-highlight: #E8A838;
    --color-breath: #F0E6DE;
    --color-overlay: #1E1812;

    --font-display: 'Fraunces', serif;
    --font-body: 'Source Sans 3', sans-serif;
    --font-accent: 'Caveat', cursive;

    --grid-gutter: 24px;
    --card-radius: 12px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 100%;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.125rem);
    line-height: 1.7;
    letter-spacing: 0.005em;
    color: var(--color-text-primary);
    background-color: var(--color-foundation);
    overflow-x: hidden;
}

/* --- Risograph Dot Overlay --- */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, #2D2319 0.5px, transparent 0.5px);
    background-size: 4px 4px;
    opacity: 0.03;
    pointer-events: none;
    z-index: 9999;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: var(--font-display);
    letter-spacing: -0.01em;
}

h2 {
    font-weight: 400;
    font-size: clamp(1.25rem, 2.5vw, 2rem);
    font-variation-settings: 'WONK' 0;
}

h3 {
    font-weight: 400;
    font-size: clamp(1.1rem, 1.8vw, 1.5rem);
    font-variation-settings: 'WONK' 0;
    margin-bottom: 0.5em;
}

.caveat {
    font-family: var(--font-accent);
    font-size: clamp(0.875rem, 1vw, 1rem);
}

/* --- Header / Navigation --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    z-index: 100;
    transition: opacity 0.4s ease;
}

.site-header.faded {
    opacity: 0.6;
}

.wordmark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    font-variation-settings: 'WONK' 1;
    color: var(--color-text-primary);
    text-decoration: none;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-text-primary);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* --- Navigation Overlay --- */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(30, 24, 18, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
}

.nav-overlay.open {
    opacity: 1;
    visibility: visible;
}

.nav-overlay-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    text-align: center;
}

.nav-link {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-variation-settings: 'WONK' 0;
    color: var(--color-foundation);
    text-decoration: none;
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out, color 0.2s ease;
}

.nav-overlay.open .nav-link {
    opacity: 1;
    transform: translateX(0);
}

.nav-overlay.open .nav-link:nth-child(1) { transition-delay: 0.08s; }
.nav-overlay.open .nav-link:nth-child(2) { transition-delay: 0.16s; }
.nav-overlay.open .nav-link:nth-child(3) { transition-delay: 0.24s; }
.nav-overlay.open .nav-link:nth-child(4) { transition-delay: 0.32s; }
.nav-overlay.open .nav-link:nth-child(5) { transition-delay: 0.40s; }

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

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 4rem 2rem 2rem;
    position: relative;
}

.hero-content {
    max-width: 700px;
}

.site-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    font-variation-settings: 'WONK' 1;
    color: var(--color-text-primary);
    margin-bottom: 0.5em;
    line-height: 1.1;
}

.hero-subtitle {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1.1rem, 1.6vw, 1.35rem);
    color: var(--color-text-secondary);
    margin-bottom: 1.5em;
    line-height: 1.6;
}

.hero-annotation {
    color: var(--color-accent-primary);
    font-size: clamp(1rem, 1.2vw, 1.15rem);
}

/* --- Stitch Dividers --- */
.stitch-divider {
    width: 100%;
    padding: 2rem 0;
    overflow: hidden;
}

.stitch-svg {
    width: 100%;
    height: 12px;
    display: block;
}

.stitch-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.2s ease-out;
}

.stitch-path.drawn {
    stroke-dashoffset: 0;
}

/* --- Breath Sections --- */
.breath-section {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    position: relative;
}

.breath-1 {
    background: linear-gradient(
        to bottom,
        var(--color-foundation) 0%,
        var(--color-breath) 50%,
        var(--color-foundation) 100%
    );
}

.breath-2 {
    background: linear-gradient(
        to bottom,
        var(--color-foundation) 0%,
        var(--color-breath) 50%,
        var(--color-foundation) 100%
    );
}

.breath-3 {
    background: linear-gradient(
        to bottom,
        var(--color-foundation) 0%,
        var(--color-breath) 50%,
        var(--color-foundation) 100%
    );
}

.breath-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.5rem, 3.5vw, 3rem);
    font-variation-settings: 'WONK' 1;
    color: var(--color-text-primary);
    max-width: 600px;
    opacity: 0;
}

.breath-text.visible {
    opacity: 1;
}

/* --- Bento Sections --- */
.bento-section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    margin-bottom: 0.5rem;
    color: var(--color-text-primary);
}

.section-annotation {
    color: var(--color-text-secondary);
}

/* --- Bento Grid --- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--grid-gutter);
    margin-bottom: 2rem;
}

/* --- Bento Cards --- */
.bento-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-surface);
    border-radius: var(--card-radius);
    padding: 2rem;
    position: relative;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.bento-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.card-wide {
    grid-column: span 8;
}

.card-square {
    grid-column: span 4;
}

.card-full {
    grid-column: 1 / -1;
    background-color: transparent;
    border: none;
}

/* --- Card Content --- */
.card-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
}

.card-icon svg {
    width: 48px;
    height: 48px;
}

.card-icon svg path,
.card-icon svg circle,
.card-icon svg line,
.card-icon svg rect,
.card-icon svg polyline {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 0.8s ease-out;
}

.bento-card.visible .card-icon svg path,
.bento-card.visible .card-icon svg circle,
.bento-card.visible .card-icon svg line,
.bento-card.visible .card-icon svg rect,
.bento-card.visible .card-icon svg polyline {
    stroke-dashoffset: 0;
    transition-delay: 0.2s;
}

.bento-card h3 {
    color: var(--color-text-primary);
}

.bento-card p {
    color: var(--color-text-secondary);
    margin-bottom: 0.75rem;
}

.card-annotation {
    display: block;
    color: var(--color-accent-primary);
    margin-top: 0.5rem;
}

/* --- Blockquotes --- */
.bento-card blockquote {
    text-align: center;
    padding: 2rem 1rem;
}

.bento-card blockquote p {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.1rem, 1.8vw, 1.5rem);
    font-variation-settings: 'WONK' 0;
    color: var(--color-text-primary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.bento-card blockquote cite {
    font-style: normal;
    color: var(--color-accent-primary);
    font-size: clamp(0.9rem, 1.1vw, 1.1rem);
}

/* --- Impact Stats --- */
.impact-stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    text-align: center;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-number {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-variation-settings: 'WONK' 1;
    color: var(--color-accent-primary);
    line-height: 1;
}

.stat-label {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-desc {
    color: var(--color-text-secondary);
}

/* --- Closing Section --- */
.closing-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(
        to bottom,
        var(--color-foundation) 0%,
        var(--color-breath) 100%
    );
}

.closing-content {
    max-width: 650px;
}

.closing-content h2 {
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-variation-settings: 'WONK' 1;
    color: var(--color-text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.closing-content > p {
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
}

.cta-link {
    display: inline-block;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--color-accent-primary);
    text-decoration: none;
    padding: 0.75rem 2rem;
    border: 2px solid var(--color-accent-primary);
    border-radius: var(--card-radius);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.cta-link:hover {
    background-color: var(--color-accent-primary);
    color: var(--color-foundation);
}

.cta-link .arrow {
    display: inline-block;
    transition: transform 0.3s ease;
}

.cta-link:hover .arrow {
    transform: translateX(4px);
}

.closing-annotation {
    display: block;
    margin-top: 2rem;
    color: var(--color-text-secondary);
    font-size: clamp(1rem, 1.2vw, 1.15rem);
}

/* --- Footer --- */
.site-footer {
    padding: 2rem;
    text-align: center;
    background-color: var(--color-breath);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.footer-wordmark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    font-variation-settings: 'WONK' 1;
    color: var(--color-text-primary);
}

.footer-note {
    color: var(--color-text-secondary);
}

/* --- Responsive / Mobile --- */
@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card-wide,
    .card-square,
    .card-full {
        grid-column: span 1;
    }

    .site-header {
        padding: 1rem 1.25rem;
    }

    .bento-section {
        padding: 3rem 1.25rem;
    }

    .hero {
        padding: 3rem 1.25rem 2rem;
    }

    .impact-stats {
        flex-direction: column;
        gap: 1.5rem;
    }

    .closing-section {
        min-height: 60vh;
        padding: 3rem 1.25rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(8, 1fr);
    }

    .card-wide {
        grid-column: span 8;
    }

    .card-square {
        grid-column: span 4;
    }

    .card-full {
        grid-column: 1 / -1;
    }
}
