/**
 * File: public/stylesheets/style.css
 * Uplands Services Inc. — site styles
 * Palette taken from the emblem: charcoal, brushed silver, gold, maple red.
 */

:root {
    --upsi-charcoal: #141414;
    --upsi-charcoal-2: #1d1d1f;
    --upsi-charcoal-3: #2a2a2d;
    --upsi-silver: #d9dadc;
    --upsi-silver-dim: #a9abb0;
    --upsi-gold: #d4a537;
    --upsi-gold-dark: #b0861f;
    --upsi-maple: #d52b1e;
    --upsi-paper: #f5f4f1;
    --upsi-ink: #222326;
}

/* ==================== BASE ==================== */
body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: var(--upsi-ink);
    background: var(--upsi-paper);
}

.display-font { font-family: 'Cinzel', Georgia, serif; font-weight: 700; letter-spacing: .02em; }
.text-gold { color: var(--upsi-gold) !important; }
.text-maple { color: var(--upsi-maple) !important; }
.text-secondary-light { color: var(--upsi-silver-dim) !important; }

a { color: var(--upsi-gold-dark); }
a:hover { color: var(--upsi-gold); }

.eyebrow {
    display: inline-block;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--upsi-gold);
    margin-bottom: .5rem;
}

.section-title { font-size: clamp(1.6rem, 3vw, 2.3rem); margin-bottom: 1rem; }

/* ==================== BUTTONS ==================== */
.btn { transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease; }
.btn:hover { transform: translateY(-2px); }

