/* =============================================================
   yome.day — Art Deco Technical Compendium
   Design seed: art-deco broken-grid baskerville-refined analogous
   ============================================================= */

/* ---- Custom Properties ---- */
:root {
    /* Analogous amber palette */
    --amber:      #D4894A;
    --mahogany:   #2C1A10;
    --near-black: #1C1811;
    --warm-gold:  #C8A96E;
    --cream:      #F0EAD6;
    --pale-parch: #EDE5D4;
    --lt-cream:   #F5F0E8;
    --copper:     #B87A45;
    --dark-brown: #3A2A1E;

    /* Fonts */
    --font-serif:   'Libre Baskerville', Georgia, serif;
    --font-body:    'Source Serif 4', Georgia, serif;
    --font-mono:    'Space Mono', 'Courier New', monospace;
    --font-code:    'JetBrains Mono', 'Courier New', monospace;
    --font-ui:      'Inter', system-ui, sans-serif;

    /* Spacing */
    --col-gap: 2rem;
    --section-pad: 6rem;
    --max-width: 1280px;
}

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

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

body {
    background-color: var(--cream);
    color: var(--mahogany);
    font-family: var(--font-serif);
    line-height: 1.7;
    overflow-x: hidden;
}

/* ---- Grain Overlay ---- */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.08;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 300px 300px;
}

/* ---- Typography ---- */
h1, h2, h3, h4 {
    font-family: var(--font-serif);
    font-weight: 700;
    color: var(--mahogany);
    line-height: 1.2;
}

p {
    font-family: var(--font-body);
    color: var(--dark-brown);
}

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

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

code, pre {
    font-family: var(--font-code);
}

/* ---- Inline code ---- */
.inline-code {
    font-family: var(--font-code);
    font-size: 0.875em;
    color: var(--amber);
    background: rgba(212, 137, 74, 0.1);
    padding: 0.1em 0.35em;
    border-radius: 2px;
    border: 1px solid rgba(212, 137, 74, 0.25);
}

/* ---- SVG Underline Draw Animation ---- */
.animate-underline {
    position: relative;
    display: inline-block;
}

.animate-underline::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--amber);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-underline.drawn::after {
    transform: scaleX(1);
}

/* ---- Section Headers ---- */
.section-header {
    margin-bottom: 3rem;
}

.section-header.centered {
    text-align: center;
}

.step-label {
    font-family: var(--font-serif);
    font-size: 0.75rem;
    font-variant: small-caps;
    letter-spacing: 0.2em;
    color: var(--amber);
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: -0.02em;
    color: var(--mahogany);
    margin-bottom: 1.25rem;
}

.section-intro {
    font-size: 1.1rem;
    color: var(--dark-brown);
    max-width: 60ch;
    line-height: 1.8;
}

/* ============================================================
   Section I: Masthead
   ============================================================ */
.masthead {
    min-height: 100vh;
    background-color: var(--near-black);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.masthead::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 40% at 50% 50%, rgba(212, 137, 74, 0.08) 0%, transparent 70%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 39px,
            rgba(212, 137, 74, 0.04) 39px,
            rgba(212, 137, 74, 0.04) 40px
        );
    pointer-events: none;
}

.masthead-inner {
    text-align: center;
    padding: 4rem 2rem;
    position: relative;
    z-index: 1;
    max-width: 800px;
    width: 100%;
}

/* Deco Crest */
.deco-crest {
    margin: 0 auto 2rem;
    width: 140px;
    height: 140px;
    animation: crestRotateIn 1.2s ease-out both;
}

.crest-svg {
    width: 100%;
    height: 100%;
}

@keyframes crestRotateIn {
    from {
        opacity: 0;
        transform: rotate(-20deg) scale(0.7);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

/* Masthead Rules */
.masthead-rule {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 1.5rem auto;
    width: 60%;
    max-width: 400px;
}

.rule-thick {
    height: 2px;
    background: var(--amber);
}

.rule-medium {
    height: 1.5px;
    background: var(--amber);
}

.rule-thin {
    height: 1px;
    background: var(--warm-gold);
    opacity: 0.6;
}

/* Masthead Text */
.masthead-kicker {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--warm-gold);
    margin-bottom: 0.5rem;
    animation: fadeUp 0.8s 0.4s ease-out both;
}

.masthead-title {
    font-family: var(--font-serif);
    font-size: clamp(4rem, 10vw, 8rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--cream);
    line-height: 1;
    animation: fadeUp 0.8s 0.6s ease-out both;
}

.masthead-dot {
    color: var(--amber);
}

.masthead-subtitle {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--warm-gold);
    margin-top: 0.75rem;
    animation: fadeUp 0.8s 0.8s ease-out both;
}

/* Masthead Nav */
.masthead-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2.5rem;
    animation: fadeUp 0.8s 1s ease-out both;
}

.nav-link {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--pale-parch);
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--amber);
}

.nav-sep {
    color: var(--amber);
    font-size: 0.5rem;
    opacity: 0.7;
}

