/* ============================================================
   yamichika.com — Sepia Isometric Mountain Journal
   ============================================================ */

/* --- Custom Properties --- */
:root {
    --bg: #F2E8D5;
    --surface: #EAD9BE;
    --text: #2A1F0E;
    --accent-gold: #8B6914;
    --shadow-sepia: #5C3D1A;
    --mid: #C4A882;
    --deep: #1C1409;
    --cream: #FAF5EC;
    --terracotta: #A0522D;
    --dark-shadow: #3D2B0A;

    --font-mono: 'Space Mono', 'Courier New', monospace;
    --font-body: 'Courier Prime', 'Courier New', serif;
    --font-jp: 'Noto Serif JP', serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    overflow-x: hidden;
    /* Kraft paper micro-texture: pure CSS */
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 1px,
            rgba(234, 217, 190, 0.4) 1px,
            rgba(234, 217, 190, 0.4) 2px
        );
}

/* ============================================================
   ACT I — Hero Section (100vh)
   ============================================================ */

.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    overflow: hidden;
    background-color: var(--bg);
}

/* Isometric dot grid overlay */
.iso-dot-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    /* Isometric dot pattern via radial gradients */
    background-image:
        radial-gradient(circle, var(--mid) 1px, transparent 1px);
    background-size: 12px 12px;
    transition: opacity 600ms ease;
}

.iso-dot-grid.visible {
    opacity: 0.15;
}

/* Mountain scene full bleed */
.mountain-scene {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.mountain-scene svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Hero text — lower-left offset */
.hero-text {
    position: absolute;
    left: 15%;
    top: 60%;
    z-index: 10;
    max-width: 600px;
}

.hero-title {
    font-family: var(--font-mono);
    font-size: 56px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text);
    line-height: 1.1;
    text-shadow: 2px 2px 0 var(--bg), 3px 3px 0 var(--bg);
}

.cursor {
    display: inline-block;
    color: var(--accent-gold);
    animation: blink 1s step-end infinite;
}

.cursor.fade-out {
    animation: cursorFadeOut 600ms forwards;
}

.hero-tagline {
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: 400;
    color: var(--shadow-sepia);
    margin-top: 12px;
    letter-spacing: 0.02em;
    text-shadow: 1px 1px 0 var(--bg);
}

.tagline-cursor {
    display: inline-block;
    width: 8px;
    height: 2px;
    background: var(--accent-gold);
    vertical-align: middle;
    animation: blink 0.8s step-end infinite;
}

.tagline-cursor.hidden {
    display: none;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes cursorFadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; display: none; }
}

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

.section-label {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.12em;
    color: var(--mid);
    text-transform: uppercase;
    margin-bottom: 32px;
    padding-left: 4px;
}

/* ============================================================
   ACT II — Ridge Section (Masonry)
   ============================================================ */

.ridge-section,
.second-ridge-section {
    position: relative;
    padding: 80px 60px;
    background-color: var(--bg);
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 1px,
            rgba(234, 217, 190, 0.4) 1px,
            rgba(234, 217, 190, 0.4) 2px
        );
}

/* Masonry Grid — two column desktop */
.masonry-grid {
    columns: 2;
    column-gap: 4%;
    max-width: 1200px;
    margin: 0 auto;
}

.masonry-grid-small {
    max-width: 900px;
}

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

.masonry-card {
    display: inline-block;
    width: 100%;
    margin-bottom: 20px;
    break-inside: avoid;
    background-color: var(--surface);
    padding: 28px 24px 24px;
    position: relative;
    overflow: hidden;
    cursor: default;

    /* Isometric shading: 3-face light/mid/dark border system */
    border-top: 2px solid var(--accent-gold);
    border-left: 2px solid var(--accent-gold);
    border-right: 4px solid var(--dark-shadow);
    border-bottom: 4px solid var(--dark-shadow);

    /* Scroll animation start state */
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity 400ms ease-out,
        transform 400ms ease-out,
        background-color 200ms ease,
        box-shadow 200ms ease;
}

.masonry-card.animated {
    opacity: 1;
    transform: translateY(0);
}

.masonry-card:hover {
    transform: translateY(-4px);
    background-color: var(--cream);
    border-right-color: var(--accent-gold);
    border-bottom-color: var(--accent-gold);
    box-shadow: 6px 6px 0 var(--shadow-sepia);
}

.masonry-card.animated:hover {
    transform: translateY(-4px);
}

/* Card contour rings — topographic overlay */
.masonry-card::after {
    content: '';
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 1px solid var(--mid);
    opacity: 0.2;
    pointer-events: none;
}

