/* Cognivance — homepage. Depends on site.css for tokens and for the shared
   panel parts (painted panel, pill, frosted glass). */

.btn-light { background: #ffffff; color: #12151c; }
.btn-light:hover { background: #e4e8f2; }

.btn-glass {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.75);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.btn-glass:hover { background: rgba(255, 255, 255, 0.26); }

.btn-accent { background: var(--panel-accent); color: #ffffff; }
.btn-accent:hover { background: #1f31c0; }

.panel :focus-visible { outline-color: #ffffff; }
.glass :focus-visible { outline-color: var(--panel-accent); }

/* ---------- hero ---------- */
.hero { padding-top: clamp(0.9rem, 2vw, 1.75rem); }

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: clamp(1.5rem, 3.5vw, 3rem);
    align-items: center;
    min-height: min(36rem, 76vh);
    padding: clamp(1.25rem, 4.5vw, 4rem);
}

/* keeps the white headline readable over the picture */
.hero-panel::after, .contact-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, rgba(8, 10, 20, 0.62), rgba(8, 10, 20, 0) 64%);
}

/* the hero film: the logo animation is the whole hero and ends on the headline.
   The panel takes the film's own background colour, so its edges do not show. */
.hero-film {
    height: min(40rem, 78vh, 52vw);      /* full width; as close to 16:9 as the screen allows */
    background: #101117;                 /* the film's background as browsers render it; the dark page uses the same */
}

.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* browsers decode the film's near-black a shade apart; fading the outer edge hides any step */
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent), linear-gradient(180deg, transparent, #000 7%, #000 93%, transparent);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent), linear-gradient(180deg, transparent, #000 7%, #000 93%, transparent);
    mask-composite: intersect;
}

.hero-film .hero-cta {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 10%;
    justify-content: center;
    margin: 0;
    padding-inline: 1rem;
}

/* while the film runs the buttons stay out of the way; they fade in when it has typed its last line */
.hero-film .hero-cta { transition: opacity 0.9s ease, visibility 0s; }
.hero-film.is-playing .hero-cta { opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0s 0.3s; }
.hero-film.is-playing.is-done .hero-cta { opacity: 1; visibility: visible; transition: opacity 0.9s ease, visibility 0s; }

.hero-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
}

