:root {
    color-scheme: light;
    --ink: #fff;
    --muted: rgb(255 255 255 / 82%);
    --purple: #726193;
    --coral: #e37b7c;
    --gold: #ffe4b4;
    --panel: #323459;
}

* {
    box-sizing: border-box;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    padding: clamp(1.25rem, 5vw, 4rem);
    display: grid;
    place-items: center;
    background:
    radial-gradient(ellipse at 50% 0%, #fff 0, transparent 38rem),
    #f1e9e8;
    color: var(--ink);
    font-family: "Segoe UI", Arial, sans-serif;
    line-height: 1.65;
}

.site {
    width: min(100%, 65rem);
    overflow: hidden;
    background: var(--panel);
    box-shadow: 0 2rem 4rem rgb(46 43 55 / 32%);
}

.banner {
    min-height: 28rem;
    display: grid;
    grid-template-columns: minmax(12rem, 0.72fr) minmax(0, 1.7fr);
}

.photo {
    min-height: 28rem;
    margin: 0;
    position: relative;
    overflow: hidden;
    background: var(--purple);
}

.photo::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, rgb(114 97 147 / 10%), rgb(227 123 124 / 18%));
    content: "";
    pointer-events: none;
}

.photo img {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    object-fit: cover;
    object-position: 25% 25%;
}

.welcome {
    padding: clamp(2rem, 6vw, 5rem);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    background: linear-gradient(120deg, var(--purple), #a16d88 55%, var(--coral));
}

.eyebrow {
    margin: 0 0 1rem;
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 1.3rem;
    font-size: clamp(2.25rem, 5.5vw, 4rem);
    letter-spacing: -0.045em;
    line-height: 1.08;
}

.welcome-copy {
    max-width: 39rem;
    margin-bottom: 1.6rem;
    color: var(--muted);
    font-size: 1rem;
}

.actions {
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8rem;
    list-style: none;
}

.button {
    min-height: 3rem;
    padding: 0.7rem 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    border: 1px solid rgb(255 255 255 / 70%);
    border-radius: 999px;
    color: #554765;
    background: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: transform 160ms ease, background-color 160ms ease;
    position: relative;
    overflow: hidden;
}

.button {
    min-height: 3rem;
    padding: 0.7rem 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    border: 1px solid rgb(255 255 255 / 70%);
    border-radius: 999px;
    color: #554765;
    background: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: transform 160ms ease, background-color 160ms ease;
    position: relative;
    overflow: hidden;
}

.button:hover {
    transform: translateY(-2px);
    background: var(--gold);
    box-shadow: 0 0 10px var(--gold), 0 0 20px var(--gold);
    animation: holy-select 3s linear infinite;
}

.button:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 4px;
}

.button svg {
    width: 1.1rem;
    height: 1.1rem;
    flex: 0 0 auto;
}

@keyframes holy-select {
    0% {
        box-shadow: 0 0 10px var(--gold), 0 0 20px var(--gold);
    }
    25% {
        box-shadow: 30px 30px 20px var(--gold), -30px -30px 20px var(--gold);
    }
    50% {
        box-shadow: 0 0 10px var(--gold), 0 0 20px var(--gold);
    }
    75% {
        box-shadow: -30px 30px 20px var(--gold), 30px -30px 20px var(--gold);
    }
    100% {
        box-shadow: 0 0 10px var(--gold), 0 0 20px var(--gold);
    }
}

.roaming-sheep {
    width: 4.5rem;
    height: 3.75rem;
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    font-size: 2.25rem;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
}

.roaming-sheep:hover {
    filter: drop-shadow(0 0 10px var(--gold)) drop-shadow(0 0 20px var(--gold));
    animation: holy-select 3s linear infinite;
}

@keyframes holy-select {
    0% {
        box-shadow: 0 0 0 0 rgb(255 228 180 / 0%);
    }
    12% {
        box-shadow: 15px 0 15px -5px rgb(255 228 180 / 70%);
    }
    25% {
        box-shadow: 15px 0 20px -5px rgb(255 228 180 / 80%);
    }
    37% {
        box-shadow: 0 15px 20px -5px rgb(255 228 180 / 70%);
    }
    50% {
        box-shadow: 0 15px 15px -5px rgb(255 228 180 / 80%);
    }
    62% {
        box-shadow: -15px 0 15px -5px rgb(255 228 180 / 70%);
    }
    75% {
        box-shadow: -15px 0 20px -5px rgb(255 228 180 / 80%);
    }
    87% {
        box-shadow: 0 -15px 20px -5px rgb(255 228 180 / 70%);
    }
    100% {
        box-shadow: 0 -15px 15px -5px rgb(255 228 180 / 0%);
    }
}

