/* yesan.xyz - Dark academia bento-box with circuit-trace connectors */

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

:root {
    --parchment-dark: #1a1610;
    --deep-brown: #2a2418;
    --dark-wood: #5a4a32;
    --forest: #4a6a3e;
    --warm-brown: #7a6a4e;
    --gold: #b89f6a;
    --muted-tan: #9a8a6a;
    --parchment: #d4c8a8;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--parchment-dark);
    color: var(--parchment);
    font-family: 'Source Serif 4', serif;
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
}

/* Title Cartouche */
.cartouche-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: var(--parchment-dark);
}

.cartouche-inner {
    text-align: center;
    padding: 40px;
}

.domain-title {
    font-family: 'Albert Sans', sans-serif;
    font-size: clamp(48px, 10vw, 80px);
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--parchment);
    margin-bottom: 16px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
}

.domain-title.visible {
    opacity: 1;
    transform: translateY(0);
}

.domain-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    font-weight: 300;
    color: var(--muted-tan);
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 1s ease 0.4s;
}

.domain-subtitle.visible {
    opacity: 1;
}

.cartouche-line {
    width: 1px;
    height: 80px;
    background: var(--dark-wood);
    margin: 40px auto 0;
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 1s ease 0.8s;
}

.cartouche-line.visible {
    transform: scaleY(1);
}

/* Bento Grid */
.bento-section {
    padding: 40px 24px 80px;
    max-width: 1100px;
    margin: 0 auto;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
}

/* Cell base */
.bento-cell {
    background-color: var(--deep-brown);
    border: 1px solid var(--dark-wood);
    padding: 28px;
    position: relative;
    overflow: hidden;
    cursor: default;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.bento-cell.revealed {
    opacity: 1;
    transform: translateY(0);
}

.cell-label {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: var(--warm-brown);
    margin-bottom: 16px;
    text-transform: uppercase;
}

.cell-heading {
    font-family: 'Albert Sans', sans-serif;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--parchment);
    margin-bottom: 12px;
}

.cell-body {
    font-family: 'Source Serif 4', serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.8;
    color: var(--muted-tan);
}

.cell-blockquote {
    font-family: 'Source Serif 4', serif;
    font-size: 18px;
    font-weight: 400;
    font-style: italic;
    line-height: 1.7;
    color: var(--parchment);
    border-left: 2px solid var(--gold);
    padding-left: 20px;
}

.stat-number {
    display: block;
    font-family: 'Albert Sans', sans-serif;
    font-size: 48px;
    font-weight: 600;
    color: var(--gold);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-unit {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--warm-brown);
    letter-spacing: 0.1em;
}

/* Cell grid placement */
.cell-definition {
    grid-column: span 2;
    grid-row: span 1;
}

.cell-circuit {
    grid-column: span 2;
    grid-row: span 1;
    min-height: 240px;
}

.cell-origin {
    grid-column: span 3;
    grid-row: span 1;
}

.cell-stat {
    grid-column: span 1;
    grid-row: span 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: var(--dark-wood);
}

.cell-stat .cell-label {
    color: var(--parchment);
}

.cell-quote {
    grid-column: span 2;
    grid-row: span 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cell-circuit-2 {
    grid-column: span 2;
    grid-row: span 1;
    min-height: 220px;
}

.cell-philosophy {
    grid-column: span 3;
    grid-row: span 1;
}

.cell-stat-2 {
    grid-column: span 1;
    grid-row: span 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: var(--forest);
}

.cell-stat-2 .cell-label {
    color: var(--parchment);
}

.cell-stat-2 .stat-number {
    color: var(--parchment);
}

/* Circuit containers */
.circuit-container {
    width: 100%;
    height: 100%;
    min-height: 160px;
}

.circuit-container svg {
    width: 100%;
    height: 100%;
}

/* Ripple effect */
.ripple-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(184, 159, 106, 0.15);
    transform: scale(0);
    animation: rippleExpand 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes rippleExpand {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Circuit Trace Section */
.trace-section {
    padding: 80px 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.trace-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 40px;
}

.section-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: var(--warm-brown);
    white-space: nowrap;
}

.section-rule {
    flex: 1;
    height: 1px;
    background: var(--dark-wood);
}

.trace-canvas {
    width: 100%;
    height: 300px;
    position: relative;
}

.trace-canvas svg {
    width: 100%;
    height: 100%;
}

/* Colophon */
.colophon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 60px 24px;
    border-top: 1px solid var(--dark-wood);
}

.colophon-domain {
    font-family: 'Albert Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--warm-brown);
}

.colophon-timestamp {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 300;
    color: var(--dark-wood);
    letter-spacing: 0.05em;
}

.colophon-korean {
    font-family: 'Albert Sans', sans-serif;
    font-size: 14px;
    color: var(--muted-tan);
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .cell-definition,
    .cell-circuit,
    .cell-origin,
    .cell-quote,
    .cell-circuit-2,
    .cell-philosophy {
        grid-column: span 2;
    }
    .cell-stat,
    .cell-stat-2 {
        grid-column: span 1;
    }
}

@media (max-width: 480px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
    .bento-cell {
        grid-column: span 1 !important;
    }
}
