/*
 * everso.in — Ink Wash Stillness
 *
 * A site that feels like a scroll painting unrolled in a quiet room.
 * Chinese watercolour sensibility. Negative space as content.
 * The visitor arrives and slows down.
 */

/* =========================================
   FOUNDATIONS
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

:root {
    /* Rice paper — aged but luminous */
    --paper: #F7F3EE;
    --paper-warm: #F3EDE5;

    /* Ink — softened by time */
    --ink: #2C2825;
    --ink-light: #4A4543;
    --ink-faint: #7A7673;

    /* Still water — weathered jade */
    --water: #5C6B6B;
    --water-light: #7A8888;

    /* Wash tones for illustrations */
    --wash-dark: #3D4A4A;
    --wash-mid: #8A9696;
    --wash-light: #C5CECE;
    --wash-faint: #E5E9E9;

    /* Typography */
    --font-body: 'EB Garamond', 'Georgia', serif;
    --font-size-base: 19px;
    --font-size-small: 16px;
    --font-size-large: 22px;
    --line-height: 1.75;
    --line-height-tight: 1.4;

    /* Spacing */
    --space: 1.5rem;
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;
    --space-xxl: 6rem;

    /* Layout */
    --content-width: 620px;
    --content-width-narrow: 520px;
}

/* =========================================
   RESET & BASE
   ========================================= */

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

html {
    font-size: var(--font-size-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: var(--line-height);
    color: var(--ink);
    background-color: var(--paper);
    min-height: 100vh;
}

/* Subtle paper texture */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.025;
    pointer-events: none;
    z-index: 1000;
}

/* =========================================
   TYPOGRAPHY
   ========================================= */

h1, h2, h3 {
    font-weight: 500;
    line-height: var(--line-height-tight);
    color: var(--ink);
}

h1 {
    font-size: 1.6rem;
    letter-spacing: -0.01em;
}

h2 {
    font-size: 1.2rem;
    margin-top: var(--space-lg);
    margin-bottom: var(--space);
}

p {
    margin-bottom: 1.3rem;
}

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

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

em {
    font-style: italic;
}

strong {
    font-weight: 600;
}

hr {
    border: none;
    height: 1px;
    background: var(--wash-light);
    margin: var(--space-lg) 0;
    opacity: 0.6;
}

ul, ol {
    padding-left: 1.5rem;
    margin-bottom: 1.3rem;
}

li {
    margin-bottom: 0.4rem;
}

blockquote {
    border-left: 2px solid var(--wash-mid);
    padding-left: var(--space);
    margin: var(--space-lg) 0;
    font-style: italic;
    color: var(--ink-light);
}

/* =========================================
   LAYOUT
   ========================================= */

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 var(--space);
}

.container-narrow {
    max-width: var(--content-width-narrow);
}

main {
    flex: 1;
}

/* =========================================
   HEADER
   ========================================= */

.site-header {
    padding: var(--space-lg) 0 var(--space);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.site-wordmark {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: 0.02em;
}

.site-wordmark:hover {
    color: var(--ink);
}

.site-wordmark-suffix {
    color: var(--water);
}

.site-nav {
    display: flex;
    gap: var(--space-lg);
}

.site-nav a {
    font-size: 0.9rem;
    color: var(--ink-faint);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.2s ease;
}

.site-nav a:hover,
.site-nav a.active {
    color: var(--ink);
}

/* =========================================
   FOOTER
   ========================================= */

.site-footer {
    padding: var(--space-xl) 0 var(--space-lg);
}

/* =========================================
   HOME PAGE
   ========================================= */

.home-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.home-illustration {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 0;
}

.home-illustration svg {
    width: 100%;
    height: auto;
    opacity: 0.15;
}

.home-content {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-xl) var(--space);
    min-height: 80vh;
}

.home-well-mark {
    margin-bottom: var(--space-xl);
}

.home-well-mark svg {
    width: 64px;
    height: 64px;
}

.home-well-mark path {
    fill: none;
    stroke: var(--wash-mid);
    stroke-width: 2;
    stroke-linecap: round;
}

.home-wordmark {
    font-size: 2rem;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: 0.03em;
    margin-bottom: var(--space-xs);
}

