/* ============================================
   My Full Life — 802 Flamingo App Portfolio
   Dark Mode · Red Accent · DM Typography
   ============================================ */

:root {
    /* Dark mode tokens */
    --bg-primary: #0A0A0A;
    --bg-secondary: #111111;
    --bg-card: #1A1A1A;
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-tertiary: rgba(255, 255, 255, 0.4);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --app-accent: #FF3B3B;
    --app-accent-subtle: rgba(255, 59, 59, 0.1);
    --app-accent-hover: #E03535;
    --grid-filled: #FFFFFF;
    --grid-empty: rgba(255, 255, 255, 0.15);
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* 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;
}

/* ============================================
   Header
   ============================================ */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: box-shadow 0.3s ease;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.back-link:hover { color: var(--text-primary); }

.header-app-name {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

/* ============================================
   Hero
   ============================================ */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 6rem 2rem 4rem;
}

.hex-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
    max-width: 700px;
}

.hero-label {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--app-accent);
    background: var(--app-accent-subtle);
    padding: 0.4rem 1rem;
    border-radius: 100px;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(10px);
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
}

.hero-subtitle {
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(15px);
}

/* ============================================
   Shared Section Styles
   ============================================ */

.section-label {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--app-accent);
    margin-bottom: 1.5rem;
}

.section-heading {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.section-subheading {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

/* ============================================
   The Brief
   ============================================ */

.brief {
    padding: 6rem 2rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.brief-content {
    max-width: 700px;
    margin: 0 auto;
}

.brief-text {
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* ============================================
   Life Grid Demo
   ============================================ */

.demo-section {
    padding: 6rem 2rem;
}

.demo-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

/* Controls */
.grid-controls {
    margin-bottom: 2.5rem;
}

.control-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    text-align: left;
    min-width: 140px;
}

.control-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.control-input {
    font-family: var(--font-body);
    font-size: 0.875rem;
    padding: 0.6rem 0.85rem;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.control-input:focus {
    border-color: var(--app-accent);
}

select.control-input {
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='rgba(255,255,255,0.4)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

/* For date input calendar icon color fix on dark bg */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.5;
}

/* Selector rows */
.selector-row {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.pill-group {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 0.25rem;
}

.pill-btn {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.4rem 0.85rem;
    border-radius: 100px;
    color: var(--text-tertiary);
    background: transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.pill-btn:hover {
    color: var(--text-secondary);
}

.pill-btn.active {
    background: var(--app-accent);
    color: white;
}

/* Canvas Wrapper */
.grid-canvas-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 2.5rem;
    min-height: 200px;
}

.life-grid-canvas {
    display: block;
    max-width: 100%;
}

/* Time Breakdown */
.time-breakdown {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.time-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    min-width: 90px;
}

.time-value {
    font-family: var(--font-body);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.time-value.live {
    color: var(--app-accent);
}

.time-label-text {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

/* ============================================
   Streak Section
   ============================================ */

.streak-section {
    padding: 6rem 2rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.streak-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.streak-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
}

.streak-canvas {
    display: block;
    margin: 0 auto 1.5rem;
    max-width: 100%;
}

.streak-stats {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.streak-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.streak-stat-value {
    font-family: var(--font-body);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.streak-stat-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

/* ============================================
   Commitment Showcase
   ============================================ */

.commitment-section {
    padding: 6rem 2rem;
    border-top: 1px solid var(--border);
}

.commitment-container {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.commitment-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.commitment-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.75rem 1.25rem;
    text-align: left;
    transition: all 0.3s ease;
}

.commitment-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.commitment-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.3rem 0.7rem;
    border-radius: 100px;
    margin-bottom: 1rem;
}

.commitment-badge.gentle {
    background: rgba(34, 197, 94, 0.12);
    color: #4ADE80;
}

.commitment-badge.easy {
    background: rgba(59, 130, 246, 0.12);
    color: #60A5FA;
}

.commitment-badge.moderate {
    background: rgba(245, 158, 11, 0.12);
    color: #FBBF24;
}

.commitment-badge.ambitious {
    background: rgba(255, 59, 59, 0.12);
    color: #FF3B3B;
}

.commitment-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.commitment-item {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding-left: 1rem;
    position: relative;
    line-height: 1.5;
}

.commitment-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--text-tertiary);
}

/* ============================================
   More from 802 Flamingo
   ============================================ */

.more-section {
    padding: 6rem 2rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.more-container {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.more-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

.more-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    border-radius: 16px;
    aspect-ratio: 4/3;
    background: var(--card-gradient);
    color: white;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.more-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 60%);
}

.more-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.more-card-title {
    position: relative;
    font-family: var(--font-display);
    font-size: 1.25rem;
    margin-bottom: 0.35rem;
}

.more-card-desc {
    position: relative;
    font-size: 0.8rem;
    opacity: 0.8;
    line-height: 1.4;
}

/* ============================================
   CTA
   ============================================ */

.cta-section {
    padding: 6rem 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.cta-container {
    max-width: 500px;
    margin: 0 auto;
}

.cta-heading {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.cta-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: white;
    background: var(--app-accent);
    padding: 1rem 2.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.cta-button:hover {
    background: var(--app-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 59, 59, 0.3);
}

/* ============================================
   Footer
   ============================================ */

.site-footer {
    padding: 3rem 2rem;
    border-top: 1px solid var(--border);
}

.site-footer .footer-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-brand {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

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

.footer-portfolio-link {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.footer-portfolio-link:hover { color: var(--text-primary); }

.footer-copy {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ============================================
   Responsive — 768px
   ============================================ */

@media (max-width: 768px) {
    .site-header {
        padding: 1rem 1.25rem;
    }

    .hero {
        padding: 5rem 1.5rem 3rem;
        min-height: 85vh;
    }

    .brief { padding: 4rem 1.5rem; }
    .brief-text { font-size: 1.1rem; }

    .demo-section { padding: 4rem 1.5rem; }

    .control-row {
        flex-direction: column;
        align-items: stretch;
    }

    .control-group {
        min-width: auto;
    }

    .pill-group {
        border-radius: 12px;
        padding: 0.25rem;
    }

    .pill-btn {
        font-size: 0.65rem;
        padding: 0.35rem 0.65rem;
    }

    .time-breakdown {
        gap: 0.5rem;
    }

    .time-stat {
        padding: 0.75rem 0.85rem;
        min-width: 75px;
    }

    .time-value {
        font-size: 1rem;
    }

    .streak-section { padding: 4rem 1.5rem; }

    .streak-stats {
        gap: 1rem;
    }

    .commitment-section { padding: 4rem 1.5rem; }

    .commitment-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .more-section { padding: 4rem 1.5rem; }

    .more-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .more-card { aspect-ratio: 16/9; }

    .cta-section { padding: 4rem 1.5rem; }

    .site-footer .footer-content {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
}

/* ============================================
   Responsive — 480px
   ============================================ */

@media (max-width: 480px) {
    .commitment-grid {
        grid-template-columns: 1fr;
    }

    .streak-stats {
        flex-direction: column;
        gap: 0.75rem;
    }

    .time-breakdown {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   Animations
   ============================================ */

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

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* GSAP fallback — if animations haven't fired in 4s, show everything */
@keyframes gsap-fallback {
    to { opacity: 1; transform: none; }
}

.hero-label, .hero-title, .hero-subtitle {
    animation: gsap-fallback 0s 4s forwards;
}