.details {
    padding: clamp(2rem, 5vw, 3.5rem);
    background: linear-gradient(135deg, #383956, #292b49);
}

.details-heading {
    max-width: 38rem;
    margin-bottom: 1.7rem;
}

.details h2 {
    margin-bottom: 0.55rem;
    font-size: clamp(1.5rem, 3vw, 2rem);
    line-height: 1.2;
}

.details-heading p {
    margin-bottom: 0;
    color: var(--muted);
}

.status {
    padding: 1.5rem clamp(2rem, 5vw, 3.5rem);
    border-top: 1px solid rgb(255 255 255 / 12%);
    background: linear-gradient(135deg, #383956, #292b49);
}

.status-heading {
    margin-bottom: 1rem;
}

.status-heading h2 {
    margin-bottom: 0.35rem;
    font-size: 1.35rem;
}

.status-heading p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.status-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.status-item {
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid rgb(255 255 255 / 14%);
    background: rgb(255 255 255 / 5%);
}

.status-value {
    font-weight: 700;
}

.status-value[data-state="up"] {
    color: #b7f0c1;
}

.status-value[data-state="down"],
.status-value[data-state="error"] {
    color: #ffb7b7;
}

/* Commandments Grid Styles - TV Launcher Look */
.commandments-grid {
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
    gap: 0.6rem;
}

.commandment-tile {
    position: relative;
    padding: 0.9rem;
    display: flex;
    align-items: flex-end;
    min-height: 7.2rem;
    aspect-ratio: 16 / 9;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    background-size: cover;
    background-position: center;
    overflow: hidden;
    transition: all 250ms ease;
    cursor: default;
    color: #fff;
}

.commandment-tile::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0) 100%);
    z-index: 1;
    border-radius: 0.5rem;
}

.commandment-tile::after {
    content: '';
    position: absolute;
    inset: -15px;
    border-radius: 0.8rem;
    z-index: -1;
    opacity: 0;
    transition: opacity 250ms ease;
    box-shadow: 0 0 0 0 rgb(255 228 180 / 0%);
    pointer-events: none;
}

.commandment-tile:not(.status-down):hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 0.5rem 1rem rgb(255 228 180 / 40%);
    filter: drop-shadow(0 0 10px var(--gold)) drop-shadow(0 0 20px var(--gold));
    animation: holy-select 3s linear infinite;
}

.commandment-tile:not(.status-down):hover::after {
    opacity: 1;
    animation: holy-select 3s linear infinite;
}

.commandment-tile.status-down {
    filter: grayscale(100%) brightness(0.7);
}

@keyframes holy-select {
    0% {
        filter: drop-shadow(0 0 10px var(--gold)) drop-shadow(0 0 20px var(--gold)) brightness(1);
    }
    25% {
        filter: drop-shadow(30px 30px 20px var(--gold)) drop-shadow(-30px -30px 20px var(--gold)) brightness(1.5);
    }
    50% {
        filter: drop-shadow(0 0 10px var(--gold)) drop-shadow(0 0 20px var(--gold)) brightness(1);
    }
    75% {
        filter: drop-shadow(-30px 30px 20px var(--gold)) drop-shadow(30px -30px 20px var(--gold)) brightness(1.5);
    }
    100% {
        filter: drop-shadow(0 0 10px var(--gold)) drop-shadow(0 0 20px var(--gold)) brightness(1);
    }
}

.commandment-tile:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 1px;
}

.tile-led {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: rgb(255 255 255 / 40%);
    box-shadow: 0 0 0.25rem currentColor;
    z-index: 2;
}

.tile-led[data-state="up"] {
    background: #b7f0c1;
    color: #b7f0c1;
}

.tile-led[data-state="down"],
.tile-led[data-state="error"] {
    background: #ffb7b7;
    color: #ffb7b7;
}

.tile-led[data-state="loading"] {
    background: var(--gold);
    color: var(--gold);
    animation: led-pulse 1.5s ease-in-out infinite;
}

@keyframes led-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.tile-name {
    position: relative;
    z-index: 1;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.3;
    color: rgb(243, 220, 214);
    -webkit-text-stroke: 0.5px rgba(0, 0, 0, 0.6);
    text-shadow: 0 0.0625rem 0.25rem rgb(0 0 0 / 70%);
    max-width: 100%;
}

.commandment-tile.status-down {
    filter: grayscale(100%) brightness(0.7);
}

.commandment-tile.status-down .tile-led {
    filter: none;
}

.steps {
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    list-style: none;
}

.step {
    padding: 1.25rem;
    border: 1px solid rgb(255 255 255 / 14%);
    background: rgb(255 255 255 / 5%);
}

.step-number {
    width: 2rem;
    height: 2rem;
    margin-bottom: 0.85rem;
    display: grid;
    place-items: center;
    border: 1px solid rgb(255 228 180 / 70%);
    border-radius: 50%;
    color: var(--gold);
    font-size: 0.9rem;
    font-weight: 700;
}

.step h3 {
    margin-bottom: 0.55rem;
    color: #fff;
    font-size: 1rem;
}

.step p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.text-link {
    color: var(--gold);
    text-underline-offset: 0.2em;
}

.text-link:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 4px;
}

