@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&family=Lora:ital,wght@0,400..700;1,400..700&display=swap');

:root {
    color-scheme: light dark;
}

/* Light Theme Variables */
:root, [data-theme="light"] {
    --bg: #FAF9F6;
    --surface: #F3F1EC;
    --surface-hover: #EAE7E0;
    --surface-accent: #E5E1D7;
    --text: #1C1B19;
    --text-muted: #5C5852;
    --text-inverse: #FAF9F6;
    --line: rgba(28, 27, 25, 0.15);
    --line-strong: rgba(28, 27, 25, 0.3);
    --accent: #E0533C; /* Muted terracotta/orange-red accent */
    --accent-bg: rgba(224, 83, 60, 0.08);
    --button-bg: #1C1B19;
    --button-text: #FAF9F6;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.03);
    --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.03);
    --radius-lg: 16px;
    --radius-md: 8px;
    --radius-sm: 4px;
}

/* Dark Theme Variables */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0A0A09;
        --surface: #141413;
        --surface-hover: #1D1D1B;
        --surface-accent: #262624;
        --text: #FAF9F6;
        --text-muted: #9E9991;
        --text-inverse: #0A0A09;
        --line: rgba(250, 249, 246, 0.12);
        --line-strong: rgba(250, 249, 246, 0.25);
        --accent: #FF6B52;
        --accent-bg: rgba(255, 107, 82, 0.1);
        --button-bg: #FAF9F6;
        --button-text: #0A0A09;
        --shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
        --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    }
}

[data-theme="dark"] {
    --bg: #0A0A09;
    --surface: #141413;
    --surface-hover: #1D1D1B;
    --surface-accent: #262624;
    --text: #FAF9F6;
    --text-muted: #9E9991;
    --text-inverse: #0A0A09;
    --line: rgba(250, 249, 246, 0.12);
    --line-strong: rgba(250, 249, 246, 0.25);
    --accent: #FF6B52;
    --accent-bg: rgba(255, 107, 82, 0.1);
    --button-bg: #FAF9F6;
    --button-text: #0A0A09;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg);
}

body {
    font-family: 'Lora', Georgia, serif;
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.625;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography Utilities */
.font-mono {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.875rem;
    letter-spacing: -0.01em;
}

h1, h2, h3, h4 {
    font-family: 'Lora', Georgia, serif;
    font-weight: 500;
    line-height: 1.2;
    color: var(--text);
}

p {
    color: var(--text-muted);
}

a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease;
}

/* Retro Frame Corners */
.retro-frame {
    position: relative;
    border: 1px solid var(--line);
    background-color: var(--surface);
    border-radius: var(--radius-md);
    transition: border-color 0.3s ease, background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.figure-corner {
    position: absolute;
    width: 6px;
    height: 6px;
    border: 1px solid var(--line-strong);
    background-color: var(--bg);
    z-index: 10;
    pointer-events: none;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.figure-corner--tl { top: -3px; left: -3px; }
.figure-corner--tr { top: -3px; right: -3px; }
.figure-corner--bl { bottom: -3px; left: -3px; }
.figure-corner--br { bottom: -3px; right: -3px; }

/* Container layout */
.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Floating Navbar */
.navbar {
    position: sticky;
    top: 20px;
    z-index: 100;
    margin-bottom: 60px;
    padding: 0 8px;
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 20px;
    background-color: rgba(243, 241, 236, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: var(--shadow);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .navbar-inner {
    background-color: rgba(20, 20, 19, 0.75);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    letter-spacing: -0.02em;
}

.nav-brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
}

.nav-link:hover, .nav-link.active {
    color: var(--text);
}

.nav-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--text-muted);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background-color 0.2s ease;
    width: 32px;
    height: 32px;
}

.theme-toggle:hover {
    color: var(--text);
    background-color: var(--surface-hover);
}

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

.theme-toggle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Hide sun/moon based on theme */
[data-theme="light"] .theme-toggle .moon-icon { display: block; }
[data-theme="light"] .theme-toggle .sun-icon { display: none; }
[data-theme="dark"] .theme-toggle .moon-icon { display: none; }
[data-theme="dark"] .theme-toggle .sun-icon { display: block; }

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 48px;
    align-items: center;
    padding: 24px 0 60px;
}

