/* App Development page styles.
 *
 * Dark, full-bleed "night ops" layout: a Three.js node field behind the
 * hero, then the software showcase rendered by
 * [traxx_case_studies layout="showcase"], a capabilities strip, the build
 * process and a closing CTA. Class prefix: ad-.
 */

:root {
    --ad-bg: #0a0d14;
    --ad-bg-2: #0f172a;
    --ad-panel: rgba(15, 23, 42, 0.72);
    --ad-line: rgba(0, 210, 255, 0.16);
    --ad-line-soft: rgba(255, 255, 255, 0.06);
    --ad-text: #cbd5e1;
    --ad-text-muted: #94a3b8;
    --ad-white: #ffffff;
    --ad-cyan: #00d2ff;
    --ad-blue: #0284c7;
    --ad-yellow: #ffc400;
    --ad-gradient: linear-gradient(90deg, #0284c7 0%, #00d2ff 100%);
    --ad-font: 'Inter', system-ui, -apple-system, sans-serif;
    --ad-code: 'Fira Code', monospace;
    --ad-radius: 14px;
    --ad-glow: 0 24px 70px rgba(0, 210, 255, 0.16), 0 0 0 1px rgba(0, 210, 255, 0.18);
}

.ad-page * { box-sizing: border-box; }
.ad-page {
    font-family: var(--ad-font);
    color: var(--ad-text);
    -webkit-font-smoothing: antialiased;
}
.ad-page a { transition: color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease; }

/* Full-bleed section shell */
.ad-section {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding: clamp(72px, 9vw, 130px) 0;
    background: var(--ad-bg);
    isolation: isolate;
}
.ad-section--alt { background: var(--ad-bg-2); }
.ad-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 28px;
}

/* Cyber grid overlay, shared with the hero */
.ad-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 40px 40px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 40%, transparent 85%);
    mask-image: radial-gradient(ellipse at center, #000 40%, transparent 85%);
    pointer-events: none;
    z-index: 0;
}

/* Section header recipe: mono eyebrow, heavy h2, gradient bar, subcopy */
.ad-section-header {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 900px;
    margin: 0 auto clamp(36px, 5vw, 64px);
}
.ad-preheading {
    display: block;
    font-family: var(--ad-code);
    color: var(--ad-cyan);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.5px;
    margin: 0 0 12px;
}
.ad-section-title {
    font-size: clamp(28px, 4.5vw, 46px);
    font-weight: 900;
    color: var(--ad-white);
    letter-spacing: -1px;
    line-height: 1.08;
    margin: 0 0 18px;
}
.ad-divider {
    width: 80px;
    height: 4px;
    background: var(--ad-gradient);
    border-radius: 2px;
    margin: 0 auto 22px;
}
.ad-section-subtitle {
    font-size: clamp(15px, 2vw, 17px);
    color: var(--ad-text-muted);
    line-height: 1.7;
    margin: 0;
}

/* ============================================================
   HERO + node field
   ============================================================ */
