/* taisho.day - Brutalist warmth meets Art Nouveau */
/* Colors: #1a1a2e (deep base), #4a90d9 (primary blue), #f5f0e8 (warm off-white), #e8b84b (accent gold), #6c757d (muted gray) */
/* Fonts: Lora, Inter */

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

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

body {
    font-family: "Inter", sans-serif;
    background-color: #f5f0e8;
    color: #1a1a2e;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===================== FLORAL BORDERS ===================== */

.floral-border {
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.floral-border svg {
    width: 100%;
    height: 60px;
    display: block;
}

.floral-border--top {
    margin-bottom: -1px;
}

.floral-border--bottom {
    margin-top: -1px;
}

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

.brutalist-header {
    border-bottom: 3px solid #1a1a2e;
    padding: 2rem 2rem 1.5rem;
    background-color: #f5f0e8;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2rem;
}

.site-title {
    font-family: "Lora", serif;
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #1a1a2e;
    position: relative;
    display: inline-block;
}

/* Glitch effect for title */
.site-title::before,
.site-title::after {
    content: attr(data-glitch);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.site-title::before {
    color: #4a90d9;
    z-index: -1;
}

.site-title::after {
    color: #e8b84b;
    z-index: -1;
}

.site-title:hover::before {
    opacity: 0.8;
    animation: glitch-1 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
}

.site-title:hover::after {
    opacity: 0.8;
    animation: glitch-2 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) reverse both infinite;
}

@keyframes glitch-1 {
    0% { clip-path: inset(40% 0 61% 0); transform: translate(-2px, -1px); }
    20% { clip-path: inset(92% 0 1% 0); transform: translate(1px, 2px); }
    40% { clip-path: inset(43% 0 1% 0); transform: translate(-1px, 3px); }
    60% { clip-path: inset(25% 0 58% 0); transform: translate(3px, 1px); }
    80% { clip-path: inset(54% 0 7% 0); transform: translate(-3px, -2px); }
    100% { clip-path: inset(58% 0 43% 0); transform: translate(2px, -1px); }
}

@keyframes glitch-2 {
    0% { clip-path: inset(65% 0 13% 0); transform: translate(2px, 1px); }
    20% { clip-path: inset(15% 0 62% 0); transform: translate(-1px, -2px); }
    40% { clip-path: inset(79% 0 2% 0); transform: translate(1px, -3px); }
    60% { clip-path: inset(2% 0 78% 0); transform: translate(-3px, -1px); }
    80% { clip-path: inset(31% 0 28% 0); transform: translate(3px, 2px); }
    100% { clip-path: inset(10% 0 69% 0); transform: translate(-2px, 1px); }
}

.site-subtitle {
    font-family: "Inter", sans-serif;
    font-size: 0.95rem;
    font-weight: 400;
    color: #6c757d;
    margin-top: 0.4rem;
    letter-spacing: 0.04em;
}

.header-date-block {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.era-label {
    font-size: 2.2rem;
    color: #e8b84b;
    font-weight: 700;
    line-height: 1;
}

.today-date {
    font-family: "Inter", sans-serif;
    font-size: 0.85rem;
    color: #6c757d;
    letter-spacing: 0.05em;
}

/* ===================== BRUTALIST GRID ===================== */

.brutalist-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto;
    gap: 0;
}

.grid-cell {
    border: 2px solid #1a1a2e;
    padding: 1.5rem;
    position: relative;
    background: #f5f0e8;
    transition: background-color 0.3s ease;
}

.grid-cell:hover {
    background: #faf7f2;
}

/* Grid cell layout */
.grid-cell--featured {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
}

.grid-cell--timeline {
    grid-column: 3 / 4;
    grid-row: 1 / 3;
}

.grid-cell--culture {
    grid-column: 1 / 2;
    grid-row: 3 / 4;
}

.grid-cell--art {
    grid-column: 2 / 3;
    grid-row: 3 / 4;
}

.grid-cell--word {
    grid-column: 3 / 4;
    grid-row: 3 / 4;
}

.grid-cell--explore {
    grid-column: 1 / 4;
    grid-row: 4 / 5;
}

/* Cell border ornament (top-left corner Art Nouveau flourish) */
.cell-border-ornament {
    position: absolute;
    top: -2px;
    left: -2px;
    width: 24px;
    height: 24px;
    border-top: 3px solid #e8b84b;
    border-left: 3px solid #e8b84b;
    pointer-events: none;
}

.cell-border-ornament::after {
    content: "";
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e8b84b;
}

/* Cell header */
.cell-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #1a1a2e;
}

.cell-label {
    font-family: "Inter", sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #6c757d;
}

.cell-date {
    font-family: "Inter", sans-serif;
    font-size: 0.75rem;
    color: #e8b84b;
    font-weight: 500;
}

/* ===================== FEATURED SECTION ===================== */

.illustration-frame {
    position: relative;
    border: 2px solid #1a1a2e;
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.taisho-illustration {
    width: 100%;
    height: auto;
    display: block;
}

.illustration-glitch-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(74, 144, 217, 0.1) 2px,
        rgba(74, 144, 217, 0.1) 4px
    );
    mix-blend-mode: overlay;
    transition: opacity 0.3s ease;
}

