/* ==========================================================================
   Technical Support & Integrations — Dedicated Stylesheet
   Uses CSS variables from style.css (--color-primary, --color-accent, etc.)
   ========================================================================== */

/* --- Page-Level Overrides --- */
.ts-page {
    background: var(--color-primary);
    color: var(--color-text-inverse);
    min-height: 100vh;
    overflow-x: hidden;
}

.ts-page *::selection {
    background: var(--color-accent);
    color: var(--color-primary);
}

/* --- Prototype Banner --- */
.prototype-banner {
    background: linear-gradient(135deg, #c5a059 0%, #e0b666 50%, #c5a059 100%);
    color: var(--color-primary);
    text-align: center;
    padding: 0.5rem 1rem;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    position: relative;
    z-index: 100;
}
.prototype-banner i {
    margin-right: 0.5rem;
}

/* --- Hero Section --- */
.ts-hero {
    background: linear-gradient(170deg, #0b132b 0%, #1c2541 40%, #0b132b 100%);
    padding: 6rem 2rem 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.ts-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 50%, rgba(197, 160, 89, 0.06) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 30%, rgba(197, 160, 89, 0.04) 0%, transparent 50%);
    animation: heroAmbient 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes heroAmbient {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-2%, 1%) rotate(1deg); }
}

.ts-hero .section-subtitle {
    display: inline-block;
    color: var(--color-accent);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    position: relative;
}

.ts-hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: #fff;
    margin-bottom: 1rem;
    line-height: 1.15;
}
.ts-hero h1 span {
    color: var(--color-accent);
}

.ts-hero .hero-desc {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.65);
    max-width: 700px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

.ts-hero .divider {
    width: 60px;
    height: 3px;
    background: var(--color-accent);
    margin: 0 auto 1.5rem;
    border-radius: 2px;
}

/* --- Section Common --- */
.ts-section {
    padding: 5rem 2rem;
    position: relative;
}

.ts-section-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.ts-section-header .section-subtitle {
    display: inline-block;
    color: var(--color-accent);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.ts-section-header h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    color: #fff;
    margin-bottom: 1rem;
}

.ts-section-header p {
    color: rgba(255,255,255,0.55);
    max-width: 650px;
    margin: 0 auto;
    font-size: 1rem;
    line-height: 1.7;
}

.ts-section-header .divider {
    width: 50px;
    height: 3px;
    background: var(--color-accent);
    margin: 0 auto 1rem;
    border-radius: 2px;
}

/* Alternating backgrounds */
.ts-section--dark {
    background: #0a0f1f;
}
.ts-section--darker {
    background: linear-gradient(180deg, var(--color-primary) 0%, #080d1e 100%);
}

/* --- Automation Cards --- */
.ts-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.ts-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(197, 160, 89, 0.12);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease, border-color 0.4s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ts-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.ts-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(197, 160, 89, 0.1);
    border-color: rgba(197, 160, 89, 0.3);
}
.ts-card:hover::before {
    opacity: 1;
}

.ts-card-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(197, 160, 89, 0.15), rgba(197, 160, 89, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--color-accent);
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}
.ts-card:hover .ts-card-icon {
    transform: scale(1.1);
}

.ts-card h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 0.75rem;
}

.ts-card p {
    color: rgba(255,255,255,0.55);
    font-size: 0.95rem;
    line-height: 1.65;
    margin-bottom: 1.25rem;
}

.ts-card-features {
    list-style: none;
    padding: 0;
    margin: 0;
}
.ts-card-features li {
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    padding: 0.4rem 0;
    padding-left: 1.5rem;
    position: relative;
}
.ts-card-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-accent);
    opacity: 0.6;
}

/* --- Workflow Engine --- */
.workflow-engine {
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
}

.workflow-container {
    position: relative;
    padding: 3rem 0;
    overflow-x: auto;
    overflow-y: visible;
}