.hero h1 {
    font-size: clamp(2.75rem, 5.6vw, 4.9rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 0.98;
    color: #ffffff;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* the reel: app screenshots on a ring; the one at the front grows into the large screen (reel.js).
   Sizes are fractions of the stage width and match the numbers in reel.js. */
.reel {
    display: block;
    min-width: 0;
    text-decoration: none;
}

.reel-stage {
    position: relative;
    display: block;
    aspect-ratio: 100 / 54;
}

.reel-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.reel-ring ellipse {
    fill: none;
    stroke: rgba(255, 255, 255, 0.4);
    stroke-width: 0.25;
    stroke-dasharray: 0.8 1.6;
    animation: reel-ring 40s linear infinite;
}

@keyframes reel-ring { to { stroke-dashoffset: -96; } }

/* every screenshot is laid out as the large screen; reel.js shrinks and moves the others onto the ring */
.reel-item {
    position: absolute;
    left: 10%;
    top: 22.2%;
    width: 80%;
    height: auto;
    aspect-ratio: 1280 / 656;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 24px 50px -16px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.35);
    will-change: transform;
}

.reel-cap {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin: 1.1rem 10% 0;
    padding: 0.85rem 1rem 1.05rem;
    overflow: hidden;
}

.reel-name {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.reel-line {
    font-size: 0.9rem;
    line-height: 1.35;
    color: var(--on-glass-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reel-name, .reel-line { transition: opacity 0.22s; }
.reel-cap.is-swapping .reel-name, .reel-cap.is-swapping .reel-line { opacity: 0; }

/* fills while the current product is in front */
.reel-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(18, 21, 28, 0.1);
}

.reel-bar i {
    display: block;
    height: 100%;
    width: 100%;
    background: var(--panel-accent);
    transform-origin: left;
    transform: scaleX(0);
}

.reel.is-ready .reel-bar i { animation: reel-fill 3200ms linear forwards; }
.reel.is-paused .reel-bar i { animation-play-state: paused; }
.reel.is-still .reel-bar { display: none; }

@keyframes reel-fill { to { transform: scaleX(1); } }

/* ---------- sketch lines (parked: hero.js, sketches.js, mockups/sketch-styles.html) ---------- */
.sk { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sk-ink { stroke: var(--ink); stroke-width: 2.1; opacity: 0.88; }
.sk-accent { stroke: var(--accent); stroke-width: 2.5; }
.sk-mark { stroke: var(--nb); stroke-width: 11; stroke-linecap: butt; opacity: 0.5; }   /* highlighter */
.sk-soft { stroke: var(--ink-3); stroke-width: 1.7; }
.sk-green { stroke: var(--al); stroke-width: 2.5; }
.sk-red { stroke: var(--bad); stroke-width: 2.5; }
.sk-ochre { stroke: var(--pp); stroke-width: 2.5; }

.sk-pencil { transition: opacity 0.25s; }
.sk-tip { fill: var(--ink); }
.sk-body { fill: var(--nb); stroke: var(--ink); stroke-width: 1.2; stroke-linejoin: round; }
.sk-end { fill: var(--ink-3); stroke: var(--ink); stroke-width: 1.2; stroke-linejoin: round; }

/* ---------- sections ---------- */
.section { padding-top: clamp(4rem, 8vw, 6.5rem); }

.section-head {
    max-width: 46rem;
    margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}

.section-head h2, .contact h2 {
    font-size: clamp(2rem, 4.3vw, 3.3rem);
    letter-spacing: -0.035em;
}

.section-head h2 { margin-top: 1rem; }

/* ---------- product mosaic ----------
   Tall tiles in offset columns. Each tile: a painted picture in the product's
   colours, the product's screenshot, a pill and a frosted caption. Without
   JavaScript the tiles fall back to a plain grid. */
.mosaic {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1.25rem;
}

.mosaic.is-built {
    display: flex;
    align-items: flex-start;
    gap: var(--gap);
    padding-block: 1rem 3.5rem;
}

.mosaic-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    will-change: transform;
}

.mosaic.is-built .mosaic-col:nth-child(odd) { margin-top: 5rem; }
.mosaic[data-cols="1"] .mosaic-col:nth-child(odd) { margin-top: 0; }

.mosaic-col:nth-child(even) .tile-art { animation-duration: 34s; animation-direction: alternate-reverse; }

.tile {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4.3;
    overflow: hidden;
    isolation: isolate;
    border-radius: 6px;
    background: var(--panel);
    text-decoration: none;
    scroll-margin-top: 6rem;
}

.tile-pill {
    position: absolute;
    top: 0.9rem;
    left: 0.9rem;
    max-width: calc(100% - 1.8rem);
}

.tile-shot {
    position: absolute;
    top: 3.3rem;
    left: 0.9rem;
    width: calc(100% - 1.8rem);
    height: auto;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.6);
}

/* the caption: a frosted panel at rest, the whole tile when pointed at */
.tile-glass {
    position: absolute;
    left: 0.9rem;
    right: 0.9rem;
    bottom: 0.9rem;
    height: 7.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.9rem 1rem 1rem;
    overflow: hidden;
    border-radius: 14px;
    background: var(--glass);
    -webkit-backdrop-filter: blur(18px) saturate(1.5);
    backdrop-filter: blur(18px) saturate(1.5);
    transition: left 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), right 0.45s cubic-bezier(0.2, 0.7, 0.2, 1),
        bottom 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), height 0.45s cubic-bezier(0.2, 0.7, 0.2, 1),
        border-radius 0.45s, padding 0.45s, background 0.3s;
}

.tile-meta {
    flex: none;
    font-family: var(--font-mono);
    font-size: 0.64rem;
    letter-spacing: 0.03em;
    color: var(--on-glass-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tile-name {
    flex: none;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.1;
    color: var(--on-glass);
}

.tile-line {
    flex: none;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: 0.86rem;
    line-height: 1.35;
    color: var(--on-glass-2);
}

.tile-more {
    flex: none;
    margin-top: 0.6rem;
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--on-glass-2);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s, transform 0.3s;
}

.tile-go {
    position: absolute;
    right: 1.1rem;
    bottom: 1.1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    background: var(--panel-accent);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s, transform 0.3s;
}

.tile:focus-visible { outline-offset: 4px; }

.tile:focus-visible .tile-glass { left: 0; right: 0; bottom: 0; height: 100%; padding: 1.2rem 1.2rem 1.3rem; border-radius: 0; background: var(--glass-strong); }
.tile:focus-visible .tile-line { -webkit-line-clamp: 4; }
.tile:focus-visible .tile-more, .tile:focus-visible .tile-go { opacity: 1; transform: none; transition-delay: 0.18s; }

@media (hover: hover) {
    .tile:hover .tile-glass { left: 0; right: 0; bottom: 0; height: 100%; padding: 1.2rem 1.2rem 1.3rem; border-radius: 0; background: var(--glass-strong); }
    .tile:hover .tile-line { -webkit-line-clamp: 4; }
    .tile:hover .tile-more, .tile:hover .tile-go { opacity: 1; transform: none; transition-delay: 0.18s; }
}

/* ---------- custom builds: three steps, stepping down ---------- */
.steps {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--gap);
    align-items: start;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 27rem;
    padding: 0.9rem;
}

