/* ============================================
   How It Works — AI YHCT Deep Dive Page
   Reuses design tokens from styles.css
   ============================================ */

/* === DESIGN TOKENS (shared with styles.css) === */
:root {
    --bg: #0D1F1C;
    --bg-card: #132A26;
    --bg-elevated: #1A3530;
    --bg-glass: rgba(19, 42, 38, 0.85);
    --text: #E8EDE6;
    --text-muted: #8FA399;
    --text-dim: #5E7A6E;
    --primary: #C9A96E;
    --primary-light: #DFC08A;
    --primary-dark: #A88B4A;
    --primary-glow: rgba(201, 169, 110, 0.15);
    --accent: #4ECDC4;
    --accent-soft: rgba(78, 205, 196, 0.12);
    --accent-muted: rgba(78, 205, 196, 0.6);
    --danger: #E74C3C;
    --danger-soft: rgba(231, 76, 60, 0.1);
    --success: #2ECC71;
    --border: rgba(255, 255, 255, 0.06);
    --border-gold: rgba(201, 169, 110, 0.2);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.2);
    --shadow-gold: 0 8px 30px rgba(201, 169, 110, 0.2);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-full: 50px;
    --nav-height: 60px;
    --z-base: 1;
    --z-sticky: 50;
    --z-nav: 100;
}

/* === RESET === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-light);
}

img {
    max-width: 100%;
    display: block;
}

ul {
    list-style: none;
}

main {
    padding-top: var(--nav-height);
    min-height: 100svh;
}

.container {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 16px;
}

@media (min-width: 375px) {
    .container {
        padding: 0 20px;
    }
}

@media (min-width: 768px) {
    .container {
        padding: 0 32px;
    }
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    min-height: 48px;
    min-width: 44px;
    border-radius: var(--radius-full);
    text-align: center;
    line-height: 1.2;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--bg);
    padding: 14px 28px;
    font-size: 0.95rem;
    box-shadow: var(--shadow-gold);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(201, 169, 110, 0.35);
    color: var(--bg);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    padding: 14px 28px;
    font-size: 0.95rem;
    border: 1.5px solid var(--border-gold);
}

.btn-outline:hover {
    background: var(--primary-glow);
    border-color: var(--primary);
    color: var(--primary-light);
}

/* === NAV === */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-nav);
    padding: 10px 0;
    transition: transform 0.3s ease, background-color 0.3s ease, padding 0.3s ease;
    will-change: transform;
}

.nav.scrolled {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.nav-logo {
    font-weight: 800;
    font-size: 1rem;
    color: var(--primary);
    letter-spacing: -0.02em;
    white-space: nowrap;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-logo span {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.75rem;
    margin-left: 4px;
}

.nav-menu {
    display: none;
    list-style: none;
    gap: 24px;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-menu a:hover {
    color: var(--primary);
}

.nav-cta {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--bg);
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    text-decoration: none;
    box-shadow: var(--shadow-small);
}

@media (min-width: 768px) {
    .nav-menu {
        display: flex;
    }
}

/* === SECTION SHARED === */
section {
    padding: 48px 0;
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 12px;
}

.section-label::before {
    content: '';
    width: 20px;
    height: 1.5px;
    background: var(--accent);
    border-radius: 1px;
}

.section-title {
    font-size: clamp(1.4rem, 5vw, 2.4rem);
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.section-desc {
    font-size: clamp(0.88rem, 2.5vw, 1rem);
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 32px;
    line-height: 1.7;
}

@media (min-width: 768px) {
    section {
        padding: 80px 0;
    }

    .section-desc {
        margin-bottom: 48px;
    }
}

/* === HERO (compact) === */
.hero-hiw {
    padding: 60px 0 40px;
    position: relative;
    overflow: hidden;
}

.hero-hiw::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 60vw;
    height: 60vw;
    max-width: 500px;
    max-height: 500px;
    background: radial-gradient(circle, rgba(78, 205, 196, 0.06), transparent 70%);
    pointer-events: none;
}

.hero-hiw h1 {
    font-size: clamp(1.5rem, 6vw, 2.6rem);
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

.hero-hiw h1 .highlight {
    background: linear-gradient(135deg, var(--accent), #6EE7B7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-hiw .hero-sub {
    font-size: clamp(0.88rem, 2.5vw, 1.05rem);
    color: var(--text-muted);
    max-width: 540px;
    line-height: 1.7;
    margin-bottom: 24px;
}

.hero-hiw .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-soft);
    border: 1px solid rgba(78, 205, 196, 0.2);
    border-radius: var(--radius-full);
    padding: 6px 14px;
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 20px;
}

/* === 3-STEP PROCESS === */
.process-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    counter-reset: step;
}

.process-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    position: relative;
    counter-increment: step;
    transition: border-color 0.3s;
}

.process-card:hover {
    border-color: var(--border-gold);
}

.process-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-soft);
    border: 1.5px solid rgba(78, 205, 196, 0.25);
    color: var(--accent);
    font-weight: 800;
    font-size: 1rem;
    margin-bottom: 14px;
    flex-shrink: 0;
}

.process-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 6px;
}

.process-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.process-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-muted);
    font-size: 1.2rem;
    padding: 4px 0;
}