.masthead-scroll-cue {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--warm-gold);
    opacity: 0.6;
    margin-top: 3rem;
    animation: fadeUp 0.8s 1.2s ease-out both, pulse 3s 2s ease-in-out infinite;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50%       { opacity: 0.9; }
}

/* ============================================================
   Cornice Dividers
   ============================================================ */
.cornice-divider {
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: var(--pale-parch);
    position: relative;
}

.cornice-rule {
    width: 100%;
    max-width: var(--max-width);
}

.cornice-rule.rule-thin {
    height: 1px;
    background: var(--warm-gold);
    opacity: 0.5;
}

.cornice-rule.rule-medium {
    height: 1.5px;
    background: var(--amber);
    opacity: 0.7;
}

.cornice-rule.rule-thick {
    height: 2px;
    background: var(--mahogany);
}

.cornice-label {
    font-family: var(--font-serif);
    font-variant: small-caps;
    font-size: 0.8rem;
    letter-spacing: 0.3em;
    color: var(--amber);
    margin-top: 0.5rem;
}

/* ============================================================
   Section II: Tutorial Steps (Broken Grid)
   ============================================================ */
.tutorial-section {
    background: var(--lt-cream);
    padding: var(--section-pad) 2rem;
}

.broken-grid-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: var(--col-gap);
    row-gap: 0;
    align-items: start;
}

/* Main column: cols 1–7 */
.main-column {
    grid-column: 1 / 8;
    grid-row: 1;
}

/* Annotation column: cols 9–12, starts at row 2 (staggered) */
.annotation-column {
    grid-column: 9 / 13;
    grid-row: 1;
    padding-top: 8rem; /* deliberate stagger — the hallmark motif */
    position: relative;
}

.annotation-rule {
    position: absolute;
    top: 0;
    left: -1rem;
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--amber) 10%, var(--amber) 90%, transparent);
    opacity: 0.4;
}

/* Tutorial Steps */
.tutorial-step {
    margin-bottom: 4rem;
    padding-bottom: 4rem;
    border-bottom: 1px solid rgba(212, 137, 74, 0.2);
}

.tutorial-step:last-child {
    border-bottom: none;
}

.step-header {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}

.step-number {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--amber);
    opacity: 0.7;
    flex-shrink: 0;
    padding-top: 0.35em;
}

.step-title {
    font-family: var(--font-serif);
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 700;
    color: var(--mahogany);
    letter-spacing: -0.01em;
}

.step-body {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--dark-brown);
    margin-bottom: 1.5rem;
    max-width: 65ch;
    font-family: var(--font-body);
}

/* Code Blocks */
.code-block {
    background: var(--near-black);
    border: 1px solid rgba(212, 137, 74, 0.3);
    border-radius: 0;
    margin: 1.75rem 0;
    position: relative;
    overflow: hidden;
}

.code-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--amber);
}

.code-block-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 1.25rem 0.6rem 1.5rem;
    border-bottom: 1px solid rgba(212, 137, 74, 0.2);
    background: rgba(212, 137, 74, 0.05);
}

.code-lang {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--amber);
    padding: 0.15rem 0.5rem;
    border: 1px solid rgba(212, 137, 74, 0.4);
}

.code-title {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--warm-gold);
    opacity: 0.7;
}

.code-pre {
    padding: 1.5rem 1.5rem 1.5rem 1.75rem;
    overflow-x: auto;
    margin: 0;
}

.code-content {
    font-family: var(--font-code);
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--pale-parch);
    display: block;
}

/* Syntax token colors — warm register only */
.tok-tag   { color: var(--warm-gold); }
.tok-attr  { color: var(--amber); }
.tok-str   { color: #E8C97A; }
.tok-punct { color: var(--warm-gold); opacity: 0.7; }
.tok-sel   { color: var(--amber); }
.tok-prop  { color: #C8A96E; }
.tok-val   { color: #E8C97A; }
.tok-kw    { color: var(--amber); font-weight: 500; }
.tok-fn    { color: #E8C97A; }
.tok-var   { color: var(--pale-parch); }
.tok-param { color: var(--warm-gold); }

/* ---- Annotation Cards ---- */
.annotation-card {
    background: var(--pale-parch);
    border: 1px solid rgba(212, 137, 74, 0.25);
    border-left: 3px solid var(--amber);
    padding: 1.25rem;
    margin-bottom: 2rem;
    position: relative;
}

.annotation-label {
    font-family: var(--font-ui);
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--amber);
    margin-bottom: 0.6rem;
}

.annotation-text {
    font-family: var(--font-serif);
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--dark-brown);
}

.annotation-medallion {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    opacity: 0.6;
}

.annotation-medallion svg {
    width: 60px;
    height: 60px;
}

/* ============================================================
   Section III: Reference
   ============================================================ */
.reference-section {
    background: var(--pale-parch);
    padding: var(--section-pad) 2rem;
}

.reference-container {
    max-width: var(--max-width);
    margin: 0 auto;
}

.reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

.ref-card {
    background: var(--lt-cream);
    border: 1px solid rgba(212, 137, 74, 0.2);
    padding: 2rem;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ref-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--amber), var(--warm-gold));
}

.ref-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(44, 26, 16, 0.12);
}

