/* ============================================
   THE CURIOUS DISSECT — v4 Apple Glass
   ============================================ */

:root {
    --bg: #f0f0f3;
    --bg-dark: #e2e2e7;

    --glass: rgba(255, 255, 255, 0.45);
    --glass-hover: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-border-hover: rgba(255, 255, 255, 0.75);
    --glass-shadow: rgba(0, 0, 0, 0.06);
    --glass-shadow-hover: rgba(0, 0, 0, 0.1);

    --text: #1d1d1f;
    --text-mid: #52525a;
    --text-soft: #8e8e93;

    --accent: #c4703e;
    --accent-light: #e8946a;

    --mesh-1: #c9b8f0;
    --mesh-2: #a8d8ea;
    --mesh-3: #f0c4ad;
    --mesh-4: #b8e0d2;
    --mesh-5: #d4b8e8;

    --border: rgba(255, 255, 255, 0.35);

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Source Serif 4', Georgia, serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-ui: 'Inter', sans-serif;

    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --radius: 24px;
    --radius-sm: 14px;
    --radius-pill: 100px;
}

/* ---- Reset ---- */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    overflow: hidden;
    height: 100dvh;
}

a { color: inherit; text-decoration: none; }
button { border: none; background: none; cursor: pointer; color: inherit; font: inherit; }

/* ---- Animated Mesh Background ---- */

.mesh-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: var(--bg);
}

/* Shimmering gradient orbs */
.mesh-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.6;
    will-change: transform;
}

.mesh-orb-1 {
    width: 55vw; height: 55vw;
    max-width: 700px; max-height: 700px;
    background: radial-gradient(circle, var(--mesh-1) 0%, transparent 70%);
    top: -20%; right: -10%;
    animation: meshFlow1 20s ease-in-out infinite;
}

.mesh-orb-2 {
    width: 50vw; height: 50vw;
    max-width: 600px; max-height: 600px;
    background: radial-gradient(circle, var(--mesh-2) 0%, transparent 70%);
    bottom: -15%; left: -10%;
    animation: meshFlow2 25s ease-in-out infinite;
}

.mesh-orb-3 {
    width: 40vw; height: 40vw;
    max-width: 500px; max-height: 500px;
    background: radial-gradient(circle, var(--mesh-3) 0%, transparent 70%);
    top: 30%; left: 20%;
    animation: meshFlow3 18s ease-in-out infinite;
}

.mesh-orb-4 {
    width: 35vw; height: 35vw;
    max-width: 420px; max-height: 420px;
    background: radial-gradient(circle, var(--mesh-4) 0%, transparent 70%);
    top: 10%; right: 25%;
    animation: meshFlow4 22s ease-in-out infinite;
}

.mesh-orb-5 {
    width: 30vw; height: 30vw;
    max-width: 350px; max-height: 350px;
    background: radial-gradient(circle, var(--mesh-5) 0%, transparent 70%);
    bottom: 5%; right: 10%;
    animation: meshFlow5 16s ease-in-out infinite;
}

/* Shimmer overlay — moving highlight */
.mesh-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        transparent 30%,
        rgba(255, 255, 255, 0.15) 50%,
        transparent 70%
    );
    background-size: 200% 100%;
    animation: shimmer 8s ease-in-out infinite;
}

@keyframes meshFlow1 {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    33%      { transform: translate(-40px, 30px) scale(1.06) rotate(3deg); }
    66%      { transform: translate(20px, -20px) scale(0.95) rotate(-2deg); }
}
@keyframes meshFlow2 {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    33%      { transform: translate(50px, -25px) scale(1.1) rotate(-4deg); }
    66%      { transform: translate(-30px, 15px) scale(0.94) rotate(2deg); }
}
@keyframes meshFlow3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-50px, -35px) scale(1.08); }
}
@keyframes meshFlow4 {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    50%      { transform: translate(35px, 25px) scale(0.92) rotate(5deg); }
}
@keyframes meshFlow5 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(-25px, -30px) scale(1.12); }
    66%      { transform: translate(20px, 15px) scale(0.96); }
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---- Grain ---- */

.grain {
    position: fixed; inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.022;
    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-size: 200px;
}

