/* ============================================
   tanso.club — Dark-Academia Carbon Terrarium
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #0d1a0f;
    color: #c8c2b6;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.72;
    overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3, .hex-menu-item {
    font-family: 'Poiret One', 'Century Gothic', sans-serif;
    font-weight: 400;
    color: #b8d4a3;
}

.card-meta, .card-meta sub {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-weight: 400;
    font-size: clamp(0.75rem, 1.2vw, 0.9rem);
    letter-spacing: 0.05em;
    color: #6b8f71;
}

/* --- Chapter (shared) --- */
.chapter {
    position: relative;
    width: 100%;
}

/* --- Hero Chapter --- */
.hero-chapter {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d1a0f;
    overflow: hidden;
}

.aurora-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.hex-lattice {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.watermark {
    position: absolute;
    font-family: 'Poiret One', sans-serif;
    font-size: 40vw;
    color: #141c16;
    opacity: 0;
    z-index: 2;
    user-select: none;
    line-height: 1;
    transition: opacity 2s ease;
}

.watermark.visible {
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    opacity: 0;
    transition: opacity 1s ease 1.2s;
}

.hero-content.visible {
    opacity: 1;
}

.hero-title {
    font-size: clamp(3rem, 7vw, 6.5rem);
    letter-spacing: 0.12em;
    background: linear-gradient(90deg, #b8d4a3, #3dd68c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.3em;
}

.hero-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    color: #c8c2b6;
    letter-spacing: 0.05em;
}

/* --- Grid Chapters --- */
.grid-chapter {
    padding: clamp(3rem, 6vw, 6rem) clamp(1.5rem, 4vw, 4rem);
    background-image: radial-gradient(circle, #1a2a1e 1px, transparent 1px);
    background-size: 40px 40px;
    background-color: #0d1a0f;
}

/* --- Chapter Heading with Deco Rules --- */
.chapter-heading {
    text-align: center;
    margin-bottom: clamp(2rem, 4vw, 4rem);
}

.chapter-heading h2 {
    font-size: clamp(2rem, 4.5vw, 4rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 0.5em 0;
}

.deco-rule {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.deco-rule::before,
.deco-rule::after {
    content: '';
    height: 1px;
    width: clamp(40px, 10vw, 120px);
    background: #2a3d2e;
}

.deco-rule .diamond {
    display: block;
    width: 8px;
    height: 8px;
    background: #2a3d2e;
    transform: rotate(45deg);
}

/* --- Specimen Grid --- */
.specimen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: clamp(1.5rem, 3vw, 3rem);
    max-width: 1400px;
    margin: 0 auto;
}

/* --- Specimen Card --- */
.specimen-card {
    position: relative;
    background: #1a2a1e;
    border: 1px solid #2a3d2e;
    border-radius: 2px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                background 0.4s ease;
}

.specimen-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.specimen-card:hover {
    background: linear-gradient(145deg, #1a2a1e 0%, #0d1a0f 100%);
}

.specimen-card.hero-cell {
    grid-column: span 2;
    grid-row: span 2;
}

@media (max-width: 700px) {
    .specimen-card.hero-cell {
        grid-column: span 1;
        grid-row: span 1;
    }
}

/* Card Visualization area */
.card-viz {
    width: 100%;
    aspect-ratio: 16/10;
    position: relative;
    overflow: hidden;
}

.hero-cell .card-viz {
    aspect-ratio: 16/12;
}

/* Card Text */
.card-text {
    padding: 1.2rem 1.4rem 1.4rem;
}

.card-text h3 {
    font-size: 1.5rem;
    letter-spacing: 0.03em;
    margin-bottom: 0.3em;
}

.card-text .card-desc {
    font-style: italic;
    font-size: 0.95rem;
    color: #c8c2b6;
    margin-top: 0.5em;
    line-height: 1.6;
}

/* Corner Brackets */
.corner-tl, .corner-tr, .corner-bl, .corner-br {
    position: absolute;
    width: 16px;
    height: 16px;
    transition: width 0.3s ease, height 0.3s ease;
}

.corner-tl {
    top: 0; left: 0;
    border-top: 1px solid #2a3d2e;
    border-left: 1px solid #2a3d2e;
}
.corner-tr {
    top: 0; right: 0;
    border-top: 1px solid #2a3d2e;
    border-right: 1px solid #2a3d2e;
}
.corner-bl {
    bottom: 0; left: 0;
    border-bottom: 1px solid #2a3d2e;
    border-left: 1px solid #2a3d2e;
}
.corner-br {
    bottom: 0; right: 0;
    border-bottom: 1px solid #2a3d2e;
    border-right: 1px solid #2a3d2e;
}

.specimen-card:hover .corner-tl,
.specimen-card:hover .corner-tr,
.specimen-card:hover .corner-bl,
.specimen-card:hover .corner-br {
    width: 21px;
    height: 21px;
    border-color: #c49b5c;
}

/* --- Interstitial Chapters --- */
.interstitial-chapter {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d1a0f;
    overflow: hidden;
}

.cycle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.interstitial-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 700px;
    padding: 0 2rem;
}

.interstitial-title {
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    animation: colorCycle 8s ease-in-out infinite alternate;
}

@keyframes colorCycle {
    0% { color: #b8d4a3; }
    100% { color: #7b68ae; }
}

.interstitial-text {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: #c8c2b6;
    margin-top: 1.5rem;
    line-height: 1.8;
}

/* --- Hexagonal Navigation --- */
.hex-nav {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
}

.hex-nav-trigger {
    background: rgba(13, 26, 15, 0.8);
    border: 1px solid #2a3d2e;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.hex-nav-trigger:hover {
    border-color: #b8d4a3;
    background: rgba(26, 42, 30, 0.9);
}

.hex-menu {
    position: absolute;
    bottom: 70px;
    right: -60px;
    width: 200px;
    height: 200px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.hex-menu.open {
    opacity: 1;
    pointer-events: all;
}

.hex-menu-item {
    position: absolute;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-decoration: none;
    color: #b8d4a3;
    background: rgba(13, 26, 15, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0.4em 0.8em;
    border: 1px solid #2a3d2e;
    border-radius: 2px;
    white-space: nowrap;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.hex-menu-item:hover {
    color: #c49b5c;
    border-color: #c49b5c;
}

/* Position menu items in a hexagonal pattern */
.hex-menu-item[data-angle="0"]   { top: 0;    left: 50%; transform: translateX(-50%); }
.hex-menu-item[data-angle="60"]  { top: 25%;  right: -20px; }
.hex-menu-item[data-angle="120"] { top: 60%;  right: -20px; }
.hex-menu-item[data-angle="180"] { bottom: 0; left: 50%; transform: translateX(-50%); }
.hex-menu-item[data-angle="240"] { top: 60%;  left: -20px; }
.hex-menu-item[data-angle="300"] { top: 25%;  left: -20px; }

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    .specimen-card {
        transition: none;
        opacity: 1;
        transform: none;
    }
    .interstitial-title {
        animation: none;
        color: #b8d4a3;
    }
    .watermark {
        transition: none;
    }
    .hero-content {
        transition: none;
    }
    .aurora-canvas, .cycle-canvas {
        display: none;
    }
}
