/* mybadge.page -- A skeuomorphic velvet display board */

:root {
    --velvet-dark: #1c1424;
    --plum-shadow: #2a1f33;
    --gold: #d4af37;
    --parchment: #f5e6cc;
    --saddle: #8b4513;
    --brass: #c9b896;
    --burgundy: #4a1942;

    --display-serif: "Cormorant Garamond", Lora, Georgia, serif;
    --body-serif: "Lora", "Cormorant Garamond", Georgia, serif;
    --caption-sans: "Josefin Sans", "Helvetica Neue", Arial, sans-serif;
}

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

html, body {
    background: var(--velvet-dark);
    color: var(--parchment);
    font-family: var(--body-serif);
    font-size: 16px;
    line-height: 1.8;
    min-height: 100%;
    overflow-x: hidden;
}

body {
    /* Velvet background -- radial gradient + SVG noise dot pattern overlay */
    background-color: var(--velvet-dark);
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='8'><circle cx='1' cy='1' r='0.6' fill='%231c1424' fill-opacity='0.55'/><circle cx='5' cy='4' r='0.5' fill='%232a1f33' fill-opacity='0.45'/><circle cx='3' cy='6' r='0.4' fill='%231c1424' fill-opacity='0.5'/></svg>"),
        radial-gradient(circle at 50% 38%, #3a2a48 0%, var(--plum-shadow) 30%, var(--velvet-dark) 75%, #110a17 100%);
    background-attachment: fixed;
    background-size: 8px 8px, 100% 100%;
    background-repeat: repeat, no-repeat;
    padding: 28px 24px 60px;
    min-height: 100vh;
}

/* Subtle pile texture overlay -- diagonal brush of velvet nap */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(
            115deg,
            rgba(255, 255, 255, 0.012) 0 1px,
            transparent 1px 3px
        ),
        repeating-linear-gradient(
            65deg,
            rgba(0, 0, 0, 0.05) 0 1px,
            transparent 1px 4px
        );
    z-index: 0;
}

.velvet-stage {
    position: relative;
    max-width: 1240px;
    margin: 0 auto;
    z-index: 1;
}

/* ---------- Gold Frame with Corner Ornaments ---------- */

.gold-frame {
    position: fixed;
    inset: 16px;
    pointer-events: none;
    border: 1px solid rgba(212, 175, 55, 0.35);
    z-index: 5;
}

.gold-frame::before,
.gold-frame::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(212, 175, 55, 0.4) 20%,
        var(--gold) 50%,
        rgba(212, 175, 55, 0.4) 80%,
        transparent 100%);
}

.gold-frame::before { top: -1px; }
.gold-frame::after { bottom: -1px; }

.frame-corner {
    position: absolute;
    width: 48px;
    height: 48px;
    pointer-events: none;
}

.frame-corner::before,
.frame-corner::after {
    content: "";
    position: absolute;
    background: var(--gold);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

.frame-corner--tl { top: -2px; left: -2px; }
.frame-corner--tl::before { top: 0; left: 0; width: 48px; height: 2px; }
.frame-corner--tl::after  { top: 0; left: 0; width: 2px; height: 48px; }

.frame-corner--tr { top: -2px; right: -2px; }
.frame-corner--tr::before { top: 0; right: 0; width: 48px; height: 2px; }
.frame-corner--tr::after  { top: 0; right: 0; width: 2px; height: 48px; }

.frame-corner--bl { bottom: -2px; left: -2px; }
.frame-corner--bl::before { bottom: 0; left: 0; width: 48px; height: 2px; }
.frame-corner--bl::after  { bottom: 0; left: 0; width: 2px; height: 48px; }

.frame-corner--br { bottom: -2px; right: -2px; }
.frame-corner--br::before { bottom: 0; right: 0; width: 48px; height: 2px; }
.frame-corner--br::after  { bottom: 0; right: 0; width: 2px; height: 48px; }

/* Tiny ornamental fleurs at frame midpoints */
.frame-corner--tl, .frame-corner--tr, .frame-corner--bl, .frame-corner--br {
    /* corners as defined */
}

/* ---------- Display Case ---------- */

.display-case {
    padding: 36px 18px;
    position: relative;
}

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

.hero {
    margin-bottom: 56px;
    padding: 4px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(212,175,55,0.5), rgba(139,69,19,0.6), rgba(212,175,55,0.4));
    box-shadow: 0 10px 40px rgba(0,0,0,0.6), inset 0 1px 0 rgba(212,175,55,0.2);
}

