/* ==========================================================================
   nonri.xyz - Luxury-Premium Experimental Design
   Coastal-blend palette | Z-pattern layout | Glitch-art aesthetics
   ========================================================================== */

/* --- CSS Custom Properties --- */
:root {
    --deep-azure: #0A3058;
    --sandy-warm: #D0B888;
    --coastal-white: #F5F0E8;
    --mediterranean-teal: #2898A0;
    --gold-prestige: #C8A038;
    --glitch-rose: #E84878;
    --surf-foam: #E0E8E8;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: clamp(15px, 1vw, 17px);
    line-height: 1.8;
    color: var(--coastal-white);
    background-color: var(--deep-azure);
    overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(32px, 4vw, 60px);
}

h2 {
    font-size: clamp(26px, 3vw, 48px);
}

h3 {
    font-size: clamp(18px, 1.5vw, 24px);
}

.accent-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--gold-prestige);
    display: block;
}

/* --- Underline Draw Animation --- */
.underline-draw {
    position: relative;
    display: inline;
}

.underline-draw::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background-color: var(--gold-prestige);
    transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.underline-draw.is-visible::after {
    width: 100%;
}

/* --- Glitch Keyframes --- */
@keyframes glitch-flash {
    0% { opacity: 1; transform: translate(0); }
    20% { opacity: 0.8; transform: translate(-3px, 1px); filter: hue-rotate(90deg); }
    40% { opacity: 1; transform: translate(2px, -1px); }
    60% { opacity: 0.9; transform: translate(-1px, 2px); filter: hue-rotate(-90deg); }
    80% { opacity: 1; transform: translate(1px, -1px); }
    100% { opacity: 1; transform: translate(0); }
}

@keyframes glitch-channel-split {
    0% { text-shadow: 0 0 0 transparent; }
    25% { text-shadow: -3px 0 var(--glitch-rose), 3px 0 var(--mediterranean-teal); }
    50% { text-shadow: 2px 0 var(--glitch-rose), -2px 0 var(--mediterranean-teal); }
    75% { text-shadow: -1px 0 var(--glitch-rose), 1px 0 var(--mediterranean-teal); }
    100% { text-shadow: 0 0 0 transparent; }
}

@keyframes glitch-horizontal-lines {
    0%, 100% { clip-path: inset(0 0 0 0); }
    10% { clip-path: inset(20% 0 60% 0); }
    20% { clip-path: inset(50% 0 20% 0); }
    30% { clip-path: inset(10% 0 70% 0); }
    40% { clip-path: inset(80% 0 5% 0); }
    50% { clip-path: inset(0 0 0 0); }
}

@keyframes coastal-gradient-shift {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes draw-line {
    from { stroke-dashoffset: 1; }
    to { stroke-dashoffset: 0; }
}

@keyframes float-drift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(10px, -15px) rotate(1deg); }
    50% { transform: translate(-5px, -25px) rotate(-0.5deg); }
    75% { transform: translate(15px, -10px) rotate(0.8deg); }
}

/* ==========================================================================
   GRAND ENTRANCE
   ========================================================================== */
#grand-entrance {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--deep-azure) 0%, #0D3D6B 30%, var(--sandy-warm) 100%);
    background-size: 200% 200%;
    animation: coastal-gradient-shift 12s ease infinite;
    overflow: hidden;
}

