/* ===========================================================
   RuleFlow Landing - Fully Integrated Style
   Author : ChatGPT + Seong
   =========================================================== */

:root {
    --bg: #070b14;
    --surface: #0f1726;
    --surface2: #151f33;
    --line: rgba(255, 255, 255, .08);
    --text: #f7f9fc;
    --muted: #90a2be;
    --primary: #4da3ff;
    --primary2: #55d6ff;
    --success: #41d39d;
    --danger: #ff6d7a;
    --shadow: 0 20px 80px rgba(0, 0, 0, .45);
    --radius: 22px;
    --transition: .35s ease;
}

/* ===========================================================
   Reset & Base Styles
   =========================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

.container {
    width: min(1180px, 92%);
    margin: auto;
}

section {
    padding: 120px 0;
    position: relative;
}

/* Common Section Headers */
.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 60px;
}

.section-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(77, 163, 255, 0.1);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 20px;
    border: 1px solid rgba(77, 163, 255, 0.2);
}

.section-header h2 {
    font-size: 44px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -1.5px;
    margin-bottom: 20px;
}

.section-header p {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.6;
}

/* ===========================================================
   Background Elements
   =========================================================== */
.background-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: radial-gradient(circle at center, black 35%, transparent 90%);
    -webkit-mask-image: radial-gradient(circle at center, black 35%, transparent 90%);
    pointer-events: none;
    z-index: -20;
}

.background-glow {
    position: fixed;
    width: 700px;
    height: 700px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: .12;
    pointer-events: none;
    z-index: -30;
}

.glow-left {
    background: #2979ff;
    left: -220px;
    top: -180px;
}

.glow-right {
    background: #36d6ff;
    right: -180px;
    bottom: -250px;
}

/* ===========================================================
   Navigation Bar
   =========================================================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 999;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    background: rgba(7, 11, 20, .7);
    border-bottom: 1px solid rgba(255, 255, 255, .05);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 78px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 700;
    font-size: 22px;
}

.logo-icon {
    width: 34px;
    height: 34px;
    position: relative;
}

.logo-icon span {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary2));
}

.logo-icon span:nth-child(1) { left: 0; top: 13px; }
.logo-icon span:nth-child(2) { right: 0; top: 0; }
.logo-icon span:nth-child(3) { right: 0; bottom: 0; }

.logo-icon::before, .logo-icon::after {
    content: "";
    position: absolute;
    left: 6px;
    width: 18px;
    height: 2px;
}
.logo-icon::before { background: var(--primary); top: 17px; transform: rotate(-25deg); }
.logo-icon::after { background: var(--primary2); top: 18px; transform: rotate(25deg); }

.nav-links {
    display: flex;
    gap: 42px;
}

.nav-links a {
    color: var(--muted);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-links a:hover {
    color: white;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: .3s;
}

.nav-links a:hover::after {
    width: 100%;
}

/* ===========================================================
   Buttons
   =========================================================== */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: var(--transition);
    border: none;
}

.button-primary {
    padding: 14px 28px;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary2));
    box-shadow: 0 15px 45px rgba(61, 157, 255, .25);
}

.button-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 50px rgba(61, 157, 255, .4);
}

.button-secondary {
    padding: 14px 28px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .03);
    color: var(--text);
}

.button-secondary:hover {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .15);
}

.button-outline {
    border: 1px solid rgba(255, 255, 255, .15);
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 14px;
    background: transparent;
    color: var(--text);
}

.button-outline:hover {
    background: white;
    color: var(--bg);
}

/* ===========================================================
   Hero Section
   =========================================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 120px;
    padding-bottom: 60px;
}

.hero-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 60px;
    align-items: center;
}

/* Hero Left Content */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(77, 163, 255, .25);
    background: rgba(77, 163, 255, .08);
    color: #8ec9ff;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 28px;
}

.hero-badge .pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 12px var(--success);
    animation: h-pulse 2s infinite;
}