.home-wordmark-suffix {
    color: var(--water);
}

.home-tagline {
    font-size: 1rem;
    font-style: italic;
    color: var(--ink-faint);
    letter-spacing: 0.01em;
}

.home-question {
    margin-top: var(--space-xxl);
    max-width: 400px;
}

.home-question a {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--ink-light);
    line-height: 1.6;
    text-decoration: underline;
    text-decoration-color: var(--wash-mid);
    text-underline-offset: 0.15em;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.home-question a:hover {
    color: var(--ink);
    text-decoration-color: var(--ink);
}

/* =========================================
   PLACED PAGE
   ========================================= */

.placed-page {
    position: relative;
    padding: var(--space-lg) 0 var(--space-xxl);
}

.placed-illustration {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 700px;
    pointer-events: none;
    z-index: 0;
}

.placed-illustration svg {
    width: 100%;
    height: auto;
    opacity: 0.08;
}

.placed-content {
    position: relative;
    z-index: 1;
}

.placed-page h1 {
    font-size: 1.3rem;
    margin-bottom: var(--space-xs);
}

.placed-intro {
    font-size: 0.95rem;
    color: var(--ink-faint);
    font-style: italic;
    margin-bottom: var(--space-xl);
}

.placed-section {
    margin-bottom: var(--space-xl);
}

.placed-section-label {
    font-size: 0.8rem;
    text-transform: lowercase;
    letter-spacing: 0.1em;
    color: var(--ink-faint);
    margin-bottom: var(--space);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--wash-light);
}

.placed-list {
    list-style: none;
    padding: 0;
}

.placed-list li {
    margin-bottom: var(--space);
    padding-bottom: var(--space);
    border-bottom: 1px solid var(--wash-faint);
}

.placed-list li:last-child {
    border-bottom: none;
}

.placed-list a {
    font-size: 1.05rem;
    color: var(--ink);
    text-decoration: none;
}

.placed-list a:hover {
    color: var(--water);
}

.placed-subtitle {
    display: block;
    font-size: 0.9rem;
    color: var(--ink-faint);
    font-style: italic;
    margin-top: 0.2rem;
}

.placed-empty {
    font-style: italic;
    color: var(--ink-faint);
}

/* =========================================
   TEXT PAGE (single)
   ========================================= */

.text-page {
    padding: var(--space-lg) 0 var(--space-xxl);
}

.text-page h1 {
    font-size: 1.8rem;
    margin-bottom: var(--space-xs);
}

.text-subtitle {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--ink-faint);
    margin-bottom: var(--space-xl);
}

.text-body {
    font-size: 1.05rem;
    line-height: 1.85;
}

.text-body p {
    margin-bottom: 1.5rem;
}

.text-body h2 {
    font-size: 1.2rem;
    margin-top: var(--space-xl);
    margin-bottom: var(--space);
}

.text-download {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--wash-light);
}

.text-download a {
    font-size: 0.95rem;
    color: var(--water);
    text-decoration: underline;
    text-decoration-color: var(--wash-mid);
    text-underline-offset: 0.15em;
}

.text-download a:hover {
    color: var(--ink);
    text-decoration-color: var(--ink);
}

/* =========================================
   QUESTION PAGE (single)
   ========================================= */

.question-page {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl) var(--space);
}

.question-content {
    text-align: center;
    max-width: 500px;
}

.question-text {
    font-size: 1.4rem;
    font-style: italic;
    line-height: 1.6;
    color: var(--ink);
}

/* =========================================
   PROVOCATION PAGE (single)
   ========================================= */

.provocation-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    padding: var(--space-xl) 0;
}

.provocation-content {
    max-width: var(--content-width-narrow);
    margin: 0 auto;
    padding: 0 var(--space);
}

.provocation-text {
    font-size: 1.3rem;
    line-height: 1.7;
    color: var(--ink);
}

.provocation-text p {
    margin-bottom: 1.3rem;
}

/* =========================================
   ABOUT PAGE
   ========================================= */

.about-page {
    padding: var(--space-lg) 0 var(--space-xxl);
}

.about-page h1 {
    font-size: 1.3rem;
    margin-bottom: var(--space-lg);
}

