/* Miso Landing Page Styles */
/* Color variables are injected from ColorTokens via Thymeleaf in layout.html */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--on-bg);
    min-height: 100svh;
}

.page {
    display: flex;
    flex-direction: column;
    min-height: 100svh;
}

/* Section: Hero */
.hero .hero-egg {
    width: 180px;
    height: 180px;
    margin-bottom: 8px;
}

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 24px 12px;
    text-align: center;
}

.app-name {
    font-family: 'Schoolbell', cursive;
    font-size: 48px;
    font-weight: 400;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.description {
    font-size: 15px;
    color: var(--on-surface-variant);
    margin-bottom: 20px;
    max-width: 560px;
    line-height: 1.7;
}

/* Section: App Store Buttons */
.store-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 16px 24px 32px;
}

.btn-store {
    display: inline-block;
    line-height: 0;
    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 999px;
    padding: 6px 18px;
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.btn-store:hover {
    border-color: #999999;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.btn-store.locked {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-store .store-badge {
    display: block;
    width: min(180px, 40vw);
    height: auto;
}

/* Section: Alternating content sections */
.section {
    padding: 24px 32px 24px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.section-row {
    display: flex;
    align-items: center;
    gap: 40px;
}

.section-row.reverse {
    flex-direction: row-reverse;
}

.section-text {
    flex: 1;
}

.section-heading {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
}

.section-copy {
    font-size: 15px;
    color: var(--outline);
    line-height: 1.6;
}

.section-img {
    flex: 0 0 180px;
}

.section-img img {
    max-width: 100%;
    height: auto;
    display: block;
}

.section-img.phone {
    flex: 0 0 160px;
}

.section-img.phone img {
    border-radius: 20px;
    border: 2px solid var(--primary-container);
}

.section-img.icon {
    flex: 0 0 140px;
}

.section-overlap {
    margin-top: -40px;
}

/* Section: Origin Story */
.origin {
    background: var(--primary-container);
    padding: 24px 32px;
}

.origin .section {
    padding: 0;
}

.origin-quote {
    font-size: 15px;
    font-style: italic;
    color: var(--on-surface-variant);
    line-height: 1.8;
    max-width: 440px;
}

.origin-note {
    margin-top: 16px;
    font-size: 13px;
    color: var(--outline);
}

/* Section: Footer */
.footer {
    background: var(--inverse-surface);
    color: var(--bg);
    padding: 32px 24px;
    text-align: center;
}

.footer-logo {
    font-family: 'Schoolbell', cursive;
    font-size: 24px;
    margin-bottom: 8px;
}

.footer-sub {
    font-size: 13px;
    color: var(--outline);
    margin-bottom: 16px;
}

.footer-links {
    display: flex;
    gap: 24px;
    justify-content: center;
    font-size: 13px;
}

.footer-links a {
    color: var(--secondary);
    text-decoration: none;
    transition: opacity 0.2s;
}

.footer-links a:hover {
    opacity: 0.7;
}

/* Legal pages (privacy / terms) */
.legal-topbar {
    display: flex;
    align-items: center;
    max-width: 720px;
    margin: 0 auto;
    padding: 12px 24px 8px;
    width: 100%;
}

.legal-content {
    flex: 1;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    padding: 16px 24px 48px;
}

.legal-content h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 12px;
}

.legal-meta {
    font-size: 14px;
    color: var(--on-surface-variant);
    line-height: 1.6;
    margin-bottom: 20px;
}

.legal-content h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 28px 0 10px;
}

.legal-content p,
.legal-content li {
    font-size: 15px;
    line-height: 1.7;
    color: var(--on-bg);
}

.legal-content p {
    margin-bottom: 12px;
}

.legal-content ul {
    margin: 0 0 12px 1.2em;
    padding: 0;
}

.legal-content li {
    margin-bottom: 8px;
}

.legal-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-content a:hover {
    opacity: 0.8;
}

.legal-updated {
    margin-top: 28px;
    font-size: 13px;
    color: var(--outline);
}

/* 404 page */
.error-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.error-page .hero-egg {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
}