@keyframes h-pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(65, 211, 157, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(65, 211, 157, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(65, 211, 157, 0); }
}

.hero h1 {
    font-size: 64px;
    line-height: 1.1;
    letter-spacing: -2.5px;
    font-weight: 800;
}

.hero h1 span {
    background: linear-gradient(135deg, var(--primary), var(--primary2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    margin-top: 24px;
    color: var(--muted);
    line-height: 1.7;
    font-size: 18px;
}

.hero-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 34px;
}

.hero-list div {
    color: #dbe9ff;
    font-size: 15px;
    font-weight: 500;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    margin-top: 42px;
}

.hero-metrics {
    display: flex;
    gap: 40px;
    margin-top: 55px;
    border-top: 1px solid var(--line);
    padding-top: 30px;
}

.hero-metrics h3 {
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.hero-metrics span {
    font-size: 13px;
    color: var(--muted);
}

/* Hero Right Visual (Revit Fake UI) */
.hero-demo {
    display: flex;
    justify-content: center;
    perspective: 1600px;
}

.revit-window {
    width: 100%;
    max-width: 480px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(15, 23, 38, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
    transform: rotateX(6deg) rotateY(-8deg) rotateZ(1deg);
    transition: transform 0.5s ease;
}

.revit-window:hover {
    transform: rotateX(2deg) rotateY(-2deg) scale(1.02);
}

.window-header {
    height: 48px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.window-buttons {
    display: flex;
    gap: 8px;
}

.window-buttons span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.window-title {
    margin-left: 16px;
    font-size: 12px;
    color: #7f93b0;
    font-weight: 500;
}

/* Revit Window Interior */
.live-status, .property-panel {
    padding: 24px;
}

.status-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary2);
    margin-bottom: 16px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.status-item .success {
    color: var(--success);
    font-weight: bold;
}

.progress {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 14px;
}

.progress-bar {
    width: 75%;
    height: 100%;
    background: var(--primary);
    animation: bar-load 3s infinite ease-in-out;
}

@keyframes bar-load {
    0% { width: 10%; }
    50% { width: 85%; }
    100% { width: 10%; }
}

.property-panel {
    border-top: 1px solid rgba(255, 255, 255, .06);
    background: rgba(0, 0, 0, 0.15);
}

.panel-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
}

.panel-subtitle {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 10px;
}

.parameter-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .04);
    font-size: 13px;
}

.parameter-row span { color: #a0aec0; }
.parameter-row strong { color: #edf2f7; font-weight: 500; }
.parameter-row strong.success { color: var(--success); font-weight: 600; }

/* ===========================================================
   Trusted / Integrations Section
   =========================================================== */
.trusted {
    padding: 60px 0;
    background: rgba(255, 255, 255, 0.01);
    border-y: 1px solid var(--line);
    text-align: center;
}

.trusted p {
    font-size: 14px;
    color: var(--muted);
    letter-spacing: 0.05em;
    margin-bottom: 30px;
}

.trusted-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 60px;
    flex-wrap: wrap;
}

.trusted-item {
    font-size: 18px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: -0.5px;
    transition: color 0.3s;
}

.trusted-item:hover {
    color: rgba(255, 255, 255, 0.85);
}

/* ===========================================================
   Problem (Workflow VS) Section
   =========================================================== */
.problem-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 50px;
}

.workflow-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 40px;
    border: 1px solid var(--line);
}

.workflow-card h3 {
    font-size: 22px;
    margin-bottom: 30px;
    font-weight: 700;
}

.workflow-old h3 { color: var(--danger); }
.workflow-new {
    border-color: rgba(65, 211, 157, 0.2);
    box-shadow: 0 10px 40px rgba(65, 211, 157, 0.03);
}
.workflow-new h3 { color: var(--success); }