/* Calligraphic strokes */
.calligraphic-stroke {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

.calligraphic-stroke.is-visible {
    opacity: 0.08;
}

.calligraphic-stroke:hover {
    opacity: 0.15;
}

.stroke-1 {
    width: 120px;
    top: 10%;
    left: 8%;
    animation: float-drift 20s ease-in-out infinite;
}

.stroke-2 {
    width: 180px;
    top: 60%;
    right: 5%;
    animation: float-drift 25s ease-in-out infinite;
    animation-delay: -5s;
}

.stroke-3 {
    width: 90px;
    bottom: 15%;
    left: 20%;
    animation: float-drift 22s ease-in-out infinite;
    animation-delay: -10s;
}

.stroke-4 {
    width: 150px;
    top: 20%;
    right: 15%;
    animation: float-drift 18s ease-in-out infinite;
    animation-delay: -3s;
}

/* Glitch element */
.glitch-element {
    position: absolute;
    width: 60%;
    max-width: 500px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

/* Z-pattern guide lines */
.z-guide-lines {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 0;
}

.z-guide-lines line {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    transition: stroke-dashoffset 1.2s ease;
    opacity: 0.15;
}

.z-guide-lines.is-drawn line {
    stroke-dashoffset: 0;
}

/* Entrance content */
.entrance-content {
    position: relative;
    z-index: 2;
    text-align: center;
    opacity: 0;
}

.entrance-content.is-visible {
    animation: fade-in-up 0.8s ease forwards;
}

.entrance-content .accent-label {
    margin-bottom: 16px;
}

.entrance-content .accent-label--bottom {
    margin-top: 20px;
    margin-bottom: 0;
}

/* Domain title */
.domain-title {
    color: var(--coastal-white);
    text-shadow: 0 0 40px rgba(200, 160, 56, 0.4);
    margin: 8px 0;
}

.glitch-text {
    position: relative;
    display: inline-block;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}

.glitch-text::before {
    color: var(--glitch-rose);
    z-index: -1;
}

.glitch-text::after {
    color: var(--mediterranean-teal);
    z-index: -1;
}

.glitch-text.is-glitching::before {
    opacity: 0.7;
    animation: glitch-flash 0.1s steps(2) 1;
    transform: translate(-3px, 1px);
}

.glitch-text.is-glitching::after {
    opacity: 0.7;
    animation: glitch-flash 0.1s steps(2) 1 0.05s;
    transform: translate(3px, -1px);
}

/* ==========================================================================
   Z-PATTERN SHOWCASE
   ========================================================================== */
#z-showcase {
    position: relative;
    padding: 96px 0;
    background: var(--deep-azure);
}

.z-node {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 40px;
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.z-node.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.z-node--left {
    transform: translateX(-60px);
}

.z-node--right {
    transform: translateX(60px);
}

.z-node--right.is-visible {
    transform: translateX(0);
}

.z-node--right {
    direction: ltr;
}

/* Z-node content */
.z-node__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

.z-node__title {
    color: var(--coastal-white);
    line-height: 1.2;
}

.z-node__text {
    color: var(--surf-foam);
    max-width: 480px;
}

.z-node--left .z-node__content {
    padding-left: 10%;
}

.z-node--right .z-node__content {
    padding-right: 10%;
}

/* Z-node visuals - luxury panels */
.z-node__visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.luxury-panel {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 4 / 3;
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow 0.4s ease;
}

.luxury-panel:hover {
    box-shadow: 0 0 40px rgba(200, 160, 56, 0.2);
}

.luxury-panel--glitch:hover {
    animation: glitch-horizontal-lines 0.3s steps(5) 1;
}

.panel-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--deep-azure) 0%, rgba(208, 184, 136, 0.3) 100%);
    border: 1px solid rgba(200, 160, 56, 0.15);
}

.panel-gradient--alt {
    background: linear-gradient(225deg, var(--deep-azure) 0%, rgba(40, 152, 160, 0.3) 100%);
    border-color: rgba(40, 152, 160, 0.15);
}

.panel-gradient--teal {
    background: linear-gradient(135deg, rgba(40, 152, 160, 0.2) 0%, var(--deep-azure) 100%);
    border-color: rgba(232, 72, 120, 0.15);
}

