@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;700;800&display=swap');

:root {
    --primary-color: #ffbc42;
    --secondary-color: #ff7a18;
    --background-color: #10151f;
    --background-accent: #1b2433;
    --text-color: #f8f2e8;
    --muted-text: rgba(248, 242, 232, 0.72);
    --surface-color: rgba(255, 255, 255, 0.05);
    --surface-strong: rgba(255, 255, 255, 0.09);
    --border-color: rgba(255, 255, 255, 0.12);
    --shadow-color: rgba(255, 122, 24, 0.22);
    --button-text-color: #201304;
    --field-background: rgba(255, 255, 255, 0.08);
    --field-border: rgba(255, 255, 255, 0.18);
    --success-color: #9cffb0;
}

[data-theme='light'] {
    --primary-color: #f7b500;
    --secondary-color: #ff8f3d;
    --background-color: #fff6ea;
    --background-accent: #ffe1bf;
    --text-color: #24180d;
    --muted-text: rgba(36, 24, 13, 0.72);
    --surface-color: rgba(255, 255, 255, 0.76);
    --surface-strong: rgba(255, 255, 255, 0.96);
    --border-color: rgba(60, 31, 0, 0.14);
    --shadow-color: rgba(247, 181, 0, 0.18);
    --button-text-color: #2f1c06;
    --field-background: rgba(255, 255, 255, 0.92);
    --field-border: rgba(47, 28, 6, 0.15);
    --success-color: #137333;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    min-height: 100vh;
    color: var(--text-color);
    background:
        radial-gradient(circle at top left, rgba(255, 188, 66, 0.22), transparent 24%),
        radial-gradient(circle at top right, rgba(255, 122, 24, 0.16), transparent 30%),
        linear-gradient(180deg, var(--background-accent), var(--background-color));
    transition: background 0.3s ease, color 0.3s ease;
}

button,
input,
textarea {
    font: inherit;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

p {
    line-height: 1.7;
}

.site-header,
.hero,
main,
.site-footer {
    width: min(1120px, calc(100% - 3rem));
    margin: 0 auto;
}

.site-header {
    padding-top: 1.25rem;
}

.nav-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--surface-color);
    backdrop-filter: blur(16px);
}

.brand {
    color: var(--text-color);
    font-weight: 800;
    font-size: 1.1rem;
}

.site-nav,
.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-nav a,
.footer-nav a {
    color: var(--muted-text);
    font-size: 0.95rem;
}

.site-nav a:hover,
.footer-nav a:hover {
    color: var(--text-color);
}

.hero {
    padding: 2rem 0 1.5rem;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 1.5rem;
    align-items: start;
}

.page-hero {
    margin-top: 2rem;
}

.hero-copy {
    max-width: 760px;
}

.eyebrow {
    margin: 0 0 0.75rem;
    color: var(--primary-color);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.84rem;
    font-weight: 700;
}

h1,
h2 {
    margin: 0;
    line-height: 1.1;
}

h1 {
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    max-width: 12ch;
}

.hero-description,
.panel-description,
.camera-note,
.status-note,
.empty-state span,
.inquiry-form label,
.comments-card noscript,
.site-footer p,
.feature-list,
details p {
    color: var(--muted-text);
}

.hero-description {
    max-width: 58ch;
    margin: 1rem 0 0;
}

.hero-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.25rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--button-text-color);
    font-weight: 800;
    box-shadow: 0 14px 30px var(--shadow-color);
}

.secondary-link {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    box-shadow: none;
}

main {
    padding-bottom: 3rem;
    display: grid;
    gap: 2rem;
}

.detector-shell,
.content-grid.two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
}

.detector-panel,
.preview-card,
.results-card,
.content-card {
    border: 1px solid var(--border-color);
    border-radius: 32px;
    background: var(--surface-color);
    box-shadow: 0 24px 55px var(--shadow-color);
    backdrop-filter: blur(16px);
    padding: 2rem;
}

.article-card h2,
.faq-card h2,
.comments-card h2,
.inquiry-card h2,
.preview-card h2,
.results-card h2,
.detector-panel h2,
.hero-aside h2,
.page-hero h1 {
    margin-bottom: 1rem;
}

