/* static/css/hero.css - the dark 3D hero shared by the homepage and About.
   The cloth itself is drawn by static/js/hero-3d.js. */

.home-hero {
    --hero-ink: #F4F1EA;
    --hero-muted: #B9C5D3;
    --hero-line: rgba(255, 255, 255, 0.14);
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding: calc(var(--header-height) + 3rem) 0 2.5rem;
    color: var(--hero-ink);
    background-color: var(--primary-deep);
    background-image:
        radial-gradient(60rem 40rem at 85% 10%, rgba(226, 174, 72, 0.16), transparent 60%),
        radial-gradient(50rem 36rem at 0% 100%, rgba(62, 140, 57, 0.18), transparent 60%),
        linear-gradient(180deg, var(--primary-navy) 0%, var(--primary-deep) 100%);
}
/* A faint woven grid drifting slowly behind everything. */
.home-hero::before {
    content: '';
    position: absolute;
    inset: -40px;
    z-index: -1;
    background-image:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 24px),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 24px);
    mask-image: radial-gradient(ellipse at 70% 40%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000 20%, transparent 75%);
    animation: hero-grid-drift 40s linear infinite;
}
@keyframes hero-grid-drift {
    to { transform: translate(24px, 24px); }
}
.home-hero.is-offscreen::before { animation-play-state: paused; }

.home-hero .home-eyebrow { color: var(--accent-yellow); }

.home-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 2rem 3rem;
    align-items: center;
}

/* ---------- Headline ---------- */
.hero-title {
    font-size: clamp(2.4rem, 4.6vw, 4.4rem);
    line-height: 1.04;
    letter-spacing: -0.025em;
    color: #fff;
    margin: 0 0 1.4rem;
}
.hero-word {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
    padding-bottom: 0.08em;
    margin-bottom: -0.08em;
}
.hero-word > span {
    display: inline-block;
    animation: hero-word-rise 0.95s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--i) * 65ms + 120ms);
}
.hero-word.is-accent > span {
    background: linear-gradient(100deg, var(--accent-yellow) 0%, #F3D48C 45%, var(--accent-yellow) 90%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation:
        hero-word-rise 0.95s cubic-bezier(0.22, 1, 0.36, 1) both,
        hero-sheen 6s ease-in-out 1.6s infinite;
    animation-delay: calc(var(--i) * 65ms + 120ms), 1.6s;
}
@keyframes hero-word-rise {
    from { transform: translateY(105%) rotate(4deg); }
    to { transform: none; }
}
@keyframes hero-sheen {
    0%, 100% { background-position: 100% 0; }
    50% { background-position: 0% 0; }
}

.hero-reveal {
    animation: hero-fade-up 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--d) * 110ms + 650ms);
}
@keyframes hero-fade-up {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
}
.home-hero .home-eyebrow.hero-reveal { animation-delay: 0s; }

.home-hero-lead {
    font-size: 1.14rem;
    line-height: 1.65;
    color: var(--hero-muted);
    max-width: 34rem;
    margin: 0 0 1.75rem;
}

.home-hero-facts {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 2rem;
    margin: 2.25rem 0 0;
    padding: 1.4rem 0 0;
    border-top: 1px solid var(--hero-line);
    color: var(--hero-muted);
    font-size: 0.93rem;
}
.home-hero-facts strong {
    color: #fff;
    font-family: var(--font-secondary);
    font-size: 1.1rem;
    margin-right: 0.25rem;
}

/* ---------- 3D stage ---------- */
.hero-stage {
    position: relative;
    height: clamp(380px, 44vw, 600px);
    border-radius: 28px;
    background:
        radial-gradient(ellipse at 50% 45%, rgba(255, 255, 255, 0.07), transparent 70%);
    touch-action: pan-y;
}
.hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 1.2s ease, transform 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero-stage.is-live .hero-canvas { opacity: 1; transform: none; }

/* Shown until the 3D is ready, and instead of it without WebGL: a swatch
   of cloth in perspective. Before the script draws the real weave, a CSS
   check stands in. */
.hero-stage-fallback {
    position: absolute;
    inset: 12% 14% 14%;
    border-radius: 6px;
    background-color: var(--primary-navy);
    background-image:
        repeating-linear-gradient(90deg, transparent 0 34px, rgba(226, 174, 72, 0.5) 34px 38px, transparent 38px 54px, rgba(255, 255, 255, 0.35) 54px 60px),
        repeating-linear-gradient(0deg, transparent 0 34px, rgba(226, 174, 72, 0.4) 34px 38px, transparent 38px 54px, rgba(255, 255, 255, 0.3) 54px 60px);
    background-size: 340px 340px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.45);
    transform: perspective(1200px) rotateY(-18deg) rotateX(6deg);
    transition: opacity 0.8s ease;
    opacity: 0.55;
}
.hero-stage.is-flat .hero-stage-fallback {
    opacity: 1;
    background-size: 512px 512px;
    animation: hero-swatch-sway 9s ease-in-out infinite;
}
.hero-stage.is-live .hero-stage-fallback { opacity: 0; }
@keyframes hero-swatch-sway {
    0%, 100% { transform: perspective(1200px) rotateY(-18deg) rotateX(6deg); }
    50% { transform: perspective(1200px) rotateY(-10deg) rotateX(3deg); }
}

