/* ========================================
   HOME PORTFOLIO STYLES
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

/* Reset and base styles */
.home-portfolio {
  position: absolute;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  top: 0;
  display: flex;
}

body {
	background-color: black;
  font-family: "Inter", sans-serif;
  font-optical-sizing: auto;
}

/* The [hidden] UA rule loses to any class selector that sets display. */
[hidden] {
    display: none !important;
}

/* ========================================
   BACKGROUND LAYER
   ======================================== */
.background-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Mobile background - default */
.bg-mobile {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.bg-mobile--bottom {
    top: auto;
    bottom: 0;
    rotate: 180deg;
}

/* Desktop backgrounds - hidden on mobile */
.bg-column-left,
.bg-column-right,
.bg-top-container {
    display: none;
}

@media (min-width: 768px) {
    .bg-mobile {
        display: none;
    }

    .bg-column-left,
    .bg-column-right,
    .bg-top-container {
        display: block;
    }

    .bg-column-left {
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        width: auto;
        object-fit: cover;
    }

    .bg-column-right {
        position: absolute;
        right: 0;
        top: 0;
        height: 100%;
        width: auto;
        object-fit: cover;
    }

    .bg-top-container {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: auto;
        /* Relative to this file, so it resolves the same locally and on production */
        background-image: url('../../../../uploads/2025/11/background-desktop-top.jpg');
        background-repeat: repeat-x;
        background-position: top center;
        background-size: auto 100%;
        min-height: 150px; /* Adjust based on your image height */
    }
}

/* ========================================
   CONTENT CONTAINER
   ======================================== */
.home-content {
    position: relative;
    z-index: 1;
    padding: 2rem 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Desktop: everything on the home page sits dead centre in the frame */
@media (min-width: 768px) {
    .home-portfolio.is-home .home-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0;
        align-self: center;
    }

    .home-portfolio.is-home .heading-section {
        margin-top: 0;
    }
}

/* ========================================
   HEADING SECTION
   ======================================== */
.heading-section {
    text-align: center;
    padding: 1rem 0;
    margin-top: 100px; /* Space for background-top */
}

.main-heading {
    font-size: clamp(1rem, 5vw, 3rem);
    font-weight: 700;
    color: #F8E415;
    text-transform: uppercase;
text-shadow: 1px -1px 21px rgba(0,0,0,1);
	letter-spacing: 0.05em;
    margin: 0 0 1rem;
    line-height: 1;
}

.main-heading a {
    display: inline-block;
    line-height: 0;
}

.main-heading img {
	max-width: 75%;
}

.sub-heading {
    font-size: clamp(0.7rem, 2vw, 1.5rem);
    color: #ffffff;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* ========================================
   DICE SECTION
   ======================================== */
.dice-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 1rem 0;
    margin: 0 auto;
    max-width: 600px;
}

.dice-container {
    --die-size: 6rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 5rem;
    perspective: 700px;
    cursor: pointer;
    padding: 1rem;
}

.dice-container:hover {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

/* Announced to screen readers only */
.dice-result {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* The wrapper carries the toss arc, the list carries the tumble */
.die-wrap {
    --hop: 3rem;
    --duration: 2s;
    --delay: 0s;
    height: var(--die-size);
    width: var(--die-size);
    margin: 0 auto;
    transform-style: preserve-3d;
}

.die-wrap.is-tossing {
    animation: die-toss var(--duration) var(--delay) both;
}

@keyframes die-toss {
    0% {
        transform: translate3d(0, 0, 0);
        animation-timing-function: cubic-bezier(0.14, 0.62, 0.35, 1);
    }
    22% {
        transform: translate3d(0, calc(var(--hop) * -1), 0);
        animation-timing-function: cubic-bezier(0.6, 0, 0.9, 0.42);
    }
    44% {
        transform: translate3d(0, 0, 0);
        animation-timing-function: cubic-bezier(0.14, 0.62, 0.35, 1);
    }
    58% {
        transform: translate3d(0, calc(var(--hop) * -0.3), 0);
        animation-timing-function: cubic-bezier(0.6, 0, 0.9, 0.42);
    }
    72% {
        transform: translate3d(0, 0, 0);
        animation-timing-function: cubic-bezier(0.14, 0.62, 0.35, 1);
    }
    82% {
        transform: translate3d(0, calc(var(--hop) * -0.09), 0);
        animation-timing-function: cubic-bezier(0.6, 0, 0.9, 0.42);
    }
    90%,
    100% {
        transform: translate3d(0, 0, 0);
    }
}

/* Die structure */
.die-list {
    --tx: 0rem;
    --ty: 0rem;
    --rx: 0deg;
    --ry: 0deg;
    --rz: 0deg;
    --tilt: 0deg;
    --duration: 2s;
    --delay: 0s;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    height: var(--die-size);
    width: var(--die-size);
    list-style-type: none;
    transform-style: preserve-3d;
    margin: 0;
    padding: 0;
    /* --tilt is applied in viewer space so the landed die reads as tipped, not skewed */
    transform:
        translate3d(var(--tx), var(--ty), 0)
        rotateZ(var(--tilt))
        rotateX(var(--rx))
        rotateY(var(--ry))
        rotateZ(var(--rz));
    transition: transform var(--duration) cubic-bezier(0.15, 0.7, 0.1, 1) var(--delay);
}

/* Die faces */
.die-item {
    background-color: RGBA(52,52,52,0.95);
    box-shadow: inset -0.35rem 0.35rem 0.75rem rgba(208, 208, 208, 0.3),
                inset 0.5rem -0.25rem 0.5rem rgba(208, 208, 208, 0.10);
    display: grid;
    grid-column: 1;
    grid-row: 1;
    grid-template-areas:
        "one two three"
        "four five six"
        "seven eight nine";
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    height: 100%;
    width: 100%;
    padding: calc(var(--die-size) * 0.085);
    border-radius: calc(var(--die-size) * 0.09);
    backface-visibility: hidden;
}

/* Dots */
.dot {
    align-self: center;
    background-color: #7E90A0;
    background-image: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.45), rgba(0, 0, 0, 0.15));
    border-radius: 50%;
    box-shadow: inset -0.15rem 0.15rem 0.25rem rgba(68, 92, 84, 0.5);
    display: block;
    height: calc(var(--die-size) * 0.17);
    width: calc(var(--die-size) * 0.17);
    justify-self: center;
}

/* ========================================
   WINNING ROLL FLASH
   Yellow for pairs, triples and a 4-5-6 run; red for a 1-2-3 run.
   ======================================== */
.die-list.is-hot {
    --flash: #F8E415;
    --flash-glow: rgba(248, 228, 21, 0.65);
}

.die-list.is-hot.is-cold {
    --flash: #FF2D2D;
    --flash-glow: rgba(255, 45, 45, 0.7);
}

.die-list.is-hot .dot {
    animation: dot-flash 0.4s ease-in-out 6;
}

@keyframes dot-flash {
    0%,
    100% {
        background-color: #7E90A0;
        box-shadow: inset -0.15rem 0.15rem 0.25rem rgba(68, 92, 84, 0.5);
    }
    50% {
        background-color: var(--flash);
        box-shadow: 0 0 0.5rem var(--flash), 0 0 1.25rem var(--flash-glow);
    }
}

/* ========================================
   DIE FACE POSITIONING
   ======================================== */
[data-side="1"] {
    transform: rotate3d(0, 0, 0, 90deg) translateZ(calc(var(--die-size) / 2));
}
[data-side="2"] {
    transform: rotate3d(-1, 0, 0, 90deg) translateZ(calc(var(--die-size) / 2));
}
[data-side="3"] {
    transform: rotate3d(0, 1, 0, 90deg) translateZ(calc(var(--die-size) / 2));
}
[data-side="4"] {
    transform: rotate3d(0, -1, 0, 90deg) translateZ(calc(var(--die-size) / 2));
}
[data-side="5"] {
    transform: rotate3d(1, 0, 0, 90deg) translateZ(calc(var(--die-size) / 2));
}
[data-side="6"] {
    transform: rotate3d(1, 0, 0, 180deg) translateZ(calc(var(--die-size) / 2));
}

/* ========================================
   DIE DOT POSITIONING
   ======================================== */
[data-side="1"] .dot:nth-of-type(1) { grid-area: five; }

[data-side="2"] .dot:nth-of-type(1) { grid-area: one; }
[data-side="2"] .dot:nth-of-type(2) { grid-area: nine; }

[data-side="3"] .dot:nth-of-type(1) { grid-area: one; }
[data-side="3"] .dot:nth-of-type(2) { grid-area: five; }
[data-side="3"] .dot:nth-of-type(3) { grid-area: nine; }

[data-side="4"] .dot:nth-of-type(1) { grid-area: one; }
[data-side="4"] .dot:nth-of-type(2) { grid-area: three; }
[data-side="4"] .dot:nth-of-type(3) { grid-area: seven; }
[data-side="4"] .dot:nth-of-type(4) { grid-area: nine; }

[data-side="5"] .dot:nth-of-type(1) { grid-area: one; }
[data-side="5"] .dot:nth-of-type(2) { grid-area: three; }
[data-side="5"] .dot:nth-of-type(3) { grid-area: five; }
[data-side="5"] .dot:nth-of-type(4) { grid-area: seven; }
[data-side="5"] .dot:nth-of-type(5) { grid-area: nine; }

[data-side="6"] .dot:nth-of-type(1) { grid-area: one; }
[data-side="6"] .dot:nth-of-type(2) { grid-area: three; }
[data-side="6"] .dot:nth-of-type(3) { grid-area: four; }
[data-side="6"] .dot:nth-of-type(4) { grid-area: six; }
[data-side="6"] .dot:nth-of-type(5) { grid-area: seven; }
[data-side="6"] .dot:nth-of-type(6) { grid-area: nine; }

/* ========================================
   ROLL BUTTON
   ======================================== */
.roll-button {
    background-color: #FFD700;
    border: none;
    color: #000;
    font-size: 1.25rem;
    font-weight: 700;
    padding: 1rem 2.5rem;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.roll-button:hover {
    background-color: #FFC000;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.roll-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* ========================================
   MAGIC MENU
   ======================================== */
.magic-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 2rem 0;
}

.menu-item {
    position: relative;
    display: inline-block;
}

.menu-link {
    font-family: inherit;
    font-size: clamp(1rem, 5vw, 3rem);
    font-weight: bold;
    text-transform: uppercase;
    color: #F8E415;
    text-decoration: none;
    letter-spacing: 0.1em;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    position: relative;
    z-index: 2;
    cursor: pointer;
}

.menu-link:hover {
    color: #f0f0f0;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.particle-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
}

@keyframes fizzle-out {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
}

.fizzling {
    animation: fizzle-out 0.6s ease-out forwards;
}

@keyframes magic-appear {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.appearing {
    animation: magic-appear 0.6s ease-out forwards;
}

/* Desktop: menu runs across in a single row */
@media (min-width: 1025px) {
    .magic-menu {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1.5rem 2.5rem;
        max-width: 60rem;
        margin: 0 auto;
        padding: 3rem 0 0;
    }

    .magic-menu .menu-link {
        font-size: clamp(1.25rem, 2.1vw, 2rem);
    }

    /* Info copy is prose, not a nav link — give it its own line */
    .magic-menu .menu-item:has(.sub-heading) {
        flex-basis: 100%;
        text-align: center;
    }
}

/* ========================================
   TRIPLE ROLL POPUP
   ======================================== */
.magic-popup {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.magic-popup.is-open {
    opacity: 1;
}

.magic-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.magic-popup__panel {
    position: relative;
    max-width: 30rem;
    width: 100%;
    padding: 3rem 2.5rem 2.5rem;
    text-align: center;
    background: #000;
    border: 2px solid #F8E415;
    border-radius: 1.25rem;
    box-shadow: 0 0 2.5rem rgba(248, 228, 21, 0.35);
    transform: scale(0.85) translateY(1.5rem);
    transition: transform 0.35s cubic-bezier(0.2, 1.3, 0.4, 1);
}

.magic-popup.is-open .magic-popup__panel {
    transform: scale(1) translateY(0);
}

.magic-popup__close {
    position: absolute;
    top: 0.5rem;
    right: 0.85rem;
    background: none;
    border: none;
    color: #F8E415;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.magic-popup__eyebrow {
    margin: 0 0 0.5rem;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.35em;
    font-size: 0.75rem;
}

.magic-popup__title {
    margin: 0 0 1rem;
    color: #F8E415;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: clamp(1.75rem, 6vw, 2.75rem);
    line-height: 1;
}

.magic-popup__body {
    margin: 0 0 2rem;
    color: #ffffff;
    font-size: 1rem;
}

/* ========================================
   PRIZE BUTTON
   Deliberately over-the-top: it shakes itself apart, then reveals
   a prize that is worth precisely nothing.
   ======================================== */
.prize {
    position: relative;
    display: grid;
    place-items: center;
}

.prize > * {
    grid-area: 1 / 1;
}

.prize__button {
    --shake: 0px;
    --shake-speed: 0.3s;
    position: relative;
    z-index: 2;
    border: none;
    cursor: pointer;
    padding: 1.15rem 2.75rem;
    border-radius: 999px;
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #3A1000;
    background: linear-gradient(180deg, #FFF493 0%, #F8E415 45%, #FFA800 100%);
    box-shadow:
        0 0.35rem 0 #B37800,
        0 0.9rem 1.75rem rgba(248, 228, 21, 0.45),
        inset 0 0.15rem 0 rgba(255, 255, 255, 0.9);
    animation: prize-pulse 1.1s ease-in-out infinite;
    overflow: hidden;
}

/* Sweeping shine */
.prize__button::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -60%;
    width: 45%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.75), transparent);
    animation: prize-shine 2.2s ease-in-out infinite;
}

@keyframes prize-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.045); }
}