.panel-gradient--dark {
    background: linear-gradient(315deg, #050E1A 0%, var(--deep-azure) 100%);
    border-color: rgba(200, 160, 56, 0.2);
}

.panel-motif {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Z-pattern diagonal connectors */
.z-diagonal-connector {
    position: relative;
    height: 96px;
    max-width: 1200px;
    margin: 0 auto;
    overflow: visible;
}

.z-diagonal-connector::after {
    content: '';
    position: absolute;
    top: 0;
    left: 30%;
    width: 40%;
    height: 100%;
    background: linear-gradient(
        to bottom right,
        transparent 49.5%,
        rgba(200, 160, 56, 0.15) 49.5%,
        rgba(200, 160, 56, 0.15) 50.5%,
        transparent 50.5%
    );
}

.z-diagonal-connector--reverse::after {
    background: linear-gradient(
        to bottom left,
        transparent 49.5%,
        rgba(200, 160, 56, 0.15) 49.5%,
        rgba(200, 160, 56, 0.15) 50.5%,
        transparent 50.5%
    );
}

/* ==========================================================================
   CULTURAL ARCHIVE
   ========================================================================== */
#cultural-archive {
    position: relative;
    padding: 96px 0 48px;
    background: linear-gradient(180deg, var(--deep-azure) 0%, #0D2440 100%);
    overflow: hidden;
}

.archive-header {
    text-align: center;
    margin-bottom: 48px;
    padding: 0 40px;
}

.archive-title {
    color: var(--coastal-white);
    margin-top: 12px;
}

.archive-scroll-container {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--gold-prestige) transparent;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
    padding: 0 40px 24px;
}

.archive-scroll-container:active {
    cursor: grabbing;
}

.archive-scroll-container::-webkit-scrollbar {
    height: 4px;
}

.archive-scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

.archive-scroll-container::-webkit-scrollbar-thumb {
    background: var(--gold-prestige);
    border-radius: 2px;
}

.archive-track {
    display: flex;
    gap: 24px;
    width: max-content;
    padding-bottom: 8px;
}

.archive-card {
    position: relative;
    width: 320px;
    min-height: 260px;
    flex-shrink: 0;
    background: rgba(10, 48, 88, 0.6);
    border: 1px solid rgba(200, 160, 56, 0.12);
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.archive-card:hover {
    border-color: rgba(200, 160, 56, 0.35);
    box-shadow: 0 0 30px rgba(200, 160, 56, 0.1);
}

.archive-card__glitch-overlay {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(232, 72, 120, 0.03) 2px,
        rgba(232, 72, 120, 0.03) 4px
    );
    transition: opacity 0.3s ease;
}

.archive-card:hover .archive-card__glitch-overlay {
    opacity: 1;
}

.archive-card__content {
    position: relative;
    z-index: 1;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.archive-card__number {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(32px, 3vw, 42px);
    color: var(--gold-prestige);
    opacity: 0.25;
    line-height: 1;
}

.archive-card__title {
    color: var(--coastal-white);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.archive-card__text {
    color: var(--surf-foam);
    font-size: 14px;
    line-height: 1.7;
}

/* ==========================================================================
   PRESTIGE FOOTER
   ========================================================================== */
#prestige-footer {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #0D2440 0%, #050E1A 100%);
    overflow: hidden;
}

.footer-accent-line {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    background: var(--gold-prestige);
    opacity: 0;
    transition: opacity 0.8s ease, height 0.8s ease;
}

.footer-accent-line--top {
    top: 0;
    height: 0;
}

.footer-accent-line--top.is-visible {
    opacity: 0.3;
    height: 120px;
}

.footer-accent-line--bottom {
    bottom: 0;
    height: 0;
}

.footer-accent-line--bottom.is-visible {
    opacity: 0.3;
    height: 120px;
}

.stroke-footer-1 {
    width: 100px;
    top: 20%;
    left: 10%;
}

.stroke-footer-2 {
    width: 160px;
    bottom: 25%;
    right: 8%;
}

.footer-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.monogram {
    width: 100px;
    height: 100px;
    border: 1px solid rgba(200, 160, 56, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.monogram:hover {
    border-color: rgba(200, 160, 56, 0.6);
    box-shadow: 0 0 40px rgba(200, 160, 56, 0.15);
}

.monogram__letter {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 42px;
    color: var(--gold-prestige);
    letter-spacing: -0.02em;
}

.footer-content .accent-label {
    text-align: center;
}

.footer-tagline {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: 14px;
    color: var(--sandy-warm);
    letter-spacing: 0.08em;
    opacity: 0.6;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
    .z-node {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 32px 24px;
    }

    .z-node--left .z-node__content,
    .z-node--right .z-node__content {
        padding-left: 0;
        padding-right: 0;
    }

    .z-node--right {
        direction: ltr;
    }

    /* On mobile, reorder visual below content for right-aligned nodes */
    .z-node--right .z-node__visual {
        order: 2;
    }

    .z-node--right .z-node__content {
        order: 1;
    }

    .z-diagonal-connector {
        height: 48px;
    }

    .archive-card {
        width: 280px;
        min-height: 220px;
    }

    .stroke-1, .stroke-2, .stroke-3, .stroke-4 {
        display: none;
    }

    #grand-entrance {
        min-height: 100vh;
    }

    .monogram {
        width: 80px;
        height: 80px;
    }

    .monogram__letter {
        font-size: 34px;
    }
}

@media (max-width: 480px) {
    .archive-card {
        width: 260px;
        min-height: 200px;
    }

    .archive-card__content {
        padding: 24px;
    }

    h1 {
        font-size: clamp(28px, 8vw, 48px);
    }
}
