/* Minimal Architecture Design System - Black & White Excellence */

:root {
    /* Pure Architecture Palette */
    --background: #FFFFFF;
    --foreground: #000000;
    --card: #FFFFFF;
    --card-foreground: #000000;
    --popover: #FFFFFF;
    --popover-foreground: #000000;
    --primary: #000000;
    --primary-foreground: #FFFFFF;
    --secondary: #F8F9FA;
    --secondary-foreground: #000000;
    --muted: #F8F9FA;
    --muted-foreground: #71717A;
    --accent: #F8F9FA;
    --accent-foreground: #000000;
    --destructive: #FFFFFF;
    --destructive-foreground: #000000;
    --border: #E4E4E7;
    --input: #E4E4E7;
    --ring: #000000;

    --radius: 0.5rem;

    /* Architecture Gradients */
    --gradient-hero: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.7));
    --gradient-overlay: linear-gradient(180deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.1));

    /* Elegant Shadows */
    --shadow-architectural: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-elegant: 0 10px 30px -10px rgba(0, 0, 0, 0.15);

    /* Smooth Transitions */
    --transition-smooth: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border-color: var(--border);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Architectural Typography */
.text-architectural {
    letter-spacing: -0.02em;
    line-height: 1.1;
    font-weight: 300;
}

.text-minimal {
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 400;
}

/* Animations */
@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(2rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    animation: reveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    /* Start hidden */
}

.reveal-delayed {
    animation: reveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
    opacity: 0;
    /* Start hidden */
}

/* Navigation */
.navbar {
    background: var(--background);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(8px);
    background-color: rgba(255, 255, 255, 0.9);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    text-decoration: none;
    color: inherit;
}

.logo h1 {
    font-size: 24px;
    font-weight: 300;
    color: var(--primary);
    letter-spacing: 0.05em;
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--foreground);
    font-weight: 400;
    font-size: 14px;
    transition: var(--transition-fast);
    letter-spacing: -0.01em;
}

.nav-links a:hover {
    color: var(--muted-foreground);
}

.nav-links a.active {
    background: var(--primary);
    color: var(--primary-foreground) !important;
    padding: 10px 24px;
    border-radius: var(--radius);
}

.btn-demo {
    background: var(--primary);
    color: var(--primary-foreground) !important;
    padding: 10px 24px;
    border-radius: var(--radius);
    transition: var(--transition-fast);
}

.btn-demo:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: var(--shadow-elegant);
}

/* Hero Section */
.hero {
    background: var(--foreground);
    /* Fallback */
    background: var(--gradient-hero);
    color: var(--background);
    padding: 160px 0 140px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Hero Overlay Effect */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-overlay);
    opacity: 0.5;
    pointer-events: none;
}

.hero>.container {
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 64px;
    font-weight: 300;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 20px;
    margin-bottom: 48px;
    opacity: 0.9;
    font-weight: 300;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.btn-primary {
    background: var(--background);
    color: var(--foreground);
    padding: 16px 40px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    display: inline-block;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-architectural);
    background: transparent;
    border-color: var(--background);
    color: var(--background);
}

/* Solutions Section */
.solutions {
    padding: 60px 0 120px;
    background: var(--muted);
}

.section-header {
    text-align: center;
    margin-bottom: 32px;
}

.section-header h2 {
    font-size: 42px;
    font-weight: 300;
    margin-bottom: 16px;
    color: var(--foreground);
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 18px;
    color: var(--muted-foreground);
    max-width: 700px;
    margin: 0 auto;
    font-weight: 300;
    min-height: 54px; /* Ensure consistent Y-position for grid across pages */
}

.solutions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 350px);
    justify-content: center;
    gap: 32px;
}

/* Solution Cards */
.solution-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 30px 40px;
    /* Reduced vertical padding from 48px */
    border: 1px solid var(--border);
    transition: var(--transition-smooth);
    position: relative;
    display: flex;
    flex-direction: column;
}

.solution-card:hover {
    /* transform: translateY(-8px); Removed hover movement */
    box-shadow: var(--shadow-architectural);
    border-color: var(--primary);
}

