/* rinji.org - Kirigami Paper-Craft Aesthetic */
/* Colors: #fdf4ec, #d46b4f, #f2a07b, #f5c467, #3d2b22, #8a6b5a, #fff8f2, #c4856a */
/* Fonts: Josefin Sans, Nunito, Noto Sans JP */

:root {
    --paper-cream: #fdf4ec;
    --kirigami-coral: #d46b4f;
    --sunset-peach: #f2a07b;
    --lantern-gold: #f5c467;
    --fold-shadow: #3d2b22;
    --paper-edge: #8a6b5a;
    --warm-white: #fff8f2;
    --soft-umber: #c4856a;
    --bg-hue: 25;
    --bg-sat: 80%;
    --bg-light: 96%;
}

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

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

body {
    font-family: 'Nunito', sans-serif;
    color: var(--fold-shadow);
    background-color: var(--paper-cream);
    background-image: linear-gradient(180deg, #fdf4ec 0%, #f2a07b 35%, #d46b4f 65%, #f5c467 85%, #fff8f2 100%);
    background-attachment: fixed;
    background-size: 100% 100%;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-color: var(--paper-cream);
    opacity: 0.85;
    z-index: 0;
    pointer-events: none;
    transition: background-color 0.6s ease;
}

/* Ribbon SVG */
.ribbon-svg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.ribbon {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 0.1s linear;
}

/* Fold Sections */
.fold {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transform-origin: center top;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.fold-1 { min-height: 100vh; }
.fold-2 { min-height: 100vh; }
.fold-3 { min-height: 150vh; }
.fold-4 { min-height: 100vh; }
.fold-5 { min-height: 100vh; }

.fold-content {
    max-width: 680px;
    width: 90%;
    padding: 12vh 0;
    position: relative;
    z-index: 5;
}

/* Fold 1 - offset slightly right */
.fold-1 .fold-content {
    transform: translateX(3%);
    text-align: center;
}

/* Fold 2 - offset left */
.fold-2 .fold-content {
    transform: translateX(-5%);
}

/* Fold 3 - centered */
.fold-3 .fold-content {
    transform: translateX(4%);
}

/* Fold 4 - high placement, breathing */
.fold-4 .fold-content {
    align-self: flex-start;
    padding-top: 18vh;
    transform: translateX(-3%);
}

/* Fold 5 - centered return */
.fold-5 .fold-content {
    text-align: center;
    transform: translateX(0);
}

/* Typography */
.domain-title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(2.4rem, 5.5vw, 4.6rem);
    letter-spacing: 0.06em;
    color: var(--kirigami-coral);
    text-transform: uppercase;
    line-height: 1.1;
    margin-bottom: 2rem;
}

.letter {
    display: inline-block;
    clip-path: inset(0 100% 0 0);
    animation: cutReveal 0.08s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: calc(var(--i) * 120ms + 0.5s);
}

@keyframes cutReveal {
    from { clip-path: inset(0 100% 0 0); }
    to { clip-path: inset(0 0% 0 0); }
}

.domain-title-final {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(2.4rem, 5.5vw, 4.6rem);
    letter-spacing: 0.06em;
    color: var(--kirigami-coral);
    text-transform: lowercase;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.section-heading {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    letter-spacing: 0.06em;
    color: var(--kirigami-coral);
    margin-bottom: 2rem;
}

.kanji {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 500;
    font-size: 1.6em;
    text-shadow: 2px 2px 0px rgba(212, 107, 79, 0.2);
    display: inline-block;
}

.body-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
    line-height: 1.72;
    color: var(--fold-shadow);
    max-width: 560px;
    margin-bottom: 1.5rem;
}

.label-text {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--paper-edge);
    margin-bottom: 1rem;
}

.final-label {
    margin-top: 1rem;
}

.haiku-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(1.2rem, 2.2vw, 1.6rem);
    line-height: 2.2;
    color: var(--fold-shadow);
    font-style: italic;
    text-align: center;
}

/* Scroll Hint */
.scroll-hint {
    margin-top: 4rem;
    display: flex;
    justify-content: center;
}

.hint-shape {
    width: 24px;
    height: 24px;
    background-color: var(--sunset-peach);
    opacity: 0.7;
    clip-path: polygon(50% 100%, 0% 0%, 100% 0%);
    animation: hintFloat 2.5s ease-in-out infinite;
}

@keyframes hintFloat {
    0%, 100% { transform: translateY(0); opacity: 0.7; }
    50% { transform: translateY(12px); opacity: 0.4; }
}

/* Fold Lines */
.fold-line {
    position: relative;
    width: 80%;
    max-width: 680px;
    margin: 0 auto;
    height: 1px;
    border-top: 1px dashed var(--soft-umber);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 3;
}

.fold-line.visible {
    opacity: 0.6;
}

/* Shapes Container */
.shapes-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

/* Floating Shapes */
.paper-shape {
    position: absolute;
    pointer-events: auto;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.shape-triangle {
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    animation: float var(--float-duration, 8s) ease-in-out infinite alternate;
}

.shape-notched-circle {
    clip-path: polygon(50% 50%, 100% 0%, 100% 35%, 80% 50%, 100% 65%, 100% 100%, 0% 100%, 0% 0%);
    animation: floatSlow var(--float-duration, 10s) ease-in-out infinite alternate;
}

.shape-half-star {
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 50% 0%);
    animation: floatSlow var(--float-duration, 9s) ease-in-out infinite alternate;
}

@keyframes float {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-20px) rotate(3deg); }
}

@keyframes floatSlow {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-15px) rotate(-2deg); }
}

/* Confetti */
.confetti-piece {
    position: absolute;
    width: 8px;
    height: 16px;
    opacity: 0;
    will-change: transform, opacity;
}

.confetti-piece.burst {
    animation: confettiBurst 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes confettiBurst {
    from {
        transform: translate(0, 0) rotate(0deg);
        opacity: 1;
    }
    to {
        transform: translate(var(--tx), var(--ty)) rotate(var(--tr));
        opacity: 0.7;
    }
}

/* Fold 4 rotating shape */
.rotating-shape {
    position: absolute;
    bottom: 20%;
    right: 15%;
    width: 40px;
    height: 40px;
    background-color: var(--lantern-gold);
    opacity: 0.6;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    animation: slowRotate 20s linear infinite;
    z-index: 3;
}

@keyframes slowRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .fold-content {
        width: 92%;
        padding: 8vh 0;
    }

    .fold-1 .fold-content,
    .fold-2 .fold-content,
    .fold-3 .fold-content,
    .fold-4 .fold-content {
        transform: translateX(0);
    }
}
