* { box-sizing: border-box; margin: 0; padding: 0; }

body, html {
    height: 100%;
    font-family: sans-serif;
}

/* ── Laser background (always fixed, revealed when gif fades) ── */
.laser-background {
    position: fixed;
    inset: 0;
    z-index: -2;
    background: #000 url('images/case_study_1bl.jpg') no-repeat center center / cover;
}

/* ── Fixed gif background ── */
.gif-background {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: url('images/PCutt.png') no-repeat center center / cover;
    border: 4px solid #f89102;
    box-shadow:
        0 0 25px #f89102,
        0 0 60px rgba(248, 145, 2, 0.45),
        inset 0 0 40px rgba(248, 145, 2, 0.1);
    pointer-events: none;
}

/* ── Slider ── */
.slider {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.8s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide.active { opacity: 1; }

.slide-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.slide-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    max-width: 800px;
    padding: 2rem;
}

.slide-content h1 {
    font-size: 3rem;
    color: #f89102;
    margin-bottom: 1rem;
}

.slide-content p {
    font-size: 1.2rem;
    color: #eee;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.slide-links { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #f89102;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: background 0.2s;
}

.btn:hover { background: #c27407; }

.arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    border: none;
    padding: 0.9rem 1.1rem;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    border-radius: 4px;
    transition: background 0.2s;
}

.arrow:hover { background: rgba(0, 0, 0, 0.75); }
.prev { left: 1.5rem; }
.next { right: 1.5rem; }

.dots {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.6rem;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: background 0.2s;
}