.solution-card.featured {
    border-color: var(--destructive);
    box-shadow: var(--shadow-elegant);
}

.card-badge {
    position: absolute;
    top: 24px;
    right: 24px;
    background: var(--destructive);
    color: var(--destructive-foreground);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.card-icon {
    width: 64px;
    height: 64px;
    background: var(--muted);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    /* Reduced margin from 32px */
    color: var(--primary);
    transition: var(--transition-fast);
}

.solution-card:hover .card-icon {
    background: var(--primary);
    color: var(--primary-foreground);
}

.card-title {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 16px;
    color: var(--card-foreground);
    letter-spacing: -0.02em;
}

.card-description {
    font-size: 16px;
    color: var(--muted-foreground);
    margin-bottom: 32px;
    line-height: 1.6;
    font-weight: 300;
}

.card-features {
    list-style: none;
    margin-bottom: 40px;
}

.card-features li {
    padding: 4px 0;
    padding-left: 28px;
    position: relative;
    color: var(--muted-foreground);
    font-size: 15px;
    font-weight: 300;
}

.card-features li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary); /* Changed from var(--destructive) which was white/invisible */
    font-weight: 500;
    font-size: 16px;
}

.btn-card {
    display: inline-block;
    width: 100%;
    text-align: center;
    background: var(--primary);
    color: var(--primary-foreground);
    padding: 16px 24px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.05em;
    transition: var(--transition-fast);
    text-transform: uppercase;
    margin-top: auto; /* Align buttons at bottom across cards */
}

.btn-card:hover {
    background: var(--muted-foreground);
    transform: translateY(-1px);
}

/* Features Section */
.features {
    padding: 60px 0;
    background: var(--background);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 64px;
}

.feature-item {
    text-align: center;
    padding: 0 16px;
    transition: var(--transition-fast);
}

.feature-item h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--foreground);
    font-weight: 600;
    letter-spacing: -0.01em;
    background: var(--muted);
    border: 1px solid var(--border);
    padding: 20px 32px;
    border-radius: 50px;
    display: block;
    width: 100%;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
    transition: var(--transition-fast);
    white-space: nowrap;
}





.feature-item p {
    color: var(--muted-foreground);
    font-size: 15px;
    line-height: 1.7;
}

/* Contact Form Section */
.contact {
    padding: 120px 0;
    background: var(--bg-white);
}

.contact-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    background: var(--card);
    padding: 48px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-elegant);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--input);
    font-family: inherit;
    font-size: 15px;
    color: var(--foreground);
    transition: var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--background);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.form-submit {
    grid-column: span 2;
    text-align: center;
    margin-top: 16px;
}

.form-submit .btn-primary {
    width: 100%;
    border: 1px solid var(--primary);
    cursor: pointer;
}

.form-submit .btn-primary:hover {
    background: var(--primary);
    color: var(--primary-foreground);
}

