@import url('https://fonts.googleapis.com/css2?family=Chewy&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Mansalva&display=swap');

/* RESET */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --header-height: 96px;
    --page-padding-x: 32px;
    --page-padding-bottom: 24px;

    --pill-accent: #ffd628;
    --pill-accent-dark: #4a3f08;
    --pill-accent-mid: #9f8520;
    --pill-accent-light: #ffe56f;

    --chewy: "Chewy", cursive;
    --mansalva: "Mansalva", cursive;
}

html,
body {
    height: 100%;
}

body {
    font-family: sans-serif;
    overflow-x: hidden;
    background: #000;
    color: white;

    font-family: var(--mansalva);
}

h1,
h2,
h3 {
    font-family: var(--chewy);
}

body.home-page,
body.pills-page,
body.pill-detail-page {
    overflow-y: hidden;
}

/* HEADER / NAVBAR */

header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 30;
}

.navbar {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding: 24px 40px;
    background: transparent;
}

.logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 48px;
    width: auto;
    display: block;
    object-fit: contain;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: white;
    font-weight: 500;
    transition: opacity 0.25s ease;
}

.nav-links a:hover {
    opacity: 0.75;
}

/* ========================================= */
/* PAGE ACCUEIL */
/* ========================================= */

.hero-section {
    height: 100svh;
    min-height: 100svh;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr;
    align-items: center;
    gap: 20px;
    padding:
        calc(var(--header-height) + 8px) var(--page-padding-x) var(--page-padding-bottom);
    color: white;
    background:
        radial-gradient(circle at top left, #0a7b57 0%, transparent 45%),
        radial-gradient(circle at top right, #6a5ab0 0%, transparent 45%),
        radial-gradient(circle at bottom left, #dce8cf 0%, transparent 50%),
        radial-gradient(circle at bottom right, #cdbbdc 0%, transparent 50%),
        linear-gradient(135deg, #0b7351 0%, #6a5ab0 50%, #d7c6de 100%);
}

.hero-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    height: min(72svh, 760px);
    min-height: 320px;
    position: relative;
    overflow: visible;
}

.three-pill {
    width: 100%;
    max-width: 520px;
    height: 100%;
    position: relative;
}

.three-pill canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    z-index: 5;
    position: relative;
}

.hero-brand {
    font-size: clamp(3rem, 5vw, 5rem);
    line-height: 1;
}

.hero-slogan {
    font-size: clamp(1.2rem, 2vw, 2rem);
    font-weight: 500;
}

.hero-description {
    font-size: 1rem;
    max-width: 540px;
    line-height: 1.6;
}

.hero-btn {
    text-decoration: none;
    color: white;
    border: 1px solid white;
    padding: 14px 24px;
    border-radius: 999px;
    transition: 0.25s ease;
}

.hero-btn:hover {
    background: white;
    color: black;
}

/* ========================================= */
/* PAGE PILLS */
/* ========================================= */

.pills-page {
    background: #000;
}

.pills-section {
    height: 100svh;
    min-height: 100svh;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding:
        calc(var(--header-height) + 6px) var(--page-padding-x) var(--page-padding-bottom);
    background: url("img/background-pills.png") center center / cover no-repeat;
}

.pills-overlay {
    position: absolute;
    inset: 0;
    background: rgba(6, 8, 18, 0.18);
    pointer-events: none;
}

.pills-row {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1550px;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(5, minmax(170px, 1fr));
    grid-template-rows: repeat(2, 1fr);
    column-gap: 18px;
    row-gap: 56px;
    align-content: center;
    align-items: center;
}

.pill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white;
    min-height: 0;
    height: 100%;
    position: relative;
}

.pill-item-3d {
    width: 100%;
    height: min(30svh, 360px);
    min-height: 210px;
    position: relative;
    overflow: visible;
}

.pill-item-3d canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none;
}

.pill-item-name {
    margin-top: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    text-wrap: balance;
}

/* ========================================= */
/* PAGE DETAIL PILULE */
/* ========================================= */

.pill-detail-page {
    background: linear-gradient(to top,
            var(--pill-accent-light) 0%,
            var(--pill-accent-mid) 45%,
            var(--pill-accent-dark) 100%);
}

.pill-detail-section {
    height: 100svh;
    min-height: 100svh;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding:
        calc(var(--header-height) + 12px) var(--page-padding-x) var(--page-padding-bottom);
    background:
        radial-gradient(circle at 20% 85%, color-mix(in srgb, var(--pill-accent-light) 60%, white 10%) 0%, transparent 28%),
        radial-gradient(circle at 80% 20%, color-mix(in srgb, var(--pill-accent) 18%, transparent) 0%, transparent 24%),
        linear-gradient(to top,
            var(--pill-accent-light) 0%,
            var(--pill-accent-mid) 45%,
            var(--pill-accent-dark) 100%);
}

.pill-detail-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to right, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)),
        radial-gradient(circle at center, rgba(255, 255, 255, 0.04), transparent 50%);
    pointer-events: none;
}