/* ---- Page Shell ---- */

.page {
    position: relative;
    z-index: 1;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 1.25rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* ---- Nav (Glass) ---- */

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    padding: 0.7rem 1.25rem;
    margin-bottom: 0.75rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    backdrop-filter: blur(24px) saturate(1.5);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    box-shadow: 0 2px 16px var(--glass-shadow);
    animation: fadeDown 0.7s var(--ease) both;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: opacity 0.3s;
}
.nav-logo:hover { opacity: 0.65; }

.logo-mark {
    color: var(--accent);
    font-size: 1rem;
}

.logo-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.01em;
}

.nav-date {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-soft);
}

/* ---- Content ---- */

.content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4rem;
    min-height: 0;
}

/* ---- Hero ---- */

.hero {
    flex: 1;
    min-width: 0;
}

.hero-label {
    margin-bottom: 1.25rem;
    animation: fadeUp 0.6s var(--ease) both;
    animation-delay: 0.2s;
}

.hero-label-pill {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(196, 112, 62, 0.1);
    border: 1px solid rgba(196, 112, 62, 0.2);
    padding: 0.35rem 1rem;
    border-radius: var(--radius-pill);
    backdrop-filter: blur(10px);
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 900;
    line-height: 1.08;
    margin-bottom: 1.25rem;
}

.hero-line { display: block; }

.hero-line-1 {
    font-size: clamp(2rem, 4vw, 3.8rem);
    animation: fadeUp 0.7s var(--ease) both;
    animation-delay: 0.35s;
}

.hero-line-2 {
    font-size: clamp(2rem, 4vw, 3.8rem);
    animation: fadeUp 0.7s var(--ease) both;
    animation-delay: 0.5s;
}

.hero-line-2 em {
    font-style: italic;
    color: var(--accent);
}

.hero-line-3 {
    font-size: clamp(2rem, 4vw, 3.8rem);
    animation: fadeUp 0.7s var(--ease) both;
    animation-delay: 0.65s;
}


/* ---- Carousel ---- */

.carousel {
    flex: 0 0 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    animation: fadeUp 0.8s var(--ease) both;
    animation-delay: 0.6s;
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 420px;
}

/* ---- Glass Cards ---- */

.card {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(28px) saturate(1.4);
    -webkit-backdrop-filter: blur(28px) saturate(1.4);
    box-shadow:
        0 8px 32px var(--glass-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition:
        transform 0.6s var(--ease),
        opacity 0.6s var(--ease),
        box-shadow 0.5s var(--ease),
        background 0.5s var(--ease),
        border-color 0.5s var(--ease);
    will-change: transform, opacity;
    opacity: 0;
    pointer-events: none;
    transform: translateX(60px) scale(0.95);
}

.card.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0) scale(1);
    z-index: 2;
}

.card.prev {
    opacity: 0;
    transform: translateX(-60px) scale(0.95);
}

.card.active:hover {
    background: var(--glass-hover);
    border-color: var(--glass-border-hover);
    box-shadow:
        0 20px 60px var(--glass-shadow-hover),
        0 4px 16px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    transform: translateY(-4px) scale(1.01);
}

/* Colored glow at top of card */
.card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 10%;
    right: 10%;
    height: 60px;
    border-radius: 0 0 50% 50%;
    filter: blur(25px);
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.4s;
}

.card.active:hover::before {
    opacity: 0.6;
}

.card[data-color="peach"]::before    { background: var(--mesh-3); }
.card[data-color="lavender"]::before { background: var(--mesh-1); }
.card[data-color="mint"]::before     { background: var(--mesh-4); }

/* Inner highlight line at very top */
.card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 10%, rgba(255,255,255,0.6) 50%, transparent 90%);
    pointer-events: none;
}

.card-inner {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem 2rem 1.75rem;
}

.card-badge {
    align-self: flex-start;
    font-family: var(--font-mono);
    font-size: 0.56rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #fff;
    background: var(--accent);
    padding: 0.3rem 0.85rem;
    border-radius: var(--radius-pill);
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 8px rgba(196, 112, 62, 0.25);
}

.card-badge--soon {
    color: var(--text-soft);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: none;
    backdrop-filter: blur(8px);
}

