/* ===== Color Palette Reference =====
   Warm Parchment:    #f5efe6
   Aged Hanji:        #e8dcc8
   Golden Hour:       #c9a96e
   Charcoal Ink:      #2c2825
   Deep Soot:         #1a1714
   Silk White:        #faf8f4
   Faded Vermillion:  #b8705a
   Aurora Teal:       #5e8a7d
   Mist Gray:         #9a948b
===== */

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

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

body {
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    color: #2c2825;
    background-color: #f5efe6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Typography ===== */
.caveat-heading {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    color: #2c2825;
    line-height: 1.1;
    letter-spacing: 0.02em;
}

.noto-heading {
    font-family: 'Noto Serif JP', serif;
    font-weight: 400;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    letter-spacing: 0.05em;
    line-height: 1.6;
}

.body-text {
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.85;
    letter-spacing: 0.01em;
    color: #2c2825;
}

/* ===== Noise Overlay ===== */
.noise-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.03;
    z-index: 1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 128px 128px;
}

/* ===== Section Base ===== */
.section {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.section-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 900px;
    padding: 4rem 2rem;
}

.section-content--left {
    margin-left: 15%;
    margin-right: auto;
    padding-left: clamp(2rem, 8vw, 6rem);
    padding-right: clamp(1.4rem, 5.7vw, 4.3rem);
}

.section-content--center {
    margin: 0 auto;
    text-align: center;
}

/* ===== Hero Section ===== */
.section--hero {
    background: linear-gradient(160deg, #f5efe6 0%, #e8dcc8 100%);
    height: 100vh;
    min-height: 100vh;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8vw), 0 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(3rem, 7vw, 6rem);
    line-height: 1.1;
    letter-spacing: 0.02em;
    color: #2c2825;
    opacity: 0;
    will-change: opacity, clip-path;
}