/* Varying contour sizes per card type */
.card-height-1::after { width: 100px; height: 100px; bottom: -10px; right: -10px; }
.card-height-2::after { width: 140px; height: 140px; bottom: -25px; right: -15px; }
.card-height-3::after { width: 80px; height: 80px; bottom: -5px; right: -5px; }
.card-height-4::after { width: 160px; height: 160px; bottom: -30px; right: -20px; }
.card-height-5::after { width: 120px; height: 120px; bottom: -20px; right: -15px; }

/* Approximate masonry heights via min-height */
.card-height-1 { min-height: 240px; }
.card-height-2 { min-height: 320px; }
.card-height-3 { min-height: 200px; }
.card-height-4 { min-height: 360px; }
.card-height-5 { min-height: 280px; }

/* Card Icon */
.card-iso-icon {
    margin-bottom: 16px;
    display: block;
}

/* Card Title */
.card-title {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text);
    margin-bottom: 12px;
    line-height: 1.3;
}

/* Card Description */
.card-desc {
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 400;
    color: var(--shadow-sepia);
    line-height: 1.65;
}

/* Card Note block */
.card-note {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--mid);
    display: flex;
    gap: 8px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.note-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--accent-gold);
    white-space: nowrap;
    padding-top: 1px;
}

.note-text {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--mid);
    font-style: italic;
}

/* Japanese topo label on card */
.card-topo-label {
    font-family: var(--font-jp);
    font-size: 13px;
    color: var(--mid);
    margin-top: 12px;
    letter-spacing: 0.08em;
}

/* ============================================================
   ACT III — Valley Section (dark breathing pause)
   ============================================================ */

.valley-section {
    position: relative;
    background-color: var(--deep);
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 80px 40px;
}

.valley-svg {
    position: absolute;
    top: 0;
    height: 100%;
    width: 200px;
    pointer-events: none;
}

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

.valley-svg-left {
    left: 0;
}

.valley-svg-right {
    right: 0;
    transform: scaleX(-1);
}

.valley-quote {
    position: relative;
    z-index: 2;
    max-width: 640px;
    text-align: center;
}

.valley-quote p {
    font-family: var(--font-body);
    font-size: 22px;
    font-weight: 400;
    font-style: italic;
    color: var(--surface);
    line-height: 1.6;
    letter-spacing: 0.01em;
}

.valley-quote cite {
    display: block;
    margin-top: 20px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--shadow-sepia);
    font-style: normal;
}

/* ============================================================
   Mountain Silhouette
   ============================================================ */

.mountain-silhouette {
    display: block;
    line-height: 0;
    background-color: var(--bg);
}

.mountain-silhouette svg {
    width: 100%;
    height: 120px;
    display: block;
}

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

.site-footer {
    position: relative;
    background-color: var(--bg);
    padding: 48px 60px 40px;
    border-top: 1px solid var(--mid);
    overflow: hidden;
}

.footer-iso-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.footer-iso-pattern {
    display: block;
}

.footer-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-legend {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-site-name {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--shadow-sepia);
}

.footer-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-link {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: var(--accent-gold);
    text-transform: uppercase;
    cursor: pointer;
    transition: color 150ms ease;
}

.footer-link:hover {
    color: var(--shadow-sepia);
}

.footer-sep {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--mid);
}

.footer-coords {
    display: flex;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--mid);
}

.footer-copy {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--shadow-sepia);
    text-transform: uppercase;
    padding-top: 8px;
    border-top: 1px solid var(--mid);
}

/* ============================================================
   Scroll Parallax Effect on dot grid
   ============================================================ */

/* Handled via JS transform */

/* ============================================================
   Responsive — Mobile
   ============================================================ */

@media (max-width: 768px) {
    .hero-title {
        font-size: 36px;
    }

    .hero-text {
        left: 8%;
        top: 55%;
        max-width: 90%;
    }

    .hero-tagline {
        font-size: 15px;
    }

    .ridge-section,
    .second-ridge-section {
        padding: 48px 20px;
    }

    .masonry-grid {
        columns: 1;
    }

    .valley-quote p {
        font-size: 18px;
    }

    .valley-svg {
        width: 100px;
    }

    .site-footer {
        padding: 40px 20px 32px;
    }

    .footer-nav {
        gap: 8px;
    }

    .card-height-1,
    .card-height-2,
    .card-height-3,
    .card-height-4,
    .card-height-5 {
        min-height: 0;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 28px;
    }

    .valley-svg {
        display: none;
    }
}