.error-heading {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.error-description {
    font-size: 15px;
    color: var(--outline);
    margin-bottom: 24px;
}

.btn-home {
    display: inline-block;
    background: var(--primary);
    color: var(--on-primary);
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-home:hover {
    background: var(--inverse-surface);
}

/* Public Recipe page */
.recipe-page {
    min-height: 100svh;
    background: var(--bg);
    color: var(--on-bg);
}

.recipe-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 520px;
    margin: 0 auto;
    padding: 12px 20px 8px;
}

.recipe-brand,
.recipe-topbar-link {
    color: var(--on-bg);
    text-decoration: none;
}

.recipe-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Schoolbell', cursive;
    font-size: 24px;
}

.recipe-brand img {
    width: 30px;
    height: 30px;
}

.recipe-topbar-link {
    color: var(--on-surface-variant);
    font-size: 13px;
    font-weight: 600;
}

.recipe-shell {
    max-width: 520px;
    margin: 0 auto;
}

.recipe-hero-card {
    overflow: hidden;
    margin: 0 32px;
    border-radius: 28px;
    background: var(--primary-container);
}

.recipe-dish-image,
.recipe-dish-placeholder {
    width: 100%;
    height: min(40svh, 320px);
    min-height: 240px;
    display: block;
}

.recipe-dish-image {
    object-fit: cover;
}

.recipe-dish-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background:
        radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.54), transparent 8rem),
        linear-gradient(135deg, var(--primary-container), color-mix(in srgb, var(--secondary) 45%, var(--primary-container)));
}

.recipe-dish-placeholder img {
    width: 96px;
    height: 96px;
}

.recipe-dish-placeholder span {
    font-family: 'Schoolbell', cursive;
    font-size: 30px;
}

.recipe-placeholder-placeholder2,
.recipe-placeholder-placeholder4 {
    background:
        radial-gradient(circle at 70% 18%, rgba(255, 255, 255, 0.5), transparent 8rem),
        linear-gradient(135deg, color-mix(in srgb, var(--primary) 28%, var(--bg)), var(--primary-container));
}

.recipe-placeholder-placeholder3 {
    background:
        radial-gradient(circle at 24% 76%, rgba(255, 255, 255, 0.42), transparent 7rem),
        linear-gradient(135deg, color-mix(in srgb, var(--secondary) 55%, var(--bg)), var(--primary-container));
}

.recipe-content-card {
    padding: 24px 32px 64px;
}

.recipe-title-block h1 {
    font-size: clamp(28px, 8vw, 34px);
    line-height: 1.12;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    font-weight: 700;
}

.recipe-attribution {
    color: var(--on-surface-variant);
    line-height: 1.5;
    font-size: 13px;
    font-weight: 500;
}

.recipe-attribution strong {
    color: var(--on-bg);
    font-weight: 650;
}

.recipe-attribution a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.recipe-description-handwritten {
    font-family: 'Schoolbell', cursive;
    margin-top: 16px;
    color: var(--on-bg);
    font-size: 20px;
    line-height: 1.5;
}

.recipe-divider {
    height: 10px;
    margin: 16px 0 24px;
    opacity: 0.7;
    background:
        radial-gradient(circle at 5px 5px, var(--primary) 2px, transparent 2.5px) repeat-x;
    background-size: 18px 10px;
}

