:root {
    --ai-bg-color: #050505;
    --ai-text-main: #e0e0e0;
    --ai-accent: #7777ff;
    /* Brighter Blue for better visibility on black */
    /* Neon Blue */
    --ai-accent-glow: rgba(119, 119, 255, 0.6);
    --ai-grid-line: rgba(255, 255, 255, 0.1);
    /* Slightly more visible grid */
    --font-mono: 'Courier New', Courier, monospace;
    /* Placeholder for system mono */
}

body.ai-page {
    background-color: var(--ai-bg-color);
    color: var(--ai-text-main);
    font-family: 'Inter', sans-serif;
}

/* Typography Overrides */
.ai-page .text-display {
    font-family: 'Inter', sans-serif;
    /* Clean, modern sans for headers */
    font-weight: 800;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.ai-page .text-mono {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: var(--ai-accent);
    /* Now brighter */
    font-weight: 600;
    /* Increased weight for small text */
}

/* Sections */
.ai-hero-section {
    height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 0 5vw;
}

.ai-hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.3;
    pointer-events: none;
}

.ai-hero-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
}

/* Solution Cards */
.ai-solution-grid {
    display: none;
    /* Hide legacy grid if present */
}

/* Premium Layout Utilities */
.ai-section-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
    padding: 6rem 0;
    min-height: 60vh;
    width: 100%;
    flex-wrap: nowrap;
}

.ai-section-row.reverse {
    flex-direction: row-reverse;
}

.ai-text-col {
    flex: 0 0 50%;
    /* Adjusted for optical balance with spacing */
}

.ai-visual-col {
    flex: 0 0 40%;
    position: relative;
}

.ai-visual-img {
    width: 100%;
    height: auto;
    border-radius: 2px;
    filter: grayscale(100%) contrast(1.1);
    /* Corporate sleek */
    transition: filter 0.5s ease;
}

.ai-section-row:hover .ai-visual-img {
    filter: grayscale(0%) contrast(1);
}

.premium-divider {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0;
}

.strategic-block {
    text-align: center !important;
    padding: 8rem 0;
    max-width: 800px;
    margin: 0 auto;
}

.strategic-text {
    font-size: 1.5rem;
    line-height: 1.6;
    color: #e0e0e0;
    font-weight: 300;
}

.strategic-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--ai-accent);
    margin-bottom: 2rem;
    display: block;
    letter-spacing: 0.2em;
}

/* Updated Typography for Premium Tone */
.ai-card h3,
.ai-section-title {
    font-size: clamp(3rem, 5vw, 5rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: white;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    line-height: 1;
}

.ai-card p,
.ai-section-desc {
    color: var(--body-color);
    line-height: var(--body-line-height);
    font-size: var(--body-font-size);
    letter-spacing: var(--body-letter-spacing);
    font-weight: var(--body-font-weight);
}

/* Remove Startup Glows */
.ai-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: none;
    transform: none;
}

.process-step.active::before {
    background: var(--ai-accent);
    box-shadow: none;
}

@media (max-width: 768px) {

    .ai-section-row,
    .ai-section-row.reverse {
        flex-direction: column;
        padding: 4rem 0;
        gap: 2rem;
    }

    .ai-hero-title {
        font-size: 3.5rem;
    }

    .ai-visual-col {
        width: 100%;
        aspect-ratio: 4 / 3;
        flex: none;
    }
}

