@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;600;800&display=swap');

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

:root{
    --bg-1: #0f1113;
    --bg-2: #121519;
    --accent: #e07a5f;
    --muted: #c9c9c9;
    --glass: rgba(255,255,255,0.04);
}

body {
    font-family: 'Noto Sans', sans-serif;
    /* Use the uploaded photo as the main background with a subtle dark overlay for readability */
    background-image:
        linear-gradient(rgba(8,8,10,0.64), rgba(8,8,10,0.64)),
        url('/0b6841ec28c0a8e773c7d6d5069092f9c9e54030-800x533.avif');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-blend-mode: multiply;
    color: #fff;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: 28px;
    position: relative;
}

/* Title */
.page-title {
    font-size: 44px;
    font-weight: 800;
    text-align: center;
    color: #fff;
    letter-spacing: 1.6px;
    margin: 22px 8px 6px;
    text-transform: uppercase;
    line-height: 1.02;
    padding: 14px 18px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    background: linear-gradient(90deg, rgba(255,255,255,0.02), rgba(224,122,95,0.02));
    border-radius: 10px;
    box-shadow: 0 6px 30px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.02);
}

/* Small clickable hint above the main instruction */
.click-instruction {
    font-size: 16px;
    font-weight: 900;
    text-align: center;
    color: var(--accent);
    margin: 8px 10px 6px;
    letter-spacing: 1.2px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0,0,0,0.6);
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(224,122,95,0.06);
    border: 1px solid rgba(224,122,95,0.08);
}

/* Prominent instruction under the title — much larger and responsive */
.instruction {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    color: #f7efe9;
    margin: 10px 10px 22px;
    line-height: 1.05;
    letter-spacing: 0.4px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 4px 22px rgba(0,0,0,0.6);
    background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
    padding: 12px 18px;
    border-radius: 8px;
}

/* Slightly smaller on narrow screens to keep layout intact */
@media (max-width: 480px) {
    .instruction {
        font-size: 18px;
        margin: 8px;
        padding: 10px;
    }
}

/* Gallery container */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 18px;
    max-width: 95vw;
    margin: 14px auto;
    padding: 18px;
}

/* Cards */
.gallery-item {
    position: relative;
    /* larger, taller cards that take up more vertical space */
    min-height: 420px;
    height: calc(min(62vh, 520px));
    cursor: pointer;
    perspective: 1000px;
    border-radius: 14px;
    overflow: visible;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(.2,.9,.2,1), box-shadow 0.4s;
    transform-style: preserve-3d;
    border-radius: 12px;
    will-change: transform;
}

.gallery-item.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.06));
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(3,6,10,0.6);
}

/* Front visual */
.card-front {
    display: block;
    transform: translateZ(0);
    border: 1px solid rgba(255,255,255,0.02);
    overflow: hidden;
}

.card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(0.18) contrast(1.02) saturate(0.95);
    transition: transform 0.6s ease, filter 0.4s ease;
    transform-origin: center;
    will-change: transform;
}

.gallery-item:hover .card-front img {
    filter: grayscale(0) contrast(1.08) saturate(1.05);
    transform: scale(1.06) rotate(-0.6deg);
}

.gallery-item:active .card-front img {
    transform: scale(0.995);
}

/* overlay */
.item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(10,10,10,0.85) 0%, rgba(10,10,10,0.6) 60%, transparent);
    padding: 14px;
    transform: translateY(100%);
    transition: transform 0.36s cubic-bezier(.2,.9,.2,1);
    box-shadow: 0 -18px 40px rgba(0,0,0,0.5);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.gallery-item:hover .item-overlay,
.gallery-item:active .item-overlay {
    transform: translateY(0);
}

.item-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

/* Engraved name overlay for dog tag */
.engrave {
    position: absolute;
    right: 10%;
    bottom: 14%;
    z-index: 4;
    font-size: 18px;
    letter-spacing: 1.6px;
    color: rgba(255,255,255,0.95);
    font-weight: 800;
    text-shadow: 0 2px 18px rgba(0,0,0,0.6);
    transform: rotate(-6deg);
    pointer-events: none;
}

/* message bubble */
.message-bubble {
    position: absolute;
    left: 6%;
    top: 8%;
    max-width: 62%;
    padding: 8px 12px;
    background: linear-gradient(180deg, #27d66c, #19a84a);
    color: #042114;
    font-weight: 700;
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.55);
    z-index: 6;
    font-size: 13px;
    line-height: 1.2;
}