.about-body {
    font-size: 1.05rem;
    line-height: 1.85;
}

.about-body p {
    margin-bottom: 1.5rem;
}

.about-body a {
    text-decoration: underline;
    text-decoration-color: var(--wash-mid);
    text-underline-offset: 0.15em;
}

.about-body a:hover {
    text-decoration-color: var(--ink);
}

.about-illustration {
    margin: var(--space-xl) 0;
    display: flex;
    justify-content: center;
}

.about-illustration svg {
    width: 100%;
    max-width: 500px;
    height: auto;
    opacity: 0.5;
}

/* =========================================
   ARCHITECTURE PAGE
   ========================================= */

.architecture-page {
    padding: var(--space-lg) 0 var(--space-xxl);
}

.architecture-page h1 {
    font-size: 1.3rem;
    margin-bottom: var(--space-xs);
}

.architecture-statement {
    font-size: 1rem;
    font-style: italic;
    color: var(--ink-faint);
    margin-bottom: var(--space-xl);
}

.architecture-body {
    font-size: 1.05rem;
    line-height: 1.85;
}

.architecture-body p {
    margin-bottom: 1.5rem;
}

.architecture-body a {
    text-decoration: underline;
    text-decoration-color: var(--wash-mid);
    text-underline-offset: 0.15em;
}

.architecture-body a:hover {
    text-decoration-color: var(--ink);
}

.architecture-body h2 {
    font-size: 1.15rem;
    margin-top: var(--space-xl);
    margin-bottom: var(--space);
}

.architecture-body h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-top: var(--space-lg);
    margin-bottom: var(--space-sm);
    color: var(--ink-light);
}

.architecture-illustration {
    margin: var(--space-xl) 0;
    display: flex;
    justify-content: center;
}

.architecture-illustration svg {
    width: 100%;
    max-width: 400px;
    height: auto;
    opacity: 0.6;
}

.separation-rules {
    background: var(--paper-warm);
    border-left: 2px solid var(--wash-mid);
    padding: var(--space) var(--space-lg);
    margin: var(--space) 0 var(--space-lg);
    list-style: none;
}

.separation-rules li {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--ink-light);
}

.separation-rules li::before {
    content: '—';
    margin-right: 0.5rem;
    color: var(--wash-mid);
}

/* =========================================
   OBJECT PAGE (placeholder)
   ========================================= */

.object-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl) var(--space);
}

.object-content {
    text-align: center;
    max-width: 400px;
}

.object-name {
    font-size: 1.4rem;
    margin-bottom: var(--space);
}

.object-description {
    font-size: 1rem;
    color: var(--ink-light);
    font-style: italic;
    line-height: 1.7;
    margin-bottom: var(--space-lg);
}

.object-status {
    font-size: 0.85rem;
    color: var(--ink-faint);
    letter-spacing: 0.05em;
}

/* =========================================
   404 PAGE
   ========================================= */

.not-found-page {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-xl) var(--space);
}

.not-found-page h1 {
    font-size: 3rem;
    font-weight: 400;
    color: var(--wash-mid);
    margin-bottom: var(--space);
}

.not-found-page p {
    font-style: italic;
    color: var(--ink-faint);
    margin-bottom: var(--space-lg);
}

.not-found-page a {
    font-size: 0.9rem;
    color: var(--water);
}

/* =========================================
   ADMIN STYLES
   ========================================= */

.admin-login {
    max-width: 320px;
    margin: var(--space-xxl) auto;
    padding: 0 var(--space);
}

.admin-login h1 {
    font-size: 1.2rem;
    margin-bottom: var(--space-lg);
}

.admin-login-form label {
    display: block;
    font-size: 0.85rem;
    color: var(--ink-faint);
    margin-bottom: var(--space-xs);
}

.admin-login-form input {
    width: 100%;
    padding: 0.7rem;
    font-family: var(--font-body);
    font-size: 1rem;
    border: 1px solid var(--wash-light);
    background: var(--paper);
    margin-bottom: var(--space);
}

.admin-login-form input:focus {
    outline: none;
    border-color: var(--water);
}

