* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0b1020;
    --card: #121a36;
    --ink: #e7ecff;
    --muted: #a7b0d8;
    --ok: #35c26b;
    --warn: #e5b454;
    --bad: #ff5a7a;

    --primary: #3182ce;
    --primary-dark: #2c5aa0;
    --danger: #e53e3e;
    --danger-dark: #c53030;
    --white: #fff;
    --gray: #4a5568;
    --gray-dark: #2d3748;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    color: var(--gray-dark);
    line-height: 1.6;
}

/* Header & Nav */
.header {
    background: var(--white);
    padding: 1rem 3rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #1a202c;
}

.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav a {
    text-decoration: none;
    color: var(--gray);
    font-weight: 500;
    transition: color 0.2s;
}

.nav a:hover {
    color: var(--gray-dark);
}

.nav .docs-link {
    color: var(--primary);
    font-weight: 600;
}

/* Buttons */
.btn-signup, .btn-default, .btn-danger {
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.2s;
    display: inline-block;
    text-align: center;
}

.btn-signup,
.btn-default {
    background: var(--primary);
    color: var(--white);
}

.btn-signup:hover,
.btn-default:hover {
    background: var(--primary-dark);
}

.btn-default,
.btn-danger {
    margin-top: 0.2rem;
    width: 80%;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: var(--danger-dark);
}

/* Hero */
.hero {
    text-align: center;
    padding: 4rem 2rem 3rem;
    max-width: 900px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    color: #1a202c;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.3rem;
    color: var(--gray);
    max-width: 700px;
    margin: 0 auto;
}

/* Card Layout */
.card {
    border: 1px solid #1e2a58;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    box-sizing: border-box;
}

.card .body,
.card .toolbar,
.card .prompt {
    padding: 16px;
}

.card .bold {
    font-size: x-large;
    font-weight: bold;
}

/* Face container */
.face-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 2rem 5rem;
    width: 100%;
    box-sizing: border-box;
}

/* Answer */
.answer p {
    margin-bottom: 1rem;
}

.answer p:last-child {
    margin-bottom: 0;
}

.answer strong {
    color: var(--gray-dark);
    font-weight: 700;
}

/* Feature List */
.feature-list li {
    padding: 0.5rem 0 0.5rem 2.25rem;
    position: relative;
}

.feature-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #22c55e;
    font-weight: 900;
    font-size: 1.2rem;
}

/* Highlighted box */
.highlight-box p {
    color: #78350f;
    font-weight: 600;
    margin: 0;
}

/* CTA (Call to Action) Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 4rem 2rem;
    text-align: center;
    margin-top: 3rem;
}

.cta-section h2 {
    color: var(--white);
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.cta-section p {
    color: #e6fffa;
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.btn-cta {
    background: var(--white);
    color: var(--primary);
    padding: 1.25rem 3rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.2rem;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Contact Note */
.contact-note {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin-top: 3rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.contact-note h3 {
    font-size: 1.5rem;
    color: #1a202c;
    margin-bottom: 0.75rem;
}

.contact-note p {
    color: var(--gray);
    font-size: 1.1rem;
}

.contact-note a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.contact-note a:hover {
    text-decoration: underline;
}

/* User ID */
.user_id {
    background: var(--white);
    padding: 0.2rem;
    border-radius: 12px;
    text-align: center;
    margin-top: 0.3rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.result {
    text-align: left;
    padding: 16px;
}

/* Stage/camera/video face overlay */
.stage {
    position: relative;
    width: 100%;
    max-width: 100vw;
    aspect-ratio: 4 / 3;
    box-sizing: border-box;
    overflow: hidden;
}

.stage video,
.stage canvas#overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    max-width: 100vw;
    max-height: 100vw;
    object-fit: cover;
    display: block;
    border-radius: 16px 16px 0 0;
    z-index: 0;
    pointer-events: none;
}

.stage canvas#overlay {
    z-index: 1;
}

.hidden {
    display: none;
}

/* Responsive */
@media (max-width: 600px) {
    .header, .logo, .nav {
        font-size: 90%;
    }

    .face-container {
        padding: 0.7em 0.2em 2em;
        max-width: 100vw;
    }

    .card {
        margin: 0.4em auto;
        border-radius: 8px;
    }

    .contact-note {
        padding: 0.5em !important;
        margin-top: 2em;
    }

    .stage {
        aspect-ratio: 3 / 4;
        /* Remove width:100vw! Use 100% and parent's width for safety */
        width: 100%;
        max-width: 100%;
        height: auto;
        margin: 0 auto;
        /* Optional: set max-height using 80vw for less vertical take-up
           or fix max-height using a CSS var or calculation with JS for better results
        */
        max-height: 100vw;
    }

    input, button, .prompt, .toolbar, label, .result {
        font-size: 1.12rem !important;
    }

    .btn-default, .btn-danger {
        min-height: 48px;
        font-size: 1.14em;
    }

    .card .body,
    .card .toolbar,
    .card .prompt {
        padding: 6px;
    }
}

@media (max-width: 480px) {
    h1, h2 {
        font-size: 1.2em;
    }

    .card .body,
    .card .toolbar,
    .card .prompt {
        padding: 6px;
    }

    /* Remove extra duplication if more specific tweaks needed for mobile */
}