/* --- :root Variables --- */
:root {
    /* Colors */
    --primary-color: #00bcd4;       /* Main accent color (Teal) */
    --primary-hover: #4dd0e1;       /* Lighter accent for hover */
    --dark-base: #0b0f19;           /* Deep dark background */
    --light-text: #edf2f4;          /* Primary light text */
    --medium-text: #adb5bd;         /* Secondary text (paragraphs) */
    --subtle-text: #8d99ae;         /* Less prominent text (keywords, footer) */
    --dark-text: #111;              /* Text for light backgrounds (e.g., buttons) */
    --section-bg: rgba(25, 32, 45, 0.85); /* Slightly transparent dark blue-grey */
    --alt-section-bg: rgba(35, 42, 55, 0.9); /* Slightly darker/more opaque version */
    --header-bg: rgba(11, 15, 25, 0.8);   /* Header background with blur */
    --footer-bg: rgba(11, 15, 25, 0.9);   /* Footer background */
    --chat-bg: rgba(15, 20, 30, 0.9);    /* Background for chat history/input area */
    --ai-message-bg: rgba(40, 50, 70, 0.9); /* AI message bubble background */
    --user-message-bg: rgba(0, 100, 120, 0.9); /* User message bubble background (using accent shade) */

    /* Shadows */
    --shadow-color-light: rgba(0, 0, 0, 0.3);
    --shadow-color-medium: rgba(0, 0, 0, 0.5);
    --accent-shadow-color: rgba(0, 188, 212, 0.4); /* Shadow matching accent */
    --accent-shadow-hover: rgba(0, 188, 212, 0.6);

    /* Fonts */
    --font-primary: 'Poppins', sans-serif;

    /* Transitions */
    --transition-speed-fast: 0.2s;
    --transition-speed-normal: 0.4s;
    --transition-easing: cubic-bezier(0.25, 0.8, 0.25, 1); /* Smooth easing */
}

/* --- Base & Resets --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    line-height: 1.7;
    color: var(--light-text);
    background-color: var(--dark-base); /* Fallback background */
    background-image: linear-gradient(rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.9)), url('https://images.unsplash.com/photo-1519389950473-47ba0277781c?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwyMDg4MDh8MHwxfHNlYXJjaHwxfHx0ZWNobm9sb2d5JTIwYWJzdHJhY3R8ZW58MHx8fHwxNjE2NzY0NTU0&ixlib=rb-1.2.1&q=80&w=1920');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    overflow-x: hidden;
}

/* --- Utility & Container --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 30px;
}

.content-section {
    padding: 80px 0;
    position: relative;
    background-color: var(--section-bg);
    backdrop-filter: blur(8px);
    margin: 50px auto;
    border-radius: 10px;
    box-shadow: 0 8px 30px var(--shadow-color-medium);
    max-width: 1200px;
    padding-left: 30px;
    padding-right: 30px;
}

.content-section.alt-bg {
     background-color: var(--alt-section-bg);
}

h1, h2, h3 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 20px;
    text-shadow: 1px 1px 4px var(--shadow-color-light);
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 50px;
}

h3 {
    font-size: 1.5rem;
    color: var(--light-text);
    margin-bottom: 10px;
}

p {
    margin-bottom: 15px;
    font-size: 1rem;
    color: var(--medium-text);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed-fast) ease;
}

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

.highlight {
    color: var(--primary-color);
    font-weight: 600;
}

/* --- Header --- */
header {
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    color: var(--light-text);
    padding: 15px 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 3px 15px var(--shadow-color-medium);
    transition: background var(--transition-speed-normal) ease;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

header nav ul {
    list-style: none;
    display: flex;
}

header nav ul li {
    margin-left: 30px;
}

header nav ul li a {
    color: var(--light-text);
    padding-bottom: 5px;
    transition: color var(--transition-speed-fast) ease, border-bottom-color var(--transition-speed-fast) ease;
    border-bottom: 2px solid transparent;
    font-weight: 400;
}

header nav ul li a:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* --- Hero Section --- */
#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 0 20px;
    color: var(--light-text);
    margin-top: 70px;
    overflow: hidden;
}