.hero-leather {
    position: relative;
    border-radius: 6px;
    padding: clamp(40px, 7vw, 80px) clamp(24px, 5vw, 64px);
    text-align: center;
    /* Leather texture: warm browns, plum undertones, simulated grain */
    background-color: #3a2418;
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0.35  0 0 0 0 0.18  0 0 0 0 0.07  0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/></svg>"),
        radial-gradient(ellipse at 30% 30%, rgba(139, 69, 19, 0.55) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 70%, rgba(74, 25, 66, 0.55) 0%, transparent 60%),
        linear-gradient(135deg, #4a2c1a 0%, #3a1f12 100%);
    background-size: 40px 40px, 100% 100%, 100% 100%, 100% 100%;
    box-shadow:
        inset 0 0 60px rgba(0,0,0,0.65),
        inset 0 2px 0 rgba(212, 175, 55, 0.15),
        inset 0 -2px 0 rgba(0,0,0,0.5);
}

/* Stitching detail along edges */
.hero-leather::before {
    content: "";
    position: absolute;
    inset: 12px;
    border: 1px dashed rgba(212, 175, 55, 0.55);
    border-radius: 4px;
    pointer-events: none;
}

.hero-leather::after {
    content: "";
    position: absolute;
    inset: 18px;
    border-top: 1px solid rgba(245, 230, 204, 0.08);
    border-bottom: 1px solid rgba(0,0,0,0.4);
    border-radius: 3px;
    pointer-events: none;
}

.hero-eyebrow {
    font-family: var(--caption-sans);
    font-weight: 300;
    font-size: 0.85rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--brass);
    margin-bottom: 18px;
    text-shadow: 0 1px 0 rgba(0,0,0,0.5);
}

.hero-title {
    font-family: var(--display-serif);
    font-weight: 600;
    font-size: clamp(2.4rem, 7vw, 5.6rem);
    line-height: 1;
    letter-spacing: 0.02em;
    color: var(--gold);
    /* Embossed effect: highlight + deboss shadow + outer glow */
    text-shadow:
        1px 1px 1px rgba(212, 175, 55, 0.4),
        -1px -1px 1px rgba(0, 0, 0, 0.6),
        2px 2px 0 rgba(139, 69, 19, 0.5),
        0 0 24px rgba(212, 175, 55, 0.18);
    margin-bottom: 22px;
    position: relative;
    display: inline-block;
}

/* Engraved subtle inner-shadow companion */
.hero-title::after {
    content: attr(data-emboss);
    position: absolute;
    inset: 0;
    color: transparent;
    background: linear-gradient(180deg, rgba(245,230,204,0.45) 0%, transparent 50%);
    -webkit-background-clip: text;
    background-clip: text;
    pointer-events: none;
    text-shadow: none;
}

.hero-rule {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 8px auto 22px;
    max-width: 480px;
}

.hero-rule-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--gold) 40%, var(--gold) 60%, transparent 100%);
}

.hero-rule-bead {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, var(--parchment) 0%, var(--gold) 50%, var(--saddle) 100%);
    box-shadow: 0 0 6px rgba(212,175,55,0.6);
}

.hero-rule-medallion {
    color: var(--gold);
    font-size: 1.4rem;
    text-shadow: 0 1px 0 rgba(0,0,0,0.6), 0 0 8px rgba(212,175,55,0.4);
}

.hero-tag {
    font-family: var(--body-serif);
    font-style: italic;
    font-size: clamp(1rem, 1.6vw, 1.18rem);
    color: var(--parchment);
    max-width: 640px;
    margin: 0 auto 22px;
    line-height: 1.7;
    text-shadow: 0 1px 0 rgba(0,0,0,0.5);
}

.hero-meta {
    font-family: var(--caption-sans);
    font-weight: 300;
    font-size: 0.78rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--brass);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}

.hero-meta-dot {
    color: var(--gold);
    font-size: 0.4rem;
    line-height: 1;
    align-self: center;
}

/* ---------- Ribbon Row ---------- */

.ribbon-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 44px;
}

