/* =============================================================
   Meditative Living Site — Global Styles
   ============================================================= */

/* =============================================================
   Selection & Scrollbar
   ============================================================= */
::selection {
    background: rgba(196, 139, 154, 0.2);
    color: var(--color-text);
}

::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--color-bg);
}
::-webkit-scrollbar-thumb {
    background: rgba(184, 181, 176, 0.15);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

/* Custom Fonts */
@font-face {
    font-family: 'Accent';
    src: url('../fonts/accent.woff2') format('woff2'),
         url('../fonts/accent.woff') format('woff'),
         url('../fonts/accent.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&display=swap');

/* =============================================================
   CSS Custom Properties
   ============================================================= */
:root {
    --color-bg:         #0a0a0f;
    --color-bg-alt:     #12121a;
    --color-text:       #b8b5b0;
    --color-text-dim:   #7a7672;
    --color-accent:     #c48b9a;
    --color-accent-alt: #8fa7a0;
    --color-accent-soft:#a89bb5;
    --color-accent-warm:#c4a882;
    --color-glow:       rgba(196, 139, 154, 0.3);
    --color-glow-strong:rgba(196, 139, 154, 0.5);
    --color-overlay:    rgba(10, 10, 15, 0.85);
    --bg-glass:         rgba(255, 255, 255, 0.015);
    --border-glass:     rgba(255, 255, 255, 0.04);
}

/* =============================================================
   Base / Reset
   ============================================================= */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;
    font-weight: 400;
    background-color: var(--color-bg);
    color: var(--color-text);
    animation: breathe 20s ease-in-out infinite;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Breathing Background */
@keyframes breathe {
    0%, 100% { background-color: #0a0a0f; }
    25%      { background-color: #111828; }
    50%      { background-color: #1a150f; }
    75%      { background-color: #16101a; }
}

/* =============================================================
   Particles Canvas
   ============================================================= */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* =============================================================
   Layout
   ============================================================= */
.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* =============================================================
   Header
   ============================================================= */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: transparent;
    z-index: 1000;
    height: 60px;
}

/* Logo */
.logo {
    font-family: 'Accent', sans-serif;
    font-weight: 700;
    font-size: 36px;
}

.logo a {
    color: var(--color-text);
    text-decoration: none;
    text-shadow: 0 0 20px var(--color-glow);
    letter-spacing: 0.08em;
    transition: letter-spacing 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                text-shadow 0.4s ease,
                color 0.4s ease;
    display: inline-block;
}

.logo a:hover {
    color: var(--color-accent);
    letter-spacing: 0.15em;
    text-shadow: 0 0 30px var(--color-glow-strong);
}

/* Logo character animation */
.logo-char {
    display: inline-block;
    opacity: 0;
    animation: charReveal 0.4s ease forwards;
}

@keyframes charReveal {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================================
   Hamburger Menu
   ============================================================= */
.menu-container {
    position: relative;
}

.hamburger {
    width: 30px;
    height: 20px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 1001;
    position: relative;
}

.hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--color-text);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.hamburger:hover span {
    background-color: var(--color-accent);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* =============================================================
   Fullscreen Overlay Menu
   ============================================================= */
.menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: var(--color-overlay);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

@supports not (backdrop-filter: blur(12px)) {
    .menu-overlay {
        background: rgba(10, 10, 15, 0.95);
    }
}

.menu-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.menu-overlay__nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.menu-overlay__item {
    font-family: 'Accent', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 4vw, 3rem);
    letter-spacing: 0.3em;
    color: var(--color-text);
    text-decoration: none;
    opacity: 0;
    transform: translateY(20px);
    transition: color 0.4s ease,
                letter-spacing 0.4s ease,
                text-shadow 0.4s ease;
}

.menu-overlay__item:hover {
    color: var(--color-accent);
    letter-spacing: 0.5em;
    text-shadow: 0 0 20px var(--color-glow);
}

/* Keep old .menu hidden — replaced by overlay */
.menu {
    display: none;
}

/* =============================================================
   Main Content
   ============================================================= */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    margin-top: 60px;
}

.content-wrapper {
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.content-wrapper--wide {
    max-width: 800px;
}

.main-content h2 {
    font-family: 'Accent', sans-serif;
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 2rem;
    margin-top: 3.5rem;
    color: var(--color-text);
    text-align: center;
    width: 100%;
    text-shadow: 0 0 15px var(--color-glow);
}

.main-content h2:first-child {
    margin-top: 0;
}

.main-content h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 1px;
    background: var(--color-accent);
    margin: 0.8rem auto 0;
    opacity: 0.5;
    transition: width 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.main-content h2:hover::after {
    width: 100%;
}

.main-content p {
    line-height: 1.75;
    letter-spacing: 0.02em;
    text-align: left;
    width: 100%;
    padding: 0;
    box-sizing: border-box;
    margin-bottom: 1.5em;
}

/* Links */
.main-content a {
    color: var(--color-text);
    text-decoration: none;
    position: relative;
    transition: color 0.4s ease;
}

.main-content a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: -1px;
    left: 0;
    background-color: var(--color-accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    opacity: 0.6;
}

.main-content a:hover {
    color: var(--color-accent);
}

.main-content a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Lists */
.main-content li {
    margin-left: 0em;
    padding: 1.2em 1.5em;
    margin-bottom: 1.5em;
    list-style: none;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    border-left: 3px solid rgba(143, 167, 160, 0.3);
    border-radius: 6px;
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1),
                border-color 0.5s ease,
                box-shadow 0.5s ease,
                background 0.5s ease;
}

.main-content li:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-glass);
    border-left-color: var(--color-accent);
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.4);
}

/* Publication Styling */
.pub_title {
    font-size: 1.1em;
    font-weight: 600;
    line-height: 1.5;
}

.pub_title p,
.pub_authors p,
.pub_publisher p,
.pub_material p {
    margin-bottom: 0.15em;
}

.pub_title a {
    text-decoration: none;
    transition: color 0.3s ease;
}

.pub_title a:hover {
    color: var(--color-accent);
}

.pub_authors {
    font-size: 0.9em;
    color: var(--color-text-dim);
    margin-top: 0.4em;
}

.pub_publisher {
    font-size: 0.85em;
    color: var(--color-accent-alt);
    font-style: italic;
}

.pub_material {
    font-size: 0.85em;
    margin-top: 0.3em;
}

.pub_material a {
    color: var(--color-accent-soft);
    text-decoration: none;
    display: inline-block;
    padding: 0.25em 0.8em;
    border-radius: 50px;
    border: 1px solid rgba(168, 155, 181, 0.3);
    font-size: 0.8em;
    margin-right: 0.4em;
    margin-top: 0.3em;
    transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.pub_material a::after {
    display: none;
}

.pub_material a:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
    background: rgba(168, 155, 181, 0.1);
}

/* =============================================================
   Hero Image (Landing Page)
   ============================================================= */
.hero-parallax {
    position: fixed;
    top: -20px;
    left: 0;
    right: 0;
    bottom: -20px;
    z-index: 0;
    will-change: transform;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    mix-blend-mode: screen;
}

.central-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom;
    opacity: 0;
}