.preview-panel,
.faq-list {
    display: grid;
    gap: 1.5rem;
}

.status-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: var(--surface-strong);
    border: 1px solid var(--border-color);
    font-size: 0.92rem;
    font-weight: 700;
}

.status-pill.ready {
    color: var(--success-color);
}

.control-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.upload-card,
.action-card,
details {
    border-radius: 24px;
    border: 1px solid var(--border-color);
    background: var(--surface-strong);
    padding: 1.25rem;
}

.upload-card {
    display: grid;
    gap: 0.45rem;
    cursor: pointer;
}

.upload-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.upload-caption,
.feature-list {
    line-height: 1.6;
}

.upload-card input {
    margin-top: 0.75rem;
}

.action-card {
    display: grid;
    gap: 0.85rem;
}

button {
    padding: 1rem 1.25rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--button-text-color);
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 14px 30px var(--shadow-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px var(--shadow-color);
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.secondary-button {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    box-shadow: none;
}

#theme-toggle {
    min-width: 148px;
}

.preview-stage {
    position: relative;
    min-height: 340px;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    display: grid;
    place-items: center;
}

.preview-stage.empty img {
    display: none;
}

#uploaded-preview,
#webcam-container canvas {
    width: 100%;
    max-width: 100%;
    border-radius: 24px;
    display: block;
}

#uploaded-preview {
    max-height: 420px;
    object-fit: contain;
}

.empty-state {
    display: grid;
    gap: 0.5rem;
    text-align: center;
    padding: 2rem;
}

.webcam-container {
    margin-top: 1rem;
}

.top-result {
    border-radius: 24px;
    background: var(--surface-strong);
    border: 1px solid var(--border-color);
    padding: 1rem 1.1rem;
    font-size: 1.05rem;
    font-weight: 700;
    margin: 1rem 0 1.25rem;
}

.prediction-list {
    display: grid;
    gap: 0.85rem;
}

.prediction-item {
    display: grid;
    gap: 0.45rem;
}

.prediction-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.95rem;
}

.prediction-bar {
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.prediction-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.feature-list {
    margin: 1rem 0 0;
    padding-left: 1.25rem;
}

.feature-list li + li {
    margin-top: 0.5rem;
}

summary {
    cursor: pointer;
    font-weight: 700;
}

details p {
    margin-top: 0.9rem;
}

.inquiry-form {
    display: grid;
    gap: 1rem;
}

.inquiry-form label {
    display: grid;
    gap: 0.45rem;
    font-size: 0.95rem;
}

.inquiry-form input,
.inquiry-form textarea {
    width: 100%;
    border: 1px solid var(--field-border);
    border-radius: 18px;
    padding: 1rem 1.1rem;
    background: var(--field-background);
    color: var(--text-color);
}

.inquiry-form textarea {
    min-height: 140px;
    resize: vertical;
}

.inquiry-form input::placeholder,
.inquiry-form textarea::placeholder {
    color: var(--muted-text);
}

.inquiry-form input:focus,
.inquiry-form textarea:focus {
    outline: 2px solid color-mix(in srgb, var(--primary-color) 65%, white 35%);
    border-color: transparent;
}

#disqus_thread {
    width: 100%;
    min-height: 240px;
}

.site-footer {
    padding-bottom: 2rem;
}

.footer-shell {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

@media (max-width: 960px) {
    .hero,
    .detector-shell,
    .content-grid.two-column,
    .control-grid {
        grid-template-columns: 1fr;
    }

    .nav-shell,
    .footer-shell {
        border-radius: 24px;
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 720px) {
    .site-header,
    .hero,
    main,
    .site-footer {
        width: min(100%, calc(100% - 1.5rem));
    }

    .detector-panel,
    .preview-card,
    .results-card,
    .content-card {
        padding: 1.25rem;
        border-radius: 24px;
    }

    .preview-stage {
        min-height: 260px;
        border-radius: 20px;
    }

    button,
    .button-link,
    #theme-toggle {
        width: 100%;
    }

    .hero-actions,
    .site-nav,
    .footer-nav {
        width: 100%;
    }
}
