/* KayOS Design System
   Warm, editorial, unhurried.
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,300;0,6..72,400;0,6..72,500;1,6..72,300;1,6..72,400&family=IBM+Plex+Mono:wght@300;400&display=swap');

:root {
    --bg: #faf9f7;
    --bg-warm: #f5f3ef;
    --text: #2a2825;
    --text-secondary: #6b6660;
    --text-tertiary: #a09a94;
    --accent: #8b7355;
    --border: #e8e4df;
    --code-bg: #f0ece7;
}

/* Reset
   ========================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Newsreader', Georgia, serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 18px;
    -webkit-font-smoothing: antialiased;
}

/* Layout
   ========================================== */

.container-narrow {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 2rem;
}

.container-wide {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

.page-padding {
    padding-top: 12vh;
    padding-bottom: 10vh;
}

.section-spacing {
    margin-bottom: 6rem;
}

/* Navigation
   ========================================== */

.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2.5rem;
    height: 52px;
    background: rgba(250, 249, 247, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(232, 228, 223, 0.5);
    transition: background 0.3s ease, border-color 0.3s ease;
}

/* When nav overlays a hero image */
.has-hero .site-nav {
    background: rgba(250, 249, 247, 0.65);
    border-bottom-color: rgba(232, 228, 223, 0.3);
}

.has-hero {
    padding-top: 0;
}

.nav-logo {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 0.02em;
}

.nav-logo span {
    color: var(--accent);
    font-weight: 500;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-tertiary);
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: color 0.2s ease;
}

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

.nav-links a.active {
    color: var(--text);
}

/* Space for fixed nav */
body {
    padding-top: 52px;
}

/* Typography
   ========================================== */

h1 {
    font-family: 'Newsreader', Georgia, serif;
    font-weight: 300;
    font-size: 2.2rem;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--text);
}

h2 {
    font-family: 'Newsreader', Georgia, serif;
    font-weight: 400;
    font-size: 1.6rem;
    line-height: 1.4;
    color: var(--text);
    margin-bottom: 1.5rem;
}

h3 {
    font-family: 'Newsreader', Georgia, serif;
    font-weight: 400;
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--text);
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

p:last-child {
    margin-bottom: 0;
}

em {
    font-style: italic;
    color: var(--accent);
}

strong {
    font-weight: 500;
    color: var(--text);
}

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

a:hover {
    color: var(--text);
}

/* Section Labels
   ========================================== */

.section-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-tertiary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

/* Divider
   ========================================== */

.divider {
    text-align: center;
    margin: 4rem 0;
    color: var(--accent);
    font-size: 1rem;
    opacity: 0.4;
}

.divider-line {
    border: none;
    border-top: 1px solid var(--border);
    margin: 6rem 0;
}

/* Blockquote
   ========================================== */

blockquote,
.blockquote {
    border-left: 2px solid var(--accent);
    padding: 1.5rem 0 1.5rem 2rem;
    margin: 2rem 0;
}

blockquote p,
.blockquote p {
    font-size: 1.15rem;
    font-style: italic;
    color: var(--text);
    line-height: 1.7;
}

.blockquote-author {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-tertiary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-top: 1rem;
}

/* Tables
   ========================================== */

table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

th {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

tr:last-child td {
    border-bottom: none;
}

/* Code
   ========================================== */

code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85em;
    color: var(--accent);
    background: var(--code-bg);
    padding: 0.15em 0.4em;
    border-radius: 3px;
}

.code-block {
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1.75rem 2rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.8;
    overflow-x: auto;
    margin: 2rem 0;
    color: var(--text-secondary);
}

.code-block .comment { color: var(--text-tertiary); }
.code-block .folder { color: var(--accent); }
.code-block .file { color: var(--text-secondary); }

/* Cards
   ========================================== */

.card-subtle {
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2rem;
    transition: border-color 0.2s ease;
}

.card-subtle:hover {
    border-color: var(--accent);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.card-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

/* Thread List (from space.html)
   ========================================== */

.thread-list .thread-item {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
    transition: all 0.2s ease;
}

.thread-list .thread-item:first-child {
    border-top: 1px solid var(--border);
}

.thread-list .thread-item:hover {
    padding-left: 0.75rem;
}

.thread-title {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 0.35rem;
    transition: color 0.2s ease;
}

.thread-item:hover .thread-title {
    color: var(--accent);
}

.thread-meta {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    font-weight: 300;
    color: var(--text-tertiary);
    display: flex;
    gap: 1.5rem;
}

/* Tags
   ========================================== */

.tag {
    display: inline-block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--text-secondary);
}

/* Contact Form
   ========================================== */

.contact-form {
    max-width: 480px;
    margin: 3rem auto;
}

.contact-field {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-family: 'Newsreader', Georgia, serif;
    font-size: 1rem;
    padding: 1rem 0;
    outline: none;
    transition: border-color 0.3s ease;
}

.contact-field:focus {
    border-color: var(--accent);
}

.contact-field::placeholder {
    color: var(--text-tertiary);
}

textarea.contact-field {
    resize: none;
    min-height: 100px;
    line-height: 1.7;
    margin-top: 0.5rem;
}

.contact-submit {
    margin-top: 2rem;
    padding: 1rem 2.5rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--bg);
    background: var(--text);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.contact-submit:hover {
    background: var(--accent);
}

.contact-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.contact-sent {
    text-align: center;
    display: none;
}

.contact-sent.show {
    display: block;
}

.contact-fields.hidden {
    display: none;
}

/* Images
   ========================================== */

.img-full {
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    margin: 4rem 0;
    overflow: hidden;
}

.img-full img {
    width: 100%;
    height: auto;
    display: block;
    filter: brightness(1.05) saturate(0.85);
    opacity: 0.85;
}

.img-contained {
    margin: 3rem 0;
    border-radius: 4px;
    overflow: hidden;
}

.img-contained img {
    width: 100%;
    height: auto;
    display: block;
    filter: brightness(1.05) saturate(0.85);
    opacity: 0.85;
}

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

.site-footer {
    margin-top: 6rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.site-footer p {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-tertiary);
    letter-spacing: 0.03em;
}

/* Signature (for manifesto-style pages)
   ========================================== */

.signature {
    margin-top: 6rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border);
    text-align: right;
}

.signature .name {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.signature .year {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--text-tertiary);
    letter-spacing: 0.05em;
}

/* Utility
   ========================================== */

.text-center { text-align: center; }
.text-right { text-align: right; }
.mono { font-family: 'IBM Plex Mono', monospace; }
.serif { font-family: 'Newsreader', Georgia, serif; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 2rem; }
.mb-4 { margin-bottom: 4rem; }
.mt-2 { margin-top: 2rem; }
.mt-4 { margin-top: 4rem; }

/* Responsive
   ========================================== */

@media (max-width: 600px) {
    body {
        font-size: 16px;
    }

    .container-narrow,
    .container-wide {
        padding: 0 1.5rem;
    }

    .page-padding {
        padding-top: 8vh;
        padding-bottom: 8vh;
    }

    .site-nav {
        padding: 0 1.5rem;
        height: 48px;
    }

    .nav-links {
        gap: 1.25rem;
    }

    .nav-links a {
        font-size: 0.65rem;
    }

    body {
        padding-top: 48px;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.35rem;
    }

    .card-grid-2 {
        grid-template-columns: 1fr;
    }

    .section-spacing {
        margin-bottom: 4rem;
    }

    .contact-form {
        margin: 2rem auto;
    }
}