.hero--centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 64px 0 60px;
    max-width: 780px;
    margin: 0 auto;
}

.hero--centered .hero-content {
    align-items: center;
}

.hero--centered .hero-description {
    margin-left: auto;
    margin-right: auto;
}

.hero--centered .hero-actions {
    justify-content: center;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 16px;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 3.75rem);
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.hero-title-accent {
    font-style: italic;
    font-weight: 400;
    color: var(--accent);
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    max-width: 560px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--button-bg);
    color: var(--button-text);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
    background-color: var(--accent);
    color: var(--text-inverse);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(224, 83, 60, 0.2);
}

.btn-secondary {
    background-color: transparent;
    border-color: var(--line-strong);
    color: var(--text);
}

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

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

@media (prefers-reduced-motion: reduce) {
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none;
    }
}

/* Platform badges */
.app-platform-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex-shrink: 0;
}

.platform-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    background-color: var(--surface-accent);
    color: var(--text-muted);
    border: 1px solid var(--line);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* Homepage mini bento preview (icon + name tiles only) */
.preview-bento {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 160px));
    gap: 20px;
    max-width: 520px;
}

.preview-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    aspect-ratio: 1;
    width: 100%;
    max-width: 160px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    box-sizing: border-box;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.preview-tile:hover {
    background-color: var(--surface-hover);
    border-color: var(--line-strong);
    box-shadow: var(--shadow);
}

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

.preview-tile-icon-wrap {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 14px;
    border: 1px solid var(--line);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--surface-accent);
    box-shadow: var(--shadow-inset);
}

.preview-tile .preview-tile-icon {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-tile-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    word-break: break-word;
}

.preview-cta {
    margin-top: 32px;
    display: flex;
    justify-content: flex-end;
}

/* Catalog page header */
.catalog-header {
    padding: 48px 0 40px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 48px;
}

.catalog-title {
    font-size: clamp(2.25rem, 4vw, 3.25rem);
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.catalog-description {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 560px;
}

/* Catalog grid — full .app-card detail cards (apps.html only) */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 24px;
    padding-bottom: 80px;
}