@keyframes prize-shine {
    0% { left: -60%; }
    55%, 100% { left: 115%; }
}

.prize__button.is-shaking {
    animation: prize-shake var(--shake-speed) linear infinite;
}

@keyframes prize-shake {
    0% { transform: translate(calc(var(--shake) * -1), 0) rotate(-2.5deg); }
    25% { transform: translate(var(--shake), 0) rotate(2.5deg) scale(1.03); }
    50% { transform: translate(calc(var(--shake) * -1), 0) rotate(-2deg); }
    75% { transform: translate(var(--shake), 0) rotate(2deg) scale(1.04); }
    100% { transform: translate(calc(var(--shake) * -1), 0) rotate(-2.5deg); }
}

.prize__button.is-shaking-1 { --shake: 2px;  --shake-speed: 0.26s; }
.prize__button.is-shaking-2 { --shake: 5px;  --shake-speed: 0.15s; }
.prize__button.is-shaking-3 { --shake: 10px; --shake-speed: 0.08s; }

.prize__button.is-bursting {
    animation: prize-burst 0.4s cubic-bezier(0.3, 0, 0.2, 1) forwards;
    pointer-events: none;
}

@keyframes prize-burst {
    0% { transform: scale(1); filter: brightness(1); }
    40% { transform: scale(1.4); filter: brightness(2.6); }
    100% { transform: scale(2.2); opacity: 0; filter: brightness(3.5); }
}

