/* ============================================================
   iconOS — Shared Styles (all public pages)
   ============================================================ */

* { box-sizing: border-box; }

/* Vietnamese typography — text-wrap balance to prevent orphan words */
h1, h2, h3 { text-wrap: balance; }
p { line-height: 1.75; text-wrap: pretty; }
/* text-wrap: pretty prevents single-word orphans on last line (Chrome 117+, Safari 17.4+) */

/* Mobile spacing — reduce excessive padding/margin on small screens */
@media (max-width: 640px) {
    section { padding-left: 1rem !important; padding-right: 1rem !important; }
    h1 { font-size: clamp(1.75rem, 8vw, 3.5rem) !important; }
    h2 { font-size: clamp(1.5rem, 6vw, 3rem) !important; }
}

:root {
    --surface-0: #06060f;
    --surface-1: rgba(255,255,255,0.03);
    --surface-2: rgba(255,255,255,0.06);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.6);
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --accent: #FF3403;
}

/* 5B System Colors */
.text-b1 { color: #FF3403; }
.text-b2 { color: #3B82F6; }
.text-b3 { color: #10B981; }
.text-b4 { color: #F59E0B; }
.text-b5 { color: #8B5CF6; }
.bg-b1\/10 { background: rgba(255,52,3,0.1); }
.bg-b2\/10 { background: rgba(59,130,246,0.1); }
.bg-b3\/10 { background: rgba(16,185,129,0.1); }
.bg-b4\/10 { background: rgba(245,158,11,0.1); }
.bg-b5\/10 { background: rgba(139,92,246,0.1); }
.hover\:text-b2:hover { color: #3B82F6; }
.text-accent-light { color: #FF5C33; }
.bg-dark-800\/50 { background: rgba(17,17,28,0.5); }

body { font-family: 'Open Sans', system-ui, sans-serif; background: var(--surface-0); color: #fff; overflow-x: hidden; }
h1, h2, h3 { font-family: 'Space Grotesk', system-ui, sans-serif; text-wrap: balance; }

/* Boost body text contrast for readability on dark backgrounds */
.text-gray-400 { color: #b0b0b8 !important; }

/* Grain overlay */
.grain::after {
    content: ''; position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: 0.10;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #FFFFFF 0%, #FF3403 50%, #FF5C33 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.gradient-text-subtle {
    background: linear-gradient(135deg, #FFFFFF 30%, rgba(255,52,3,0.7) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glass card */
.glass {
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.08);
}
.glass-hover:hover {
    background: var(--surface-2);
    border-color: rgba(255,255,255,0.12);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Glow button */
.btn-glow {
    position: relative; overflow: hidden;
    background: #FF3403; color: #fff;
    transition: all 0.3s ease;
    display: inline-block;
}
.btn-glow.block { display: block; }
.btn-glow.w-full { display: block; }
.btn-glow::before {
    content: ''; position: absolute; inset: -2px; border-radius: inherit;
    background: linear-gradient(135deg, #FF3403, #FF5C33, #FF3403);
    z-index: -1; filter: blur(16px); opacity: 0.5;
    transition: opacity 0.3s ease;
}
.btn-glow:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(255,52,3,0.4); }
.btn-glow:hover::before { opacity: 0.8; }

/* Ghost button */
.btn-ghost {
    display: inline-block;
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
    transition: all 0.3s ease;
}
.btn-ghost:hover {
    border-color: rgba(255,255,255,0.2);
    color: #fff;
    transform: translateY(-1px);
}

/* Accent line */
.accent-line { height: 1px; background: linear-gradient(90deg, transparent, rgba(255,52,3,0.3), transparent); }

/* Nav */
.nav-blur { backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }

/* Floating orb */
.orb {
    position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.10; pointer-events: none; z-index: -1;
}

/* Section reveal */
.reveal { opacity: 0; transform: translateY(20px); }
.reveal.visible { opacity: 1; transform: translateY(0); transition: all 0.5s ease-out; }

/* FAQ accordion */
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.4s ease, padding 0.4s ease; }
.faq-item.open .faq-answer { max-height: 500px; }
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-icon { transition: transform 0.3s ease; }

/* Counter */
.count-up { font-variant-numeric: tabular-nums; }

/* Module accordion */
.module-group.open .module-chevron { transform: rotate(180deg); }
.module-group.open .module-content { max-height: 500px; }
.module-group.open { background: rgba(255,255,255,0.04); }

/* Step node stagger */
.step-node { opacity: 0; transform: translateY(20px); }
.step-node.visible { opacity: 1; transform: translateY(0); transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.step-node:nth-child(2) { transition-delay: 120ms; }
.step-node:nth-child(3) { transition-delay: 240ms; }
.step-node:nth-child(4) { transition-delay: 360ms; }
.step-node:nth-child(5) { transition-delay: 480ms; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0A0A0B; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* ===== BENTO GRID — 6-Layer Showcase ===== */
.ip-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.ip-card {
    background: rgba(255,255,255,0.04); backdrop-filter: blur(12px);
    border-radius: 16px; padding: 36px 32px 32px; position: relative;
    overflow: hidden; transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid rgba(255,255,255,0.08); display: flex; flex-direction: column;
}
.ip-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: rgba(255,255,255,0.12); }
.ip-card--hero {
    grid-column: span 12; padding: 48px; background: rgba(255,255,255,0.06);
    flex-direction: row; align-items: center; gap: 48px;
}
.ip-card--hero .ip-card__content { flex: 1; }
.ip-card--hero .ip-card__visual { flex: 0 0 320px; display: flex; align-items: center; justify-content: center; }
.ip-card--medium { grid-column: span 6; }
.ip-card--small  { grid-column: span 4; }
.ip-card__number {
    font-family: 'Space Grotesk', sans-serif; font-size: 72px; font-weight: 700;
    line-height: 1; color: rgba(255,255,255,0.04); position: absolute;
    top: 24px; right: 28px; pointer-events: none; user-select: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.ip-card:hover .ip-card__number { transform: translateY(-4px); opacity: 0.06; }
.ip-card__layer-label {
    font-family: 'Space Grotesk', sans-serif; font-size: 11px; font-weight: 600;
    letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,0.45); margin-bottom: 14px;
}
.ip-card__icon {
    width: 48px; height: 48px; border-radius: 12px; background: rgba(255,52,3,0.1);
    display: flex; align-items: center; justify-content: center; margin-bottom: 20px; font-size: 22px;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}
.ip-card:hover .ip-card__icon { background: rgba(255,52,3,0.18); box-shadow: 0 0 20px rgba(255,52,3,0.15); }
.ip-card__name-vi { font-family: 'Space Grotesk', sans-serif; font-size: clamp(18px, 2vw, 22px); font-weight: 700; line-height: 1.3; margin-bottom: 4px; }
.ip-card--hero .ip-card__name-vi { font-size: clamp(22px, 2.5vw, 28px); }
.ip-card__name-en { font-family: 'Space Grotesk', sans-serif; font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.45); margin-bottom: 16px; letter-spacing: 0.3px; }
.ip-card__desc { font-size: 15px; line-height: 1.65; color: rgba(255,255,255,0.7); flex: 1; }
.ip-card--hero .ip-card__desc { font-size: 16px; color: rgba(255,255,255,0.8); }
.ip-card__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.ip-card__tag {
    font-family: 'Space Grotesk', sans-serif; font-size: 11px; font-weight: 600;
    letter-spacing: 0.5px; padding: 5px 12px; border-radius: 100px;
    background: rgba(255,52,3,0.1); color: #FF3403;
    transition: background 0.2s ease, transform 0.2s ease;
}
.ip-card__tag:hover { background: rgba(255,52,3,0.18); transform: translateY(-1px); }
.five-b-diagram { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.five-b-step {
    display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 10px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); transition: background 0.2s;
}
.five-b-step:hover { background: rgba(255,255,255,0.09); border-left: 2px solid #FF3403; padding-left: 14px; }
.five-b-step__num {
    font-family: 'Space Grotesk', sans-serif; font-size: 11px; font-weight: 700; color: #FF3403;
    background: rgba(255,52,3,0.12); width: 28px; height: 28px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.five-b-step__text { font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.85); }
.engine-steps { display: flex; flex-direction: column; gap: 5px; margin: 16px 0 0; }
.engine-step { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.engine-step:last-child { border-bottom: none; }
.engine-step__num { font-family: 'Space Grotesk', sans-serif; font-size: 13px; font-weight: 700; color: #FF3403; flex-shrink: 0; width: 22px; transition: transform 0.2s ease; }
.engine-step:hover .engine-step__num { transform: scale(1.1); }
.engine-step__text { font-size: 13px; color: rgba(255,255,255,0.7); }
.engine-step--loop .engine-step__num { color: rgba(255,255,255,0.3); }
.engine-step--loop .engine-step__text { color: rgba(255,255,255,0.3); font-style: italic; }
.mechanism-tags { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.mechanism-tag {
    display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 8px;
    font-family: 'Space Grotesk', sans-serif; font-size: 12px; font-weight: 600; letter-spacing: 0.2px;
}
.mechanism-tag--hot { background: rgba(255,52,3,0.08); border: 1px solid rgba(255,52,3,0.2); color: #ff8060; }
.mechanism-tag--happy { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.2); color: #34d399; }
.mechanism-tag--joy { background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.2); color: #fbbf24; }
.cadence-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.cadence-chip {
    font-family: 'Space Grotesk', sans-serif; font-size: 12px; font-weight: 600;
    padding: 6px 14px; border-radius: 100px; background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08); color: rgba(255,255,255,0.6);
}
.standards-checks { display: flex; flex-direction: column; gap: 7px; margin-top: 16px; }
.standards-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(255,255,255,0.7); }
.standards-check__icon {
    width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700;
}
.standards-check__icon--pass { background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.3); color: #34d399; }
.standards-check__icon--flag { background: rgba(255,52,3,0.12); border: 1px solid rgba(255,52,3,0.3); color: #ff8060; }
.standards-check__icon--list { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.5); }
.ai-flow { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; }
.ai-flow__step {
    display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 7px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
    font-family: 'Space Grotesk', sans-serif; font-size: 12px; font-weight: 600;
    color: rgba(255,255,255,0.6); letter-spacing: 0.3px;
}
.ai-flow__step--highlight { background: rgba(255,52,3,0.12); border-color: rgba(255,52,3,0.2); color: #ff8060; }
.ai-flow__arrow { padding-left: 12px; font-size: 11px; color: rgba(255,255,255,0.2); }
@media (max-width: 1024px) {
    .ip-card--hero { flex-direction: column; padding: 40px 32px; }
    .ip-card--hero .ip-card__visual { flex: none; width: 100%; }
    .ip-card--small { grid-column: span 6; }
}
@media (max-width: 768px) {
    .ip-grid { gap: 12px; }
    .ip-card--hero, .ip-card--medium, .ip-card--small { grid-column: span 12; }
    .ip-card { padding: 28px 24px 24px; }
    .ip-card--hero { padding: 32px 24px; }
    .ip-card__number { font-size: 48px; }
}
.ip-card { opacity: 0; transform: translateY(24px); animation: cardReveal 0.6s ease forwards; }
.ip-card:nth-child(1) { animation-delay: 0s; }
.ip-card:nth-child(2) { animation-delay: 0.08s; }
.ip-card:nth-child(3) { animation-delay: 0.16s; }
.ip-card:nth-child(4) { animation-delay: 0.24s; }
.ip-card:nth-child(5) { animation-delay: 0.32s; }
.ip-card:nth-child(6) { animation-delay: 0.40s; }
@keyframes cardReveal { to { opacity: 1; transform: translateY(0); } }

/* ===== ICON ENGINE FLYWHEEL ===== */
.flywheel-wrap {
    position: relative;
    width: 100%;
    max-width: 700px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
}
/* Center hub */
.flywheel-hub {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 160px; height: 160px;
    border-radius: 50%;
    background: rgba(255,52,3,0.08);
    border: 2px solid rgba(255,52,3,0.25);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    z-index: 2;
    box-shadow: 0 0 60px rgba(255,52,3,0.12);
}
.flywheel-hub__title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px; font-weight: 700; color: #FF3403;
    line-height: 1.2;
}
.flywheel-hub__sub {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px; font-weight: 500;
    color: rgba(255,255,255,0.5);
    margin-top: 4px; letter-spacing: 0.3px;
}
/* Circular ring connector */
.flywheel-ring {
    position: absolute;
    top: 50%; left: 50%;
    width: 420px; height: 420px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px dashed rgba(255,52,3,0.2);
    z-index: 0;
}
/* Nodes positioned around the circle */
.flywheel-node {
    position: absolute;
    width: 150px;
    text-align: center;
    z-index: 3;
}
.flywheel-node__card {
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 16px 12px 14px;
    transition: all 0.3s ease;
}
.flywheel-node__card:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,52,3,0.3);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(255,52,3,0.1);
}
.flywheel-node__num {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px; font-weight: 700;
    color: #FF3403; background: rgba(255,52,3,0.12);
    width: 26px; height: 26px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 8px;
}
.flywheel-node__vi {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px; font-weight: 700; color: #fff;
    line-height: 1.2; margin-bottom: 2px;
}
.flywheel-node__en {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px; font-weight: 500;
    color: rgba(255,255,255,0.4);
    margin-bottom: 6px;
}
.flywheel-node__desc {
    font-size: 11px; line-height: 1.4;
    color: rgba(255,255,255,0.55);
}
/* Arrow indicators between nodes */
.flywheel-arrow {
    position: absolute;
    color: rgba(255,52,3,0.4);
    font-size: 18px;
    z-index: 1;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
}
/* Desktop positions (6 nodes around circle, clock positions) */
.fw-pos-1 { top: -30px;  left: 50%;  transform: translateX(-50%); }
.fw-pos-2 { top: 15%;   right: -40px; }
.fw-pos-3 { bottom: 15%; right: -40px; }
.fw-pos-4 { bottom: -30px; left: 50%; transform: translateX(-50%); }
.fw-pos-5 { bottom: 15%; left: -40px; }
.fw-pos-6 { top: 15%;   left: -40px; }

/* Arrows between nodes (positioned on the ring path) */
.fw-arrow-1 { top: 5%;   right: 12%; transform: rotate(55deg); }
.fw-arrow-2 { top: 50%;  right: -4%; transform: translateY(-50%) rotate(90deg); }
.fw-arrow-3 { bottom: 5%; right: 12%; transform: rotate(125deg); }
.fw-arrow-4 { bottom: 5%; left: 12%;  transform: rotate(-125deg); }
.fw-arrow-5 { top: 50%;  left: -4%;  transform: translateY(-50%) rotate(-90deg); }
.fw-arrow-6 { top: 5%;   left: 12%;  transform: rotate(-55deg); }

/* Flywheel node stagger animation */
.flywheel-node { opacity: 0; transform-origin: center; }
.flywheel-section.visible .flywheel-node { animation: fwNodeIn 0.5s ease forwards; }
.flywheel-section.visible .fw-pos-1 { animation-delay: 0.1s; animation-name: fwNodeIn1; }
.flywheel-section.visible .fw-pos-2 { animation-delay: 0.2s; }
.flywheel-section.visible .fw-pos-3 { animation-delay: 0.3s; }
.flywheel-section.visible .fw-pos-4 { animation-delay: 0.4s; animation-name: fwNodeIn4; }
.flywheel-section.visible .fw-pos-5 { animation-delay: 0.5s; }
.flywheel-section.visible .fw-pos-6 { animation-delay: 0.6s; }
@keyframes fwNodeIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fwNodeIn1 {
    from { opacity: 0; transform: translateX(-50%) translateY(16px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes fwNodeIn4 {
    from { opacity: 0; transform: translateX(-50%) translateY(16px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Flywheel ring rotate animation */
.flywheel-ring {
    animation: fwRingSpin 30s linear infinite;
}
@keyframes fwRingSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* Mobile: stacked vertical flow */
@media (max-width: 768px) {
    .flywheel-wrap {
        aspect-ratio: unset;
        max-width: 400px;
        display: flex; flex-direction: column;
        gap: 0;
    }
    .flywheel-hub {
        position: relative;
        top: auto; left: auto;
        transform: none;
        margin: 0 auto 24px;
        width: 140px; height: 140px;
    }
    .flywheel-ring { display: none; }
    .flywheel-arrows { display: none; }
    .flywheel-node {
        position: relative !important;
        top: auto !important; bottom: auto !important;
        left: auto !important; right: auto !important;
        transform: none !important;
        width: 100%;
    }
    .flywheel-node__card {
        display: flex; align-items: center; gap: 14px;
        text-align: left; padding: 14px 16px;
    }
    .flywheel-node__num { margin-bottom: 0; flex-shrink: 0; }
    .flywheel-node__info { flex: 1; }
    .flywheel-node__vi { font-size: 15px; }
    .flywheel-node__desc { display: none; }
    .flywheel-mobile-arrow {
        display: flex; justify-content: center;
        color: rgba(255,52,3,0.35); font-size: 18px;
        padding: 4px 0;
        font-family: 'Space Grotesk', sans-serif;
    }
    .flywheel-mobile-loop {
        display: flex; justify-content: center;
        margin-top: 8px;
    }
    .flywheel-mobile-loop span {
        font-family: 'Space Grotesk', sans-serif;
        font-size: 12px; font-weight: 600;
        color: rgba(255,52,3,0.4);
        padding: 6px 16px;
        border: 1px dashed rgba(255,52,3,0.2);
        border-radius: 100px;
    }
    /* Reset animation for mobile (no translateX needed) */
    .flywheel-section.visible .fw-pos-1,
    .flywheel-section.visible .fw-pos-4 {
        animation-name: fwNodeIn;
    }
}
/* Desktop: hide mobile-only elements */
@media (min-width: 769px) {
    .flywheel-mobile-arrow { display: none; }
    .flywheel-mobile-loop { display: none; }
}

/* Focus visible */
a:focus-visible, button:focus-visible, [role="button"]:focus-visible, [tabindex="0"]:focus-visible {
    outline: 2px solid #FF3403;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Reduced motion — also strips GPU-heavy blur for low-end devices */
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; }
    * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
    .glass { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: rgba(20,20,20,0.95) !important; }
    .nav-blur { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: rgba(10,10,10,0.97) !important; }
    .orb { display: none !important; }
    .btn-glow::before { display: none !important; }
}