.ad-hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: clamp(60px, 8vh, 110px) 20px;
    overflow: hidden;
    background-color: var(--ad-bg);
    background-image:
        radial-gradient(ellipse at 20% 30%, rgba(2, 132, 199, 0.30) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 70%, rgba(0, 210, 255, 0.18) 0%, transparent 50%);
}
.ad-hero__scene {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.ad-hero__scene canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.ad-hero .ad-grid { z-index: 1; }
.ad-hero__vignette {
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
        radial-gradient(ellipse at center, transparent 45%, rgba(10, 13, 20, 0.78) 100%),
        linear-gradient(180deg, rgba(10, 13, 20, 0.35) 0%, transparent 25%, transparent 70%, var(--ad-bg) 100%);
    pointer-events: none;
}
.ad-hero__content {
    position: relative;
    z-index: 3;
    max-width: 1080px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.ad-hero__tag {
    font-family: var(--ad-code);
    color: var(--ad-cyan);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.5px;
    padding: 7px 18px;
    background: rgba(0, 210, 255, 0.10);
    border: 1px solid rgba(0, 210, 255, 0.22);
    border-radius: 50px;
    margin-bottom: 28px;
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    animation: adFadeUp 0.7s ease-out 0.05s forwards;
}
.ad-hero__h1 {
    font-size: clamp(40px, 7.2vw, 84px);
    font-weight: 900;
    color: var(--ad-white);
    letter-spacing: -2.5px;
    line-height: 1.02;
    margin: 0 0 22px;
}
.ad-hero__h1 .ad-line { display: block; overflow: hidden; padding-bottom: 4px; }
.ad-hero__h1 .ad-word {
    display: inline-block;
    margin: 0 0.18em 0 0;
    transform: translateY(110%);
    opacity: 0;
    animation: adWordReveal 0.85s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.ad-hero__h1 .ad-line:nth-child(1) .ad-word:nth-child(1) { animation-delay: 0.18s; }
.ad-hero__h1 .ad-line:nth-child(1) .ad-word:nth-child(2) { animation-delay: 0.26s; }
.ad-hero__h1 .ad-line:nth-child(1) .ad-word:nth-child(3) { animation-delay: 0.34s; }
.ad-hero__h1 .ad-line:nth-child(2) .ad-word:nth-child(1) { animation-delay: 0.46s; }
.ad-hero__h1 .ad-line:nth-child(2) .ad-word:nth-child(2) { animation-delay: 0.54s; }
.ad-hero__h1 .ad-line:nth-child(2) .ad-word:nth-child(3) { animation-delay: 0.62s; }
.ad-hero__h1 .ad-line:nth-child(2) .ad-word:nth-child(4) { animation-delay: 0.70s; }
.ad-accent {
    background: var(--ad-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.ad-hero__sub {
    font-size: clamp(16px, 2.2vw, 19px);
    color: var(--ad-text-muted);
    line-height: 1.7;
    max-width: 700px;
    margin: 0 0 40px;
    opacity: 0;
    transform: translateY(8px);
    animation: adFadeUp 0.8s ease-out 0.95s forwards;
}
.ad-hero__ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    opacity: 0;
    transform: translateY(8px);
    animation: adFadeUp 0.8s ease-out 1.1s forwards;
}
.ad-hero__stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 34px;
    margin: 54px 0 0;
    padding: 0;
    list-style: none;
    font-family: var(--ad-code);
    font-size: 12px;
    letter-spacing: 1px;
    color: var(--ad-text-muted);
    opacity: 0;
    animation: adFadeUp 0.8s ease-out 1.35s forwards;
}
.ad-hero__stats li::before {
    content: '// ';
    color: var(--ad-cyan);
}

@keyframes adWordReveal {
    0%   { transform: translateY(110%) rotate(2deg); opacity: 0; }
    60%  { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(0) rotate(0deg); opacity: 1; }
}
@keyframes adFadeUp { to { opacity: 1; transform: translateY(0); } }

/* Buttons */
.ad-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--ad-gradient);
    color: var(--ad-white);
    text-decoration: none;
    font-family: var(--ad-code);
    font-size: 14px;
    font-weight: 600;
    padding: 16px 38px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}
.ad-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 210, 255, 0.28);
    color: var(--ad-white);
    text-decoration: none;
}
.ad-btn i { font-size: 12px; transition: transform 0.3s ease; }
.ad-btn:hover i { transform: translateX(4px); }
.ad-btn--ghost {
    background: transparent;
    border: 1px solid rgba(0, 210, 255, 0.45);
    color: var(--ad-cyan);
}
.ad-btn--ghost:hover {
    background: rgba(0, 210, 255, 0.10);
    color: var(--ad-cyan);
    box-shadow: 0 12px 30px rgba(0, 210, 255, 0.16);
}

/* ============================================================
   WHAT WE BUILD - capability tiles
   ============================================================ */
.ad-tiles {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}
.ad-tile {
    position: relative;
    padding: 28px 26px 30px;
    background: var(--ad-panel);
    border: 1px solid var(--ad-line-soft);
    border-radius: var(--ad-radius);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow: hidden;
    transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.ad-tile::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: var(--ad-gradient);
    opacity: 0;
    transition: opacity 0.35s ease;
}
.ad-tile:hover {
    transform: translateY(-6px);
    border-color: var(--ad-line);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.ad-tile:hover::before { opacity: 1; }
.ad-tile__icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(0, 210, 255, 0.10);
    border: 1px solid rgba(0, 210, 255, 0.22);
    color: var(--ad-cyan);
    font-size: 18px;
    margin-bottom: 18px;
}
.ad-tile__tag {
    display: block;
    font-family: var(--ad-code);
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--ad-cyan);
    margin-bottom: 8px;
}
.ad-tile h3 {
    font-size: 19px;
    font-weight: 800;
    color: var(--ad-white);
    letter-spacing: -0.3px;
    margin: 0 0 10px;
}
.ad-tile p {
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--ad-text-muted);
    margin: 0;
}

/* ============================================================
   SHOWCASE - shortcode output (.ad-showcase / .ad-app)
   ============================================================ */