.card-category {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-soft);
    margin-bottom: 0.75rem;
}

.card-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 0.75rem;
    transition: color 0.3s;
}

.card.active:hover .card-title {
    color: var(--accent);
}

.card-excerpt {
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 300;
    color: var(--text-mid);
    line-height: 1.65;
    flex: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.25rem;
    margin-top: auto;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.card-date {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-soft);
}

.card-cta {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    color: var(--accent);
    transition: letter-spacing 0.3s var(--ease);
}

.card.active:hover .card-cta {
    letter-spacing: 0.12em;
}

.card--upcoming { cursor: default; }
.card--upcoming .card-title { color: var(--text-soft); }

/* ---- Carousel Nav (Glass) ---- */

.carousel-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.carousel-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text-mid);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 2px 10px var(--glass-shadow);
    transition: all 0.3s var(--ease);
}

.carousel-btn:hover {
    background: var(--text);
    color: #fff;
    border-color: var(--text);
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.carousel-btn:active {
    transform: scale(0.94);
}

.carousel-dots {
    display: flex;
    gap: 0.5rem;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    cursor: pointer;
    transition: all 0.4s var(--ease-spring);
    padding: 0;
}

.carousel-dot.active {
    width: 28px;
    border-radius: var(--radius-pill);
    background: var(--accent);
    box-shadow: 0 2px 8px rgba(196, 112, 62, 0.3);
}

/* ---- Footer ---- */

.foot {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    font-family: var(--font-mono);
    font-size: 0.56rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-soft);
    animation: fadeUp 0.7s var(--ease) both;
    animation-delay: 1s;
}

/* ---- Keyframes ---- */

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-14px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

/* ---- Mobile ---- */

@media (max-width: 900px) {
    body { overflow-y: auto; overflow-x: hidden; height: auto; min-height: 100dvh; }

    .page {
        height: auto;
        min-height: 100dvh;
        padding: 1rem 1rem;
    }

    .content {
        flex-direction: column;
        gap: 2rem;
        align-items: stretch;
    }

    .hero { text-align: center; }
    .hero-sub { margin: 0 auto; }

    .carousel {
        flex: none;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    .carousel-track { height: 360px; }
    .card-inner { padding: 1.5rem 1.5rem 1.25rem; }
    .card-title { font-size: 1.6rem; }

    .mesh-orb-1 { width: 80vw; height: 80vw; top: -20%; right: -25%; }
    .mesh-orb-2 { width: 70vw; height: 70vw; bottom: -15%; left: -20%; }
    .mesh-orb-3 { width: 50vw; height: 50vw; }
    .mesh-orb-4 { width: 45vw; height: 45vw; }
    .mesh-orb-5 { width: 40vw; height: 40vw; }

    .foot {
        flex-direction: column;
        gap: 0.35rem;
        text-align: center;
        padding: 1rem 0;
    }
}

@media (max-width: 480px) {
    .page { padding: 0.75rem 0.75rem; }
    .hero-line-1, .hero-line-2, .hero-line-3 { font-size: 1.5rem; }
    .carousel { max-width: 100%; }
    .carousel-track { height: 320px; }
    .card-inner { padding: 1.25rem 1.25rem 1rem; }
    .card-title { font-size: 1.4rem; }
    .card-badge { font-size: 0.6rem; }
    .card-category { font-size: 0.62rem; }
    .card-excerpt { font-size: 0.85rem; }
    .carousel-btn { width: 44px; height: 44px; }
    .nav-date { display: none; }
    .nav { padding: 0.6rem 0.85rem; margin-bottom: 0.5rem; }
    .logo-text { font-size: 0.88rem; }
}

/* Short desktop */
@media (min-width: 901px) and (max-height: 700px) {
    .page { padding: 0.75rem 2rem; }
    .nav { padding: 0.5rem 1rem; margin-bottom: 0.5rem; }
    .hero-title { margin-bottom: 0.75rem; }
    .hero-label { margin-bottom: 0.75rem; }
    .carousel-track { height: 340px; }
    .card-inner { padding: 1.25rem 1.5rem; }
    .card-title { font-size: 1.5rem; }
    .foot { padding-top: 0.5rem; }
}