.ribbon {
    position: relative;
    background: linear-gradient(180deg, #5e2356 0%, var(--burgundy) 50%, #2e0f2a 100%);
    color: var(--parchment);
    font-family: var(--display-serif);
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 14px 36px;
    box-shadow:
        0 4px 18px rgba(0,0,0,0.6),
        inset 0 1px 0 rgba(212,175,55,0.25),
        inset 0 -1px 0 rgba(0,0,0,0.5);
    text-shadow: 0 1px 1px rgba(0,0,0,0.7);
    border-top: 1px solid rgba(212, 175, 55, 0.4);
    border-bottom: 1px solid rgba(0, 0, 0, 0.5);
}

/* Ribbon notch tails using clip-path */
.ribbon--left {
    clip-path: polygon(0 0, 100% 0, 92% 50%, 100% 100%, 0 100%);
    padding-right: 48px;
}

.ribbon--right {
    clip-path: polygon(8% 0, 100% 0, 100% 100%, 8% 100%, 0 50%);
    padding-left: 48px;
}

.ribbon-divider {
    color: var(--gold);
    font-size: 1.6rem;
    text-shadow: 0 1px 0 rgba(0,0,0,0.6), 0 0 10px rgba(212,175,55,0.4);
}

/* ---------- Board (Masonry) ---------- */

.board {
    column-count: 3;
    column-gap: 24px;
    margin-bottom: 64px;
}

@media (max-width: 960px) {
    .board { column-count: 2; }
}

@media (max-width: 600px) {
    .board { column-count: 1; }
}

/* ---------- Badges ---------- */

.badge {
    --accent: var(--gold);
    position: relative;
    break-inside: avoid;
    margin-bottom: 24px;
    padding: 28px 22px 24px;
    background:
        linear-gradient(160deg, rgba(212, 175, 55, 0.04) 0%, transparent 50%),
        linear-gradient(180deg, var(--plum-shadow) 0%, #1f1527 100%);
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 6px;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(212, 175, 55, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.4);
    transform: translateY(0) rotate(0);
    transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
                box-shadow 320ms ease,
                border-color 320ms ease;
    overflow: hidden;
    text-align: center;
}

.badge::before {
    /* faint inner velvet ring backing the badge */
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 4px;
    background: radial-gradient(ellipse at 50% 30%, rgba(212,175,55,0.06) 0%, transparent 60%);
    pointer-events: none;
}

.badge::after {
    /* corner notch ornaments inside each badge */
    content: "";
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(201, 184, 150, 0.14);
    border-radius: 3px;
    pointer-events: none;
}

.badge--burgundy {
    background:
        linear-gradient(180deg, rgba(74,25,66,0.65) 0%, rgba(42,31,51,0.95) 100%);
    border-color: rgba(201, 184, 150, 0.35);
}

.badge--gold {
    background:
        linear-gradient(180deg, rgba(212,175,55,0.10) 0%, var(--plum-shadow) 100%);
    border-color: rgba(212, 175, 55, 0.5);
}

.badge--wide {
    /* ensure the wide ones look like multi-column items in masonry */
}

.badge--tall {
    /* taller pieces to break the rhythm */
}

.badge:hover {
    transform: translateY(-6px) rotate(-0.4deg);
    box-shadow:
        0 14px 38px rgba(0, 0, 0, 0.7),
        0 2px 0 rgba(212, 175, 55, 0.15),
        inset 0 1px 0 rgba(212, 175, 55, 0.18);
    border-color: var(--accent);
}

.badge.is-lifted {
    transform: translateY(-10px) rotate(-0.6deg) scale(1.015);
    box-shadow:
        0 22px 50px rgba(0, 0, 0, 0.75),
        inset 0 1px 0 rgba(212, 175, 55, 0.25);
}

/* The pin -- a small rounded brass head at the top of each badge */
.badge-pin {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 25%, #fff7d6 0%, var(--gold) 35%, #8a6a1a 80%, #2a1808 100%);
    box-shadow:
        0 2px 4px rgba(0,0,0,0.6),
        0 0 0 2px rgba(28, 20, 36, 0.85),
        0 0 12px rgba(212,175,55,0.4),
        inset 0 1px 1px rgba(255,255,255,0.7);
    z-index: 2;
}

.badge-pin::after {
    /* tiny pin shadow on velvet */
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 4px;
    background: radial-gradient(ellipse, rgba(0,0,0,0.5) 0%, transparent 70%);
    pointer-events: none;
}

.badge-medal {
    width: 116px;
    height: 116px;
    margin: 18px auto 18px;
    filter:
        drop-shadow(0 6px 8px rgba(0,0,0,0.6))
        drop-shadow(0 0 1px rgba(212,175,55,0.3));
    transition: transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.badge-medal--large {
    width: 130px;
    height: 170px;
}

.badge:hover .badge-medal {
    transform: rotate(-4deg) scale(1.04);
}

.medal-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.badge-rank {
    font-family: var(--caption-sans);
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
    text-shadow: 0 1px 0 rgba(0,0,0,0.5);
}

.badge-name {
    font-family: var(--display-serif);
    font-weight: 600;
    font-size: clamp(1.4rem, 2.2vw, 1.85rem);
    line-height: 1.15;
    color: var(--parchment);
    margin-bottom: 12px;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 0 rgba(0,0,0,0.5);
}

.badge-desc {
    font-family: var(--body-serif);
    font-style: italic;
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(245, 230, 204, 0.82);
    margin-bottom: 14px;
}

.badge-date {
    font-family: var(--caption-sans);
    font-weight: 300;
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--brass);
    padding-top: 10px;
    border-top: 1px solid rgba(212, 175, 55, 0.18);
    margin-top: auto;
}

/* ---------- Vault Section ---------- */

.vault {
    margin: 56px 0 48px;
    padding: 4px;
    background: linear-gradient(135deg, rgba(212,175,55,0.55), rgba(139,69,19,0.6), rgba(212,175,55,0.4));
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.55);
}

.vault-frame {
    background:
        radial-gradient(ellipse at 20% 0%, rgba(74, 25, 66, 0.5) 0%, transparent 60%),
        linear-gradient(180deg, var(--plum-shadow) 0%, var(--velvet-dark) 100%);
    padding: clamp(36px, 6vw, 64px) clamp(24px, 5vw, 56px);
    border-radius: 6px;
    text-align: center;
    position: relative;
}

.vault-frame::before {
    content: "";
    position: absolute;
    inset: 12px;
    border: 1px dashed rgba(212, 175, 55, 0.4);
    border-radius: 4px;
    pointer-events: none;
}

.vault-eyebrow {
    font-family: var(--caption-sans);
    font-weight: 300;
    font-size: 0.78rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--brass);
    margin-bottom: 14px;
}