.dot.active { background: #f89102; }

/* ── Main content ── */
main {
    max-width: 1100px;
    margin: 60px auto;
    padding: 0 2rem;
    text-align: center;
}

main h1 {
    font-size: 2rem;
    color: #f89102;
    margin: 3rem 0 1.5rem;
}

.content-img {
    max-width: 100%;
    border-radius: 8px;
}

footer {
    text-align: center;
    padding: 2rem;
    background: #222;
    color: #aaa;
    margin-top: 4rem;
    position: relative;
    z-index: 200;
}

/* ── Scroll spacer for parallax ── */
.scroll-spacer {
    height: 200vh;
}

/* ── Scroll Overlay (jacket) ── */
.overlay {
    position: fixed;
    inset: 0;
    height: 100vh;
    width: 100vw;
    z-index: 100;
    pointer-events: none;
    transform: translateY(90vh);
    will-change: transform;
}

/* ── Scroll to bottom arrow on peeking hood ── */
.scroll-to-bottom {
    position: absolute;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 4rem;
    color: #f89102;
    text-decoration: none;
    pointer-events: auto;
    line-height: 1;
    text-shadow: 0 0 12px rgba(0,0,0,0.8), 0 0 24px rgba(0,0,0,0.5);
    transition: color 0.2s, opacity 0.3s;
    z-index: 2;
    opacity: 1;
    animation: bob-down 2s ease-in-out infinite;
}

.scroll-to-bottom:hover { color: #fff; }

.scroll-to-bottom.hidden {
    opacity: 0;
    pointer-events: none;
}

@keyframes bob-down {
    0%, 100% { top: 1.5rem; }
    50%       { top: 2.5rem; }
}

/* ── Back to top arrow on hood ── */
.back-to-top {
    position: absolute;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 4rem;
    color: #f89102;
    text-decoration: none;
    pointer-events: auto;
    line-height: 1;
    text-shadow: 0 0 12px rgba(0,0,0,0.8), 0 0 24px rgba(0,0,0,0.5);
    transition: color 0.2s, transform 0.2s, opacity 0.3s;
    z-index: 2;
    opacity: 0;
    animation: bob 2s ease-in-out infinite;
}

.back-to-top:hover {
    color: #fff;
    transform: translateX(-50%) scale(1.15);
}

.back-to-top.visible { opacity: 1; }

@keyframes bob {
    0%, 100% { bottom: 5%; }
    50%       { bottom: 7%; }
}

/* ── Enquiries button on jacket ── */
.enquire-btn {
    position: absolute;
    bottom: 18%;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: auto;
    background: #f89102;
    color: #fff;
    border: none;
    padding: 1rem 2.8rem;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    border-radius: 8px;
    cursor: pointer;
    z-index: 2;
    box-shadow:
        0 0 18px rgba(248,145,2,0.7),
        0 0 40px rgba(248,145,2,0.35);
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
    white-space: nowrap;
}

.enquire-btn:hover {
    background: #d97d01;
    box-shadow:
        0 0 28px rgba(248,145,2,0.95),
        0 0 60px rgba(248,145,2,0.5);
    transform: translateX(-50%) scale(1.05);
}

/* ── Modal backdrop ── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0,0,0,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(4px);
}

.modal-backdrop.open {
    opacity: 1;
    visibility: visible;
}

/* ── Modal box ── */
.modal-box {
    position: relative;
    background: #111;
    border: 2px solid #f89102;
    border-radius: 16px;
    padding: 2.5rem 2.5rem 2rem;
    width: min(480px, 92vw);
    box-shadow:
        0 0 30px rgba(248,145,2,0.6),
        0 0 80px rgba(248,145,2,0.25),
        inset 0 0 30px rgba(248,145,2,0.05);
    transform: scale(0.85) translateY(30px);
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
    opacity: 0;
}

.modal-backdrop.open .modal-box {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Modal close */
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    background: none;
    border: none;
    color: #888;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover { color: #f89102; }

/* Modal logo badge */
.modal-logo {
    display: inline-block;
    background: #f89102;
    color: #000;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    padding: 0.3rem 0.85rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

/* Modal logo image */
.modal-logo-img {
    display: block;
    max-width: 120px;
    height: auto;
    margin: 0 auto 1rem auto;
}

/* Welcome logo above slider text */
.welcome-logo {
    display: block;
    max-width: 180px;
    height: auto;
    margin: 0 auto 1.5rem auto;
}

/* Modal text */
.modal-title {
    font-size: 1.7rem;
    color: #f89102;
    margin-bottom: 0.4rem;
}

.modal-sub {
    font-size: 0.95rem;
    color: #888;
    margin-bottom: 1.6rem;
    line-height: 1.5;
}

/* Fields */
.field-group {
    margin-bottom: 1.2rem;
    text-align: left;
}

.field-group label {
    display: block;
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 0.4rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.field-group input,
.field-group textarea {
    width: 100%;
    background: #1a1a1a;
    border: 1.5px solid #333;
    border-radius: 8px;
    color: #eee;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    resize: vertical;
}

.field-group input:focus,
.field-group textarea:focus {
    border-color: #f89102;
    box-shadow: 0 0 0 3px rgba(248,145,2,0.2);
}

.char-count {
    display: block;
    text-align: right;
    font-size: 0.78rem;
    color: #555;
    margin-top: 0.3rem;
}

.field-error {
    display: block;
    color: #e05252;
    font-size: 0.82rem;
    margin-top: 0.3rem;
    min-height: 1em;
}

.form-error {
    text-align: center;
    margin-bottom: 0.5rem;
}

/* Submit button */
.modal-submit {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.9rem;
    background: #f89102;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    box-shadow: 0 0 16px rgba(248,145,2,0.4);
}

.modal-submit:hover:not(:disabled) {
    background: #d97d01;
    box-shadow: 0 0 28px rgba(248,145,2,0.7);
}

.modal-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success state */
.success-icon {
    font-size: 3.5rem;
    color: #f89102;
    margin-bottom: 1rem;
    animation: popIn 0.5s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes popIn {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* hood2 jacket image */
.overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('images/hood2.png') no-repeat center bottom;
    background-size: contain;
    opacity: 0.6;
}

/* ── Case Pages ── */
.case-page {
    background-color: #111;
    color: #ddd;
    min-height: 100vh;
}

.case-header {
    background: #f89102;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.back-link {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    transition: opacity 0.2s, background-color 0.2s, box-shadow 0.2s;
    padding: 0.5rem 1rem;
    background: rgba(195, 116, 5, 0.712);
    border: 1px solid rgba(248, 145, 2, 0.3);
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.back-link:hover { 
    opacity: 0.75; 
    background: rgba(248, 145, 2, 0.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.header-title {
    color: #fff;
    font-size: 1rem;
    font-weight: bold;
    opacity: 0.85;
    flex: 1;
    text-align: center;
}

.case-main {
    max-width: 900px;
    margin: 3rem auto;
    padding: 0 2rem;
}

.case-main h1 {
    font-size: 2.2rem;
    color: #f89102;
    margin-bottom: 1.5rem;
    text-align: center;
}

.case-main h2 {
    font-size: 1.5rem;
    color: #f89102;
    margin: 2.5rem 0 1rem;
    text-align: center;
}

.lead {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #ccc;
    max-width: 720px;
    margin: 0 auto 1rem;
    text-align: center;
}

.lead strong { color: #f89102; }

.case-figure {
    margin: 2.5rem auto;
    text-align: center;
    max-width: 700px;
}

.case-figure img {
    width: 100%;
    border-radius: 8px;
}

.case-figure figcaption {
    margin-top: 0.6rem;
    font-style: italic;
    color: #888;
    font-size: 0.9rem;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto;
    font-size: 1rem;
}

.results-table th,
.results-table td {
    padding: 0.85rem 1rem;
    border: 1px solid #333;
    text-align: center;
}

.results-table thead tr {
    background: #f89102;
    color: #fff;
}

.results-table tbody tr:nth-child(even) { background: #1a1a1a; }
.results-table tbody tr:nth-child(odd)  { background: #161616; }

.results-table td:first-child { text-align: left; }

.highlight {
    color: #f89102;
    font-weight: bold;
}

.table-note {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #777;
    text-align: center;
}

/* ── Parallax Storyboard (case2) ── */
.story-page { scroll-behavior: smooth; }

.story-panel {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.intro-panel  { background-image: url('images/case_study_1a.jpg'); }
.outro-panel  { background-color: #0a0a0a; }

.panel-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
}

.outro-overlay { background: rgba(0, 0, 0, 0.82); }

.panel-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 680px;
    padding: 2rem;
    color: #fff;
}

.story-label {
    font-size: 0.8rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #f89102;
    margin-bottom: 0.75rem;
}

.panel-content h1 {
    font-size: 3.2rem;
    color: #fff;
    margin-bottom: 1rem;
    line-height: 1.15;
}

.panel-content h2 {
    font-size: 2.4rem;
    color: #fff;
    margin-bottom: 1rem;
}

.story-sub {
    font-size: 1.15rem;
    color: #ccc;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.panel-content p {
    font-size: 1.1rem;
    color: #ddd;
    line-height: 1.7;
    margin: 0 auto;
    max-width: 560px;
}

.scroll-cue {
    display: inline-block;
    margin-top: 2rem;
    color: #f89102;
    text-decoration: none;
    font-size: 1rem;
    letter-spacing: 0.1em;
    animation: bounce 1.8s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(8px); }
}

/* Fade-in on scroll */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.9s ease, transform 0.9s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Side dot navigation */
.story-nav {
    position: fixed;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 50;
}

.story-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.5);
    transition: background 0.3s, transform 0.3s;
    position: relative;
}

.story-dot::after {
    content: attr(data-label);
    position: absolute;
    right: 1.4rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: #fff;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.story-dot:hover::after,
.story-dot.active::after { opacity: 1; }

.story-dot.active {
    background: #f89102;
    border-color: #f89102;
    transform: scale(1.3);
}

@media (max-width: 768px) {
    /* Slider */
    .slide-content h1 { font-size: 1.8rem; }
    .slide-content p  { font-size: 1rem; margin-bottom: 1.2rem; }
    .slide-content    { padding: 1.2rem; }
    .welcome-logo     { max-width: 130px; margin-bottom: 1rem; }
    .arrow            { padding: 0.6rem 0.8rem; font-size: 1.2rem; }
    .prev             { left: 0.5rem; }
    .next             { right: 0.5rem; }

    /* Main section */
    main              { margin: 30px auto; padding: 0 1rem; }
    main h1           { font-size: 1.4rem; margin: 2rem 0 1rem; }

    /* Case pages */
    .case-header      { padding: 0.6rem 1rem; gap: 0.75rem; }
    .case-main        { margin: 1.5rem auto; padding: 0 1rem; }
    .case-main h1     { font-size: 1.5rem; }
    .case-main h2     { font-size: 1.2rem; }
    .lead             { font-size: 1rem; }

    /* Results table — horizontal scroll on small screens */
    .results-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .results-table { font-size: 0.82rem; min-width: 480px; }
    .results-table th,
    .results-table td { padding: 0.55rem 0.5rem; }

    /* Story panels — background-attachment: fixed is broken on iOS */
    .story-panel {
        background-attachment: scroll;
        height: auto;
        min-height: 100svh;
    }

    /* Story panel text */
    .panel-content h1  { font-size: 2rem; }
    .panel-content h2  { font-size: 1.6rem; }
    .story-sub         { font-size: 1rem; margin-bottom: 1.2rem; }
    .panel-content p   { font-size: 0.95rem; }
    .panel-content     { padding: 1.5rem 1rem; }

    /* Side nav dots — keep but move slightly inward */
    .story-nav         { right: 0.6rem; }
    .story-dot::after  { display: none; } /* hide label tooltips on mobile */

    /* Enquiry button on jacket */
    .enquire-btn {
        font-size: 1.1rem;
        padding: 0.85rem 2rem;
    }

    /* Modal */
    .modal-box         { padding: 1.8rem 1.2rem 1.4rem; }
    .modal-title       { font-size: 1.4rem; }
}

@media (max-width: 480px) {
    .slide-content h1  { font-size: 1.4rem; }
    .slide-content p   { font-size: 0.9rem; }
    .dots              { bottom: 0.8rem; }

    .panel-content h1  { font-size: 1.6rem; }
    .panel-content h2  { font-size: 1.3rem; }

    .enquire-btn {
        font-size: 1rem;
        padding: 0.75rem 1.4rem;
    }

    /* Prevent the border on gif-background from causing overflow */
    .gif-background    { border-width: 2px; }
}