.prize__canvas {
    z-index: 3;
}

/* The panel hiding underneath. It keeps its space in the grid from the start,
   so revealing it never resizes the popup — it is only invisible. */
.prize__reveal {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 1.5rem 1.25rem 1.25rem;
    border-radius: 1rem;
    overflow: hidden;
    background: linear-gradient(155deg, #FF4FA3 0%, #FF7BC4 38%, #F8E415 100%);
    box-shadow: 0 0 0 3px #fff, 0 0 2.5rem rgba(255, 79, 163, 0.6);
    transform: scale(0.4);
    opacity: 0;
    visibility: hidden;
}

/* Cheap rotating ray burst */
.prize__reveal::before {
    content: '';
    position: absolute;
    inset: -60%;
    background: repeating-conic-gradient(rgba(255, 255, 255, 0.16) 0 9deg, transparent 9deg 18deg);
    animation: prize-rays 14s linear infinite;
}

@keyframes prize-rays {
    to { transform: rotate(360deg); }
}

.prize__reveal.is-revealed {
    visibility: visible;
    animation: prize-pop 0.55s cubic-bezier(0.2, 1.65, 0.4, 1) forwards;
}

@keyframes prize-pop {
    0% { transform: scale(0.4) rotate(-6deg); opacity: 0; }
    100% { transform: scale(1) rotate(-1.5deg); opacity: 1; }
}

.prize__amount,
.prize__label,
.prize__smallprint,
.prize__link {
    position: relative;
    z-index: 1;
}

.prize__amount {
    margin: 0;
    color: #fff;
    font-size: clamp(1.6rem, 7vw, 2.4rem);
    font-weight: 900;
    line-height: 0.95;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 0 #C8206E, 0 4px 0 rgba(0, 0, 0, 0.25);
}

.prize__label {
    margin: 0.15rem 0 0;
    color: #3A1000;
    font-size: clamp(1.1rem, 5vw, 1.7rem);
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.35em;
    text-indent: 0.35em;
}

.prize__smallprint {
    margin: 0.9rem auto 0;
    max-width: 22rem;
    color: rgba(0, 0, 0, 0.6);
    font-size: 0.65rem;
    line-height: 1.35;
}

.prize__link {
    display: inline-block;
    margin-top: 0.85rem;
    color: #3A1000;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: underline;
}

.prize__link:hover {
    color: #fff;
}

/* ========================================
   GALLERY PAGES
   ======================================== */
.gallery-page {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem 0 5rem;
    text-align: center;
}

.gallery-title {
    color: #F8E415;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    margin: 0 0 2.5rem;
}

.gallery-body img {
    max-width: 100%;
    height: auto;
    display: block;
}

.gallery-body p {
    color: #ffffff;
}

.gallery-back {
    display: inline-block;
    margin-top: 3rem;
    color: #F8E415;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 700;
    text-decoration: none;
}

.gallery-back:hover {
    color: #ffffff;
}

/* Style the Envira gallery container */
.gallery-section .envira-gallery-wrap {
    max-width: 100%;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 767px) {
    .heading-section {
        margin-top: 2rem;
        padding: 1rem 0 2rem;
    }

    .dice-container {
        --die-size: 2rem;
        grid-gap: 2rem;
        padding: 0.5rem;
    }

    .roll-button {
        font-size: 1rem;
        padding: 0.75rem 2rem;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .dice-container {
        --die-size: 3.5rem;
        grid-gap: 2.5rem;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
.roll-button:focus-visible {
    outline: 3px solid #FFC000;
    outline-offset: 4px;
}

.dice-container:focus-visible {
    outline: 2px solid #FFD700;
    outline-offset: 8px;
    border-radius: 1rem;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .die-list {
        transition: none;
    }

    .die-wrap.is-tossing {
        animation: none;
    }

    .die-list.is-hot .dot {
        animation-iteration-count: 2;
    }

    .roll-button:hover {
        transform: none;
    }

    .dice-container:hover {
        transform: none;
    }
}