.ad-showcase {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: clamp(64px, 8vw, 120px);
}
.ad-showcase-empty {
    text-align: center;
    font-family: var(--ad-code);
    color: var(--ad-text-muted);
}
.ad-app {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(28px, 4vw, 64px);
    align-items: center;
}
.ad-app--flip .ad-app-stage { order: 2; }
.ad-app--flip .ad-app-body { order: 1; }

/* Reveal on scroll (JS adds .is-visible; without JS everything shows) */
.ad-page.ad-js [data-ad-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ad-page.ad-js [data-ad-reveal].is-visible {
    opacity: 1;
    transform: none;
}

/* App window */
.ad-app-stage {
    position: relative;
    perspective: 1400px;
}
.ad-app-window {
    position: relative;
    z-index: 1;
    border-radius: var(--ad-radius);
    background: linear-gradient(180deg, rgba(24, 34, 53, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
    border: 1px solid rgba(0, 210, 255, 0.22);
    box-shadow: var(--ad-glow), 0 30px 80px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    transform-style: preserve-3d;
    transform: rotateX(var(--ad-rx, 0deg)) rotateY(var(--ad-ry, 0deg));
    transition: transform 0.25s ease-out, box-shadow 0.4s ease;
    will-change: transform;
}
.ad-app-stage.is-tilting .ad-app-window { transition: transform 0.08s linear; }
.ad-app-window::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(115deg, rgba(255, 255, 255, 0.07) 0%, transparent 35%, transparent 65%, rgba(0, 210, 255, 0.06) 100%);
    mix-blend-mode: screen;
}
.ad-app-window__bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 11px 16px;
    background: #182235;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.ad-app-window__bar span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ad-app-window__bar span:nth-child(1) { background: #ff5f57; }
.ad-app-window__bar span:nth-child(2) { background: #febc2e; }
.ad-app-window__bar span:nth-child(3) { background: #28c840; }
.ad-app-window__bar em {
    margin-left: 12px;
    flex: 1;
    font-style: normal;
    font-family: var(--ad-code);
    font-size: 12px;
    color: var(--ad-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ad-app-window__tag {
    font-family: var(--ad-code);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.5px;
    color: var(--ad-cyan);
    background: rgba(0, 210, 255, 0.10);
    border: 1px solid rgba(0, 210, 255, 0.22);
    border-radius: 50px;
    padding: 3px 10px;
    white-space: nowrap;
}
.ad-app-window__screen {
    position: relative;
    aspect-ratio: 16 / 10;
    background: #0a0d14;
    overflow: hidden;
}
.ad-app-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}
.ad-app-video { background: #0a0d14; }
.ad-app-gallery__img {
    opacity: 0;
    transition: opacity 0.9s ease;
}
.ad-app-gallery__img.is-active { opacity: 1; }
.ad-app-gallery__dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 12px;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 2;
}
.ad-app-gallery__dots button {
    width: 8px;
    height: 8px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(0, 210, 255, 0.5);
    background: rgba(10, 13, 20, 0.6);
    cursor: pointer;
    transition: transform 0.3s ease, background 0.3s ease;
}
.ad-app-gallery__dots button.is-active {
    background: var(--ad-cyan);
    transform: scale(1.25);
}
.ad-app-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--ad-cyan);
    font-family: var(--ad-code);
    font-size: 12px;
    letter-spacing: 1px;
    background:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}
.ad-app-placeholder i { font-size: 40px; opacity: 0.85; }
.ad-app-glow {
    position: absolute;
    inset: 12% -6% -8% -6%;
    z-index: 0;
    background: radial-gradient(ellipse at center, rgba(0, 210, 255, 0.22) 0%, transparent 65%);
    filter: blur(24px);
    pointer-events: none;
}

/* App copy */
.ad-app-body { min-width: 0; }
.ad-app-eyebrow {
    font-family: var(--ad-code);
    font-size: 12px;
    letter-spacing: 1.5px;
    color: var(--ad-cyan);
    margin: 0 0 12px;
}
.ad-app-eyebrow span { color: var(--ad-text-muted); letter-spacing: 0.5px; }
.ad-app-title {
    font-size: clamp(26px, 3.4vw, 38px);
    font-weight: 900;
    color: var(--ad-white);
    letter-spacing: -1px;
    line-height: 1.1;
    margin: 0 0 8px;
}
.ad-app-tagline {
    font-size: clamp(16px, 2vw, 19px);
    color: #e2e8f0;
    font-weight: 500;
    line-height: 1.5;
    margin: 0 0 14px;
}
.ad-app-desc {
    font-size: 15.5px;
    line-height: 1.7;
    color: var(--ad-text-muted);
    margin: 0 0 18px;
}
.ad-app-features {
    list-style: none;
    margin: 0 0 22px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 18px;
}
.ad-app-features li {
    position: relative;
    padding-left: 22px;
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--ad-text);
}
.ad-app-features li::before {
    content: '>';
    position: absolute;
    left: 0;
    top: 0;
    font-family: var(--ad-code);
    font-weight: 700;
    color: var(--ad-cyan);
}
.ad-app-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 26px;
}
.ad-app-stack span {
    font-family: var(--ad-code);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--ad-cyan);
    background: rgba(0, 210, 255, 0.08);
    border: 1px solid rgba(0, 210, 255, 0.2);
    border-radius: 4px;
    padding: 5px 10px;
}
.ad-app-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    align-items: center;
}
.ad-app-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--ad-code);
    font-size: 14px;
    font-weight: 600;
    color: var(--ad-white);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 210, 255, 0.45);
    padding-bottom: 3px;
}
.ad-app-link i { font-size: 12px; transition: transform 0.3s ease; color: var(--ad-cyan); }
.ad-app-link:hover { color: var(--ad-cyan); border-bottom-color: var(--ad-cyan); text-decoration: none; }
.ad-app-link:hover i { transform: translateX(4px); }
.ad-app-link--ghost { color: var(--ad-text-muted); border-bottom-color: transparent; }
.ad-app--dev .ad-app-window__tag { color: var(--ad-yellow); border-color: rgba(255, 196, 0, 0.35); background: rgba(255, 196, 0, 0.08); }

