/* ===== ronri.net — Evolved Minimal / Bento-Box / Monochrome ===== */

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

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

body {
    background-color: #fafafa;
    color: #5c5c5c;
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
}

/* --- Scroll Progress Bar --- */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 1px;
    background-color: #0d0d0d;
    z-index: 1000;
    transition: none;
}

/* --- Navigation Toggle --- */
#nav-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1001;
    width: 32px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    padding: 0;
}

#nav-toggle .bar {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #0d0d0d;
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                opacity 0.3s ease;
    transform-origin: center center;
}

#nav-toggle.active .bar-1 {
    transform: translateY(11px) rotate(45deg);
}

#nav-toggle.active .bar-2 {
    opacity: 0;
}

#nav-toggle.active .bar-3 {
    transform: translateY(-11px) rotate(-45deg);
}

/* --- Navigation Overlay --- */
#nav-overlay {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background-color: #fafafa;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: right 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#nav-overlay.nav-open {
    right: 0;
}

.nav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    max-width: 600px;
    width: 90%;
}

.nav-link {
    display: block;
    padding: 32px 24px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    color: #2a2a2a;
    text-decoration: none;
    border: 2px solid #c8c8c8;
    position: relative;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 16px;
    left: 24px;
    width: 0;
    height: 1px;
    background-color: #0d0d0d;
    transition: width 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.nav-link:hover {
    background-color: #ffffff;
}

.nav-link:hover::after {
    width: calc(100% - 48px);
}

/* --- Bento Grid System --- */
.bento-section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 48px;
}

.bento-grid {
    display: grid;
    gap: 2px;
    border: 2px solid #2a2a2a;
}

.bento-cell {
    border: none;
    outline: 1px solid #c8c8c8;
    padding: 24px;
    overflow: hidden;
    position: relative;
    background-color: #fafafa;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                background-color 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    opacity: 0;
    transform: translateY(8px);
}

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

.bento-cell:hover {
    background-color: #ffffff;
    transform: scale(1.02);
    z-index: 2;
}

.bento-cell.visible:hover {
    transform: scale(1.02);
}

/* Alternating cell backgrounds */
.bento-cell:nth-child(even) {
    background-color: #e8e8e8;
}

.bento-cell:nth-child(even):hover {
    background-color: #ffffff;
}

/* --- Hero Section --- */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: stretch;
    padding-top: 0;
    padding-bottom: 0;
}

.hero-grid {
    grid-template-columns: 1fr 2fr 1fr 1.5fr;
    grid-template-rows: 1fr 1fr 1fr;
    flex: 1;
}

/* Hero grid area assignments */
.cell-penrose {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
}

.cell-hero-title {
    grid-column: 2 / 4;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 48px;
}

.cell-logic-symbol {
    grid-column: 4 / 5;
    grid-row: 1 / 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.cell-pinstripe {
    grid-column: 4 / 5;
    grid-row: 2 / 3;
    background-image: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 23px,
        #c8c8c8 23px,
        #c8c8c8 24px
    ) !important;
}

