/* ============================================
   mybadge.id - Design Language Stylesheet
   Luxury Stationery Atelier Aesthetic
   ============================================ */

/* === CSS Custom Properties === */
:root {
    --espresso: #2C1810;
    --antique-gold: #8B6914;
    --parchment: #F5F0E8;
    --sandstone: #E8DCC8;
    --umber: #3A2F28;
    --emperador: #9C8B7A;
    --burnished-gold: #C9A96E;
    --obsidian: #1A120D;
    --sidebar-width: 280px;
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
    --font-ui: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
}

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

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

body {
    font-family: var(--font-body);
    color: var(--umber);
    background-color: var(--parchment);
    line-height: 1.72;
    overflow-x: hidden;
}

/* === Floating Ambient Elements === */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.floating-badge {
    position: absolute;
    opacity: 0.15;
    background: var(--burnished-gold);
    pointer-events: none;
}

.floating-badge-1 {
    width: 24px;
    height: 24px;
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    top: 20%;
    left: 40%;
}

.floating-badge-2 {
    width: 18px;
    height: 18px;
    clip-path: circle(50%);
    top: 60%;
    left: 70%;
    opacity: 0.2;
}

.floating-badge-3 {
    width: 28px;
    height: 28px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    top: 40%;
    left: 55%;
    opacity: 0.12;
}

.floating-badge-4 {
    width: 16px;
    height: 16px;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    top: 75%;
    left: 35%;
    opacity: 0.18;
}

/* === Persistent Sidebar === */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Emperador Dark marble texture */
    background:
        radial-gradient(ellipse at 30% 40%, var(--antique-gold) 0%, var(--espresso) 50%, var(--umber) 100%);
    filter: contrast(1.1) saturate(0.8);
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: conic-gradient(from 45deg, transparent 0%, rgba(201,169,110,0.05) 25%, transparent 50%);
    pointer-events: none;
}

.sidebar-gold-rule {
    position: absolute;
    right: 0;
    top: 0;
    width: 1px;
    height: 100%;
    background: var(--burnished-gold);
    opacity: 0.6;
}

.sidebar-logotype {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 18px;
    letter-spacing: 0.12em;
    color: var(--parchment);
    text-transform: uppercase;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    position: absolute;
    left: 32px;
    top: 50%;
    margin-top: -80px;
    opacity: 0.8;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 32px;
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
}

.nav-marker {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.3s ease;
    opacity: 0.6;
}

.nav-marker:hover,
.nav-marker.active {
    opacity: 1;
}

.nav-disc {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--burnished-gold);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
}

.nav-marker.active .nav-disc {
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(201, 169, 110, 0.5);
}

.nav-label {
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--parchment);
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
}

.nav-marker:hover .nav-label {
    opacity: 0.9;
    transform: translateX(0);
}

/* === Main Content === */
.content {
    margin-left: var(--sidebar-width);
    position: relative;
    z-index: 10;
}

.section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 64px;
    position: relative;
}

/* === Section I: The Credential === */
.section-credential {
    height: 100vh;
    background:
        radial-gradient(ellipse at 70% 60%, var(--parchment) 0%, var(--sandstone) 40%, var(--emperador) 100%);
}

.section-credential::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: 3px 3px;
    background-image: radial-gradient(circle, rgba(60,47,40,0.03) 1px, transparent 1px);
    pointer-events: none;
}

.credential-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 48px;
}

.hero-badge {
    width: clamp(240px, 30vw, 380px);
    height: clamp(240px, 30vw, 380px);
    cursor: pointer;
    transform-style: preserve-3d;
    perspective: 800px;
    transition: transform 0.15s ease-out;
}