.steps .step:nth-child(2) { margin-top: 2.25rem; }
.steps .step:nth-child(3) { margin-top: 4.5rem; }
.steps .step:nth-child(2) .tile-art { animation-duration: 34s; animation-direction: alternate-reverse; }

.step-n {
    margin: auto 0 0.4rem 0.3rem;
    font-family: var(--font-display);
    font-size: clamp(5rem, 9vw, 7.5rem);
    font-weight: 600;
    letter-spacing: -0.05em;
    line-height: 0.9;
    color: #ffffff;
}

.step-glass { align-self: stretch; padding: 1rem 1.1rem 1.15rem; }

.step-glass h3, .how-list dt {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.15;
}

.step-glass p, .how-list dd {
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--on-glass-2);
    margin-top: 0.4rem;
}

.keep {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.9rem 1.25rem;
    margin-top: var(--gap);
    padding: 1.1rem 1.2rem;
}

.keep-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.keep ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex: 1 1 16rem;
}

/* ---------- how we work: one wide panel, three notes on glass ---------- */
.how-panel { padding: clamp(7rem, 17vw, 13rem) 0.9rem 0.9rem; }

.how-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.how-list .glass { padding: 1rem 1.1rem 1.15rem; }

/* ---------- contact ---------- */
.contact { padding-bottom: clamp(4rem, 8vw, 6.5rem); }

.contact-panel {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(1.5rem, 4vw, 3.5rem);
    align-items: start;
    padding: clamp(0.9rem, 4vw, 3.5rem);
}

.contact-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
    padding-top: 0.5rem;
}

.contact h2 { color: #ffffff; }

.contact-mail { color: rgba(255, 255, 255, 0.88); }

.contact-mail a {
    color: #ffffff;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
}

.form {
    display: grid;
    gap: 1rem;
    padding: clamp(1rem, 2.5vw, 1.75rem);
    color-scheme: light;
}

.field-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.field { display: grid; gap: 0.4rem; min-width: 0; }

.field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--on-glass-2);
}

.field input, .field select, .field textarea {
    width: 100%;
    font: inherit;
    font-size: 1rem;
    color: var(--on-glass);
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(18, 21, 28, 0.2);
    border-radius: 8px;
    padding: 0.75rem 0.85rem;
    transition: border-color 0.15s, background 0.15s;
}

.field select {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%232a3040' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 0.7rem;
}

.field textarea { resize: vertical; min-height: 7.5rem; }
.field ::placeholder { color: var(--on-glass-3); opacity: 0.75; }

.field input:hover, .field select:hover, .field textarea:hover { border-color: rgba(18, 21, 28, 0.45); }

.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
    outline: 2px solid var(--panel-accent);
    outline-offset: 1px;
    border-color: var(--panel-accent);
    background-color: #ffffff;
}

.field [aria-invalid="true"] { border-color: #b3261e; }

.form-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.9rem 1.5rem;
}

.form-privacy { font-size: 0.8rem; color: var(--on-glass-2); }
.form-privacy a { color: inherit; text-underline-offset: 3px; }

.form-status { font-size: 0.92rem; font-weight: 500; line-height: 1.5; }
.form-status:empty { display: none; }
.form-status.ok { color: #0f6a3d; }
.form-status.err { color: #a3201a; }

/* ---------- parked: screenshot frame and product sketches (mockups/sketch-styles.html) ---------- */
.shot {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--sunk);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.shot-sketch { background: var(--surface); }
.sketch { display: block; width: 100%; height: 100%; }
.sketch .sk-ink { stroke-width: 1.5; }
.sketch .sk-soft { stroke-width: 1.2; }
.sketch .sk-accent, .sketch .sk-green, .sketch .sk-red, .sketch .sk-ochre { stroke-width: 1.8; }
.sketch .sk-mark { stroke-width: 9; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
    .hero-panel, .contact-panel { grid-template-columns: minmax(0, 1fr); }
    .hero-panel { min-height: 0; }
    .hero-panel::after, .contact-panel::after { background: linear-gradient(180deg, rgba(8, 10, 20, 0.55), rgba(8, 10, 20, 0) 70%); }
    .reel { max-width: 38rem; }
}

@media (max-width: 820px) {
    .steps, .how-list { grid-template-columns: minmax(0, 1fr); }
    .steps .step:nth-child(n) { margin-top: 0; }
    .step { min-height: 0; }
    .step-n { margin-top: 2.5rem; }
    .how-panel { padding-top: 8rem; }
}

@media (max-width: 700px) {
    /* on a phone the buttons go under the film instead of over it */
    .hero-film { height: auto; }
    .hero-video { position: static; display: block; height: auto; aspect-ratio: 16 / 9; }
    .hero-film .hero-cta { position: static; padding: 0 1rem 1.25rem; }
}

@media (max-width: 600px) {
    .field-row { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    .tile-art { animation: none; }
    .reel-ring ellipse { animation: none; }
}