.hero-stage-tag,
.hero-stage-hint {
    position: absolute;
    z-index: 1;
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    pointer-events: none;
}
.hero-stage-tag {
    left: 1.25rem;
    bottom: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    color: #fff;
    background: rgba(10, 28, 51, 0.55);
    border: 1px solid var(--hero-line);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.hero-stage-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--accent-yellow);
    box-shadow: 0 0 0 0 rgba(226, 174, 72, 0.6);
    animation: hero-dot 2.4s ease-out infinite;
}
@keyframes hero-dot {
    0% { box-shadow: 0 0 0 0 rgba(226, 174, 72, 0.6); }
    100% { box-shadow: 0 0 0 10px rgba(226, 174, 72, 0); }
}
.hero-stage-hint {
    right: 1.25rem;
    top: 1.25rem;
    color: var(--hero-muted);
    opacity: 0;
    transition: opacity 0.6s ease 0.6s;
}
@media (hover: hover) and (pointer: fine) {
    .hero-stage.is-live .hero-stage-hint { opacity: 0.85; }
}

/* ---------- Lines of business, below the stage ---------- */
.hero-lines {
    list-style: none;
    margin: 2.5rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 2rem;
}
.hero-line {
    position: relative;
    padding-top: 1.25rem;
    border-top: 1px solid var(--hero-line);
    transition: opacity 0.4s ease;
}
.has-switcher .hero-line:not(.is-active) { opacity: 0.55; }
.has-switcher .hero-line:hover { opacity: 1; }

.hero-line-pick {
    all: unset;
    box-sizing: border-box;
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    width: 100%;
    cursor: pointer;
    font-family: var(--font-secondary);
    color: #fff;
}
.hero-line-pick:focus-visible { outline: 3px solid var(--accent-yellow); outline-offset: 6px; border-radius: 4px; }
.hero-line-progress {
    position: absolute;
    top: -1px;
    left: 0;
    height: 2px;
    width: 0;
    background: var(--accent-yellow);
}
/* The bar fills while a line is shown; when it ends, the script moves on. */
.has-switcher .hero-line.is-active .hero-line-progress {
    animation: hero-progress 7s linear forwards;
}
.has-switcher.is-held .hero-line.is-active .hero-line-progress,
.has-switcher.is-offscreen .hero-line.is-active .hero-line-progress { animation-play-state: paused; }
.has-switcher.no-autoplay .hero-line.is-active .hero-line-progress { animation: none; width: 100%; }
@keyframes hero-progress {
    from { width: 0; }
    to { width: 100%; }
}
.hero-line-num {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-yellow);
    letter-spacing: 0.06em;
}
.hero-line-title {
    font-size: clamp(1.15rem, 1.7vw, 1.45rem);
    font-weight: 700;
}
.hero-line-text {
    margin: 0.5rem 0 0.8rem;
    font-size: 0.93rem;
    line-height: 1.55;
    color: var(--hero-muted);
}
.hero-line-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
}
.hero-line-link i { font-size: 0.8em; transition: transform 0.2s ease; color: var(--accent-yellow); }
.hero-line-link:hover { color: var(--accent-yellow); }
.hero-line-link:hover i { transform: translateX(4px); }
.hero-line-link:focus-visible { outline: 3px solid var(--accent-yellow); outline-offset: 3px; border-radius: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
    .home-hero-grid { grid-template-columns: minmax(0, 1fr); }
    .hero-stage { height: clamp(320px, 70vw, 480px); }
    .hero-lines { grid-template-columns: 1fr; gap: 0; }
    .hero-line { padding: 1rem 0; }
    .has-switcher .hero-line:not(.is-active) .hero-line-text { display: none; }
    .has-switcher .hero-line:not(.is-active) .hero-line-link { display: none; }
}
@media (max-width: 600px) {
    .home-hero { padding: calc(var(--header-height) + 2rem) 0 2rem; }
    .home-hero-lead { font-size: 1.04rem; }
    .home-hero-actions .home-btn { flex: 1 1 100%; justify-content: center; }
    .home-hero-facts { gap: 0.5rem 1.25rem; }
    .hero-stage { margin: 0 calc(var(--gutter) * -1); border-radius: 0; }
    .hero-stage-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .home-hero::before,
    .hero-word > span,
    .hero-word.is-accent > span,
    .hero-reveal,
    .hero-stage-dot,
    .hero-stage.is-flat .hero-stage-fallback { animation: none; }
    .hero-canvas { transition: none; transform: none; }
}