.workflow-svg {
    width: 100%;
    height: auto;
    min-width: 900px;
    display: block;
}

/* Node styling */
.wf-node {
    cursor: default;
}
.wf-node-bg {
    fill: rgba(28, 37, 65, 0.9);
    stroke: rgba(197, 160, 89, 0.3);
    stroke-width: 1.5;
    rx: 12;
    ry: 12;
    transition: all 0.3s ease;
    filter: drop-shadow(0 4px 15px rgba(0,0,0,0.3));
}
.wf-node:hover .wf-node-bg {
    stroke: var(--color-accent);
    stroke-width: 2;
    filter: drop-shadow(0 4px 25px rgba(197, 160, 89, 0.2));
}

.wf-node-icon {
    font-size: 1.3rem;
    fill: var(--color-accent);
}
.wf-node-label {
    fill: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-anchor: middle;
}
.wf-node-sublabel {
    fill: rgba(255,255,255,0.45);
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    text-anchor: middle;
}

/* Pulse keyframe for nodes */
@keyframes nodePulse {
    0%, 100% { 
        filter: drop-shadow(0 0 8px rgba(197, 160, 89, 0.15));
    }
    50% { 
        filter: drop-shadow(0 0 20px rgba(197, 160, 89, 0.35));
    }
}
.wf-node {
    animation: nodePulse 3s ease-in-out infinite;
}
.wf-node:nth-child(2) { animation-delay: 0.5s; }
.wf-node:nth-child(3) { animation-delay: 1s; }
.wf-node:nth-child(4) { animation-delay: 1.5s; }
.wf-node:nth-child(5) { animation-delay: 2s; }
.wf-node:nth-child(6) { animation-delay: 2.5s; }

/* Connection pipes */
.wf-pipe {
    fill: none;
    stroke: rgba(197, 160, 89, 0.15);
    stroke-width: 2;
    stroke-linecap: round;
}

/* Liquid flow animation */
.wf-flow {
    fill: none;
    stroke: url(#liquidGradient);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 20 80;
    animation: liquidFlow 2.5s linear infinite;
}

@keyframes liquidFlow {
    0% { stroke-dashoffset: 100; }
    100% { stroke-dashoffset: 0; }
}

/* Flowing orbs */
.wf-orb {
    r: 4;
    fill: var(--color-accent);
    filter: drop-shadow(0 0 6px rgba(197, 160, 89, 0.8));
    offset-distance: 0%;
    animation: orbTravel 3s linear infinite;
}
@keyframes orbTravel {
    0% { offset-distance: 0%; opacity: 0; }
    5% { opacity: 1; }
    95% { opacity: 1; }
    100% { offset-distance: 100%; opacity: 0; }
}

.wf-orb:nth-child(2) { animation-delay: 0.6s; }
.wf-orb:nth-child(3) { animation-delay: 1.2s; }
.wf-orb:nth-child(4) { animation-delay: 1.8s; }
.wf-orb:nth-child(5) { animation-delay: 2.4s; }

/* Workflow status indicator */
.workflow-status {
    text-align: center;
    margin-top: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
}
.workflow-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    animation: statusPulse 2s ease-in-out infinite;
}
@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

/* --- Architecture Section --- */
.arch-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.arch-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(197, 160, 89, 0.1);
    border-radius: 16px;
    padding: 2.5rem;
    position: relative;
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.arch-card:hover {
    transform: translateY(-4px);
    border-color: rgba(197, 160, 89, 0.25);
}

.arch-card-badge {
    display: inline-block;
    background: linear-gradient(135deg, rgba(197, 160, 89, 0.2), rgba(197, 160, 89, 0.08));
    color: var(--color-accent);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.arch-card h3 {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.5rem;
}
.arch-card .model-name {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--color-accent);
    margin-bottom: 1rem;
    display: block;
}

.arch-card p {
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
    line-height: 1.65;
}