/* ============================================================
   HOW WE BUILD - process
   ============================================================ */
.ad-process {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    counter-reset: ad-step;
}
.ad-step {
    position: relative;
    padding: 30px 26px 28px;
    border: 1px solid var(--ad-line-soft);
    border-radius: var(--ad-radius);
    background: rgba(10, 13, 20, 0.6);
}
.ad-step::before {
    counter-increment: ad-step;
    content: '0' counter(ad-step);
    display: block;
    font-family: var(--ad-code);
    font-size: 34px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 18px;
    background: var(--ad-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.ad-step h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--ad-white);
    margin: 0 0 8px;
    letter-spacing: -0.3px;
}
.ad-step p {
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--ad-text-muted);
    margin: 0;
}
.ad-step + .ad-step::after {
    content: '';
    position: absolute;
    left: -18px;
    top: 50%;
    width: 18px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 210, 255, 0.5));
}

/* ============================================================
   CTA band
   ============================================================ */
.ad-cta {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: clamp(44px, 6vw, 72px) clamp(24px, 5vw, 64px);
    border-radius: 20px;
    border: 1px solid var(--ad-line);
    background:
        radial-gradient(ellipse at 15% 20%, rgba(2, 132, 199, 0.35) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 80%, rgba(0, 210, 255, 0.22) 0%, transparent 50%),
        var(--ad-bg-2);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}
.ad-cta .ad-grid { -webkit-mask-image: none; mask-image: none; opacity: 0.7; }
.ad-cta > * { position: relative; z-index: 1; }
.ad-cta h2 {
    font-size: clamp(26px, 4vw, 42px);
    font-weight: 900;
    color: var(--ad-white);
    letter-spacing: -1px;
    margin: 0 0 14px;
}
.ad-cta p {
    color: var(--ad-text-muted);
    font-size: clamp(15px, 2vw, 17px);
    line-height: 1.7;
    max-width: 640px;
    margin: 0 auto 30px;
}
.ad-cta__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
    .ad-tiles, .ad-process { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ad-step + .ad-step::after { display: none; }
}
@media (max-width: 900px) {
    .ad-app {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .ad-app--flip .ad-app-stage { order: 1; }
    .ad-app--flip .ad-app-body { order: 2; }
    .ad-app-features { grid-template-columns: 1fr; }
    .ad-hero__h1 { letter-spacing: -1.5px; }
}
@media (max-width: 600px) {
    .ad-container { padding: 0 18px; }
    .ad-tiles, .ad-process { grid-template-columns: 1fr; }
    .ad-hero__stats { gap: 8px 18px; }
    .ad-app-window__tag { display: none; }
}

/* ============================================================
   Motion opt-out: freeze the word reveals, tilt and scene.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .ad-page .ad-hero__tag,
    .ad-page .ad-hero__sub,
    .ad-page .ad-hero__ctas,
    .ad-page .ad-hero__stats,
    .ad-page .ad-hero__h1 .ad-word {
        animation: none;
        opacity: 1;
        transform: none;
    }
    .ad-page .ad-app-window { transform: none !important; transition: none; }
    .ad-page.ad-js [data-ad-reveal] { opacity: 1; transform: none; transition: none; }
    .ad-hero__scene { display: none; }
}
