/* alth.ing - Wabi-Sabi Health & Healing
   Palette: Bisque Clay #E8E0D4, Kiln Char #2C2622, Ash Glaze #7D746A,
   Kintsugi Gold #B8923F, Deep Urushi #8A6A2F, Raku Smoke #D5CCC0,
   Fracture Light #C4A35A, Tenmoku Brown #4A3F35
   Fonts: Cormorant Garamond 300, Source Serif 4 400, Karla 400-600
*/

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

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

body {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.7;
    letter-spacing: 0.01em;
    color: #2C2622;
    background-color: #E8E0D4;
    background-image: radial-gradient(ellipse at center, #E8E0D4 0%, #D5CCC0 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* === SVG Filters (hidden) === */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

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

/* === Navigation === */
.nav {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 1000;
}

.ensou-mark {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: block;
    transition: opacity 0.3s ease;
}

.ensou-mark:hover {
    opacity: 0.7;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 24px;
    opacity: 0;
    transform: translateX(-20px);
    pointer-events: none;
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-menu.open {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.nav-link {
    font-family: 'Karla', 'Helvetica Neue', sans-serif;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    color: #4A3F35;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #B8923F;
}

/* === Sections Base === */
.section {
    position: relative;
    min-height: 100vh;
    width: 100%;
    padding: 0;
    transition: background-color 0.4s ease;
}

/* Section background colors - progressive darkening */
.section-hero {
    background-color: #E8E0D4;
}

.section-philosophy {
    background-color: #E3DBD0;
}

.section-practice {
    background-color: #DED6CA;
}

.section-meditation {
    background-color: #D9D1C5;
}

/* === Fracture Dividers === */
.fracture-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    z-index: 10;
}

.fracture-path {
    stroke: #C4A35A;
    stroke-width: 1.5;
    fill: none;
    stroke-linecap: round;
}

/* === Fade Reveal Animation === */
.fade-reveal {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.fade-reveal.visible {
    opacity: 1;
}

/* === Section Labels === */
.section-label {
    font-family: 'Karla', 'Helvetica Neue', sans-serif;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7D746A;
    display: block;
    margin-bottom: 24px;
}

/* === Section Headings === */
.section-heading {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 300;
    font-size: 56px;
    line-height: 1.15;
    letter-spacing: 0.04em;
    color: #2C2622;
    margin-bottom: 32px;
}

/* === Section Body === */
.section-body {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.7;
    letter-spacing: 0.01em;
    color: #2C2622;
    max-width: 38em;
    margin-bottom: 20px;
}

.section-body:last-child {
    margin-bottom: 0;
}

/* ===================== */
/* === SECTION 1: HERO === */
/* ===================== */
.section-hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-bottom: 40px;
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    padding: 0 40px;
    min-height: 100vh;
    align-items: center;
    position: relative;
}

.hero-vessel {
    grid-column: 2 / 8;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateY(-15%);
}

.vessel-svg {
    width: 100%;
    max-width: 400px;
    height: auto;
}

.vessel-body,
.vessel-body-right,
.vessel-rim,
.vessel-shadow {
    stroke-linecap: round;
}

.crack {
    opacity: 0;
    transition: opacity 1.2s ease;
}

.section-hero .crack {
    opacity: 1;
}

.hero-kintsugi-line {
    position: absolute;
    top: 50%;
    left: 40%;
    width: 35%;
    height: 200px;
    transform: translateY(-30%);
    z-index: 1;
    pointer-events: none;
}

.hero-title {
    grid-column: 8 / 12;
    align-self: center;
    padding-top: 20%;
}

.site-name {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 300;
    font-size: 72px;
    line-height: 1.15;
    letter-spacing: 0.04em;
    color: #2C2622;
    margin-bottom: 12px;
}

.hero-subtitle {
    font-family: 'Karla', 'Helvetica Neue', sans-serif;
    font-weight: 400;
    font-size: 15px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7D746A;
}

/* ========================== */
/* === SECTION 2: PHILOSOPHY === */
/* ========================== */
.section-philosophy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 120px 0 80px;
}

.philosophy-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

.philosophy-text {
    grid-column: 1 / 6;
}

.philosophy-illustration {
    grid-column: 7 / 13;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.fragments-svg {
    width: 100%;
    max-width: 300px;
    height: auto;
}

/* Fragment drift animation */
.fragment {
    animation: fragmentDrift 12s ease-in-out infinite;
}

.fragment-1 { animation-delay: 0s; }
.fragment-2 { animation-delay: -2s; }
.fragment-3 { animation-delay: -4s; }
.fragment-4 { animation-delay: -6s; }
.fragment-5 { animation-delay: -8s; }

@keyframes fragmentDrift {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(8px) rotate(1deg); }
}

/* Angular decorative marks */
.angular-marks {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.5;
}

.angular-marks-right {
    left: auto;
    right: 80px;
    bottom: 80px;
    transform: none;
}

/* ========================== */
/* === SECTION 3: PRACTICE CARDS === */
/* ========================== */
.section-practice {
    padding: 120px 0 100px;
}

.practice-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    margin-bottom: 80px;
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    position: relative;
    min-height: 600px;
}

/* Card positioning - asymmetric stagger */
.card-wrapper-1 {
    grid-column: 2 / 6;
    align-self: start;
}

.card-wrapper-2 {
    grid-column: 6 / 10;
    align-self: start;
    margin-top: 80px;
}

.card-wrapper-3 {
    grid-column: 3 / 7;
    align-self: start;
    margin-top: 160px;
}

/* Card perspective container */
.card-perspective {
    perspective: 1200px;
}

/* Card base */
.card {
    position: relative;
    width: 100%;
    height: 340px;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card.flipped {
    transform: rotateY(180deg);
}

/* Card faces */
.card-front,
.card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 32px;
    overflow: hidden;
}

/* Front face - cracked surface */
.card-front {
    background-color: #D5CCC0;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 85% 100%, 0 100%);
}

.card-crack {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Back face - tenmoku brown */
.card-back {
    background-color: #4A3F35;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 85% 100%, 0 100%);
    transform: rotateY(180deg);
}

.card-crack-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    filter: drop-shadow(0 0 12px rgba(184, 146, 63, 0.3));
}

.card-label {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 14px;
    color: #7D746A;
    margin-bottom: 8px;
}

.card-title {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 300;
    font-size: 32px;
    letter-spacing: 0.04em;
    color: #2C2622;
}

.card-label-back {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 14px;
    color: #B8923F;
    margin-bottom: 8px;
}

.card-title-back {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 300;
    font-size: 28px;
    letter-spacing: 0.04em;
    color: #E8E0D4;
    margin-bottom: 16px;
}

.card-description {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.6;
    color: #D5CCC0;
}

/* Card breathing animation */
.card-wrapper-1 .card {
    animation: breathe1 6s ease-in-out infinite;
}

.card-wrapper-2 .card {
    animation: breathe2 8s ease-in-out infinite;
}

.card-wrapper-3 .card {
    animation: breathe3 7s ease-in-out infinite;
}

@keyframes breathe1 {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.005); }
}