.badge-outer-ring {
    width: 100%;
    height: 100%;
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    background:
        repeating-linear-gradient(135deg, transparent 0%, rgba(201,169,110,0.08) 2px, transparent 4px),
        radial-gradient(ellipse at 50% 50%, var(--sandstone) 0%, var(--emperador) 60%, var(--umber) 100%);
    box-shadow: inset 0 0 0 3px var(--burnished-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    position: relative;
}

.badge-outer-ring::after {
    content: '';
    position: absolute;
    inset: 3px;
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    border: 1px solid var(--burnished-gold);
    pointer-events: none;
}

.badge-mid-ring {
    width: 90%;
    height: 90%;
    border-radius: 50%;
    border: 1px solid var(--emperador);
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at 40% 40%, rgba(201,169,110,0.1) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 60%, var(--parchment) 0%, var(--sandstone) 100%);
}

.badge-inner-ring {
    width: 75%;
    height: 75%;
    border-radius: 50%;
    border: 1px solid rgba(156, 139, 122, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge-field {
    width: 60%;
    height: 60%;
    border-radius: 50%;
    background:
        repeating-linear-gradient(135deg, transparent 0%, rgba(201,169,110,0.08) 2px, transparent 4px),
        radial-gradient(ellipse at 50% 50%, var(--parchment) 0%, var(--sandstone) 50%, var(--emperador) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.badge-monogram {
    font-family: var(--font-display);
    font-weight: 600;
    font-style: italic;
    font-size: clamp(36px, 6vw, 72px);
    color: var(--espresso);
    line-height: 1;
    user-select: none;
}

.credential-tagline {
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--umber);
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.credential-tagline.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* === Section II: The Provenance === */
.section-provenance {
    min-height: 100vh;
    background: var(--parchment);
    align-items: stretch;
}

.provenance-grid {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 48px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    align-items: stretch;
}

.provenance-text {
    display: flex;
    flex-direction: column;
    gap: 48px;
    padding: 40px 0;
}

.provenance-block {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.provenance-block.revealed {
    opacity: 1;
    transform: translateY(0);
}

.provenance-numeral {
    font-family: var(--font-display);
    font-weight: 600;
    font-style: italic;
    font-size: clamp(28px, 4vw, 48px);
    color: var(--burnished-gold);
    display: block;
    margin-bottom: 12px;
    letter-spacing: 0.06em;
}

.provenance-heading {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(20px, 3vw, 32px);
    letter-spacing: 0.03em;
    color: var(--umber);
    margin-bottom: 16px;
    line-height: 1.3;
}

.provenance-body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(16px, 1.8vw, 20px);
    line-height: 1.72;
    color: var(--umber);
}

.provenance-marble-strip {
    position: relative;
    overflow: hidden;
}

.marble-strip-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 50% 30%, var(--antique-gold) 0%, var(--espresso) 50%, var(--umber) 100%);
    transition: background 1.5s ease;
}

/* === Section III: The Collection === */
.section-collection {
    min-height: 100vh;
    flex-direction: column;
    gap: 64px;
    background: var(--sandstone);
}

.collection-header {
    text-align: center;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.collection-header.revealed {
    opacity: 1;
    transform: translateY(0);
}

.section-numeral {
    font-family: var(--font-display);
    font-weight: 600;
    font-style: italic;
    font-size: clamp(36px, 6vw, 72px);
    color: var(--burnished-gold);
    letter-spacing: 0.06em;
    display: block;
    margin-bottom: 8px;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(24px, 4vw, 48px);
    letter-spacing: 0.03em;
    color: var(--umber);
    margin-bottom: 24px;
}

.gold-rule {
    width: 120px;
    height: 1px;
    background: var(--burnished-gold);
    margin: 0 auto;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1s ease;
}

.gold-rule.revealed {
    transform: scaleX(1);
}

.badge-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    width: 100%;
    max-width: 800px;
}

.grid-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px 16px;
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform;
}

.grid-badge.revealed {
    opacity: 1;
    transform: scale(1);
}

.grid-badge-frame {
    width: clamp(100px, 12vw, 150px);
    height: clamp(100px, 12vw, 150px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    background:
        repeating-linear-gradient(135deg, transparent 0%, rgba(201,169,110,0.08) 2px, transparent 4px),
        radial-gradient(ellipse at 50% 50%, var(--parchment) 0%, var(--sandstone) 50%, var(--emperador) 100%);
    box-shadow: inset 0 0 0 3px var(--burnished-gold), 0 4px 12px rgba(44, 24, 16, 0.08);
}

.grid-badge.elevated .grid-badge-frame {
    transform: translateY(-8px);
    box-shadow: inset 0 0 0 3px var(--burnished-gold), 0 16px 32px rgba(44, 24, 16, 0.15);
}

/* Badge Shapes via clip-path */
.octagon-frame {
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
}

.circle-frame {
    border-radius: 50%;
    clip-path: circle(50%);
}

.shield-frame {
    clip-path: polygon(50% 0%, 100% 15%, 100% 65%, 50% 100%, 0% 65%, 0% 15%);
}

.hexagon-frame {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.diamond-frame {
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.rectangle-frame {
    clip-path: polygon(10% 0%, 90% 0%, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0% 90%, 0% 10%);
}

.grid-badge-field {
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-badge-letter {
    font-family: var(--font-display);
    font-weight: 600;
    font-style: italic;
    font-size: clamp(28px, 4vw, 48px);
    color: var(--espresso);
    line-height: 1;
    user-select: none;
}

.grid-badge-label {
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--umber);
}

/* === Section IV: The Imprint === */
.section-imprint {
    min-height: 60vh;
    flex-direction: column;
    gap: 32px;
    background:
        linear-gradient(180deg, var(--sandstone) 0%, var(--espresso) 40%);
    position: relative;
}

.imprint-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.imprint-wordmark {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(64px, 10vw, 160px);
    letter-spacing: 0.06em;
    color: var(--parchment);
    line-height: 1.1;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.imprint-wordmark.revealed {
    opacity: 1;
    transform: translateY(0);
}

.imprint-manifesto {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(16px, 1.8vw, 20px);
    line-height: 1.72;
    color: var(--sandstone);
    max-width: 600px;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease 0.15s, transform 0.6s ease 0.15s;
}

.imprint-manifesto.revealed {
    opacity: 1;
    transform: translateY(0);
}

.imprint-rule {
    margin-top: 16px;
}

.imprint-floating-badges {
    position: relative;
    width: 200px;
    height: 80px;
}

.imprint-badge {
    position: absolute;
    background: var(--burnished-gold);
    opacity: 0.25;
    pointer-events: none;
}

.imprint-badge-1 {
    width: 20px;
    height: 20px;
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    top: 10px;
    left: 20px;
}

.imprint-badge-2 {
    width: 16px;
    height: 16px;
    clip-path: circle(50%);
    top: 40px;
    left: 100px;
}

.imprint-badge-3 {
    width: 22px;
    height: 22px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    top: 15px;
    left: 160px;
}

.site-footer {
    margin-top: 40px;
}

.footer-text {
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--emperador);
}

/* === Reveal Animations === */
.reveal-element {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-rule {
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1s ease;
}

.reveal-rule.revealed {
    transform: scaleX(1);
}

/* === Responsive === */
@media (max-width: 900px) {
    :root {
        --sidebar-width: 72px;
    }

    .sidebar-logotype {
        font-size: 12px;
        left: 14px;
    }

    .sidebar-nav {
        right: 16px;
    }

    .nav-label {
        display: none;
    }

    .provenance-grid {
        grid-template-columns: 1fr;
    }

    .provenance-marble-strip {
        display: none;
    }

    .badge-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .section {
        padding: 60px 32px;
    }
}

@media (max-width: 600px) {
    :root {
        --sidebar-width: 56px;
    }

    .sidebar-logotype {
        font-size: 10px;
        left: 10px;
    }

    .sidebar-nav {
        right: 12px;
    }

    .badge-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .section {
        padding: 48px 20px;
    }
}
