/* ============================================
   DeSoPage Marketing Website - Styles
   Clean, minimal, Web3-inspired dark theme
   ============================================ */

:root {
    --bg-dark: #0d0f12;
    --bg-card: #161a1f;
    --bg-elevated: #1c2128;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent: #58a6ff;
    --accent-hover: #79b8ff;
    --accent-muted: rgba(88, 166, 255, 0.15);
    --border: #30363d;
    --border-light: #21262d;
    --success: #3fb950;
    --radius: 8px;
    --radius-lg: 12px;
    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-dark);
    -webkit-font-smoothing: antialiased;
    position: relative;
    min-height: 100vh;
}

/* Blurred, darkened background image */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image: url('https://lh3.googleusercontent.com/TpHQEb-74mc2_uOVk_9a9bsOkHb7xPZ-JzR1tcTOGGMzzS8ovRt_sxRIYBYCCd215knvGEyqca_BK9ev1n2glJk7GEFPiXgLdeqIoV5P_fGw=s1920');
    background-size: cover;
    background-position: center;
    filter: blur(6px);
    transform: scale(1.05);
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background: rgba(0, 0, 0, 0.55);
    pointer-events: none;
}

/* Typography */
h1, h2, h3, h4 {
    margin: 0 0 0.5em;
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: clamp(2.5rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; }

p {
    margin: 0 0 1em;
    color: var(--text-secondary);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-hover);
}

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    padding: 0.15em 0.4em;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    color: var(--accent);
}

/* Layout */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header & Navigation */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(13, 15, 18, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.nav-logo {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.nav-logo:hover { color: var(--text-primary); }

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-radius: var(--radius);
}

.nav-menu a:hover {
    color: var(--text-primary);
    background: var(--accent-muted);
}

.nav-menu a.nav-cta {
    color: var(--bg-dark);
    background: var(--accent);
    font-weight: 600;
}

.nav-menu a.nav-cta:hover {
    background: var(--accent-hover);
}

/* Mobile menu toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 5px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
}

@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .nav-menu {
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-card);
        padding: 1rem;
        border-bottom: 1px solid var(--border);
        display: none;
    }
    .nav-menu.open { display: flex; }
}

/* Main content */
main {
    padding: 3rem 0 4rem;
    min-height: calc(100vh - 200px);
}

/* Hero section */
.hero {
    text-align: center;
    padding: 4rem 0 5rem;
}

.hero h1 {
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    max-width: 560px;
    margin: 0 auto 2rem;
    font-size: 1.15rem;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--bg-dark);
    background: var(--accent);
    border-radius: var(--radius);
    transition: background 0.2s, transform 0.1s;
}

.cta-button:hover {
    background: var(--accent-hover);
    color: var(--bg-dark);
    transform: translateY(-1px);
}

.cta-button.secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.cta-button.secondary:hover {
    background: var(--accent-muted);
    border-color: var(--accent);
}

/* Button aliases for internal pages */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius);
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
}

.btn-primary {
    color: var(--bg-dark);
    background: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: var(--bg-dark);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: var(--accent-muted);
    border-color: var(--accent);
}

/* Hero small (internal pages) */
.hero-small {
    padding: 3rem 0 2rem;
}

.hero-small .lead {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Content sections */
.content-section {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

.content-section h2 {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.content-section h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* Feature grid (Features page) */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.feature-card .feature-icon {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

/* Steps (How It Works) */
.steps-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.step {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-muted);
    color: var(--accent);
    font-weight: 700;
    border-radius: 50%;
}

.step-content h3 {
    margin-bottom: 0.5rem;
}

.step-content p {
    margin: 0;
}

/* Examples page */
.intro-text {
    margin-bottom: 2rem;
}

.example-cards {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.example-card {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

@media (max-width: 640px) {
    .example-card {
        grid-template-columns: 1fr;
    }
}

.example-preview {
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
}

.example-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.example-placeholder i {
    display: block;
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.example-info {
    padding: 1.5rem;
}

.example-info h3 {
    margin-bottom: 0.5rem;
}

.example-info h3 a {
    color: var(--text-primary);
}

.example-info h3 a:hover {
    color: var(--accent);
}

.example-info p {
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.example-more {
    text-align: center;
    padding: 2rem;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
}

.example-more h3 {
    margin-bottom: 0.5rem;
}

.example-more p {
    margin-bottom: 1rem;
}

/* Docs page */
.docs-content ul {
    padding-left: 1.5rem;
}

.docs-content li {
    margin-bottom: 0.5rem;
}

/* Feature cards */
.features-preview,
.example-preview,
.cta-section {
    padding: 4rem 0;
}

.features-preview h2,
.example-preview h2,
.cta-section h2 {
    text-align: center;
    margin-bottom: 0.5rem;
}

.section-desc {
    text-align: center;
    margin-bottom: 2rem;
}

.feature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    transition: border-color 0.2s;
}

.feature-card:hover {
    border-color: var(--border);
}

.feature-card i {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
}

.feature-card p {
    margin: 0;
    font-size: 0.9rem;
}

/* Example placeholder */
.example-frame {
    max-width: 400px;
    margin: 0 auto 1.5rem;
}

.example-preview-link {
    display: block;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.example-preview-link:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.2);
}

.example-preview-img {
    display: block;
    width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
}

.example-placeholder {
    aspect-ratio: 9 / 16;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-content {
    text-align: center;
}

.placeholder-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-elevated);
    margin: 0 auto 1rem;
}

.placeholder-lines span {
    display: block;
    height: 8px;
    background: var(--bg-elevated);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    width: 120px;
    margin-left: auto;
    margin-right: auto;
}

.placeholder-lines span:nth-child(1) { width: 100px; }
.placeholder-lines span:nth-child(2) { width: 80px; }
.placeholder-lines span:nth-child(3) { width: 90px; }
.placeholder-lines span:nth-child(4) { width: 70px; }

.placeholder-cta {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.link-text {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
}

.link-text:hover { color: var(--accent-hover); }

.example-preview .link-text {
    display: inline-flex;
    justify-content: center;
    width: 100%;
}

/* CTA section */
.cta-section {
    text-align: center;
}

.cta-section p {
    margin-bottom: 1.5rem;
}

/* Page content (generic) */
.page-content h2 {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.page-content h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.page-content ul, .page-content ol {
    margin: 0 0 1em;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.page-content li {
    margin-bottom: 0.5rem;
}

.page-content .doc-block {
    margin-bottom: 2rem;
}

.page-content pre {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-x: auto;
}

.page-content pre code {
    padding: 0;
    background: none;
}

/* Examples page */
.example-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.example-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
}

.example-item:hover {
    border-color: var(--border);
}

.example-item a {
    flex: 1;
    font-weight: 500;
}

.example-item .example-url {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Footer */
.footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border-light);
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: center;
}

.footer-brand {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.nav-brand-icon {
    color: var(--accent);
    margin-right: 0.25rem;
}

.footer-tagline {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 1.5rem;
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--text-secondary);
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}

/* Username modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.modal.is-open {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
}

.modal-dialog {
    position: relative;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-dialog .modal-content,
.modal > .modal-content {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.modal > .modal-content {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-title {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
}

.modal-desc {
    margin: 0 0 1.25rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.modal-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.modal-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: var(--font-mono);
    color: var(--text-primary);
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

.modal-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted);
}

.modal-form input::placeholder {
    color: var(--text-muted);
}

.modal-error {
    margin: 0 0 1rem;
    font-size: 0.85rem;
    color: #f85149;
    min-height: 1.25em;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.modal-actions .btn {
    flex: 1;
    justify-content: center;
}