.cell-watermark {
    grid-column: 1 / 2;
    grid-row: 3 / 4;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.cell-circuit {
    grid-column: 3 / 4;
    grid-row: 3 / 4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cell-dotgrid {
    grid-column: 4 / 5;
    grid-row: 3 / 4;
    background-image: radial-gradient(circle, #c8c8c8 1px, transparent 1px);
    background-size: 16px 16px;
}

.cell-logic-text {
    display: none;
}

.cell-conic {
    display: none;
}

.cell-alt {
    display: none;
}

/* --- Hero Typography --- */
.hero-title {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 600;
    font-size: clamp(3rem, 8vw, 7rem);
    color: #0d0d0d;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 16px;
}

.hero-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: #8a8a8a;
    letter-spacing: 0.04em;
}

/* --- Logic Symbols --- */
.logic-symbols {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logic-sym {
    position: absolute;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(4rem, 10vw, 12rem);
    font-weight: 300;
    color: #0d0d0d;
    opacity: 0;
    transition: opacity 1s ease;
}

.logic-sym.active {
    opacity: 1;
}

/* --- Decorative Elements --- */
.diagonal-line {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.diagonal-line line {
    stroke: #d0d0d0;
}

.watermark-text {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 300;
    font-size: clamp(3rem, 6vw, 5rem);
    color: #e8e8e8;
    white-space: nowrap;
    user-select: none;
    line-height: 1;
}

.watermark-section {
    opacity: 0.05;
    transition: opacity 0.3s ease;
}

.decorative-symbol {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(4rem, 10vw, 10rem);
    font-weight: 300;
    color: #0d0d0d;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.logic-notation {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: #8a8a8a;
    letter-spacing: 0.04em;
}

/* --- Penrose SVG --- */
.penrose-svg {
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.penrose-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawPenrose 3s ease-out forwards;
}

@keyframes drawPenrose {
    to {
        stroke-dashoffset: 0;
    }
}

.penrose-small {
    max-width: 200px;
    max-height: 200px;
    margin: auto;
}

/* --- Circuit SVG --- */
.circuit-svg {
    width: 100%;
    height: 100%;
    max-width: 200px;
    max-height: 200px;
    opacity: 0.6;
}

/* --- Section Typography --- */
.section-heading {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    color: #0d0d0d;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.subsection-heading {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: #2a2a2a;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.body-text {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.125rem);
    color: #5c5c5c;
    line-height: 1.7;
}

.body-text em {
    font-style: italic;
}

.pull-quote {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.4rem, 2.8vw, 2.2rem);
    color: #2a2a2a;
    line-height: 1.4;
    letter-spacing: -0.02em;
}

.pull-quote p::before {
    content: none;
}

.contact-email {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: #2a2a2a;
    letter-spacing: 0.04em;
    margin-top: 16px;
}

/* --- Section Dividers --- */
.section-divider {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 48px;
    height: 24px;
    display: flex;
    align-items: center;
}

.divider-svg {
    width: 100%;
    height: 2px;
}

.divider-line {
    stroke-dasharray: 1280;
    stroke-dashoffset: 1280;
    transition: stroke-dashoffset 1.2s ease-out;
}

.divider-line.drawn {
    stroke-dashoffset: 0;
}

/* --- About Grid --- */
.about-grid {
    grid-template-columns: 1fr 2fr 1fr 1.5fr;
    grid-template-rows: auto auto;
}

.cell-about-title {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    display: flex;
    align-items: center;
}

.cell-about-text {
    grid-column: 2 / 4;
    grid-row: 1 / 2;
}

.cell-about-symbol {
    grid-column: 4 / 5;
    grid-row: 1 / 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cell-about-watermark {
    grid-column: 1 / 3;
    grid-row: 2 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cell-about-breathing {
    grid-column: 3 / 4;
    grid-row: 2 / 3;
    min-height: 120px;
}

.cell-about-text2 {
    grid-column: 4 / 5;
    grid-row: 2 / 3;
}

/* --- Principles Grid --- */
.principles-grid {
    grid-template-columns: 1fr 2fr 1fr 1.5fr;
    grid-template-rows: auto auto;
}

.cell-princ-title {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    display: flex;
    align-items: center;
}

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

.cell-princ-pattern {
    grid-column: 3 / 4;
    grid-row: 1 / 2;
    background-image: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 23px,
        #c8c8c8 23px,
        #c8c8c8 24px
    ) !important;
    min-height: 120px;
}

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

.cell-princ-symbol {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.cell-princ-watermark {
    grid-column: 4 / 5;
    grid-row: 2 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cell-princ-breathing {
    display: none;
}

/* --- Diagrams Grid --- */
.diagrams-grid {
    grid-template-columns: 1fr 2fr 1.5fr;
    grid-template-rows: auto auto;
}

.cell-diag-title {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    display: flex;
    align-items: center;
}

.cell-diag-interactive {
    grid-column: 2 / 3;
    grid-row: 1 / 3;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cell-diag-penrose {
    grid-column: 3 / 4;
    grid-row: 1 / 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cell-diag-text {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
}

.cell-diag-watermark {
    grid-column: 3 / 4;
    grid-row: 2 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cell-diag-dotgrid {
    display: none;
}

/* --- Logic Diagram --- */
.logic-diagram {
    width: 100%;
    max-width: 400px;
}

.diagram-node circle {
    transition: fill 0.3s ease;
}

.diagram-node:hover circle {
    fill: #e8e8e8;
}

.logic-diagram:hover .diagram-connection line {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.8s ease-out;
}

/* --- Exploration Grid --- */
.exploration-grid {
    grid-template-columns: 1fr 2fr 1fr 1.5fr;
    grid-template-rows: auto auto;
}

.cell-expl-title {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    display: flex;
    align-items: center;
}

.cell-expl-text {
    grid-column: 2 / 4;
    grid-row: 1 / 2;
}

.cell-expl-symbol {
    grid-column: 4 / 5;
    grid-row: 1 / 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cell-expl-pinstripe {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    background-image: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 23px,
        #c8c8c8 23px,
        #c8c8c8 24px
    ) !important;
    min-height: 120px;
}

.cell-expl-quote {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    display: flex;
    align-items: center;
    padding: 32px;
}

.cell-expl-watermark {
    grid-column: 3 / 4;
    grid-row: 2 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cell-expl-conic {
    grid-column: 4 / 5;
    grid-row: 2 / 3;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        #c8c8c8 1deg,
        transparent 2deg,
        transparent 30deg,
        #c8c8c8 31deg,
        transparent 32deg,
        transparent 60deg,
        #c8c8c8 61deg,
        transparent 62deg,
        transparent 90deg,
        #c8c8c8 91deg,
        transparent 92deg,
        transparent 120deg,
        #c8c8c8 121deg,
        transparent 122deg,
        transparent 150deg,
        #c8c8c8 151deg,
        transparent 152deg,
        transparent 180deg,
        #c8c8c8 181deg,
        transparent 182deg,
        transparent 210deg,
        #c8c8c8 211deg,
        transparent 212deg,
        transparent 240deg,
        #c8c8c8 241deg,
        transparent 242deg,
        transparent 270deg,
        #c8c8c8 271deg,
        transparent 272deg,
        transparent 300deg,
        #c8c8c8 301deg,
        transparent 302deg,
        transparent 330deg,
        #c8c8c8 331deg,
        transparent 332deg,
        transparent 360deg
    ) !important;
    min-height: 120px;
}

.cell-expl-text2 {
    display: none;
}

/* --- Contact Grid --- */
.contact-grid {
    grid-template-columns: 1fr 2fr 1fr 1.5fr;
    grid-template-rows: auto;
}

.cell-contact-title {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    display: flex;
    align-items: center;
}

.cell-contact-text {
    grid-column: 2 / 4;
    grid-row: 1 / 2;
}

.cell-contact-symbol {
    grid-column: 4 / 5;
    grid-row: 1 / 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cell-contact-watermark {
    display: none;
}

/* --- Footer --- */
.site-footer {
    max-width: 1280px;
    margin: 48px auto 0;
    padding: 24px 48px 48px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #c8c8c8;
    padding-top: 24px;
}

.footer-text {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.875rem;
    color: #8a8a8a;
}

.footer-notation {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: #8a8a8a;
    letter-spacing: 0.04em;
}

/* --- Tablet (below 1024px) --- */
@media (max-width: 1024px) {
    .bento-section {
        padding: 0 24px;
    }

    .hero-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr 1fr;
    }

    .cell-penrose {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
    }

    .cell-hero-title {
        grid-column: 1 / 3;
        grid-row: 2 / 3;
    }

    .cell-logic-symbol {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
    }

    .cell-breathing {
        display: none;
    }

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

    .cell-watermark {
        display: none;
    }

    .cell-breathing-2 {
        display: none;
    }

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

    .cell-dotgrid {
        display: none;
    }

    .about-grid,
    .principles-grid,
    .exploration-grid,
    .contact-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }

    .cell-about-title { grid-column: 1 / 2; grid-row: 1 / 2; }
    .cell-about-symbol { grid-column: 2 / 3; grid-row: 1 / 2; }
    .cell-about-text { grid-column: 1 / 3; grid-row: 2 / 3; }
    .cell-about-watermark { grid-column: 1 / 2; grid-row: 3 / 4; }
    .cell-about-breathing { grid-column: 2 / 3; grid-row: 3 / 4; }
    .cell-about-text2 { grid-column: 1 / 3; grid-row: 4 / 5; }

    .cell-princ-title { grid-column: 1 / 2; grid-row: 1 / 2; }
    .cell-princ-pattern { grid-column: 2 / 3; grid-row: 1 / 2; }
    .cell-princ-1 { grid-column: 1 / 3; grid-row: 2 / 3; }
    .cell-princ-2 { grid-column: 1 / 3; grid-row: 3 / 4; }
    .cell-princ-symbol { grid-column: 1 / 2; grid-row: 4 / 5; }
    .cell-princ-3 { grid-column: 2 / 3; grid-row: 4 / 5; }
    .cell-princ-watermark { grid-column: 1 / 3; grid-row: 5 / 6; }

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

    .cell-diag-title { grid-column: 1 / 3; grid-row: 1 / 2; }
    .cell-diag-interactive { grid-column: 1 / 3; grid-row: 2 / 3; }
    .cell-diag-penrose { grid-column: 1 / 2; grid-row: 3 / 4; }
    .cell-diag-text { grid-column: 2 / 3; grid-row: 3 / 4; }
    .cell-diag-watermark { grid-column: 1 / 3; grid-row: 4 / 5; }

    .cell-expl-title { grid-column: 1 / 2; grid-row: 1 / 2; }
    .cell-expl-symbol { grid-column: 2 / 3; grid-row: 1 / 2; }
    .cell-expl-text { grid-column: 1 / 3; grid-row: 2 / 3; }
    .cell-expl-pinstripe { grid-column: 1 / 2; grid-row: 3 / 4; }
    .cell-expl-quote { grid-column: 2 / 3; grid-row: 3 / 4; }
    .cell-expl-watermark { grid-column: 1 / 2; grid-row: 4 / 5; }
    .cell-expl-conic { grid-column: 2 / 3; grid-row: 4 / 5; }

    .cell-contact-title { grid-column: 1 / 2; grid-row: 1 / 2; }
    .cell-contact-symbol { grid-column: 2 / 3; grid-row: 1 / 2; }
    .cell-contact-text { grid-column: 1 / 3; grid-row: 2 / 3; }

    .section-divider {
        padding: 0 24px;
    }

    .site-footer {
        padding: 24px 24px 48px;
    }
}

/* --- Mobile (below 640px) --- */
@media (max-width: 640px) {
    .bento-section {
        padding: 0 16px;
    }

    .hero-section {
        height: auto;
        min-height: 100vh;
    }

    .hero-grid,
    .about-grid,
    .principles-grid,
    .diagrams-grid,
    .exploration-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .cell-penrose,
    .cell-hero-title,
    .cell-logic-symbol,
    .cell-pinstripe,
    .cell-circuit {
        grid-column: 1 / 2;
        grid-row: auto;
    }

    .cell-hero-title {
        padding: 32px 24px;
        min-height: 50vh;
    }

    .cell-about-title,
    .cell-about-text,
    .cell-about-symbol,
    .cell-about-watermark,
    .cell-about-breathing,
    .cell-about-text2 {
        grid-column: 1 / 2;
        grid-row: auto;
    }

    .cell-princ-title,
    .cell-princ-1,
    .cell-princ-pattern,
    .cell-princ-2,
    .cell-princ-symbol,
    .cell-princ-3,
    .cell-princ-watermark {
        grid-column: 1 / 2;
        grid-row: auto;
    }

    .cell-diag-title,
    .cell-diag-interactive,
    .cell-diag-penrose,
    .cell-diag-text,
    .cell-diag-watermark {
        grid-column: 1 / 2;
        grid-row: auto;
    }

    .cell-expl-title,
    .cell-expl-text,
    .cell-expl-symbol,
    .cell-expl-pinstripe,
    .cell-expl-quote,
    .cell-expl-watermark,
    .cell-expl-conic {
        grid-column: 1 / 2;
        grid-row: auto;
    }

    .cell-contact-title,
    .cell-contact-text,
    .cell-contact-symbol {
        grid-column: 1 / 2;
        grid-row: auto;
    }

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

    .section-divider {
        padding: 0 16px;
    }

    .site-footer {
        padding: 24px 16px 48px;
    }

    .footer-content {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}
