/* mathdance - AI Consulting Website */

/* Color Variables */
:root {
    --text-dark: #4a4a4a;
    --highlight: #f5f5f5;
    --accent: #FF2D55;
    --background: #fcfcfc;
    --white: #ffffff;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--background);
    color: var(--text-dark);
    line-height: 1.7;
    font-size: 17px;
}

/* Typography */
h1, h2, h3 {
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.3;
}

h1 {
    font-size: 2.75rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.875rem;
    margin-bottom: 0.75rem;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 1rem;
}

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

a:hover {
    opacity: 0.8;
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--white);
    box-shadow: 0 0 10px var(--highlight);
    z-index: 100;
}

nav {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-dark);
}

.logo:hover {
    color: var(--text-dark);
    opacity: 1;
}

.logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-dark);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-links a {
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.9375rem;
}

.nav-links a:hover {
    color: var(--accent);
    opacity: 1;
}

/* Main Content */
main {
    padding-top: 80px;
}

section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 5rem 2rem;
}

.section-intro {
    font-size: 1.125rem;
    opacity: 0.8;
    margin-bottom: 3rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 8rem 2rem 6rem;
    max-width: 900px;
}

.hero-tagline {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero h1 {
    margin-bottom: 1.5rem;
}

.hero-sub {
    font-size: 1.25rem;
    opacity: 0.8;
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

/* Hero Input */
.hero-input {
    display: flex;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
    background-color: var(--white);
    border-radius: 50px;
    box-shadow: 0 0 10px var(--highlight);
    border: 1px solid var(--highlight);
    padding: 0.5rem 0.5rem 0.5rem 1.5rem;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.hero-input:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 45, 85, 0.1);
}

.hero-input input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    color: var(--text-dark);
    background: transparent;
}

.hero-input input::placeholder {
    color: var(--text-dark);
    opacity: 0.5;
}

/* Send Button */
.send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background-color: var(--accent);
    color: var(--white);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 45, 85, 0.3);
}

.send-btn:active {
    transform: scale(0.98);
}

/* Services Section */
.services {
    text-align: center;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    text-align: left;
}

/* Card */
.card {
    background-color: var(--white);
    box-shadow: 0 0 10px var(--highlight);
    border-radius: 10px;
    padding: 2rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.card-icon {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 1rem;
}

.card h3 {
    margin-bottom: 0.75rem;
}

.card p {
    font-size: 0.9375rem;
    opacity: 0.85;
    margin-bottom: 0;
    line-height: 1.6;
}

/* About Section */
.about {
    background-color: var(--white);
    max-width: 100%;
}

.about-content {
    max-width: 680px;
    margin: 0 auto;
}

.about-lead {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.about p {
    opacity: 0.9;
}

.about-cta {
    margin-top: 2rem;
    font-size: 1.125rem;
    opacity: 1 !important;
}

/* Contact Section */
.contact {
    text-align: center;
}

.contact-content {
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.contact-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    opacity: 0.6;
}

.contact-item a,
.contact-item span:not(.contact-label) {
    font-size: 1.125rem;
}

.contact-item a {
    color: var(--accent);
    font-weight: 500;
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem 2rem;
    border-top: 1px solid var(--highlight);
}

footer p {
    font-size: 0.875rem;
    opacity: 0.6;
    margin-bottom: 0;
}

footer a {
    color: var(--text-dark);
    opacity: 0.8;
}

/* Chat View */
.chat-view {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 480px;
    height: 100vh;
    background-color: var(--white);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.chat-view.open {
    transform: translateX(0);
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--highlight);
    flex-shrink: 0;
}

.chat-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-dark);
}

.chat-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-dark);
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.chat-close:hover {
    background-color: var(--highlight);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 85%;
    padding: 1rem 1.25rem;
    border-radius: 16px;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.message p {
    margin-bottom: 0;
}

.message.assistant {
    background-color: var(--highlight);
    color: var(--text-dark);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message.user {
    background-color: var(--accent);
    color: var(--white);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-input-container {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--highlight);
    gap: 0.75rem;
    flex-shrink: 0;
}

.chat-input-container input {
    flex: 1;
    border: 1px solid var(--highlight);
    border-radius: 24px;
    padding: 0.875rem 1.25rem;
    font-size: 0.9375rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-input-container input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 45, 85, 0.1);
}

.chat-input-container .send-btn {
    width: 44px;
    height: 44px;
}

/* Chat Overlay */
.chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.chat-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    nav {
        flex-wrap: wrap;
        padding: 1rem 1.5rem;
    }

    .hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
        padding-top: 1rem;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
        padding: 0.75rem 0;
        border-top: 1px solid var(--highlight);
    }

    main {
        padding-top: 80px;
    }

    section {
        padding: 3.5rem 1.5rem;
    }

    .hero {
        padding: 5rem 1.5rem 4rem;
    }

    .hero-sub {
        font-size: 1.125rem;
    }

    .hero-input {
        max-width: 100%;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .section-intro {
        margin-bottom: 2rem;
    }

    .chat-view {
        max-width: 100%;
    }
}
