/* Homepage-only visual layer. Shared page layout and theme controls stay in style.css. */
html.homepage-document {
    overflow-x: clip;
}

.homepage {
    --studio-surface: #141821;
    --studio-highlight: #303644;
    --studio-edge: #080b11;
    --studio-inset: #0e121c;
    --studio-stroke: #485062;
    --studio-ink: #f2f5ff;
    --studio-muted: #9aa6bf;
}

.homepage.light-theme {
    --studio-surface: #fff;
    --studio-highlight: #f6f8ff;
    --studio-edge: #c3cbdc;
    --studio-inset: #eef2f9;
    --studio-stroke: #b9c4d9;
    --studio-ink: #15233e;
    --studio-muted: #687792;
}

.homepage.devotion-theme {
    --studio-surface: #38291f;
    --studio-highlight: #604332;
    --studio-edge: #211610;
    --studio-inset: #2b1d16;
    --studio-stroke: #8e6341;
    --studio-ink: #fff5e6;
    --studio-muted: #d4b89c;
}

.homepage #home.hero-studio-section {
    --scene-primary: var(--primary);
    --scene-accent: var(--accent);
    padding: 104px 0 56px;
    position: relative;
    isolation: isolate;
    overflow: clip;
    text-align: left;
    background: var(--bg-body);
}

/* Each service has a related accent; all accents inherit the visitor's saved palette. */
.homepage #home[data-scene='1'] {
    --scene-primary: color-mix(in srgb, var(--primary) 65%, var(--accent));
    --scene-accent: var(--accent);
}
.homepage #home[data-scene='2'] {
    --scene-primary: var(--accent);
    --scene-accent: var(--primary);
}
.homepage #home[data-scene='3'] {
    --scene-primary: color-mix(in srgb, var(--primary) 85%, var(--accent));
    --scene-accent: color-mix(in srgb, var(--accent) 80%, var(--primary));
}

.homepage #home::before {
    inset: 0;
    width: auto;
    height: auto;
    z-index: -2;
    opacity: 0.13;
    background: radial-gradient(ellipse at 78% 45%, var(--scene-primary) 0%, transparent 63%);
}

.homepage #home::after {
    content: '';
    position: absolute;
    inset: 0 0 0 48%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.28;
    background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse, #000, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse, #000, transparent 70%);
}

.homepage .hero-layout {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    align-items: center;
    gap: 14px;
}

.homepage .hero-content {
    min-width: 0;
    position: relative;
    z-index: 1;
}

.homepage .hero-eyebrow {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 22px;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.homepage .hero-eyebrow > span {
    flex: 0 0 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--primary) 12%, transparent);
}

.homepage .hero-title {
    margin: 0 0 22px;
    font-size: clamp(42px, 4.5vw, 66px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -2.6px;
    text-wrap: balance;
}

.homepage .hero-title-accent {
    color: var(--scene-primary);
    background: linear-gradient(115deg, var(--scene-primary) 10%, var(--scene-accent) 95%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.homepage .hero-description {
    max-width: 43ch;
    margin: 0 0 28px;
    font-size: 16px;
    line-height: 1.8;
    text-wrap: pretty;
}

/* The longest phrase reserves the height, even while another phrase is visible. */
.homepage .hero-word-stack { display: grid; }
.homepage .hero-word {
    grid-area: 1 / 1;
    position: relative;
    justify-self: start;
    width: max-content;
    max-width: 100%;
    opacity: 0;
    visibility: hidden;
}
.homepage .hero-word.is-active { opacity: 1; visibility: visible; transform: none; }
.homepage .hero-typing-sizer { visibility: hidden; padding-right: 0.12em; }
.homepage .hero-typing-text { position: absolute; inset: 0; text-align: left; }
.homepage .hero-typing-caret {
    display: inline-block;
    width: 0;
    height: 0.75em;
    margin-left: 0.05em;
    border-right: 2px solid var(--scene-accent);
    vertical-align: baseline;
}
.homepage .hero-motion-ready .hero-typing-caret { animation: hero-caret 0.9s steps(1, end) infinite; }
.homepage .hero-motion-paused .hero-typing-caret,
.homepage .hero-motion-offscreen .hero-typing-caret { animation: none; opacity: 0; }
@keyframes hero-caret { 0%, 45% { opacity: 1; } 46%, 100% { opacity: 0; } }
.homepage .studio-slide { opacity: 0; pointer-events: none; transition: opacity 0.5s ease; }
.homepage .studio-slide.is-active { opacity: 1; }
.homepage .studio-scene :is(path, rect, circle, ellipse, text, stop) {
    transition: fill 0.35s ease, stroke 0.35s ease, stop-color 0.35s ease;
}
.homepage .hero-motion-ready .studio-slide.is-active .studio-signal {
    transform-box: fill-box;
    transform-origin: center;
    animation: studio-signal 3.5s ease-in-out infinite;
}
@keyframes studio-signal {
    0%, 100% { opacity: 0.65; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.05); }
}

.homepage .hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.homepage .hero-actions > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    min-height: 49px;
    padding: 12px 22px !important;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
}

.homepage .hero-actions .btn-brand {
    box-shadow: 0 7px 24px color-mix(in srgb, var(--primary) 25%, transparent);
}

.homepage .hero-actions .hero-quote-link {
    border: 1px solid var(--border) !important;
    background: var(--bg-glass);
}

.homepage .hero-actions .hero-quote-link:hover {
    background: var(--text-main);
}

.homepage .hero-actions > a:focus-visible,
.homepage .hero-motion-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 5px;
}