.central-image.revealed {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-12px); }
}

/* =============================================================
   Other Page Styles
   ============================================================= */
h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
}

p {
    font-size: 1em;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
}

/* =============================================================
   Contact Info
   ============================================================= */
.contact-info {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

.contact-info::before,
.contact-info::after {
    content: '';
    display: block;
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, transparent, rgba(184, 181, 176, 0.2));
}

.contact-info::after {
    background: linear-gradient(to top, transparent, rgba(184, 181, 176, 0.2));
}

.contact-info a {
    color: var(--color-text-dim);
    text-decoration: none;
    display: inline-block;
    transition: color 0.4s ease,
                transform 0.4s cubic-bezier(0.19, 1, 0.22, 1),
                filter 0.4s ease;
}

.contact-info a:hover {
    color: var(--color-accent);
    transform: translateX(-4px);
    filter: drop-shadow(0 0 6px var(--color-glow));
}

/* =============================================================
   Logo Link Styles (kept for specificity)
   ============================================================= */

/* =============================================================
   Fade-in Animation
   ============================================================= */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.fade-in {
    animation: fadeIn 1s ease-in-out;
    opacity: 0;
    animation-fill-mode: forwards;
}

/* =============================================================
   Click Bloom — Petal Effect
   ============================================================= */
.click-petal {
    position: fixed;
    pointer-events: none;
    z-index: 9997;
    border-radius: 50% 0 50% 0;
    opacity: 0.8;
    transform: translate(-50%, -50%);
    animation: petalBurst ease-out forwards;
}

@keyframes petalBurst {
    0% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(0.3) rotate(0deg);
    }
    50% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
        transform: translate(
            calc(-50% + var(--tx)),
            calc(-50% + var(--ty))
        ) scale(1) rotate(var(--rot));
    }
}

/* =============================================================
   Scroll Reveal (used by GSAP ScrollTrigger)
   ============================================================= */
.scroll-reveal {
    opacity: 0;
    transform: translateY(20px);
}

/* =============================================================
   Cursor Glow
   ============================================================= */
.cursor-glow {
    position: fixed;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(196, 139, 154, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    will-change: left, top;
}

/* =============================================================
   Gallery (migrated from old style.css)
   ============================================================= */
.gallery_container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding: 20px;
}

.gallery {
    border: 1px solid rgba(184, 181, 176, 0.1);
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1),
                box-shadow 0.5s ease;
}

.gallery:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.4);
}