.illustration-frame:hover .illustration-glitch-overlay {
    opacity: 1;
    animation: scanlines 0.1s steps(2) infinite;
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

.feature-title {
    font-family: "Lora", serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.75rem;
}

.feature-text {
    font-family: "Inter", sans-serif;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #1a1a2e;
}

/* ===================== TIMELINE ===================== */

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

.timeline-item {
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(26, 26, 46, 0.15);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
    cursor: pointer;
    transition: all 0.25s ease;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: #6c757d;
    border-radius: 50%;
    transition: all 0.25s ease;
}

.timeline-item:hover::before,
.timeline-item.active::before {
    background: #e8b84b;
    width: 8px;
    height: 8px;
    box-shadow: 0 0 8px rgba(232, 184, 75, 0.5);
}

.timeline-item:hover,
.timeline-item.active {
    padding-left: 0.5rem;
}

.timeline-year {
    font-family: "Lora", serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a2e;
}

.timeline-item.active .timeline-year {
    color: #e8b84b;
}

.timeline-event {
    font-family: "Inter", sans-serif;
    font-size: 0.82rem;
    color: #6c757d;
    line-height: 1.4;
}

/* ===================== CULTURAL FRAGMENT ===================== */

.culture-quote {
    margin-bottom: 1.25rem;
    padding-left: 1rem;
    border-left: 3px solid #e8b84b;
}

.culture-quote p {
    font-family: "Lora", serif;
    font-size: 1.05rem;
    font-style: italic;
    line-height: 1.6;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.culture-quote cite {
    font-family: "Inter", sans-serif;
    font-size: 0.8rem;
    color: #6c757d;
    font-style: normal;
}

.culture-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    font-family: "Inter", sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.3rem 0.6rem;
    border: 1px solid #1a1a2e;
    color: #1a1a2e;
    transition: all 0.2s ease;
    cursor: default;
}

.tag:hover {
    background: #1a1a2e;
    color: #e8b84b;
}

/* ===================== ART AND DESIGN ===================== */

.art-nouveau-frame {
    border: 1px solid rgba(26, 26, 46, 0.2);
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(26, 26, 46, 0.02);
}

.ornamental-svg {
    width: 100%;
    height: auto;
    display: block;
}

.art-description {
    font-family: "Inter", sans-serif;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #6c757d;
}

/* ===================== WORD OF THE DAY ===================== */

.word-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    padding: 1rem 0;
}

.word-japanese {
    font-size: 3rem;
    color: #1a1a2e;
    line-height: 1;
}

.word-romaji {
    font-family: "Lora", serif;
    font-size: 1.2rem;
    font-style: italic;
    color: #e8b84b;
}