/* Back of the card */
.card-back {
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    padding: 22px;
    justify-content: center;
    background: linear-gradient(180deg, rgba(20,20,20,0.85), rgba(12,12,12,0.95));
    color: var(--muted);
}

.back-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 10px;
    color: #fff;
}

.back-description {
    font-size: 15px;
    line-height: 1.6;
    color: #d7d7d7;
}

/* Modal improvements */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(2,2,2,0.92), rgba(8,8,10,0.95));
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.28s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    position: relative;
    width: 98%;
    max-width: 1100px;
    height: auto;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.6));
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 40px 140px rgba(2,4,6,0.8);
}

.close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.04);
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    z-index: 10;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.14s ease, opacity 0.14s;
}

.close-btn:hover { transform: scale(1.04); opacity: 0.95; }

.modal-image {
    width: 100%;
    height: 560px;
    object-fit: cover;
    filter: contrast(1.05) saturate(0.95);
    display: block;
}

.modal-text {
    padding: 18px 20px;
}

.modal-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
    color: #fff;
}

.modal-description {
    font-size: 15px;
    line-height: 1.6;
    color: #d9d9d9;
}

/* Responsive grid */
@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
        padding: 12px;
    }
    .modal-image { height: 480px; }
}

@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        padding: 18px;
    }
}

/* Timeline styles */
#timeline-section {
    max-width: 95vw;
    margin: 28px auto 40px;
    padding: 18px 20px;
    background: linear-gradient(180deg, rgba(224,122,95,0.04), rgba(255,255,255,0.02));
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.03);
}

.timeline-title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
    text-align: left;
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    padding-left: 48px;
    border-left: 3px solid rgba(224,122,95,0.12);
}

/* Each step */
.timeline-item {
    position: relative;
    padding: 14px 18px;
    background: rgba(255,255,255,0.02);
    border-radius: 10px;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    cursor: default;
    backdrop-filter: blur(3px);
    border: 1px solid rgba(255,255,255,0.02);
}

.timeline-item:hover {
    transform: translateX(8px);
    box-shadow: 0 18px 50px rgba(0,0,0,0.6);
}

.timeline-step {
    position: absolute;
    left: -48px;
    top: 14px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(180deg, #ffd7c9, #e07a5f);
    color: #111;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.45);
    font-size: 15px;
}

/* short label and description */
.timeline-title-line {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 6px;
}

.timeline-desc {
    font-size: 15px;
    color: #e8e6e3;
    line-height: 1.45;
}

/* compact on small screens */
@media (max-width: 600px) {
    #timeline-section { padding: 10px; margin: 14px auto 28px; }
    .timeline { padding-left: 36px; gap: 10px; }
    .timeline-item { padding: 10px 12px; border-radius: 8px; }
    .timeline-step { left: -36px; width: 30px; height: 30px; font-size: 13px; top: 12px; }
    .timeline-title { font-size: 18px; }
    .timeline-title-line { font-size: 16px; }
    .timeline-desc { font-size: 14px; }
}

/* Exercise table styles */
#exercise-section {
    max-width: 95vw;
    margin: 12px auto 40px;
    padding: 18px 20px;
}

.exercise-title {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
    text-align: left;
}

.exercise-container {
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.04));
    padding: 18px;
    border-radius: 12px;
    display: grid;
    gap: 12px;
    border: 1px solid rgba(255,255,255,0.02);
}

.exercise-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: center;
}

.exercise-cell {
    padding: 12px;
    background: rgba(255,255,255,0.02);
    border-radius: 10px;
    display: flex;
    gap: 8px;
    align-items: center;
    color: #fff;
    font-size: 15px;
    border: 1px solid rgba(255,255,255,0.02);
}

.exercise-cell input {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    color: #fff;
    padding: 12px 14px;
    border-radius: 10px;
    width: 100%;
    font-size: 18px;
    height: 52px;
    transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.exercise-cell input:focus {
    outline: none;
    box-shadow: 0 8px 28px rgba(224,122,95,0.12);
    border-color: rgba(224,122,95,0.9);
}

.exercise-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
}

.btn {
    background: linear-gradient(180deg,#2f2f2f,#1f1f1f);
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    font-weight: 800;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,0,0,0.5); }
.btn:active { transform: translateY(0); }

.feedback {
    margin-top: 8px;
    font-size: 15px;
    color: #ffdede;
    min-height: 20px;
}

/* Responsive stack */
@media (max-width: 720px) {
    .exercise-row { grid-template-columns: 1fr; }
    .exercise-actions { justify-content: stretch; }
}