.gallery img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    transition: opacity 0.4s ease;
}

.gallery img:hover {
    opacity: 0.85;
}

.gallery .desc {
    padding: 8px;
    text-align: center;
    font-size: 0.85em;
    color: var(--color-text-dim);
}

.gallery-section h2 {
    text-align: center;
    margin: 2rem 0 1rem;
    color: var(--color-text);
}

/* =============================================================
   Talk Link
   ============================================================= */
.talk-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: var(--color-text);
    text-decoration: none;
    font-family: 'Accent', sans-serif;
    letter-spacing: 0.05em;
    font-size: 0.95em;
    transition: color 0.4s ease;
}

.talk-link:hover {
    color: var(--color-accent);
}

/* =============================================================
   Misc Page Sections
   ============================================================= */
.misc-section {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 2em;
    margin-bottom: 2rem;
    transition: border-color 0.4s ease;
}

.misc-section:hover {
    border-color: rgba(184, 181, 176, 0.1);
}

.misc-section h2 {
    margin-top: 0;
}

/* =============================================================
   About Page Highlight
   ============================================================= */
.about-highlight {
    border-left: 2px solid var(--color-accent);
    padding-left: 1.5em;
    font-size: 1.05em;
}

/* =============================================================
   Responsive Design
   ============================================================= */
@media (max-width: 768px) {
    .main-content {
        padding: 16px 20px;
    }

    .main-content h2 {
        margin-bottom: 1rem;
        margin-top: 2rem;
    }

    .main-content p {
        font-size: 0.9em;
        line-height: 1.6;
    }

    .menu-container {
        order: -1;
    }

    .central-image {
        max-width: 100%;
    }

    .central-image.revealed {
        animation: floatMobile 6s ease-in-out infinite;
    }

    @keyframes floatMobile {
        0%, 100% { transform: translateY(0); }
        50%      { transform: translateY(-6px); }
    }

    .contact-info {
        position: fixed;
        bottom: 10px;
        right: auto;
        top: auto;
        left: 50%;
        transform: translateX(-50%);
        flex-direction: row;
        gap: 2px;
        background: rgba(10, 10, 15, 0.7);
        padding: 8px 16px;
        border-radius: 20px;
    }

    .contact-info::before,
    .contact-info::after {
        display: none;
    }

    .contact-info a {
        margin: 0 6px;
        font-size: 16px;
        padding: 4px;
    }

    .contact-info a:hover {
        transform: scale(1.25);
    }

    .gallery_container {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .main-content li {
        padding: 1em;
    }

    .misc-section {
        padding: 1.5em;
    }

    .cursor-glow {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .gallery_container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .main-content h2 {
        font-size: 1.1rem;
        letter-spacing: 0.15em;
    }
}

/* =============================================================
   Reduced Motion
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    body, html {
        animation: none;
    }

    .cursor-glow {
        display: none !important;
    }
}

/* Blog post styles */
.autonomy-levels {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.autonomy-levels caption {
    padding: 10px;
    font-weight: bold;
    text-align: left;
}

.autonomy-levels th,
.autonomy-levels td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.autonomy-levels th {
    font-weight: bold;
}

article.page.sans img,
.content-wrapper img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

article.page.sans figure,
.content-wrapper figure {
    margin: 1.5em 0;
}

article.page.sans figcaption,
.content-wrapper figcaption {
    font-size: 0.85em;
    color: var(--color-text-muted, #888);
    margin-top: 0.5em;
}

article.page.sans p,
article.page.sans ul,
article.page.sans li {
    margin-top: 0;
    margin-bottom: 0.8em;
    line-height: 1.5;
}

article.page.sans ul {
    padding-left: 20px;
}

article.page.sans li {
    margin-bottom: 0.4em;
}

article.page.sans li ul {
    margin-top: 0.4em;
    margin-bottom: 0;
}

article.page.sans li li {
    margin-bottom: 0.2em;
}

article.page.sans ul li {
    font-size: 1em;
}

/* =============================================================
   Link Icons (auto-applied via Font Awesome 5)
   ============================================================= */

/* GitHub links: Octocat icon */
a[href*="github.com"]::before {
    font-family: "Font Awesome 5 Brands";
    content: "\f09b"; /* fa-github */
    margin-right: 0.3em;
    font-weight: 400;
    font-style: normal;
}

/* External links: subtle arrow icon (except GitHub, which already has an icon) */
a[target="_blank"]:not([href*="github.com"])::before {
    font-family: "Font Awesome 5 Free";
    content: "\f35d"; /* fa-external-link-alt */
    margin-right: 0.25em;
    font-size: 0.75em;
    font-weight: 900;
    font-style: normal;
    opacity: 0.6;
}

/* Don't add icons inside icon-only links (e.g. contact bar) */
.contact-info a::before {
    content: none !important;
}