@keyframes breathe2 {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.005); }
}

@keyframes breathe3 {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.005); }
}

/* When flipped, override animation */
.card-wrapper-1 .card.flipped {
    animation: breathe1Flipped 6s ease-in-out infinite;
}

.card-wrapper-2 .card.flipped {
    animation: breathe2Flipped 8s ease-in-out infinite;
}

.card-wrapper-3 .card.flipped {
    animation: breathe3Flipped 7s ease-in-out infinite;
}

@keyframes breathe1Flipped {
    0%, 100% { transform: rotateY(180deg) scale(1); }
    50% { transform: rotateY(180deg) scale(1.005); }
}

@keyframes breathe2Flipped {
    0%, 100% { transform: rotateY(180deg) scale(1); }
    50% { transform: rotateY(180deg) scale(1.005); }
}

@keyframes breathe3Flipped {
    0%, 100% { transform: rotateY(180deg) scale(1); }
    50% { transform: rotateY(180deg) scale(1.005); }
}

/* ============================== */
/* === SECTION 4: MEDITATION === */
/* ============================== */
.section-meditation {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 120px 0 60px;
}

.meditation-container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    max-width: 1200px;
    width: 100%;
    padding: 0 40px;
    position: relative;
    min-height: 60vh;
    align-items: center;
}