.admin-login-form button {
    width: 100%;
    padding: 0.7rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    background: var(--ink);
    color: var(--paper);
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.admin-login-form button:hover {
    background: var(--ink-light);
}

.admin-dashboard {
    padding: var(--space-lg) 0 var(--space-xxl);
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--space-xl);
}

.admin-topbar h1 {
    font-size: 1.2rem;
}

.admin-topbar-actions {
    display: flex;
    gap: var(--space);
}

.admin-btn {
    font-family: var(--font-body);
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border: 1px solid var(--wash-light);
    background: var(--paper);
    color: var(--ink);
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-btn:hover {
    border-color: var(--ink);
    color: var(--ink);
}

.admin-btn-primary {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}

.admin-btn-primary:hover {
    background: var(--ink-light);
    color: var(--paper);
}

.admin-btn-muted {
    color: var(--ink-faint);
}

.admin-section {
    margin-bottom: var(--space-xl);
}

.admin-section-label {
    font-size: 0.8rem;
    text-transform: lowercase;
    letter-spacing: 0.1em;
    color: var(--ink-faint);
    margin-bottom: var(--space);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--wash-light);
}

.admin-list {
    list-style: none;
}

.admin-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--wash-faint);
}

.admin-piece-title {
    font-size: 1rem;
}

.admin-piece-subtitle {
    font-size: 0.85rem;
    color: var(--ink-faint);
    font-style: italic;
    margin-left: var(--space-sm);
}

.admin-piece-actions {
    display: flex;
    gap: var(--space);
}

.admin-link {
    font-size: 0.85rem;
    color: var(--water);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
}

.admin-link:hover {
    color: var(--ink);
}

.admin-link-danger {
    color: #8B5A5A;
}

.admin-link-danger:hover {
    color: #6B3A3A;
}

.admin-inline-form {
    display: inline;
}

.admin-empty {
    font-style: italic;
    color: var(--ink-faint);
    font-size: 0.95rem;
}

.admin-editor {
    padding: var(--space-lg) 0 var(--space-xxl);
}

.admin-meta {
    margin-bottom: var(--space-lg);
}

.admin-meta-label {
    font-size: 0.8rem;
    text-transform: lowercase;
    letter-spacing: 0.1em;
    color: var(--ink-faint);
}

.admin-meta-slug {
    font-size: 0.85rem;
    color: var(--water);
    margin-left: var(--space);
}

.admin-editor-form label {
    display: block;
    font-size: 0.85rem;
    color: var(--ink-faint);
    margin-bottom: var(--space-xs);
    margin-top: var(--space);
}

.admin-hint {
    font-weight: 400;
    font-style: italic;
}

.admin-editor-form input,
.admin-editor-form select,
.admin-editor-form textarea {
    width: 100%;
    padding: 0.7rem;
    font-family: var(--font-body);
    font-size: 1rem;
    border: 1px solid var(--wash-light);
    background: var(--paper);
}

.admin-editor-form input:focus,
.admin-editor-form select:focus,
.admin-editor-form textarea:focus {
    outline: none;
    border-color: var(--water);
}

.admin-editor-form textarea {
    min-height: 400px;
    line-height: 1.6;
    resize: vertical;
}

.admin-form-actions {
    margin-top: var(--space-lg);
    display: flex;
    gap: var(--space);
}

.flash {
    padding: var(--space);
    margin-bottom: var(--space-lg);
    font-size: 0.9rem;
    border-left: 3px solid var(--water);
    background: var(--paper-warm);
}

.flash-error {
    border-color: #8B5A5A;
}

.flash-success {
    border-color: var(--water);
}

/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 640px) {
    :root {
        --font-size-base: 17px;
    }

    .site-header .container {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space);
    }

    .site-nav {
        gap: var(--space);
    }

    .home-wordmark {
        font-size: 1.7rem;
    }

    .home-question a {
        font-size: 1rem;
    }

    .text-page h1 {
        font-size: 1.5rem;
    }

    .question-text {
        font-size: 1.2rem;
    }

    .admin-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }
}

/* =========================================
   PRINT
   ========================================= */

@media print {
    body::before {
        display: none;
    }

    .site-header,
    .site-footer,
    .home-illustration,
    .placed-illustration,
    .admin-piece-actions {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    a {
        color: black;
        text-decoration: underline;
    }
}