/* Footer */
.footer {
    background: var(--foreground);
    color: var(--background);
    padding: 24px 0 12px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.footer-section h3 {
    font-size: 20px;
    margin-bottom: 24px;
    font-weight: 300;
    letter-spacing: -0.02em;
}

.footer-section h4 {
    font-size: 14px;
    margin-bottom: 24px;
    color: var(--destructive);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

.footer-section p {
    opacity: 0.7;
    line-height: 1.7;
    font-weight: 300;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 16px;
}

.footer-section ul li a {
    color: var(--background);
    text-decoration: none;
    opacity: 0.6;
    transition: var(--transition-fast);
    font-weight: 300;
}

.footer-section ul li a:hover {
    opacity: 1;
    color: var(--destructive);
}

.footer-bottom {
    text-align: center;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.4;
    font-size: 13px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 40px;
    }

    .hero-subtitle {
        font-size: 18px;
        margin-bottom: 32px;
    }

    .section-header h2 {
        font-size: 32px;
    }

    .solutions-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
        /* Stack feature items vertically */
        gap: 16px;
        margin-top: 40px;
    }

    .feature-item h3 {
        white-space: normal;
        /* Allow text to wrap on mobile */
        max-width: 100%;
        /* Ensure it doesn't overflow container */
        padding: 16px 20px;
        /* Reduced padding */
        font-size: 15px;
    }

    .contact-form {
        grid-template-columns: 1fr;
        padding: 32px 24px;
    }

    .form-group.full-width {
        grid-column: span 1;
    }

    .form-submit {
        grid-column: span 1;
    }

    .nav-links {
        gap: 20px;
    }

    .nav-links a {
        font-size: 13px;
    }

    .navbar {
        padding: 16px 0;
    }

    .solution-card {
        padding: 32px 24px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 100px 0 80px;
    }

    .hero-title {
        font-size: 32px;
    }

    .section-header h2 {
        font-size: 28px;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: var(--primary);
    color: var(--primary-foreground);
}

/* ================================================================
   Upstage-style App Shell — top bar + left sidebar + content frame
   ================================================================ */

:root {
    --app-accent: #0066CC;
    --app-accent-hover: #0071E3;
    --app-accent-soft: #EFF6FF;
    --app-text: #101828;
    --app-text-secondary: #475467;
    --app-text-muted: #98A2B3;
    --app-bg: #F7F8FA;
    --app-surface: #FFFFFF;
    --app-border: #E4E7EC;
    --app-border-strong: #D0D5DD;
    --app-sidebar-width: 248px;
    --app-topbar-height: 60px;
    --ff-app: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* App body layout — used on index.html */
body.app-shell {
    margin: 0;
    padding: 0;
    background: var(--app-bg);
    color: var(--app-text);
    font-family: var(--ff-app);
    overflow: hidden;
    height: 100vh;
}

/* Top bar */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--app-topbar-height);
    background: var(--app-surface);
    border-bottom: 1px solid var(--app-border);
    z-index: 100;
}

.topbar-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.topbar-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--app-text);
}

.topbar-logo img {
    height: 28px;
    width: auto;
    display: block;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-user {
    font-size: 13px;
    color: var(--app-text-secondary);
}

/* === Topbar user menu (dropdown) === */
.topbar-user-menu {
    position: relative;
}

.topbar-user-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--ff-app);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 12px;
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    color: var(--app-text);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.topbar-user-toggle:hover {
    border-color: var(--app-border-strong);
}

.topbar-user-toggle .topbar-user {
    color: inherit;
}

.topbar-user-chevron {
    width: 12px;
    height: 12px;
    color: var(--app-text-secondary);
    transition: transform 0.15s;
}

.topbar-user-menu.open .topbar-user-chevron {
    transform: rotate(180deg);
}

.topbar-user-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 160px;
    padding: 6px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(16, 24, 40, 0.08), 0 10px 20px -4px rgba(16, 24, 40, 0.06);
    display: none;
    z-index: 200;
}

.topbar-user-menu.open .topbar-user-dropdown {
    display: block;
}

.topbar-user-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    font-family: var(--ff-app);
    font-size: 13px;
    color: var(--app-text);
    background: transparent;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.12s;
}

.topbar-user-menu-item[hidden] {
    display: none;
}

.topbar-user-menu-item:hover {
    background-color: rgba(16, 24, 40, 0.05);
}

.topbar-user-menu-logout {
    color: #c0392b;
}

.topbar-user-menu-logout:hover {
    background-color: rgba(192, 57, 43, 0.08);
}

.topbar-user-menu-admin {
    color: #0066CC;
    font-weight: 500;
}

.topbar-user-menu-admin:hover {
    background-color: rgba(0, 102, 204, 0.08);
}

.topbar-user-menu-divider {
    height: 1px;
    margin: 4px 6px;
    background-color: rgba(16, 24, 40, 0.08);
}

/* Sidebar */
.app-sidebar {
    position: fixed;
    top: var(--app-topbar-height);
    left: 0;
    bottom: 0;
    width: var(--app-sidebar-width);
    background: var(--app-surface);
    border-right: 1px solid var(--app-border);
    overflow-y: auto;
    padding: 16px 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
}

.sb-group {
    margin-bottom: 1px;
}