.arch-stack {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}
.arch-stack-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 30px;
    padding: 0.5rem 1.25rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    transition: border-color 0.3s ease, color 0.3s ease;
}
.arch-stack-item:hover {
    border-color: rgba(197, 160, 89, 0.3);
    color: rgba(255,255,255,0.85);
}
.arch-stack-item i {
    color: var(--color-accent);
    font-size: 0.9rem;
}

/* --- Profile Section --- */
.profile-section {
    background: linear-gradient(180deg, #080d1e 0%, var(--color-primary) 100%);
}

.profile-card {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(197, 160, 89, 0.15);
    border-radius: 20px;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 10%, var(--color-accent) 50%, transparent 90%);
}

.profile-photo-wrapper {
    position: relative;
}
.profile-photo {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 16px;
    object-fit: cover;
    border: 2px solid rgba(197, 160, 89, 0.2);
    filter: grayscale(10%);
    transition: filter 0.4s ease, border-color 0.4s ease;
}
.profile-photo:hover {
    filter: grayscale(0%);
    border-color: var(--color-accent);
}

.profile-info h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 0.25rem;
}
.profile-title {
    color: var(--color-accent);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 1.25rem;
    display: block;
}

.profile-bio {
    color: rgba(255,255,255,0.6);
    font-size: 0.95rem;
    line-height: 1.75;
    margin-bottom: 1.5rem;
}

.profile-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.profile-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border: 1px solid rgba(197, 160, 89, 0.25);
    border-radius: 8px;
    color: var(--color-accent);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}
.profile-link:hover {
    background: rgba(197, 160, 89, 0.1);
    border-color: var(--color-accent);
    color: #fff;
}
.profile-link i {
    font-size: 1rem;
}

/* --- Footer --- */
.ts-footer {
    background: #060a17;
    padding: 2rem;
    text-align: center;
    border-top: 1px solid rgba(197, 160, 89, 0.08);
}
.ts-footer p {
    color: rgba(255,255,255,0.35);
    font-size: 0.8rem;
}
.ts-footer a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s ease;
}
.ts-footer a:hover {
    color: var(--color-accent-hover);
}

/* --- Back to Main Site Button --- */
.ts-back-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-hover));
    color: var(--color-primary);
    border: none;
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 8px 25px rgba(197, 160, 89, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 99;
}
.ts-back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(197, 160, 89, 0.4);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1024px) {
    .ts-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .profile-card {
        grid-template-columns: 220px 1fr;
        gap: 2rem;
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .ts-hero {
        padding: 4rem 1.5rem 3rem;
    }
    .ts-section {
        padding: 3.5rem 1.5rem;
    }
    .ts-cards-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
    }
    .arch-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 0 auto;
    }
    .profile-card {
        grid-template-columns: 1fr;
        text-align: center;
        max-width: 500px;
    }
    .profile-photo {
        width: 200px;
        margin: 0 auto;
    }
    .profile-links {
        justify-content: center;
    }
    .workflow-container {
        padding: 2rem 0;
    }
}

@media (max-width: 480px) {
    .ts-hero h1 {
        font-size: 1.7rem;
    }
    .ts-hero .hero-desc {
        font-size: 0.95rem;
    }
    .ts-card {
        padding: 2rem 1.5rem;
    }
    .profile-card {
        padding: 1.5rem;
    }
    .profile-info h3 {
        font-size: 1.4rem;
    }
    .ts-back-btn {
        bottom: 1rem;
        right: 1rem;
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
    .arch-stack {
        gap: 0.75rem;
    }
    .arch-stack-item {
        font-size: 0.7rem;
        padding: 0.4rem 0.9rem;
    }
}

/* — Scroll-triggered fade-in animations — */
.ts-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.ts-animate.ts-visible {
    opacity: 1;
    transform: translateY(0);
}
.ts-animate-delay-1 { transition-delay: 0.1s; }
.ts-animate-delay-2 { transition-delay: 0.2s; }
.ts-animate-delay-3 { transition-delay: 0.3s; }