.pill-detail-layout {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1500px;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    grid-template-rows: 1fr auto;
    align-items: center;
    gap: 32px 40px;
}

.pill-viewer-column {
    grid-column: 1;
    grid-row: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pill-detail-3d {
    width: 100%;
    max-width: 560px;
    height: min(72svh, 760px);
    min-height: 320px;
    position: relative;
}

.pill-detail-3d canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.pill-detail-separator {
    grid-column: 2;
    grid-row: 1;
    width: 1px;
    height: min(70svh, 720px);
    background: linear-gradient(to bottom,
            transparent 0%,
            rgba(255, 255, 255, 0.16) 15%,
            rgba(255, 255, 255, 0.38) 50%,
            rgba(255, 255, 255, 0.16) 85%,
            transparent 100%);
    justify-self: center;
}

.pill-detail-content {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    max-width: 640px;
}

.pill-detail-badge {
    display: inline-flex;
    align-self: flex-start;
    padding: 10px 16px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--pill-accent-light) 26%, rgba(255, 255, 255, 0.05));
    border: 1px solid color-mix(in srgb, var(--pill-accent-light) 46%, rgba(255, 255, 255, 0.22));
    font-size: 0.92rem;
    font-weight: 600;
    color: white;
    backdrop-filter: blur(8px);
}

.pill-detail-title {
    font-size: clamp(2.8rem, 4vw, 5rem);
    line-height: 0.95;
}

.pill-detail-description {
    font-size: 1.05rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.92);
    max-width: 58ch;
}

.pill-detail-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pill-detail-block h2 {
    font-size: 1rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.pill-detail-block p {
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.96);
}

.pill-detail-price {
    font-size: 1.8rem !important;
    font-weight: 700;
}

.pill-detail-btn {
    grid-column: 1 / 4;
    grid-row: 2;
    display: inline-flex;
    justify-self: center;
    align-self: end;
    padding: 14px 22px;
    border-radius: 999px;
    text-decoration: none;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.28);
    transition: 0.25s ease;
}

.pill-detail-btn:hover {
    background: white;
    color: black;
}

/* ========================================= */
/* RESPONSIVE */
/* ========================================= */

@media (max-width: 1400px) {
    .pills-row {
        grid-template-columns: repeat(4, minmax(150px, 1fr));
        grid-template-rows: auto;
        column-gap: 16px;
        row-gap: 36px;
    }

    .pill-item-3d {
        height: min(26svh, 300px);
    }
}

@media (max-width: 1100px) {
    .hero-section {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 4px;
    }

    .hero-pill {
        height: min(26svh, 260px);
        min-height: 180px;
    }

    .three-pill {
        max-width: 260px;
    }

    .hero-pill.left {
        order: 1;
    }

    .hero-content {
        order: 2;
    }

    .hero-pill.right {
        order: 3;
    }

    .pills-row {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
        row-gap: 28px;
    }

    .pill-detail-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 16px;
        overflow-y: auto;
        padding-right: 4px;
    }

    .pill-viewer-column {
        grid-column: 1;
        grid-row: 1;
        height: auto;
    }

    .pill-detail-separator {
        display: none;
    }

    .pill-detail-3d {
        height: min(38svh, 420px);
        min-height: 240px;
        max-width: 360px;
    }

    .pill-detail-content {
        grid-column: 1;
        grid-row: 2;
        max-width: 100%;
        text-align: center;
        align-items: center;
        padding-bottom: 0;
    }

    .pill-detail-badge {
        align-self: center;
    }

    .pill-detail-btn {
        grid-column: 1;
        grid-row: 3;
        justify-self: center;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 128px;
        --page-padding-x: 20px;
        --page-padding-bottom: 18px;
    }

    .navbar {
        padding: 20px;
        flex-direction: column;
        gap: 14px;
        justify-content: center;
    }

    .nav-links {
        gap: 18px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .logo-img {
        height: 40px;
    }

    .hero-section {
        gap: 0;
    }

    .hero-pill {
        height: min(22svh, 220px);
        min-height: 150px;
    }

    .hero-brand {
        font-size: 2.6rem;
    }

    .hero-description {
        font-size: 0.95rem;
    }

    .pills-row {
        grid-template-columns: repeat(2, minmax(130px, 1fr));
        column-gap: 14px;
        row-gap: 22px;
    }

    .pill-item-3d {
        height: min(22svh, 220px);
        min-height: 160px;
    }

    .pill-item-name {
        font-size: 0.9rem;
    }

    .pill-detail-title {
        font-size: 2.6rem;
    }

    .pill-detail-description,
    .pill-detail-block p {
        font-size: 0.96rem;
    }
}

@media (max-width: 480px) {
    .pills-row {
        grid-template-columns: 1fr;
    }

    body.home-page,
    body.pills-page,
    body.pill-detail-page {
        overflow-y: auto;
    }

    .hero-section,
    .pills-section,
    .pill-detail-section {
        height: auto;
        min-height: 100svh;
        overflow: visible;
    }
}