.ref-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.ref-icon {
    display: block;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.ref-icon svg {
    width: 100%;
    height: 100%;
}

.ref-title {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 700;
    color: var(--mahogany);
    letter-spacing: -0.01em;
}

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

.ref-list li {
    font-family: var(--font-serif);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--dark-brown);
    padding-left: 1rem;
    position: relative;
}

.ref-list li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: var(--amber);
    font-size: 0.75rem;
}

/* ============================================================
   Section IV: Archive
   ============================================================ */
.archive-section {
    background: var(--cream);
    padding: var(--section-pad) 2rem;
}

.archive-container {
    max-width: 900px;
    margin: 0 auto;
}

.archive-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.archive-entry {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 2rem;
    padding: 2.5rem 0;
    border-bottom: 1px solid rgba(212, 137, 74, 0.2);
    transition: background 0.2s ease;
    cursor: pointer;
}

.archive-entry:last-child {
    border-bottom: none;
}

.archive-entry:hover {
    background: rgba(212, 137, 74, 0.03);
}

.archive-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 0.25rem;
    gap: 2px;
}

.date-day {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    color: var(--amber);
    line-height: 1;
}

.date-month {
    font-family: var(--font-ui);
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--warm-gold);
}

.date-year {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--copper);
    opacity: 0.6;
}

.archive-content {
    padding-top: 0.1rem;
}

.archive-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--mahogany);
    margin-bottom: 0.6rem;
    letter-spacing: -0.01em;
}

.archive-excerpt {
    font-family: var(--font-serif);
    font-size: 0.925rem;
    line-height: 1.75;
    color: var(--dark-brown);
    margin-bottom: 1rem;
}

.archive-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.meta-tag {
    font-family: var(--font-ui);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--mahogany);
    background: rgba(212, 137, 74, 0.12);
    padding: 0.2rem 0.6rem;
    border: 1px solid rgba(212, 137, 74, 0.3);
}

.meta-sep {
    color: var(--warm-gold);
    opacity: 0.5;
}

.meta-read {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    color: var(--copper);
    opacity: 0.7;
}

/* ============================================================
   Section V: About / Colophon
   ============================================================ */
.about-section {
    background: var(--near-black);
    padding: var(--section-pad) 2rem;
    text-align: center;
}

.about-container {
    max-width: 700px;
    margin: 0 auto;
}

.about-crest {
    margin: 0 auto 2.5rem;
    width: 100px;
    height: 100px;
}

.about-crest svg {
    width: 100%;
    height: 100%;
}

.about-section .step-label {
    color: var(--warm-gold);
}

.about-section .section-title {
    color: var(--cream);
}

.about-body {
    font-family: var(--font-serif);
    font-size: 1rem;
    line-height: 1.9;
    color: var(--pale-parch);
    margin-bottom: 1.5rem;
    text-align: left;
}

.about-body strong {
    color: var(--warm-gold);
    font-weight: 700;
}

/* Colophon rule group */
.colophon-rule {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin: 2.5rem 0;
}

.rule-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rule-group .rule-thin {
    height: 1px;
    background: var(--warm-gold);
    opacity: 0.3;
}

.rule-group .rule-medium {
    height: 1.5px;
    background: var(--amber);
    opacity: 0.5;
}

.colophon-ornament {
    color: var(--amber);
    font-size: 0.75rem;
    flex-shrink: 0;
}

.about-edition {
    font-family: var(--font-serif);
    font-variant: small-caps;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    color: var(--warm-gold);
    opacity: 0.6;
    text-align: center;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    background: var(--near-black);
    border-top: 1px solid rgba(212, 137, 74, 0.2);
    padding: 3rem 2rem;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer-rule {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 2rem;
}

.footer-rule .rule-thick {
    background: var(--amber);
    opacity: 0.5;
}

.footer-rule .rule-thin {
    background: var(--warm-gold);
    opacity: 0.2;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-brand {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--cream);
    letter-spacing: -0.02em;
}

.footer-nav {
    display: flex;
    gap: 2rem;
}

.footer-nav a {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--warm-gold);
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.footer-nav a:hover {
    opacity: 1;
    color: var(--amber);
}

.footer-copy {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--warm-gold);
    opacity: 0.4;
    letter-spacing: 0.05em;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
    .broken-grid-container {
        display: block;
    }

    .annotation-column {
        padding-top: 0;
        margin-top: 3rem;
        padding-left: 1.5rem;
        border-left: 2px solid rgba(212, 137, 74, 0.3);
    }

    .annotation-rule {
        display: none;
    }

    .archive-entry {
        grid-template-columns: 70px 1fr;
        gap: 1rem;
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

@media (max-width: 600px) {
    :root {
        --section-pad: 4rem;
    }

    .masthead-nav {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .archive-entry {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .archive-date {
        flex-direction: row;
        gap: 0.75rem;
        align-items: baseline;
    }

    .date-day {
        font-size: 1.25rem;
    }

    .reference-grid {
        grid-template-columns: 1fr;
    }

    .footer-nav {
        flex-wrap: wrap;
        gap: 1rem;
    }
}
