@font-face {
    font-family: 'Forte';
    src: url('../fonts/FORTE.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'Open Sans';
    src: url('../fonts/OpenSans-Regular.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Open Sans';
    src: url('../fonts/OpenSans-Semibold.ttf') format('truetype');
    font-weight: 600;
    font-display: swap;
}

:root {
    --bg: #ECE7C6;
    --panel-bg: #D8D0A8;
    --elevated-bg: #E5DEC0;
    --text-primary: #3A352E;
    --text-secondary: #5A5448;
    --text-sub: #8A846F;
    --accent: #F2C17E;
    --accent-deep: #C98E3F;
    --divider: #CFC7A3;
    --border: #BFB78F;
    --info: #1B3F8C;
    --app-navy: #0D1E37;
    --app-cyan: #2AACCB;
    --font-display: 'Forte', 'Trajan Pro', 'Times New Roman', serif;
    --font-body: 'Open Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

html, body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text-primary);
    margin: 0;
    line-height: 1.6;
}

h1, h2, h3 {
    font-family: var(--font-display);
    color: var(--text-primary);
    letter-spacing: 0.5px;
    font-weight: 400;
}

h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); margin: 0 0 1rem; line-height: 1.15; }
h2 { font-size: clamp(1.7rem, 2.6vw, 2.3rem); margin: 0 0 0.75rem; }
h3 { font-size: 1.25rem; margin: 0 0 0.5rem; font-family: var(--font-body); font-weight: 600; letter-spacing: 0; }

h1:focus { outline: none; }

a {
    color: var(--info);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

.btn-primary,
a.btn-primary {
    color: var(--app-navy);
    background-color: var(--accent);
    border-color: var(--accent-deep);
    font-weight: 600;
    padding: 0.6rem 1.4rem;
    border-radius: 999px;
}
.btn-primary:hover,
a.btn-primary:hover {
    background-color: var(--accent-deep);
    color: #fff;
    border-color: var(--accent-deep);
}

.btn-ghost {
    display: inline-block;
    padding: 0.55rem 1.3rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text-primary);
    background: transparent;
    font-weight: 600;
}
.btn-ghost:hover { background: var(--elevated-bg); text-decoration: none; }

.playstore-badge {
    display: inline-block;
    line-height: 0;
    border-radius: 8px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.playstore-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
    text-decoration: none;
}
.playstore-badge img {
    height: 56px;
    width: auto;
    display: block;
}

.wip-badge {
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.5rem;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--app-navy);
    background: var(--accent);
    font-family: var(--font-body);
}

.container-narrow {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.container-wide {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.section {
    padding: 4rem 0;
}
.section-tight {
    padding: 2.5rem 0;
}
.section-dark {
    background: var(--app-navy);
    color: #E9EDF3;
}
.section-dark h1, .section-dark h2, .section-dark h3 {
    color: #fff;
}
.section-panel {
    background: var(--panel-bg);
}

.eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-deep);
    margin-bottom: 0.75rem;
}

.divider-rule {
    height: 1px;
    background: var(--divider);
    margin: 3rem 0;
    border: 0;
}

.card-parchment {
    background: var(--elevated-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.feature-grid .card-parchment h3 { color: var(--text-primary); }

.hero {
    position: relative;
    padding: 5rem 0 4rem;
    overflow: hidden;
}
.hero-eonscribe {
    background: linear-gradient(180deg, rgba(13,30,55,0.86) 0%, rgba(13,30,55,0.78) 100%),
                url('../images/eonscribe/bg-library.jpg') center/cover no-repeat;
    color: #F4EFD7;
}
.hero-eonscribe h1, .hero-eonscribe h2 { color: #fff; }
.hero-eonscribe .tagline { color: var(--accent); font-family: var(--font-display); font-size: 1.4rem; }
.hero-eonscribe .banner-img {
    max-width: min(640px, 90%);
    height: auto;
    display: block;
    margin: 0 auto 1.5rem;
}

.hero-studio {
    background: var(--bg);
    text-align: center;
    padding: 6rem 0 4rem;
}
.hero-studio .lede {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto 2rem;
}

.studio-wordmark {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 6vw, 4.6rem);
    color: var(--text-primary);
    margin: 0 0 0.5rem;
    line-height: 1;
}

.product-card {
    display: flex;
    gap: 2rem;
    align-items: center;
    background: var(--elevated-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 2rem;
    margin: 2rem 0;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    text-decoration: none;
}
.product-card img {
    width: 200px;
    max-width: 35%;
    border-radius: 8px;
    flex-shrink: 0;
}
.product-card h2 { font-family: var(--font-display); margin: 0 0 0.5rem; }
.product-card .pitch { color: var(--text-secondary); margin: 0 0 0.75rem; }
.product-card .read-more { color: var(--info); font-weight: 600; }

@media (max-width: 640px) {
    .product-card { flex-direction: column; text-align: center; padding: 1.5rem; }
    .product-card img { width: 60%; max-width: 240px; }
}

.samples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
}
.samples-grid img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
    aspect-ratio: 1;
    object-fit: cover;
}

.scenario-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}
.scenario-card {
    margin: 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--elevated-bg);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.scenario-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
}
.scenario-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
}
.scenario-card figcaption {
    padding: 0.7rem 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}
.scenario-card figcaption span {
    display: block;
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--accent);
    margin-top: 0.15rem;
}

.comic-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}
.comic-strip img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.spotlight {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}
.spotlight img { max-width: 100%; height: auto; }
@media (max-width: 720px) {
    .spotlight { grid-template-columns: 1fr; }
}

.feature-row {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    padding: 1rem 0;
    border-bottom: 1px solid var(--divider);
}
.feature-row:last-child { border-bottom: 0; }
.feature-row .icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--panel-bg);
    border-radius: 12px;
}
.feature-row .icon img { width: 32px; height: 32px; }
.feature-row .icon .glyph { font-size: 1.6rem; }

.cta-band {
    background: var(--app-navy);
    color: #F4EFD7;
    text-align: center;
    padding: 4rem 1.25rem;
    background-image: linear-gradient(rgba(13,30,55,0.88), rgba(13,30,55,0.96));
}
.cta-band h2 { color: #fff; }

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}
.contact-card {
    background: var(--elevated-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.contact-card img { height: 36px; width: auto; max-width: 120px; object-fit: contain; }

.legal-doc { max-width: 760px; margin: 0 auto; }
.legal-doc .last-updated { color: var(--text-sub); font-size: 0.9rem; margin-bottom: 2rem; }
.legal-doc .todo {
    background: #FFF5DA;
    border-left: 4px solid var(--accent);
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.content { padding-top: 0; }

.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid red; }
.validation-message { color: red; }

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}
.blazor-error-boundary::after { content: "An error has occurred." }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}
.loading-progress circle {
    fill: none;
    stroke: var(--divider);
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}
.loading-progress circle:last-child {
    stroke: var(--accent-deep);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}
.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: 600;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    color: var(--text-secondary);
}
.loading-progress-text:after { content: var(--blazor-load-percentage-text, "Loading"); }

code { color: #c02d76; }