.meditation-kintsugi-line {
    position: absolute;
    left: calc((100% / 12) * 3 - 10px);
    top: 0;
    width: 20px;
    height: 100%;
    z-index: 1;
}

.meditation-text {
    grid-column: 4 / 10;
    padding-left: 40px;
}

.poem {
    margin-top: 32px;
}

.poem-line {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 300;
    font-size: 28px;
    line-height: 1.6;
    letter-spacing: 0.02em;
    color: #2C2622;
    margin-bottom: 4px;
}

/* === Footer === */
.site-footer {
    width: 100%;
    max-width: 1200px;
    padding: 80px 40px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-mark {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 300;
    font-size: 18px;
    letter-spacing: 0.04em;
    color: #7D746A;
}

.footer-year {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 16px;
    color: #7D746A;
}

/* === Kintsugi Line Drawing Animation === */
.kintsugi-path {
    stroke: #B8923F;
    stroke-width: 1.5;
    fill: none;
    stroke-linecap: round;
}

.kintsugi-path.animated {
    transition: stroke-dashoffset 1.5s ease-in-out;
}

/* ========================== */
/* === RESPONSIVE (Mobile) === */
/* ========================== */
@media (max-width: 768px) {
    .hero-grid {
        grid-template-columns: 1fr;
        padding: 0 24px;
        text-align: center;
    }

    .hero-vessel {
        grid-column: 1;
        transform: translateY(0);
        padding-top: 100px;
    }

    .vessel-svg {
        max-width: 280px;
    }

    .hero-kintsugi-line {
        display: none;
    }

    .hero-title {
        grid-column: 1;
        padding-top: 40px;
        padding-bottom: 60px;
    }

    .site-name {
        font-size: 52px;
    }

    .section-heading {
        font-size: 38px;
    }

    .philosophy-grid {
        grid-template-columns: 1fr;
        padding: 0 24px;
    }

    .philosophy-text {
        grid-column: 1;
        padding-left: 24px;
    }

    .philosophy-illustration {
        grid-column: 1;
        padding-right: 24px;
    }

    .section-practice {
        padding: 80px 0 60px;
    }

    .practice-header {
        padding: 0 24px;
        margin-bottom: 40px;
    }

    .cards-container {
        grid-template-columns: 1fr;
        padding: 0 24px;
        min-height: auto;
    }

    .card-wrapper-1 {
        grid-column: 1;
        padding-left: 24px;
    }

    .card-wrapper-2 {
        grid-column: 1;
        margin-top: 0;
        padding-right: 24px;
    }

    .card-wrapper-3 {
        grid-column: 1;
        margin-top: 0;
        padding-left: 24px;
    }

    .card {
        height: 300px;
    }

    .meditation-container {
        grid-template-columns: 1fr;
        padding: 0 24px;
    }

    .meditation-text {
        grid-column: 1;
        padding-left: 0;
    }

    .meditation-kintsugi-line {
        display: none;
    }

    .poem-line {
        font-size: 22px;
    }

    .site-footer {
        padding: 60px 24px 30px;
    }

    .angular-marks,
    .angular-marks-right {
        display: none;
    }
}

@media (max-width: 480px) {
    .site-name {
        font-size: 40px;
    }

    .section-heading {
        font-size: 32px;
    }

    .poem-line {
        font-size: 20px;
    }

    .card {
        height: 280px;
    }

    .section-body {
        font-size: 16px;
    }
}