.homepage .hero-proof {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 0;
    margin: 25px 0 0;
    padding: 0;
    list-style: none;
    color: var(--text-secondary);
    font-size: 10px;
    line-height: 1.6;
}

.homepage .hero-proof li + li {
    margin-left: 13px;
    padding-left: 13px;
    border-left: 1px solid var(--border);
}

.homepage .hero-proof strong {
    color: var(--text-main);
    font-weight: 700;
}

.homepage .hero-artwork {
    position: relative;
    min-width: 0;
    perspective: 1200px;
}

.homepage .hero-studio {
    --studio-rotate-x: 0deg;
    --studio-rotate-y: 0deg;
    width: 112%;
    margin-left: -3%;
    aspect-ratio: 660 / 520;
    transform: rotateX(var(--studio-rotate-x)) rotateY(var(--studio-rotate-y));
    transition: transform 0.35s ease-out;
}

.homepage .studio-scene {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.homepage .hero-motion-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 5px 10px;
    margin: 0 0 0 43%;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-glass);
    color: var(--text-secondary);
    font: inherit;
    font-size: 9px;
    cursor: pointer;
}

.homepage .hero-motion-toggle[hidden] {
    display: none;
}

.homepage .hero-scene-controls {
    display: flex;
    justify-content: center;
    gap: 3px;
    width: fit-content;
    max-width: 100%;
    padding: 5px;
    margin: -1px auto 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--bg-card);
}
.homepage .hero-scene-controls[hidden] { display: none; }
.homepage .hero-scene-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 7px 12px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 10px;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}
.homepage .hero-scene-button[aria-selected='true'] {
    color: var(--text-main);
    background: color-mix(in srgb, var(--scene-primary) 16%, var(--bg-card));
    border-color: color-mix(in srgb, var(--scene-primary) 70%, var(--border));
    box-shadow: 0 2px 10px color-mix(in srgb, var(--scene-primary) 12%, transparent);
}
.homepage .hero-scene-button > :is(span, svg) { color: var(--scene-primary); flex-shrink: 0; }
.homepage .hero-scene-button:hover { background: var(--bg-glass); }
.homepage .hero-service-panels { min-height: 34px; margin: 0 0 6px; text-align: center; }
.homepage .hero-service-note { max-width: 430px; margin: 0 auto; color: var(--text-secondary); font-size: 10px; line-height: 1.6; }
.homepage .hero-service-note:focus-visible { outline: 2px solid var(--scene-primary); outline-offset: 3px; border-radius: 3px; }
.homepage .hero-scene-button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.homepage .hero-scene-button:disabled { opacity: 0.45; cursor: default; }
.homepage .hero-motion-paused .hero-word,
.homepage .hero-motion-paused .studio-slide,
.homepage .hero-motion-offscreen .hero-word,
.homepage .hero-motion-offscreen .studio-slide { transition: none; }

.homepage .hero-motion-toggle[aria-pressed='true'] .hero-motion-icon {
    opacity: 1;
}

.homepage .hero-motion-ready .studio-browser-float {
    animation: studio-float 8s ease-in-out infinite;
}

.homepage .hero-motion-ready .studio-phone-float {
    animation: studio-float 7s ease-in-out -2s infinite reverse;
}

.homepage .hero-motion-ready .studio-detail-float {
    animation: studio-float 9s ease-in-out -4s infinite;
}

.homepage .hero-motion-paused .studio-scene g,
.homepage .hero-motion-offscreen .studio-scene g,
.homepage .hero-motion-paused .studio-slide.is-active .studio-signal,
.homepage .hero-motion-offscreen .studio-slide.is-active .studio-signal {
    animation-play-state: paused;
}