.word-meaning {
    font-family: "Inter", sans-serif;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #6c757d;
    max-width: 280px;
}

/* ===================== EXPLORE LINKS ===================== */

.explore-links {
    display: flex;
    gap: 0;
    flex-wrap: wrap;
}

.explore-link {
    flex: 1;
    min-width: 150px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-right: 2px solid #1a1a2e;
    text-decoration: none;
    color: #1a1a2e;
    font-family: "Lora", serif;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.explore-link:last-child {
    border-right: none;
}

.explore-link::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: #1a1a2e;
    transition: left 0.35s ease;
    z-index: 0;
}

.explore-link:hover::before {
    left: 0;
}

.explore-link-text,
.explore-link-arrow {
    position: relative;
    z-index: 1;
    transition: color 0.25s ease;
}

.explore-link:hover .explore-link-text,
.explore-link:hover .explore-link-arrow {
    color: #e8b84b;
}

.explore-link-arrow {
    font-size: 1.3rem;
    transform: translateX(0);
    transition: transform 0.25s ease, color 0.25s ease;
}

.explore-link:hover .explore-link-arrow {
    transform: translateX(4px);
}

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

.brutalist-footer {
    border-top: 3px solid #1a1a2e;
    padding: 1.5rem 2rem;
    background: #1a1a2e;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-domain {
    font-family: "Lora", serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #f5f0e8;
}

.footer-divider {
    color: #6c757d;
    font-weight: 300;
}

.footer-era {
    color: #e8b84b;
    font-size: 1rem;
}

.footer-note {
    font-family: "Inter", sans-serif;
    font-size: 0.8rem;
    color: #6c757d;
    letter-spacing: 0.04em;
}

/* ===================== GLITCH EFFECT (global) ===================== */

.glitch-active {
    animation: element-glitch 0.15s steps(2) forwards;
}

@keyframes element-glitch {
    0% { transform: translate(0); filter: none; }
    25% { transform: translate(-2px, 1px); filter: hue-rotate(90deg); }
    50% { transform: translate(2px, -1px); filter: hue-rotate(-90deg); }
    75% { transform: translate(-1px, -1px); filter: hue-rotate(45deg); }
    100% { transform: translate(0); filter: none; }
}

/* ===================== ERA TRANSITION GLITCH ===================== */

.era-glitch-line {
    position: fixed;
    left: 0;
    width: 100%;
    height: 2px;
    background: #4a90d9;
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    mix-blend-mode: screen;
}

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

@media (max-width: 900px) {
    .brutalist-grid {
        grid-template-columns: 1fr 1fr;
    }
    .grid-cell--featured {
        grid-column: 1 / 3;
        grid-row: auto;
    }
    .grid-cell--timeline {
        grid-column: 1 / 3;
        grid-row: auto;
    }
    .grid-cell--culture {
        grid-column: 1 / 2;
        grid-row: auto;
    }
    .grid-cell--art {
        grid-column: 2 / 3;
        grid-row: auto;
    }
    .grid-cell--word {
        grid-column: 1 / 3;
        grid-row: auto;
    }
    .grid-cell--explore {
        grid-column: 1 / 3;
        grid-row: auto;
    }
    .site-title {
        font-size: 2.5rem;
    }
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .header-date-block {
        align-items: flex-start;
    }
}

@media (max-width: 600px) {
    .brutalist-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    .grid-cell--featured,
    .grid-cell--timeline,
    .grid-cell--culture,
    .grid-cell--art,
    .grid-cell--word,
    .grid-cell--explore {
        grid-column: 1;
        grid-row: auto;
    }
    .site-title {
        font-size: 2rem;
    }
    .brutalist-header {
        padding: 1.5rem 1rem 1rem;
    }
    .explore-links {
        flex-direction: column;
    }
    .explore-link {
        border-right: none;
        border-bottom: 2px solid #1a1a2e;
    }
    .explore-link:last-child {
        border-bottom: none;
    }
    .footer-inner {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
    .footer-left {
        justify-content: center;
    }
}