.sb-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: calc(100% - 16px);
    margin: 6px 8px 1px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-family: var(--ff-app);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--app-text-muted);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, color 0.15s;
}

.sb-group-header:hover {
    background: var(--app-bg);
    color: var(--app-text-secondary);
}

.sb-group-header.active {
    color: var(--app-accent);
}

.sb-group-chevron {
    margin-left: auto;
    width: 12px;
    height: 12px;
    transition: transform 0.2s;
}

.sb-group.collapsed .sb-group-chevron {
    transform: rotate(-90deg);
}

.sb-group.collapsed .sb-items {
    display: none;
}

.sb-items {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 8px 2px;
}

.sb-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--app-text-secondary);
    font-size: 13.5px;
    font-weight: 400;
    line-height: 1.3;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
    background: none;
    border: none;
    text-align: left;
    width: 100%;
    font-family: var(--ff-app);
}

.sb-item:hover {
    background: var(--app-bg);
    color: var(--app-text);
}

.sb-item.active {
    background: var(--app-accent-soft);
    color: var(--app-accent);
    font-weight: 500;
}

.sb-item-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--app-text-muted);
    flex-shrink: 0;
}

.sb-item.active .sb-item-dot {
    background: var(--app-accent);
}

/* Recent Keywords (per-user history) */
.sb-recent {
    border-top: 1px solid var(--app-border);
    margin-top: 8px;
    padding-top: 4px;
}

.rk-list {
    padding: 0 8px 8px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.rk-row {
    display: flex;
    align-items: center;
    border-radius: 6px;
    transition: background 0.15s;
}

.rk-row:hover {
    background: var(--app-bg);
}

.rk-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 4px 5px 12px;
    border-radius: 6px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    flex: 1;
    min-width: 0;
    transition: background 0.15s;
    font-family: var(--ff-app);
    line-height: 1.3;
}

.rk-row .rk-item:hover {
    background: transparent;
}

.rk-item:hover {
    background: var(--app-bg);
}

.rk-delete {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--app-text-muted);
    padding: 4px 6px;
    margin-right: 2px;
    font-size: 11px;
    line-height: 1;
    border-radius: 4px;
    opacity: 0.35;
    transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.rk-row:hover .rk-delete {
    opacity: 1;
}

.rk-delete:hover {
    color: #e53e3e;
    background: rgba(229, 62, 62, 0.12);
}

.rk-item .rk-keyword {
    font-size: 13px;
    color: var(--app-text);
    font-weight: 400;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 auto;
    min-width: 0;
}

.rk-item .rk-ts {
    font-size: 11px;
    color: var(--app-text-muted);
    line-height: 1.3;
    flex-shrink: 0;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

.rk-item .rk-app {
    font-size: 11px;
    font-weight: 400;
    color: var(--app-text-muted);
    line-height: 1.3;
    flex-shrink: 0;
}

.rk-item.active .rk-app {
    color: var(--app-accent);
}

.rk-empty {
    font-size: 12px;
    color: var(--app-text-muted);
    padding: 6px 12px;
}

/* Content area */
.app-content {
    position: fixed;
    top: var(--app-topbar-height);
    left: var(--app-sidebar-width);
    right: 0;
    bottom: 0;
    background: var(--app-bg);
    overflow: hidden;
}

.app-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: var(--app-bg);
}

/* Mobile — collapse sidebar to off-canvas */
@media (max-width: 900px) {
    :root {
        --app-sidebar-width: 220px;
    }

    .app-sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.08);
    }

    .app-sidebar.open {
        transform: translateX(0);
    }

    .app-content {
        left: 0;
    }

    .topbar-burger {
        display: inline-flex !important;
    }
}

.topbar-burger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    border-radius: 8px;
    cursor: pointer;
    margin-right: 8px;
    color: var(--app-text);
    padding: 0;
}

/* Mobile sidebar backdrop — dims content behind the off-canvas drawer */
.app-sidebar-backdrop {
    display: none;
    position: fixed;
    top: var(--app-topbar-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 45;
}

@media (max-width: 900px) {
    .app-sidebar-backdrop.show {
        display: block;
    }
}