.footer {
    margin: 1.6rem 0 0;
    color: rgb(255 255 255 / 65%);
    font-size: 0.82rem;
    text-align: center;
    line-height: 1.55;
}

@media (max-width: 700px) {
    .steps {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }
    
    .step {
        padding: 1.25rem;
    }
    
    .step-number {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.85rem;
    }
}

.roaming-sheep {
    width: 4.5rem;
    height: 3.75rem;
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    font-size: 2.25rem;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    transition: left 1.5s ease-in-out, top 1.5s ease-in-out, transform 160ms ease;
    filter: drop-shadow(0 0.2rem 0.25rem rgb(46 43 55 / 30%));
}

.sheep-dancer {
    width: 100%;
    height: 100%;
    overflow: visible;
    animation: sheep-bob 420ms ease-in-out infinite alternate;
}

.sheep-leg {
    transform-box: fill-box;
    transform-origin: 50% 0;
    animation: sheep-kick 420ms ease-in-out infinite alternate;
}

.sheep-leg.back {
    animation-delay: 210ms;
}

@keyframes sheep-bob {
    from { transform: translateY(1px) rotate(-5deg); }
    to { transform: translateY(-5px) rotate(5deg); }
}

@keyframes sheep-kick {
    from { transform: rotate(-18deg); }
    to { transform: rotate(22deg); }
}

.roaming-sheep:hover {
    transform: scale(1.16);
}

.roaming-sheep:focus-visible {
    outline: 3px solid var(--coral);
    outline-offset: 2px;
}

.grail-display {
    width: 4.5rem;
    height: 4.5rem;
    padding: 0;
    position: fixed;
    top: max(1rem, env(safe-area-inset-top));
    right: max(1rem, env(safe-area-inset-right));
    z-index: 11;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgb(255 228 180 / 55%);
    border-radius: 50%;
    color: #fff;
    background: rgb(50 52 89 / 94%);
    box-shadow: 0 0.4rem 1rem rgb(46 43 55 / 20%);
    cursor: default;
}

button.grail-display {
    font: inherit;
}

button.grail-display:focus-visible {
    outline: 3px solid var(--coral);
    outline-offset: 3px;
}

.grail-display.ready {
    color: #fff2a8;
    border-color: #fff2a8;
    cursor: pointer;
    animation: grail-holy-glow 850ms ease-in-out infinite alternate;
}

.grail-display.ready .grail-liquid {
    fill: #ffe64d;
}

.grail-display.ready .grail-outline {
    stroke: #fff2a8;
}

@keyframes grail-holy-glow {
    from {
    background: #756322;
    box-shadow: 0 0 0.4rem #ffe64d, 0 0 0.8rem rgb(255 230 77 / 55%);
    }
    to {
    background: #c09a15;
    box-shadow: 0 0 1rem #fff2a8, 0 0 2rem rgb(255 230 77 / 90%);
    }
}

.grail-display[hidden] {
    display: none;
}

.grail-icon {
    width: 2.8rem;
    height: 3.5rem;
    overflow: visible;
}

.grail-liquid {
    fill: #ffe4b4;
    transition: y 550ms ease, height 550ms ease;
}

.sheep-celebration[hidden] {
    display: none;
}

.sheep-celebration {
    padding: 1.5rem;
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    background: rgb(15 13 24 / 96%);
    color: #fffaf6;
    text-align: center;
}

.celebration-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.celebration-gif {
    width: min(80vw, 70vh, 32rem);
    height: min(80vw, 70vh, 32rem);
    object-fit: contain;
    image-rendering: auto;
}

.celebration-caption {
    margin: 0;
    font-size: clamp(1.25rem, 4vw, 2rem);
    font-weight: 700;
}

.celebration-close {
    min-height: 2.75rem;
    padding: 0.65rem 1.2rem;
    border: 1px solid rgb(255 255 255 / 75%);
    border-radius: 999px;
    color: #403448;
    background: #fffaf6;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.celebration-close:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 4px;
}

@media (max-width: 700px) {
    body {
    padding: 1rem;
    }

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

    .photo {
    min-height: 17rem;
    }

    .photo img {
    object-position: center 28%;
    }

    .welcome {
    padding: 2rem 1.5rem;
    }

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

@media (max-width: 700px) {
    .commandments-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 8rem), 1fr));
        gap: 0.5rem;
    }
    
    .commandment-tile {
        aspect-ratio: 16 / 9;
        padding: 0.75rem;
        min-height: 4.5rem;
    }
    
    .tile-led {
        width: 0.5rem;
        height: 0.5rem;
        top: 0.5rem;
        left: 0.5rem;
    }
    
    .tile-name {
        font-size: 0.7rem;
    }
}

@media (max-width: 400px) {
    .commandments-grid {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }
    
    .commandment-tile {
        min-height: 4rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    }

    .roaming-sheep {
    transition: none;
    }

    .sheep-dancer,
    .sheep-leg {
    animation: none;
    }

    .grail-liquid {
    transition: none;
    }

    .grail-display.ready {
    animation: none;
    }
}