.workflow-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.workflow-item {
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    font-size: 15px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.workflow-old .workflow-item { border-left: 3px solid var(--danger); }
.workflow-new .workflow-item { 
    background: rgba(65, 211, 157, 0.04); 
    border: 1px solid rgba(65, 211, 157, 0.15);
    border-left: 3px solid var(--success);
}

.workflow-arrow {
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    opacity: 0.5;
}

/* ===========================================================
   Live Rule Engine Section
   =========================================================== */
.rule-layout {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 80px;
    align-items: center;
}

.rule-left h2 {
    font-size: 44px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 24px;
}

.rule-left p {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.7;
}

.rule-editor {
    background: #090e1a;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 30px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px; /* 가독성을 위해 폰트를 살짝 줄임 */
    line-height: 1.7;
    color: #ccd6f6;
    box-shadow: var(--shadow);
    
    /* 💡 틀 깨짐 방지 핵심 속성 */
    white-space: pre-wrap;       /* 무조건 가로로 늘어나지 않고 박스 너비에 맞춰 줄바꿈 */
    word-break: break-all;       /* 긴 영어 단어나 특수문자도 박스 끝에서 자연스럽게 끊어짐 */
    overflow-x: auto;            /* 만약의 상황에서 가로 스크롤바 허용 */
    max-width: 100%;             /* 부모 요소인 .rule-right 너비를 절대 넘지 않음 */
}

/* ===========================================================
   Features Section
   =========================================================== */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 35px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.15);
    background: var(--surface2);
}

.feature-icon {
    font-size: 28px;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}

/* ===========================================================
   Workflow Steps Section
   =========================================================== */
.flow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 40px;
    gap: 20px;
}

.flow-box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 30px;
    flex: 1;
    position: relative;
}

.flow-number {
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.01));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: absolute;
    top: 15px;
    right: 20px;
}

.flow-box h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: white;
}

.flow-box p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.flow-line {
    height: 2px;
    background: var(--line);
    flex: 0.3;
    max-width: 50px;
}

/* ===========================================================
   FAQ Section
   =========================================================== */
.faq-grid {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.faq-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 24px 30px;
}

.faq-item h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: white;
}

.faq-item p {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}

/* ===========================================================
   Final CTA Section
   =========================================================== */
.final-cta {
    padding-bottom: 120px;
}

.cta-box {
    background: linear-gradient(135deg, #0f1c36, #070b14);
    border: 1px solid rgba(77, 163, 255, 0.2);
    border-radius: var(--radius);
    padding: 80px 40px;
    text-align: center;
    box-shadow: var(--shadow);
}

.cta-box h2 {
    font-size: 40px;
    font-weight: 800;
    margin-bottom: 16px;
}

.cta-box p {
    color: var(--muted);
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto 40px;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* ===========================================================
   Footer Section
   =========================================================== */
.footer {
    background: #04070d;
    border-top: 1px solid var(--line);
    padding: 80px 0 40px;
}

.footer-layout {
    display: flex;
    justify-content: space-between;
    margin-bottom: 60px;
}

.footer-brand .logo-text {
    font-size: 20px;
    font-weight: 700;
}

.footer-brand p {
    margin-top: 12px;
    color: var(--muted);
    font-size: 14px;
}

.footer-links {
    display: flex;
    gap: 80px;
}

.footer-links h4 {
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin-bottom: 16px;
}

.footer-links a {
    display: block;
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 10px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    padding-top: 30px;
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.25);
}

/* ===========================================================
   Responsive Settings (Mobile Optimization)
   =========================================================== */
@media (max-width: 968px) {
    section { padding: 80px 0; }
    .section-header h2 { font-size: 32px; }
    
    .hero-layout, .problem-grid, .rule-layout {
        grid-template-columns: 1fr;
        gap: 50px;
    }
    
    .hero h1 { font-size: 46px; }
    .hero-demo { order: -1; } /* Mobile reads visual first */
    
    .feature-grid, .flow {
        grid-template-columns: 1fr;
        flex-direction: column;
    }
    .flow-line { display: none; }
    .flow-box { width: 100%; }
    
    .footer-layout {
        flex-direction: column;
        gap: 40px;
    }
}