/* Text Links for Sub-pages */
/* Text Links for Sub-pages - Updated to Button Style */
.text-link {
    display: inline-block;
    margin-top: 2.5rem;
    padding: 1rem 2rem;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.05);
    /* Slight fill */
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    /* Pill shape */
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.text-link:hover {
    background: white;
    color: black;
    border-color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* ACE Workflow Section */
.ace-workflow-section {
    width: 100%;
    background-color: #FFFFFF;
    padding-top: 180px;
    padding-bottom: 180px;
    text-align: center;
    color: #111111;
    /* Animation initial state */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.ace-workflow-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.ace-workflow-container {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.workflow-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 80px;
    color: #111111;
    font-family: 'Inter', sans-serif;
}

.workflow-step {
    font-size: 18px;
    font-weight: 500;
    color: #111111;
    letter-spacing: 0.02em;
    margin: 70px 0;
    position: relative;
    font-family: 'Inter', sans-serif;
}

.workflow-step:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 100%;
    width: 1px;
    height: 60px;
    background-color: #DDDDDD;
}

/* ACE Workflow Responsive */
@media (max-width: 768px) {
    .workflow-step {
        font-size: 16px;
        margin: 50px 0;
    }
}

/* =========================================
   EMBEDDED ACE WORKFLOW STYLES
   Scoped to #ace-workflow-embed
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,200;0,300;0,400;0,600;1,200;1,300&family=Barlow+Condensed:wght@200;300;400;500;600;700;800;900&display=swap');

#ace-workflow-embed {
    /* Local Variables Scoped to Container */
    --bg: #FFFFFF;
    /* Changed to White to match user request context or keep dark if preferred? User code had #060608. Keeping user code but ensuring it fits. actually user previous verify showed white section. let's stick to user code colors which are dark theme */
    /* Wait, user code has --bg: #060608; --text: #dce8ec; This is DARK theme. 
       But the previous placeholder was white. I will use the USER CODE colors as they are "source of truth" for this embed.
    */
    --embed-bg: #060608;
    --embed-text: #ffffff;
    --embed-muted: rgba(210, 230, 240, 0.85);
    /* Increased opacity and brightness */
    --embed-faint: rgba(0, 229, 200, 0.15);
    /* More visible */
    --embed-border: rgba(0, 229, 200, 0.25);
    /* More visible border */
    --embed-border-plain: rgba(255, 255, 255, 0.2);
    /* brighter border */
    --embed-accent: #00ffd5;
    /* Brighter accent */
    --embed-accent-glow: rgba(0, 229, 200, 0.3);

    background: var(--embed-bg);
    color: var(--embed-text);
    font-family: 'Barlow', sans-serif;
    position: relative;
    width: 100%;
    overflow: hidden;
    /* Contain inner floats/margins */
}

/* Scoped Global Reset within Embed */
#ace-workflow-embed * {
    box-sizing: border-box;
}

/* Background Effects (Scoped) */
#ace-workflow-embed .ace-grain {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    opacity: 0.02;
    pointer-events: none;
    z-index: 0;
}

#ace-workflow-embed .ace-glow {
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 500px;
    background: radial-gradient(ellipse at center, rgba(0, 200, 180, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

#ace-workflow-embed .ace-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 100px 80px 120px;
    position: relative;
    z-index: 1;
}

/* Header */
#ace-workflow-embed .sec-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 60px;
    border-bottom: 1px solid var(--embed-border-plain);
    padding-bottom: 28px;
    opacity: 0;
    animation: ace-up 0.7s ease forwards 0.1s;
}

#ace-workflow-embed .sec-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 300;
    font-size: clamp(11px, 1vw, 14px);
    letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--embed-accent);
    opacity: 1;
    /* Made fully visible */
}

#ace-workflow-embed .sec-title-wrap {
    text-align: right;
}

#ace-workflow-embed .sec-title-en {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    font-size: clamp(40px, 5.5vw, 72px);
    text-transform: uppercase;
    letter-spacing: -2px;
    line-height: 0.9;
    color: var(--embed-text);
}

#ace-workflow-embed .sec-title-ko {
    font-family: 'Barlow', sans-serif;
    font-weight: 400;
    /* Increased weight */
    font-style: italic;
    font-size: clamp(13px, 1.2vw, 16px);
    color: var(--embed-muted);
    letter-spacing: 0.5px;
    display: block;
    margin-top: 8px;
}

/* Pipeline */
#ace-workflow-embed .pipeline-wrap {
    width: 100%;
    opacity: 0;
    animation: ace-up 0.7s ease forwards 0.3s;
    margin-bottom: 0;
}

/* Steps Grid */
#ace-workflow-embed .steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--embed-border-plain);
    margin-top: -1px;
}

#ace-workflow-embed .step {
    background: var(--embed-bg);
    padding: 40px 34px 44px;
    position: relative;
    overflow: hidden;
    transition: background 0.4s ease;
    opacity: 0;
    animation: ace-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#ace-workflow-embed .step:nth-child(1) {
    animation-delay: 0.4s;
}

#ace-workflow-embed .step:nth-child(2) {
    animation-delay: 0.55s;
}

#ace-workflow-embed .step:nth-child(3) {
    animation-delay: 0.70s;
}