@keyframes studio-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.homepage .marquee-section {
    padding: 19px 0;
}

.homepage .marquee-track {
    gap: 32px;
}

.homepage .tech-item {
    padding: 8px 19px;
    font-size: 13px;
}

.homepage .tech-item i {
    font-size: 19px;
}

@media (min-width: 992px) and (max-width: 1199px) {
    .homepage #mainNav .navbar-nav { gap: 18px !important; }
    .homepage #mainNav .nav-link { font-size: 13px; }
    .homepage #mainNav .btn-brand { padding: 12px 22px; font-size: 12px; }
    .homepage #mainNav .navbar-brand { gap: 10px; }
    .homepage .hero-title { font-size: 52px; }
    .homepage .hero-studio { width: 104%; margin-left: -2%; }
}

@media (max-width: 991px) {
    .homepage #home.hero-studio-section { padding: 110px 0 38px; }
    .homepage .hero-layout { grid-template-columns: 1fr; gap: 6px; text-align: center; }
    .homepage .hero-content { max-width: 620px; margin-inline: auto; }
    .homepage .hero-eyebrow,
    .homepage .hero-actions,
    .homepage .hero-proof { justify-content: center; }
    .homepage .hero-description { margin-inline: auto; }
    .homepage .hero-title { font-size: 60px; }
    .homepage .hero-word { justify-self: center; }
    .homepage .hero-artwork { width: 100%; max-width: 430px; margin: 5px auto 0; }
    .homepage .hero-studio { width: 100%; margin: 0; }
    .homepage .hero-motion-toggle { margin: -4px auto 0; }
    .homepage .hero-scene-controls { margin: 0 auto 10px; }
}

@media (max-width: 575px) {
    .homepage #home.hero-studio-section { padding: 98px 0 25px; }
    .homepage #home::after { inset: 35% -10% 0; background-size: 38px 38px; }
    .homepage .hero-layout { padding-inline: 22px; gap: 0; }
    .homepage .hero-eyebrow { font-size: 8px; letter-spacing: 0.95px; margin-bottom: 18px; gap: 8px; }
    .homepage .hero-title { font-size: clamp(35px, 9.5vw, 49px); line-height: 1.1; letter-spacing: -1.7px; margin-bottom: 17px; }
    .homepage .hero-description { font-size: 14px; line-height: 1.8; margin-bottom: 22px; }
    .homepage .hero-actions { gap: 9px; }
    .homepage .hero-actions > a { font-size: 11px; min-height: 45px; padding: 11px 16px !important; }
    .homepage .hero-actions .btn-brand svg { width: 13px; height: 13px; }
    .homepage .hero-proof { font-size: 9px; margin-top: 18px; }
    .homepage .hero-proof li + li { margin-left: 9px; padding-left: 9px; }
    .homepage .hero-artwork { max-width: 330px; margin-top: 8px; }
    .homepage .hero-motion-toggle { min-height: 44px; font-size: 9px; margin-top: -2px; }
    .homepage .hero-scene-controls { margin-bottom: 10px; gap: 1px; padding: 4px; }
    .homepage .hero-scene-button { min-height: 44px; font-size: 9px; padding-inline: 8px; gap: 4px; }
    .homepage .hero-service-note { font-size: 9px; }
    .homepage .marquee-section { padding: 14px 0; }
    .homepage .tech-item { font-size: 12px; padding: 7px 15px; }
}

@media (max-width: 359px) {
    .homepage .hero-layout { padding-inline: 16px; }
    .homepage .hero-eyebrow { font-size: 7px; }
    .homepage .hero-title { font-size: 33px; }
    .homepage .hero-actions > a { padding-inline: 13px !important; font-size: 10px; }
    .homepage .hero-actions { gap: 7px; }
    .homepage .hero-proof { font-size: 8px; }
    .homepage .hero-scene-button { padding-inline: 6px; font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    .homepage { scroll-behavior: auto; }
    .homepage .studio-scene g,
    .homepage .marquee-track,
    .homepage .logo-icon { animation: none !important; }
    .homepage .hero-studio { transform: none; transition: none; }
    .homepage .hero-actions > a { transition: none; }
    .homepage .hero-word,
    .homepage .studio-slide { transition: none; transform: none; }
    .homepage .hero-typing-caret { display: none; animation: none !important; }
    .homepage .studio-scene :is(path, rect, circle, ellipse, text, stop) { transition: none; }
    .homepage .hero-motion-toggle { display: none; }
}