.hero-title.revealed {
    animation: brushstrokeReveal 2.5s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes brushstrokeReveal {
    0% {
        opacity: 1;
        clip-path: inset(0 100% 0 0);
    }
    100% {
        opacity: 1;
        clip-path: inset(0 0% 0 0);
    }
}

.hero-subtitle {
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: #9a948b;
    margin-top: 1.5rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Scroll Chevron */
.scroll-chevron {
    position: absolute;
    bottom: calc(8vw + 2rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.scroll-chevron.visible {
    animation: chevronPulse 3s ease-in-out infinite;
}

@keyframes chevronPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* ===== Philosophy Section ===== */
.section--philosophy {
    background-color: #2c2825;
    clip-path: polygon(0 8vw, 100% 0, 100% calc(100% - 8vw), 0 100%);
    margin-top: -8vw;
    padding-top: 8vw;
    padding-bottom: 8vw;
}

.section--philosophy .caveat-heading {
    color: #e8dcc8;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
}

.section--philosophy .body-text {
    color: #e8dcc8;
    opacity: 0.85;
    margin-bottom: clamp(1.5rem, 4vh, 3rem);
}

/* ===== Brushstroke Divider ===== */
.brushstroke-divider {
    width: 40%;
    margin: 1.5rem 0 2rem;
    overflow: visible;
}

.brushstroke-svg {
    width: 100%;
    height: 12px;
    display: block;
}

.brushstroke-path {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Aurora Teal decorative accent for focus rings */
.glass-card:focus-within {
    outline: 1px solid #5e8a7d;
}

.brushstroke-path.drawn {
    stroke-dashoffset: 0;
}

/* ===== Stagger Animation ===== */
.stagger-line {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s cubic-bezier(0.23, 1, 0.32, 1),
                transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.stagger-line.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Process Section ===== */
.section--process {
    background-color: #1a1714;
    clip-path: polygon(0 0, 100% 8vw, 100% 100%, 0 calc(100% - 8vw));
    margin-top: -8vw;
    padding-top: calc(8vw + 4rem);
    padding-bottom: calc(8vw + 4rem);
}

.section--process .section-heading {
    color: #e8dcc8;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    margin-bottom: 3rem;
}

/* ===== Aurora Background ===== */
.aurora-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 60%, rgba(201, 169, 110, 0.15) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 70% 30%, rgba(184, 112, 90, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 90% 45% at 50% 80%, rgba(94, 138, 125, 0.10) 0%, transparent 65%);
    background-size: 200% 200%, 180% 180%, 220% 220%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.aurora-bg--active {
    opacity: 1;
    animation:
        auroraDrift1 60s ease-in-out infinite alternate,
        auroraDrift2 45s ease-in-out infinite alternate-reverse,
        auroraDrift3 75s ease-in-out infinite alternate;
}

.aurora-bg--subtle {
    opacity: 0.5;
    animation:
        auroraDrift1 60s ease-in-out infinite alternate,
        auroraDrift2 45s ease-in-out infinite alternate-reverse,
        auroraDrift3 75s ease-in-out infinite alternate;
}

.aurora-bg.in-view {
    opacity: 1;
}

@keyframes auroraDrift1 {
    0% { background-position: 0% 0%, 0% 0%, 0% 0%; }
    100% { background-position: 100% 100%, 0% 0%, 0% 0%; }
}

@keyframes auroraDrift2 {
    0% { background-position: 0% 0%, 0% 0%, 0% 0%; }
    100% { background-position: 0% 0%, 100% 50%, 0% 0%; }
}

@keyframes auroraDrift3 {
    0% { background-position: 0% 0%, 0% 0%, 0% 0%; }
    100% { background-position: 0% 0%, 0% 0%, 50% 100%; }
}

/* ===== Glassmorphic Cards ===== */
.glass-cards-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    position: relative;
    padding: 2rem 0;
}

.glass-card {
    background: rgba(250, 248, 244, 0.18);
    backdrop-filter: blur(18px) saturate(1.3);
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
    border: 1px solid rgba(201, 169, 110, 0.15);
    border-radius: 2px;
    box-shadow:
        0 8px 32px rgba(26, 23, 20, 0.06),
        inset 0 1px 0 rgba(250, 248, 244, 0.3);
    padding: clamp(2rem, 4vw, 3rem);
    max-width: 560px;
    width: 90%;
    text-align: left;
    position: relative;
    transition: border-color 0.4s ease, transform 0.8s cubic-bezier(0.23, 1, 0.32, 1),
                opacity 0.8s cubic-bezier(0.23, 1, 0.32, 1), margin-top 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.glass-card:hover {
    border-color: rgba(201, 169, 110, 0.35);
    background: rgba(250, 248, 244, 0.25);
    box-shadow:
        0 8px 32px rgba(26, 23, 20, 0.08),
        inset 0 1px 0 #faf8f4;
}

.glass-card .card-title {
    color: #c9a96e;
    margin-bottom: 1rem;
}

.glass-card .card-text {
    color: rgba(232, 220, 200, 0.85);
    font-size: clamp(0.9rem, 1.5vw, 1.05rem);
}

/* Cards stacked state */
.glass-card[data-card="1"] {
    z-index: 3;
    margin-top: 0;
}

.glass-card[data-card="2"] {
    z-index: 2;
    margin-top: -60%;
    opacity: 0.7;
}

.glass-card[data-card="3"] {
    z-index: 1;
    margin-top: -60%;
    opacity: 0.4;
}

/* Cards separated state */
.glass-cards-container.separated .glass-card[data-card="1"] {
    margin-top: 0;
    opacity: 1;
}

.glass-cards-container.separated .glass-card[data-card="2"] {
    margin-top: 40px;
    opacity: 1;
}

.glass-cards-container.separated .glass-card[data-card="3"] {
    margin-top: 40px;
    opacity: 1;
}

/* ===== Reflection Section ===== */
.section--reflection {
    background: linear-gradient(160deg, #e8dcc8 0%, #f5efe6 100%);
    clip-path: polygon(0 8vw, 100% 0, 100% calc(100% - 8vw), 0 100%);
    margin-top: -8vw;
    padding-top: 8vw;
    padding-bottom: 8vw;
    min-height: 100vh;
}

.thesis-statement {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

.thesis-text {
    font-size: clamp(2.2rem, 5vw, 4rem);
    line-height: 1.2;
    color: #2c2825;
    opacity: 0;
    will-change: opacity, clip-path;
}

.thesis-text.revealed {
    animation: brushstrokeReveal 2.5s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

/* ===== Contact Section ===== */
.section--contact {
    background-color: #1a1714;
    clip-path: polygon(0 0, 100% 8vw, 100% 100%, 0 100%);
    margin-top: -8vw;
    padding-top: calc(8vw + 4rem);
    padding-bottom: 4rem;
    min-height: 80vh;
}

.contact-heading {
    color: #e8dcc8;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    margin-bottom: 1.5rem;
}

.contact-text {
    color: #9a948b;
    margin-bottom: 2.5rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.contact-input-wrapper {
    position: relative;
    max-width: 360px;
    margin: 0 auto 3rem;
}

.contact-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(201, 169, 110, 0.3);
    padding: 0.75rem 0;
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    font-size: 1rem;
    color: #e8dcc8;
    letter-spacing: 0.02em;
    outline: none;
    transition: border-color 0.4s ease;
}

.contact-input::placeholder {
    color: #9a948b;
    opacity: 0.6;
}

.contact-input:focus {
    border-bottom-color: #c9a96e;
}

.contact-input:active {
    color: #b8705a;
}

.input-underline {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 1px;
    background-color: #c9a96e;
    transition: width 0.4s ease, left 0.4s ease;
}

.contact-input:focus ~ .input-underline {
    width: 100%;
    left: 0;
}

.domain-echo {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    color: #9a948b;
    opacity: 0.4;
    margin-top: 4rem;
    letter-spacing: 0.05em;
}

/* ===== Brush Reveal for Section Headings ===== */
.section-heading {
    opacity: 0;
    will-change: opacity, clip-path;
}

.section-heading.revealed {
    animation: brushstrokeReveal 2.5s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

/* ===== Pull-quote scale transition ===== */
.noto-heading {
    transform: scale(0.97);
    transition: transform 1.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.noto-heading.scaled {
    transform: scale(1.0);
}

/* ===== Ink Diffusion Edge Effect ===== */
.section--philosophy::before,
.section--process::before,
.section--reflection::before,
.section--contact::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    width: 100%;
    height: 20px;
    z-index: 3;
    pointer-events: none;
    filter: url(#ink-diffusion);
    background: inherit;
    opacity: 0.6;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
    .section-content--left {
        margin-left: 5%;
        padding-left: 1.5rem;
        padding-right: 1rem;
    }

    .glass-card {
        width: 95%;
        padding: 1.5rem;
    }

    .glass-card[data-card="2"],
    .glass-card[data-card="3"] {
        margin-top: -50%;
    }

    .glass-cards-container.separated .glass-card[data-card="2"],
    .glass-cards-container.separated .glass-card[data-card="3"] {
        margin-top: 24px;
    }

    .brushstroke-divider {
        width: 60%;
    }

    .thesis-text {
        font-size: clamp(1.8rem, 6vw, 3rem);
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }

    .section-content--left {
        margin-left: 0;
        padding-left: 1.2rem;
        padding-right: 1rem;
    }
}

/* ===== SVG Ink Diffusion Filter (referenced inline) ===== */
/* The SVG filter is injected via JS for the ink-diffusion edge effect */