#ace-workflow-embed .step:nth-child(4) {
    animation-delay: 0.85s;
}

#ace-workflow-embed .step:hover {
    background: rgba(0, 229, 200, 0.025);
}

/* Top accent line on hover */
#ace-workflow-embed .step::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--embed-accent), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

#ace-workflow-embed .step:hover::before {
    opacity: 0.6;
}

/* Ghost number */
#ace-workflow-embed .step-ghost {
    position: absolute;
    top: -14px;
    right: -6px;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 900;
    font-size: 140px;
    line-height: 1;
    color: var(--embed-accent);
    opacity: 0.1;
    /* Made more visible */
    letter-spacing: -6px;
    pointer-events: none;
    user-select: none;
    transition: opacity 0.4s;
}

#ace-workflow-embed .step:hover .step-ghost {
    opacity: 0.2;
    /* Better hover state */
}

/* Visual */
#ace-workflow-embed .step-visual {
    height: 110px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

#ace-workflow-embed .step-visual svg {
    height: 100%;
    width: auto;
}

#ace-workflow-embed .step-idx {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 300;
    font-size: clamp(11px, 1vw, 14px);
    letter-spacing: 4px;
    color: var(--embed-accent);
    opacity: 1;
    /* Fully visible */
    margin-bottom: 10px;
}

#ace-workflow-embed .step-name-en {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(22px, 2.5vw, 32px);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--embed-text);
    line-height: 1.05;
    margin-bottom: 4px;
}

#ace-workflow-embed .step-name-ko {
    font-family: 'Barlow', sans-serif;
    font-weight: 400;
    /* Increased weight */
    font-style: italic;
    font-size: clamp(12px, 1.1vw, 15px);
    color: var(--embed-muted);
    margin-bottom: 18px;
    letter-spacing: 0.5px;
}

#ace-workflow-embed .step-desc {
    font-weight: 400;
    /* Increased weight */
    font-size: clamp(13px, 1.3vw, 16px);
    line-height: 1.75;
    color: var(--embed-muted);
    margin-bottom: 22px;
}

#ace-workflow-embed .step-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

#ace-workflow-embed .tag {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 300;
    font-size: clamp(10px, 0.9vw, 13px);
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--embed-accent);
    border: 1px solid rgba(0, 229, 200, 0.4);
    padding: 3px 10px;
    opacity: 1;
    /* Fully visible */
}

/* Stats */
#ace-workflow-embed .stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--embed-border-plain);
    margin-top: 1px;
    opacity: 0;
    animation: ace-up 0.6s ease forwards 1.1s;
}

#ace-workflow-embed .stat {
    background: var(--embed-bg);
    padding: 28px 34px 32px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    overflow: hidden;
    transition: background 0.3s;
}

#ace-workflow-embed .stat:hover {
    background: rgba(0, 229, 200, 0.02);
}

#ace-workflow-embed .stat::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 34px;
    right: 34px;
    height: 1px;
    background: linear-gradient(90deg, var(--embed-accent), transparent);
    opacity: 0.15;
}

#ace-workflow-embed .stat-num {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    font-size: clamp(34px, 3.5vw, 54px);
    letter-spacing: -2px;
    line-height: 1;
    color: var(--embed-text);
}

#ace-workflow-embed .stat-en {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 300;
    font-size: clamp(11px, 1vw, 14px);
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--embed-accent);
    opacity: 1;
    /* Fully visible */
}

#ace-workflow-embed .stat-ko {
    font-size: clamp(12px, 1.1vw, 15px);
    font-weight: 400;
    /* Increased weight */
    font-style: italic;
    color: var(--embed-muted);
    /* Used brighter color variable */
    margin-top: 1px;
}

@keyframes ace-up {
    from {
        opacity: 0;
        transform: translateY(22px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1024px) {

    #ace-workflow-embed .steps,
    #ace-workflow-embed .stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    #ace-workflow-embed .steps,
    #ace-workflow-embed .stats {
        grid-template-columns: 1fr;
    }

    #ace-workflow-embed .sec-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    #ace-workflow-embed .sec-title-wrap {
        text-align: left;
    }

    #ace-workflow-embed .sec-title-en {
        font-size: 42px;
    }

    #ace-workflow-embed .ace-inner {
        padding: 60px 20px;
    }
}