.vault-title {
    font-family: var(--display-serif);
    font-weight: 600;
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--gold);
    margin-bottom: 24px;
    text-shadow:
        1px 1px 1px rgba(212, 175, 55, 0.4),
        -1px -1px 1px rgba(0,0,0,0.6);
}

.vault-body {
    font-family: var(--body-serif);
    font-size: 1.05rem;
    line-height: 1.85;
    color: rgba(245, 230, 204, 0.85);
    max-width: 680px;
    margin: 0 auto 18px;
}

.vault-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(28px, 5vw, 64px);
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid rgba(212, 175, 55, 0.22);
}

.vault-meta-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.vault-meta-num {
    font-family: var(--display-serif);
    font-weight: 600;
    font-size: clamp(2.2rem, 4vw, 3.2rem);
    color: var(--gold);
    line-height: 1;
    text-shadow:
        1px 1px 1px rgba(212, 175, 55, 0.4),
        -1px -1px 1px rgba(0,0,0,0.6);
    letter-spacing: 0.04em;
}

.vault-meta-label {
    font-family: var(--caption-sans);
    font-weight: 300;
    font-size: 0.78rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--brass);
}

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

.case-footer {
    text-align: center;
    padding: 32px 12px 8px;
}

.footer-rule {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    max-width: 320px;
    margin: 0 auto 18px;
}

.footer-rule-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.footer-rule-medallion {
    color: var(--gold);
    font-size: 1.2rem;
    text-shadow: 0 1px 0 rgba(0,0,0,0.6);
}

.footer-line {
    font-family: var(--display-serif);
    font-style: italic;
    font-size: 1.05rem;
    color: var(--parchment);
    margin-bottom: 6px;
}

.footer-tag {
    font-family: var(--caption-sans);
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--brass);
}

/* ---------- Loupe (hover tooltip / click reveal) ---------- */

.badge-loupe {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 50;
    opacity: 0;
    transform: translate(-50%, -120%) scale(0.92);
    transition: opacity 220ms ease, transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
    width: min(280px, 80vw);
}

.badge-loupe.is-visible {
    opacity: 1;
    transform: translate(-50%, -110%) scale(1);
}

.loupe-glass {
    background:
        linear-gradient(180deg, #3a2a18 0%, #2a1f12 100%);
    border: 1px solid var(--gold);
    border-radius: 6px;
    padding: 16px 18px;
    box-shadow:
        0 14px 38px rgba(0,0,0,0.7),
        inset 0 1px 0 rgba(212,175,55,0.3),
        0 0 0 4px rgba(212,175,55,0.15);
    text-align: center;
}

.loupe-rank {
    font-family: var(--caption-sans);
    font-weight: 300;
    font-size: 0.72rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--brass);
    margin-bottom: 6px;
}

.loupe-name {
    font-family: var(--display-serif);
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--gold);
    margin-bottom: 8px;
    text-shadow: 0 1px 1px rgba(0,0,0,0.6);
}

.loupe-desc {
    font-family: var(--body-serif);
    font-style: italic;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--parchment);
    margin-bottom: 10px;
}

.loupe-date {
    font-family: var(--caption-sans);
    font-weight: 300;
    font-size: 0.68rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--brass);
}

/* ---------- Responsive Adjustments ---------- */

@media (max-width: 720px) {
    body { padding: 16px 12px 40px; }
    .gold-frame { inset: 8px; }
    .ribbon-row { flex-direction: column; gap: 10px; }
    .ribbon--left, .ribbon--right { padding: 10px 28px; clip-path: none; }
    .display-case { padding: 24px 6px; }
}

@media (max-width: 460px) {
    .hero-meta { letter-spacing: 0.2em; }
}