@media (min-width: 768px) {
    .process-grid {
        grid-template-columns: 1fr auto 1fr auto 1fr;
        gap: 12px;
        align-items: stretch;
    }

    .process-connector {
        font-size: 1.5rem;
        align-self: center;
    }
}

/* === PHONE MOCKUP === */
.phone-section {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg) 100%);
}

.phone-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

.phone-frame {
    width: 320px;
    max-width: 85vw;
    background: #111;
    border-radius: 36px;
    padding: 12px;
    box-shadow:
        0 0 0 2px #333,
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(78, 205, 196, 0.08);
    position: relative;
}

.phone-notch {
    width: 120px;
    height: 28px;
    background: #111;
    border-radius: 0 0 16px 16px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.phone-screen {
    background: var(--bg);
    border-radius: 26px;
    overflow: hidden;
    margin-top: -14px;
}

/* Chat Header */
.chat-header {
    background: var(--bg-card);
    padding: 18px 16px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #2CA69E);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-avatar svg {
    width: 16px;
    height: 16px;
    fill: white;
}

.chat-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
}

.chat-status {
    font-size: 0.65rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-status .online-dot {
    width: 5px;
    height: 5px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Chat Messages */
.chat-body {
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 340px;
    max-height: 420px;
    overflow-y: auto;
}

.chat-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.78rem;
    line-height: 1.55;
    opacity: 0;
    transform: translateY(10px);
    animation: chatFadeIn 0.4s ease forwards;
}

.chat-msg.user {
    background: var(--primary-glow);
    border: 1px solid var(--border-gold);
    color: var(--text);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-msg.ai {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-msg.ai .ai-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-msg strong {
    color: var(--primary-light);
    font-weight: 600;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    opacity: 0;
    animation: chatFadeIn 0.3s ease forwards;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-muted);
    animation: typingBounce 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Chat input bar */
.chat-input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}

.chat-input-fake {
    flex: 1;
    height: 34px;
    border-radius: 17px;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0 14px;
    font-size: 0.72rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
}

.chat-send-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #2CA69E);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-send-btn svg {
    width: 14px;
    height: 14px;
    fill: white;
}

/* Delay classes for chat animation */
.chat-msg.delay-1 {
    animation-delay: 0.3s;
}

.chat-msg.delay-2 {
    animation-delay: 1.2s;
}

.chat-msg.delay-3 {
    animation-delay: 2.4s;
}

.chat-msg.delay-4 {
    animation-delay: 3.8s;
}

.chat-msg.delay-5 {
    animation-delay: 5.2s;
}

.typing-indicator.delay-t1 {
    animation-delay: 0.8s;
}

.typing-indicator.delay-t2 {
    animation-delay: 2s;
}

/* === CASE STUDY TABS === */
.case-section {
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-card) 100%);
}

.tabs-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 24px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tabs-nav::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex-shrink: 0;
    padding: 10px 18px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    min-height: 44px;
    white-space: nowrap;
}

.tab-btn:hover {
    border-color: var(--border-gold);
    color: var(--text);
}

.tab-btn.active {
    background: var(--primary-glow);
    border-color: var(--primary);
    color: var(--primary-light);
}

.tab-panel {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.tab-panel.active {
    display: block;
}

/* Case content */
.case-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.case-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.case-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 4px;
}

.case-header .case-tag {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: var(--accent-soft);
    border: 1px solid rgba(78, 205, 196, 0.2);
    font-size: 0.7rem;
    color: var(--accent);
    font-weight: 600;
    margin-top: 6px;
}

.case-body {
    padding: 20px;
}

.case-stage {
    margin-bottom: 20px;
}

.case-stage:last-child {
    margin-bottom: 0;
}

.case-stage-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}

.case-stage-label .stage-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.case-detail {
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
}

.case-detail:last-child {
    margin-bottom: 0;
}

.case-detail h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.case-detail p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.case-detail .highlight-text {
    color: var(--primary-light);
    font-weight: 600;
}

/* === CAPABILITIES GRID === */
.cap-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.cap-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: border-color 0.3s;
}

.cap-card:hover {
    border-color: var(--border-gold);
}

.cap-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--primary-glow);
    border: 1px solid var(--border-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.cap-card h3 {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 4px;
}

.cap-card p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.55;
}

@media (min-width: 500px) {
    .cap-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}

@media (min-width: 768px) {
    .cap-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

/* === FINAL CTA === */
.final-cta {
    text-align: center;
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}

.final-cta::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    height: 80vw;
    max-width: 500px;
    max-height: 500px;
    background: radial-gradient(circle, var(--primary-glow), transparent 60%);
    pointer-events: none;
}

.final-cta h2 {
    font-size: clamp(1.3rem, 5vw, 2rem);
    font-weight: 800;
    margin-bottom: 12px;
    position: relative;
}

.final-cta p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
    position: relative;
}

.final-cta .btn {
    position: relative;
}

.text-gold {
    color: var(--primary);
}

/* === FOOTER === */
footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    text-align: center;
}

.footer-text {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.footer-text a {
    color: var(--primary);
}

/* === SCROLL REVEAL === */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

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

@keyframes chatFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* === RESPONSIVE 768+ === */
@media (min-width: 768px) {
    .phone-frame {
        width: 360px;
    }

    .chat-body {
        min-height: 380px;
    }
}