.hero-content {
    z-index: 2;
    max-width: 850px;
    animation: fadeInUp 1s var(--transition-easing) forwards;
    opacity: 0;
}

#hero h1 {
    font-size: 3.8rem;
    margin-bottom: 15px;
    font-weight: 700;
    line-height: 1.1;
}

#hero .subtitle {
    font-size: 1.5rem;
    margin-bottom: 35px;
    color: var(--light-text);
    font-weight: 300;
}

.cta-button {
    display: inline-block;
    background: var(--primary-color);
    color: var(--dark-text);
    padding: 14px 35px;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all var(--transition-speed-normal) var(--transition-easing);
    box-shadow: 0 5px 20px var(--accent-shadow-color);
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    background: var(--primary-hover);
    color: var(--dark-text);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 25px var(--accent-shadow-hover);
}

.hero-button {
     margin-top: 25px;
}

.scroll-down-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
}
.scroll-down-indicator span {
  display: block;
  width: 20px;
  height: 20px;
  border-bottom: 3px solid var(--primary-color);
  border-right: 3px solid var(--primary-color);
  transform: rotate(45deg);
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0) rotate(45deg); }
  40% { transform: translateY(-10px) rotate(45deg); }
  60% { transform: translateY(-5px) rotate(45deg); }
}


/* --- Principles Section --- */
#principles {
    perspective: 1200px;
}

.principles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 35px;
    margin-top: 50px;
}

.principle-item {
    background: rgba(45, 55, 70, 0.9);
    padding: 35px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px var(--shadow-color-light);
    transition: transform var(--transition-speed-normal) var(--transition-easing),
                box-shadow var(--transition-speed-normal) var(--transition-easing);
    transform-style: preserve-3d;
    opacity: 0;
    animation: fadeInUp 0.8s var(--transition-easing) forwards;
}
.principle-item:nth-child(1) { animation-delay: 0.2s; }
.principle-item:nth-child(2) { animation-delay: 0.4s; }
.principle-item:nth-child(3) { animation-delay: 0.6s; }
.principle-item:nth-child(4) { animation-delay: 0.8s; }

.principle-item:hover {
    transform: translateY(-12px) rotateY(8deg) scale(1.05);
    box-shadow: 0 12px 30px var(--shadow-color-medium);
}

.principle-item .icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--primary-color);
    display: block;
}

/* --- Facey UI Section --- */
#interaction-container {
    max-width: 800px;
    margin: 40px auto 0 auto;
    background: var(--chat-bg);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#chat-interface {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

#chat-history {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.message {
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 80%;
    line-height: 1.5;
    word-wrap: break-word;
}

.message .sender {
    font-weight: 600;
    display: block;
    margin-bottom: 3px;
    font-size: 0.9em;
}

.message .text {
    font-size: 1rem;
}

.ai-message {
    background-color: var(--ai-message-bg);
    color: var(--light-text);
    border-bottom-left-radius: 5px;
    align-self: flex-start;
}
.ai-message .sender {
    color: var(--primary-color);
}

.user-message {
    background-color: var(--user-message-bg);
    color: #fff;
    border-bottom-right-radius: 5px;
    align-self: flex-end;
}
.user-message .sender {
    color: rgba(255, 255, 255, 0.8);
}


#input-area {
    display: flex;
    align-items: stretch;
    padding: 15px;
    background-color: rgba(10, 15, 25, 0.9);
}

#chat-input {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    background-color: rgba(50, 60, 80, 0.8);
    color: var(--light-text);
    font-family: var(--font-primary);
    font-size: 1rem;
    resize: none;
    margin-right: 10px;
    line-height: 1.4;
    max-height: 100px;
    overflow-y: auto;
}
#chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(0, 188, 212, 0.5);
}

#input-area button {
    background: var(--primary-color);
    color: var(--dark-text);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color var(--transition-speed-fast) ease, transform var(--transition-speed-fast) ease;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

#input-area button:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

#multimodal-controls {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 15px;
    background-color: rgba(10, 15, 25, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9em;
    color: var(--subtle-text);
}