/* App card name used as h2 in catalog */
.app-card-name {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

/* Contact section standalone card */
.contact-card {
    padding: 48px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.contact-card h2 {
    font-size: 1.75rem;
    margin-bottom: 12px;
}

.contact-btn {
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .contact-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .contact-btn {
        width: 100%;
    }

    .preview-bento {
        max-width: none;
    }

    .catalog-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        min-width: 0;
    }

    .preview-cta {
        justify-content: stretch;
    }

    .preview-cta .btn {
        width: 100%;
        justify-content: center;
    }

    .app-card {
        padding: 24px 20px;
        min-width: 0;
    }

    .app-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .app-brand-info {
        width: 100%;
        min-width: 0;
    }

    .app-title-group {
        display: flex;
        flex-direction: column;
        gap: 6px;
        min-width: 0;
    }

    .app-card-name {
        font-size: 1.25rem;
        overflow-wrap: anywhere;
    }

    .app-subtitle {
        font-size: 0.7rem;
        letter-spacing: 0.04em;
    }

    .app-platform-badges {
        width: 100%;
        justify-content: flex-start;
        margin-top: 2px;
    }

    .app-description {
        font-size: 1rem;
    }
}

/* Sections */
.section {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid var(--line);
}

.section-header {
    margin-bottom: 40px;
    max-width: 600px;
}

.section-title {
    font-size: 2.25rem;
    letter-spacing: -0.01em;
    margin-bottom: 16px;
}


/* App Retro Card */
.app-card {
    padding: 40px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.app-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}

.app-brand-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-icon {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    border: 1px solid var(--line);
    object-fit: cover;
}

.app-title-group h3 {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.app-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
}

.app-card-body {
    margin-bottom: 32px;
}

.app-description {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.app-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.app-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    padding: 4px 10px;
    background-color: var(--surface-accent);
    border-radius: 4px;
    color: var(--text-muted);
    border: 1px solid var(--line);
}

.app-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.app-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1.5px solid var(--text);
    padding-bottom: 2px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.app-link:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.app-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.contact-description {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 560px;
}

/* About Philosophy Section */
.about-split {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 48px;
    margin-top: 40px;
}

@media (max-width: 768px) {
    .about-split {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

.about-editorial-title {
    font-size: 1.75rem;
    font-style: italic;
    line-height: 1.3;
    font-weight: 400;
    color: var(--accent);
}

.about-text {
    display: flex;
    flex-direction: column;
    gap: 20px;
    font-size: 1.0625rem;
}

/* Info Pages & Disclosures Layout */
.back-link-container {
    margin-bottom: 24px;
}

.back-link {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

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

.back-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.page-header {
    margin-bottom: 48px;
    text-align: center;
    border-bottom: 1px solid var(--line);
    padding-bottom: 40px;
}

.page-brand {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.page-brand-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    border: 1px solid var(--line);
}

.page-title h1 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    margin-bottom: 12px;
}

.page-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.content-layout {
    display: grid;
    grid-template-columns: 1.4fr 0.6fr;
    gap: 40px;
    align-items: start;
}

@media (max-width: 900px) {
    .content-layout {
        grid-template-columns: 1fr;
    }
}

.policy-card {
    padding: 36px;
    margin-bottom: 32px;
}

.policy-card h2 {
    font-size: 1.625rem;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
}

.policy-card h3 {
    font-size: 1.15rem;
    margin-top: 24px;
    margin-bottom: 12px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text);
}

.policy-card p {
    margin-bottom: 16px;
}

.policy-card ul {
    margin-left: 20px;
    margin-bottom: 20px;
    color: var(--text-muted);
}

.policy-card li {
    margin-bottom: 8px;
}

.highlight-box {
    background-color: var(--surface-hover);
    border-left: 3px solid var(--accent);
    padding: 20px;
    margin: 24px 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    border-top: 1px solid var(--line);
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.highlight-box ul {
    margin-bottom: 0;
    list-style: none;
    margin-left: 0;
}

.highlight-box li {
    position: relative;
    padding-left: 22px;
}

.highlight-box li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

.highlight-box li.prohibited::before {
    content: "✗";
    color: #EF4444;
}

/* Sidebar navigation for sections */
.sidebar-sticky {
    position: sticky;
    top: 96px;
}

.outline-card {
    padding: 24px;
}

.outline-card h4 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.outline-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.outline-link {
    font-size: 0.95rem;
    color: var(--text-muted);
    cursor: pointer;
}

.outline-link:hover {
    color: var(--accent);
    padding-left: 4px;
}

.outline-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Footer styling */
footer {
    margin-top: 100px;
    padding: 40px 0;
    border-top: 1px solid var(--line);
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
}

footer p {
    margin-bottom: 8px;
}

footer a {
    color: var(--text);
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 980px) {
    .hero:not(.hero--centered) {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
    }

    .hero:not(.hero--centered) .hero-content {
        align-items: center;
    }

    .hero:not(.hero--centered) .hero-description {
        margin-left: auto;
        margin-right: auto;
    }

    .hero:not(.hero--centered) .hero-actions {
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .navbar {
        top: 12px;
    }
    
    .navbar-inner {
        padding: 0 16px;
    }

    .nav-links {
        gap: 16px;
    }
    
    .nav-brand-text {
        display: none;
    }
}