.btn-gold {
    background: linear-gradient(180deg, #e3b955, var(--upsi-gold-dark));
    border: none;
    color: #111;
    font-weight: 700;
}
.btn-gold:hover, .btn-gold:focus { color: #111; box-shadow: 0 6px 18px rgba(212, 165, 55, .35); }

.btn-outline-silver {
    border: 1px solid var(--upsi-silver-dim);
    color: var(--upsi-silver);
    font-weight: 600;
}
.btn-outline-silver:hover { background: var(--upsi-silver); color: #111; }

.btn-chip {
    border: 1px solid #c9c6bd;
    border-radius: 2rem;
    color: var(--upsi-ink);
    background: #fff;
}
.btn-check:checked + .btn-chip { background: var(--upsi-charcoal); border-color: var(--upsi-charcoal); color: var(--upsi-gold); }

.link-arrow { font-weight: 700; text-decoration: none; }
.link-arrow i { transition: transform .2s ease; }
.link-arrow:hover i { transform: translateX(4px); }

/* ==================== NAVBAR ==================== */
.upsi-navbar {
    background: rgba(20, 20, 20, .96);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(212, 165, 55, .25);
}
.brand-wordmark { height: 32px; width: auto; }
.upsi-navbar .nav-link { color: var(--upsi-silver-dim); font-weight: 600; position: relative; }
.upsi-navbar .nav-link:hover,
.upsi-navbar .nav-link.active { color: #fff; }
.upsi-navbar .nav-link.active::after {
    content: '';
    position: absolute;
    left: .5rem; right: .5rem; bottom: .1rem;
    height: 2px;
    background: var(--upsi-gold);
}

/* ==================== INTRO VIDEO ==================== */
/* Home page only (views/partials/intro.ejs). Stays hidden unless intro.js adds .intro-active to <html>. */
.intro { display: none; }

/* Lock scrolling while the intro covers the page; the stable gutter stops the page
   shifting sideways when the scrollbar comes back, so the video lands exactly on the emblem. */
html.intro-active { overflow: hidden; scrollbar-gutter: stable; background: #0b0a0a; }

.intro-active .intro {
    position: fixed; inset: 0; z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    background: #0b0a0a;
    overflow: hidden;
}
.intro-video {
    flex: none;
    /* Fill the screen width, letting up to ~23% of the picture's height run off the top and
       bottom on wide screens (16:9 would be 177.78vh). The finished logo only uses the middle
       70% of the frame, so it still fits; on tall screens the video is simply full width. */
    width: min(100%, 231vh);
    width: min(100%, 231dvh);
    height: auto;
    aspect-ratio: 16 / 9;
    /* centre of the wordmark in the last frame — keep in step with VIDEO_ANCHOR in intro.js */
    transform-origin: 50.9% 52.8%;
    will-change: transform;
}
/* Feather all four edges so the video has no visible border — it rarely fills the screen
   exactly, and intro.js lifts it during the opening shots, which exposes its bottom edge. */
.intro-video {
    --intro-fade-x: linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%);
    --intro-fade-y: linear-gradient(to bottom, transparent 0, #000 12%, #000 88%, transparent 100%);
    -webkit-mask-image: var(--intro-fade-x), var(--intro-fade-y);
    mask-image: var(--intro-fade-x), var(--intro-fade-y);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
}
.intro-skip {
    position: absolute;
    right: max(1.25rem, env(safe-area-inset-right));
    bottom: max(1.25rem, env(safe-area-inset-bottom));
    padding: .45rem 1rem;
    border-radius: 2rem;
    border: 1px solid rgba(217, 218, 220, .35);
    background: rgba(20, 20, 20, .6);
    color: var(--upsi-silver);
    font-size: .85rem; font-weight: 600; letter-spacing: .04em;
    transition: color .2s ease, border-color .2s ease, opacity .3s ease;
}
.intro-skip:hover, .intro-skip:focus-visible { color: #fff; border-color: var(--upsi-gold); outline: none; }
.intro-skip.is-leaving { opacity: 0; }

/* ==================== HERO ==================== */
.hero {
    background: radial-gradient(ellipse at 70% 20%, #2b2622 0%, var(--upsi-charcoal) 55%), var(--upsi-charcoal);
    color: var(--upsi-silver);
}
.hero-emblem {
    max-width: 900px; width: 100%; height: auto;
    /* soften the image edges into the hero background */
    -webkit-mask-image: radial-gradient(ellipse 72% 70% at center, #000 70%, transparent 100%);
    mask-image: radial-gradient(ellipse 72% 70% at center, #000 70%, transparent 100%);
}
.hero-lead { max-width: 720px; font-size: 1.15rem; color: var(--upsi-silver-dim); }

.stats-band {
    background: var(--upsi-charcoal-2);
    border-top: 1px solid rgba(212, 165, 55, .3);
    border-bottom: 1px solid rgba(212, 165, 55, .3);
}
.stat { padding: 1.5rem .5rem; border-right: 1px solid rgba(255, 255, 255, .06); }
.stat:last-child { border-right: none; }
.stat-value { display: block; font-family: 'Cinzel', Georgia, serif; font-size: clamp(1.3rem, 2.6vw, 2rem); color: var(--upsi-gold); font-weight: 700; }
.stat-label { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--upsi-silver-dim); }

/* ==================== SECTIONS ==================== */
.section-light { background: var(--upsi-paper); }
.section-dark { background: var(--upsi-charcoal); color: var(--upsi-silver); }
.section-dark p, .section-dark li { color: var(--upsi-silver-dim); }

.page-header {
    background: linear-gradient(180deg, var(--upsi-charcoal) 0%, var(--upsi-charcoal-2) 100%);
    color: #fff;
    padding: 4rem 0 3rem;
    border-bottom: 3px solid var(--upsi-gold);
}
.page-header h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
.page-header .lead { color: var(--upsi-silver-dim); max-width: 760px; }

/* ==================== CARDS ==================== */
.differentiator {
    background: #fff;
    border-left: 4px solid var(--upsi-gold);
    border-radius: .5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .07);
}

.pain-card {
    background: var(--upsi-charcoal-2);
    border: 1px solid var(--upsi-charcoal-3);
    border-radius: .75rem;
    transition: border-color .25s ease, transform .25s ease;
}
.pain-card:hover { border-color: rgba(212, 165, 55, .6); transform: translateY(-4px); }
.pain-card h3 { color: #fff; }

.service-card {
    background: #fff;
    border-radius: .75rem;
    border: 1px solid #e7e4dc;
    transition: transform .25s ease, box-shadow .25s ease;
}
.service-card:hover { transform: translateY(-6px); box-shadow: 0 15px 35px rgba(0, 0, 0, .1); }

.icon-badge {
    width: 52px; height: 52px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(212, 165, 55, .15);
    color: var(--upsi-gold);
    font-size: 1.3rem;
}

.check-list { list-style: none; padding-left: 0; }
.check-list li { position: relative; padding-left: 1.6rem; margin-bottom: .55rem; }
.check-list li::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute; left: 0; top: .1rem;
    color: var(--upsi-gold);
    font-size: .85rem;
}
.check-list-dark li { color: var(--upsi-ink); }

.tech-tile {
    background: var(--upsi-charcoal-2);
    border: 1px solid var(--upsi-charcoal-3);
    border-radius: .75rem;
    padding: 2rem 1rem;
    text-align: center;
}
.tech-tile i { display: block; font-size: 2rem; color: var(--upsi-gold); margin-bottom: .6rem; }
.tech-tile span { font-weight: 700; color: var(--upsi-silver); letter-spacing: .05em; }
.tech-tile-sm { padding: 1.25rem .5rem; }
.tech-tile-sm i { font-size: 1.5rem; }
.tech-tile-sm span { font-size: .85rem; letter-spacing: .02em; }

.project-list li { padding: .55rem 0; border-bottom: 1px solid #eee; font-size: .93rem; }
.project-list li:last-child { border-bottom: none; }
.project-badge { background: var(--upsi-charcoal); color: var(--upsi-gold); font-weight: 600; align-self: center; }

/* ==================== APPROACH ==================== */
.lifecycle-step {
    position: relative;
    background: #fff;
    border-radius: .75rem;
    border-top: 4px solid var(--upsi-gold);
    padding: 2.2rem 1.25rem 1.25rem;
    height: 100%;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .06);
}
.step-no {
    position: absolute; top: -20px; left: 1.25rem;
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--upsi-charcoal); color: var(--upsi-gold);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Cinzel', Georgia, serif; font-weight: 700;
}

.upsi-accordion .accordion-item { background: var(--upsi-charcoal-2); border-color: var(--upsi-charcoal-3); }
.upsi-accordion .accordion-button { background: var(--upsi-charcoal-2); color: #fff; font-weight: 600; }
.upsi-accordion .accordion-button:not(.collapsed) { color: var(--upsi-gold); box-shadow: none; }
.upsi-accordion .accordion-button::after { filter: invert(1); }
.upsi-accordion .accordion-button:focus { box-shadow: 0 0 0 .2rem rgba(212, 165, 55, .35); }
.upsi-accordion .accordion-body { color: var(--upsi-silver-dim); }

/* ==================== CONTACT ==================== */
.contact-form .form-control:focus,
.contact-form .form-select:focus { border-color: var(--upsi-gold); box-shadow: 0 0 0 .2rem rgba(212, 165, 55, .25); }
.form-label { font-weight: 600; }
.inline-error { background: #fdecea; border-left: 4px solid var(--upsi-maple); padding: 1rem 1.25rem; border-radius: .4rem; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ==================== CTA / FOOTER ==================== */
.cta-band { background: var(--upsi-charcoal-2); color: #fff; border-top: 3px solid var(--upsi-gold); }

.upsi-footer { background: var(--upsi-charcoal); color: var(--upsi-silver); }
.upsi-footer a { color: var(--upsi-silver); text-decoration: none; }
.upsi-footer a:hover { color: var(--upsi-gold); }
.footer-wordmark { height: 38px; width: auto; }
.footer-heading { color: var(--upsi-gold); text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700; margin-bottom: 1rem; }
.footer-links li { margin-bottom: .4rem; }
.footer-rule { border-color: rgba(255, 255, 255, .12); opacity: 1; }

.error-page { min-height: 60vh; display: flex; align-items: center; }

/* ==================== TOASTS ==================== */
.upsi-toast { color: #fff; border: none; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.upsi-toast.toast-success { background: #1f6f43; }
.upsi-toast.toast-error { background: #a3271d; }
.upsi-toast.toast-info { background: var(--upsi-charcoal-3); }

/* ==================== REVEAL ANIMATION ==================== */
/* Only hidden when main.js has loaded (adds .js to <html>), so content never stays invisible */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .js .reveal { opacity: 1; transform: none; transition: none; }
    .btn:hover, .service-card:hover, .pain-card:hover { transform: none; }
}

@media (max-width: 767.98px) {
    .stat:nth-child(2) { border-right: none; }
    .stat { border-bottom: 1px solid rgba(255, 255, 255, .06); }
}

/* FAQ group headings (views/approach.ejs) */
.upsi-accordion .faq-group { letter-spacing: .08em; margin: 1.75rem 0 .75rem; }
.upsi-accordion .faq-group:first-child { margin-top: 0; }
.upsi-accordion .accordion-header { font-size: 1rem; margin-bottom: 0; }
.upsi-accordion .faq-group + .accordion-item { border-top: var(--bs-accordion-border-width) solid var(--upsi-charcoal-3); }