#multimodal-controls button {
    background: none;
    border: 1px solid var(--subtle-text);
    color: var(--subtle-text);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition-speed-fast) ease;
    font-size: 0.9em;
}
#multimodal-controls button:hover:not(:disabled) {
    background-color: var(--primary-color);
    color: var(--dark-text);
    border-color: var(--primary-color);
}
#multimodal-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
#multimodal-controls button i {
    margin-right: 5px;
}

#multimodal-controls div { /* This targets #gesture-status and #ai-status */
    display: flex;
    align-items: center;
    gap: 5px;
}
#multimodal-controls div i {
    font-size: 1.1em;
}

#ai-status i { /* The FontAwesome icon */
    animation: pulseStatus 2s infinite ease-in-out;
}


/* --- Call to Action Section --- */
.cta-section {
    text-align: center;
    background: linear-gradient(to bottom, rgba(0, 188, 212, 0.05), rgba(0, 188, 212, 0.15)), var(--section-bg);
    padding-top: 100px;
    padding-bottom: 100px;
}
.cta-section h2 { color: var(--light-text); font-size: 2.8rem; }
.cta-section p { max-width: 700px; margin-left: auto; margin-right: auto; color: var(--medium-text); font-size: 1.1rem; }
.cta-section .cta-button { margin-top: 30px; padding: 16px 40px; }
.keywords { margin-top: 40px; font-size: 0.9rem; color: var(--subtle-text); font-style: italic; max-width: 800px; margin-left: auto; margin-right: auto; }


/* --- Footer --- */
footer {
    text-align: center;
    padding: 40px 0;
    margin-top: 80px;
    background: var(--footer-bg);
    color: var(--subtle-text);
    font-size: 0.9rem;
}
footer p small { display: block; margin-top: 8px; color: #6c757d; }


/* --- Animation Keyframes --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseStatus {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* --- Spinner Styles (NEW) --- */
.spinner {
    border: 3px solid rgba(0, 188, 212, 0.3); /* Lighter primary color for track */
    border-left-color: var(--primary-color);   /* Solid primary color for spinning part */
    border-radius: 50%;
    width: 16px;  /* Adjust size as needed to fit nicely */
    height: 16px; /* Adjust size as needed */
    animation: spin 0.8s linear infinite;
    display: inline-block; /* Allows it to sit next to text */
    vertical-align: middle; /* Aligns with text */
    margin-right: 8px; /* Space between spinner and "Processing..." text */
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* --- Responsiveness --- */
@media (max-width: 992px) {
    .content-section { margin-left: 20px; margin-right: 20px; max-width: calc(100% - 40px); }
}

@media (max-width: 768px) {
    #hero h1 { font-size: 2.8rem; }
    #hero .subtitle { font-size: 1.2rem; }
    h2 { font-size: 2rem; }
    .content-section { padding: 60px 0; margin: 30px auto; }
    header .container { flex-direction: column; }
    header .logo { margin-bottom: 15px; }
    header nav ul { justify-content: center; flex-wrap: wrap; }
    header nav ul li { margin: 5px 15px; }
    .principles-grid { grid-template-columns: 1fr; gap: 25px; }
    #principles { perspective: none; }
    .principle-item:hover { transform: translateY(-8px); }
    .cta-section h2 { font-size: 2.2rem; }
    .cta-section p { font-size: 1rem; }
    #chat-history { height: 350px; }
    #multimodal-controls { flex-direction: column; gap: 10px; align-items: center; }
}

@media (max-width: 480px) {
     #hero h1 { font-size: 2.2rem; }
     #hero .subtitle { font-size: 1rem; }
     .cta-button, .hero-button { padding: 12px 28px; font-size: 0.9rem; }
    h2 { font-size: 1.8rem; margin-bottom: 30px; }
    .content-section { border-radius: 5px; margin-left: 10px; margin-right: 10px; max-width: calc(100% - 20px); }
    header nav ul li { margin: 5px 10px; }
    #chat-history { height: 300px; padding: 15px; }
    #input-area { padding: 10px; }
    #chat-input { padding: 8px 12px; }
    #input-area button { width: 40px; height: 40px; }
}