.recipe-meta-grid {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.recipe-meta-item {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 2px;
}

.recipe-meta-item dt {
    color: var(--outline);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    text-transform: lowercase;
}

.recipe-meta-item dd {
    color: var(--on-bg);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.recipe-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.recipe-tags span {
    border: 1px solid color-mix(in srgb, var(--outline) 38%, transparent);
    border-radius: 999px;
    padding: 7px 12px;
    color: var(--on-surface-variant);
    font-size: 13px;
}

.recipe-section-block {
    margin-top: 24px;
}

.recipe-section-block h2 {
    font-size: 22px;
    line-height: 1.25;
    margin-bottom: 16px;
    font-weight: 700;
}

.recipe-section-block h3 {
    color: var(--primary);
    font-size: 16px;
    line-height: 1.3;
    margin: 0 0 12px;
    font-weight: 700;
}

.recipe-ingredient-list,
.recipe-step-list {
    list-style: none;
}

.recipe-ingredient-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    padding: 12px 0;
    align-items: start;
}

.recipe-ingredient-quantity {
    color: var(--outline);
    font-size: 16px;
    line-height: 1.4;
    text-align: right;
    white-space: nowrap;
}

.recipe-ingredient-name {
    color: var(--on-bg);
    display: block;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 400;
}

.recipe-ingredient-note {
    color: var(--outline);
    display: block;
    font-size: 14px;
    line-height: 1.4;
    margin-top: 2px;
}

.recipe-step-list li {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 16px;
    padding: 0 0 24px;
    line-height: 1.5;
}

.recipe-step-number {
    color: var(--outline);
    font-size: 16px;
    line-height: 1.5;
}

.recipe-step-timer {
    grid-column: 2;
    width: fit-content;
    margin-top: -14px;
    border-radius: 999px;
    background: var(--primary-container);
    color: var(--on-surface-variant);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
}

.recipe-step-text {
    color: var(--on-bg);
    font-size: 16px;
    line-height: 1.5;
}

.recipe-empty-state {
    color: var(--on-surface-variant);
    border: 1px dashed color-mix(in srgb, var(--outline) 45%, transparent);
    border-radius: 16px;
    padding: 18px;
}

.recipe-cta {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 456px;
    margin: 0 auto 32px;
    padding: 18px;
    border-radius: 18px;
    background: var(--primary-container);
    color: var(--on-bg);
}

.recipe-cta img {
    width: 44px;
    height: 44px;
}

.recipe-cta div {
    flex: 1;
}

.recipe-cta h2 {
    font-size: 16px;
    margin-bottom: 4px;
}

.recipe-cta p {
    color: var(--on-surface-variant);
    font-size: 13px;
    line-height: 1.4;
}

.recipe-cta .btn-home {
    flex: 0 0 auto;
    padding: 10px 14px;
}

@media (min-width: 900px) {
    .recipe-topbar,
    .recipe-shell {
        max-width: 860px;
    }

    .recipe-topbar {
        padding: 20px 28px 14px;
    }

    .recipe-hero-card {
        margin: 0 64px;
        border-radius: 32px;
    }

    .recipe-dish-image,
    .recipe-dish-placeholder {
        height: 420px;
        min-height: 420px;
    }

    .recipe-content-card {
        padding: 32px 64px 72px;
    }

    .recipe-title-block h1 {
        max-width: 680px;
        font-size: 44px;
    }

    .recipe-description-handwritten {
        max-width: 680px;
        font-size: 22px;
    }

    .recipe-section-block {
        max-width: 700px;
    }

    .recipe-cta {
        max-width: 732px;
    }
}

/* Responsive: Tablet */
@media (max-width: 768px) {
    .section {
        padding: 20px 24px;
    }

    .section-row {
        gap: 24px;
    }

    .hero {
        padding: 48px 24px 24px;
    }

    .recipe-dish-image,
    .recipe-dish-placeholder {
        min-height: 300px;
    }

    .recipe-cta {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Responsive: Mobile */
@media (max-width: 480px) {
    .section-row,
    .section-row.reverse {
        flex-direction: column;
        text-align: center;
    }

    .section-img,
    .section-img.phone,
    .section-img.icon {
        flex: none;
        width: 100%;
        max-width: 160px;
        margin: 0 auto;
    }

    .origin .section-row {
        flex-direction: column;
        text-align: center;
    }

    .origin-quote {
        max-width: 100%;
    }

    .store-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn-store {
        width: 100%;
        max-width: 260px;
    }

    .btn-store .store-badge {
        width: 100%;
    }

    .app-name {
        font-size: 36px;
    }

    .recipe-page {
        padding: 14px;
    }

    .recipe-topbar {
        align-items: flex-start;
    }

    .recipe-topbar-link {
        text-align: right;
    }

    .recipe-content-card {
        padding: 24px 28px 56px;
    }
}
