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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #FFFFFF;
    color: #2B2B2B;
    min-height: 100vh;
    line-height: 1.6;
}

/* ========== VERTICAL SITE TITLE (COOKBOOK SPINE) ========== */
.page-layout {
    display: flex;
    min-height: 100vh;
}

/* Green area: fills all space left of the centered body */
.site-title-sidebar {
    flex: 1;
    background: #5F734A;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    min-width: 80px;
    padding-right: 24px;
    overflow: hidden;

}

.site-title-sidebar a {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 3.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #FFFFFF;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.15s;
}

.site-title-sidebar a:hover {
    opacity: 0.85;
}

.page-content {
    flex: 0 1 800px;
    min-width: 0;
    padding: 20px 20px 20px 32px;
}

/* Right-side spacer — 2:1 ratio pushes body left */
.page-layout::after {
    content: '';
    flex: 2;
}

.container {
    max-width: 800px;
}

header {
    margin-bottom: 40px;
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2B2B2B;
    margin-bottom: 8px;
}

/* Hidden on desktop, shown in mobile media query */
.hamburger-btn {
    display: none;
}

.step-drawer-close {
    display: none;
}

/* Mobile: spine becomes a horizontal banner */
@media (max-width: 640px) {
    .page-layout {
        flex-direction: column;
    }

    .site-title-sidebar {
        flex: none;
        width: 100%;
        height: auto;
        min-width: unset;
        padding: 14px 20px;
        padding-right: 20px;
        position: relative;
        align-self: auto;
        justify-content: center;
    }

    .page-layout::after {
        display: none;
    }

    .site-title-sidebar a {
        writing-mode: horizontal-tb;
        transform: none;
        font-size: 1rem;
        letter-spacing: 0.08em;
    }

    .page-content {
        padding: 20px;
    }

    .hero {
        padding: 32px 20px;
        margin-left: -20px;
        margin-right: -20px;
        margin-top: -20px;
        padding-top: 32px;
    }

    .hero-tagline {
        font-size: 1.5rem;
    }

    .hero-image {
        display: none;
    }

    .sidebar-onion {
        display: none;
    }

    /* ---- Cooking: single column ---- */
    .cooking-content {
        display: block;
    }

    /* ---- Step list: hidden by default, full-screen drawer on tap ---- */
    .step-list {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        z-index: 100;
        background: #FFFFFF;
        padding: 20px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .step-list.drawer-open {
        display: block;
    }

    .step-drawer-close {
        display: block;
        background: none;
        border: 1px solid #D1D5DB;
        border-radius: 4px;
        padding: 10px 16px;
        font-size: 1rem;
        color: #374151;
        cursor: pointer;
        margin-bottom: 16px;
        width: 100%;
        text-align: center;
    }

    .step-list-item {
        padding: 14px 0;
        font-size: 1rem;
        border-bottom: 1px solid #F0F0F0;
    }

    .step-list-item.current {
        font-size: 1.125rem;
    }

    /* ---- Current step: tighter padding ---- */
    .current-step {
        padding: 24px 20px;
    }

    /* ---- Command grid: 2-column, larger buttons ---- */
    .command-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .command-grid button {
        padding: 18px 12px;
        font-size: 1rem;
        min-height: 56px;
    }

    /* ---- Timer buttons: larger tap targets ---- */
    .timer-cancel,
    .timer-dismiss {
        padding: 12px 18px;
        font-size: 1rem;
        min-height: 44px;
    }

    /* ---- Recipe card: single column + hamburger nav ---- */
    .recipe-card-layout {
        display: block;
    }

    .hamburger-btn {
        display: block;
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 99;
        background: #5F734A;
        color: #FFFFFF;
        border: none;
        border-radius: 50px;
        padding: 14px 20px;
        font-size: 0.875rem;
        font-weight: 600;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }

    .recipe-nav {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        z-index: 100;
        background: #FFFFFF;
        padding: 20px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .recipe-nav.nav-open {
        display: flex;
        flex-direction: column;
    }

    .recipe-nav-item {
        padding: 14px 0;
        font-size: 1rem;
        border-bottom: 1px solid #F0F0F0;
    }

    .recipe-nav-begin {
        margin-top: 16px;
        padding: 16px;
    }
}

.recipe-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 4px 0 2px;
    color: #2B2B2B;
}

.recipe-meta {
    font-size: 0.875rem;
    color: #6B7280;
}

/* ========== ERROR ========== */
.error-message {
    background: #9A4A2F;
    color: #FFFFFF;
    padding: 16px 20px;
    border-radius: 4px;
    margin-bottom: 24px;
    display: none;
    font-size: 0.875rem;
}

.error-message.show {
    display: block;
}

/* ========== PRE-COOK SCREEN ========== */
.precook-screen {
    display: block;
}

.precook-screen.hidden {
    display: none;
}

.precook-section {
    border-top: 1px solid #E2E2E2;
    padding: 40px 0;
}

.precook-section:first-child {
    border-top: none;
    padding-top: 0;
}

.precook-section h2 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #5F6670;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 24px;
}

.precook-section ul {
    list-style: none;
    padding: 0;
}

.precook-section li {
    padding: 14px 0;
    line-height: 1.6;
    color: #2B2B2B;
}

.precook-section li::before {
    content: "—";
    color: #5F6670;
    margin-right: 12px;
}

.equipment-item::before {
    content: "☐" !important;
}

.ingredient-amount {
    font-weight: 500;
    color: #2B2B2B;
}

.ingredient-note {
    color: #5F6670;
    font-size: 0.875rem;
}

.start-cooking-btn {
    width: 100%;
    padding: 18px;
    font-size: 1rem;
    font-weight: 600;
    background: #5F734A;
    border: none;
    border-radius: 4px;
    color: #FFFFFF;
    cursor: pointer;
    margin-top: 48px;
    transition: opacity 0.15s;
}

.start-cooking-btn:hover {
    opacity: 0.9;
}

.start-cooking-btn:active {
    opacity: 0.8;
}

/* ========== COOKING SCREEN ========== */
.cooking-screen {
    display: none;
}

.cooking-screen.active {
    display: block;
}

.cooking-content {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* Step list sidebar */
.step-list {
    flex-shrink: 0;
    width: 200px;
    position: sticky;
    top: 20px;
}

.step-list-item {
    font-size: 0.875rem;
    color: #5F6670;
    padding: 8px 0;
    line-height: 1.4;
    cursor: pointer;
    transition: color 0.15s;
}

.step-list-item:hover {
    color: #2B2B2B;
}

.step-list-item.current {
    color: #2B2B2B;
    font-weight: 600;
    font-size: 1rem;
}

.main-content {
    flex: 1;
    min-width: 0;
}

/* ========== TIMERS ========== */
.timers-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 40px;
}

.timer-card {
    background: #F4F1ED;
    padding: 18px 24px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timer-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.timer-display {
    font-family: 'IBM Plex Mono', 'SF Mono', Monaco, monospace;
    font-size: 1.25rem;
    font-weight: 500;
    color: #9A4A2F;
    font-variant-numeric: tabular-nums;
    min-width: 80px;
}

.timer-display.warning {
    color: #9A4A2F;
}

.timer-display.urgent {
    color: #9A4A2F;
    font-weight: 600;
}

.timer-label {
    color: #5F6670;
    font-size: 0.875rem;
}

.timer-cancel {
    background: #FFFFFF;
    color: #5F6670;
    border: 1px solid #D1D5DB;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.15s;
}

.timer-cancel:hover {
    background: #F9FAFB;
    color: #374151;
}

/* Expired / alarming timer */
.timer-card.timer-expired {
    background: #9A4A2F;
    animation: timer-flash 1s ease-in-out infinite;
}

@keyframes timer-flash {
    0%, 100% { background: #9A4A2F; }
    50%      { background: #C05A3A; }
}

.timer-card.timer-expired .timer-display {
    color: #FFFFFF;
    font-weight: 700;
}

.timer-card.timer-expired .timer-label {
    color: #FFFFFF;
    font-weight: 600;
}

.timer-dismiss {
    background: #FFFFFF;
    color: #9A4A2F;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.15s;
}

.timer-dismiss:hover {
    background: #F4F1ED;
}

/* ========== CURRENT STEP ========== */
.current-step {
    background: #F4F1ED;
    padding: 40px;
    border-radius: 4px;
    margin-bottom: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.step-time {
    font-family: 'IBM Plex Mono', 'SF Mono', Monaco, monospace;
    color: #5F6670;
    font-weight: 500;
    margin-bottom: 20px;
    font-size: 0.875rem;
}

.step-content {
    font-size: 1.125rem;
    line-height: 1.7;
    color: #2B2B2B;
}

.step-content strong {
    font-weight: 600;
    color: #2B2B2B;
}

.step-content em {
    display: block;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #E2E2E2;
    color: #5F6670;
    font-size: 1rem;
    font-style: normal;
}

.step-timer-hint {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #E2E2E2;
    color: #5F6670;
    font-size: 0.875rem;
}

.step-timer-hint code {
    font-family: 'IBM Plex Mono', 'SF Mono', Monaco, monospace;
    background: #FFFFFF;
    padding: 2px 6px;
    border-radius: 2px;
    color: #2B2B2B;
    font-size: 0.875rem;
}

/* ========== NEXT PREVIEW ========== */
.next-preview {
    background: #F4F1ED;
    padding: 18px 24px;
    border-radius: 4px;
    margin-bottom: 48px;
}

.next-preview-label {
    color: #5F6670;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.next-preview-content {
    color: #5F6670;
    font-size: 0.875rem;
}

/* ========== COMMAND PANEL ========== */
.command-panel {
    border-top: 1px solid #E2E2E2;
    padding: 40px 0 0 0;
}

.command-panel-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: #5F6670;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 24px;
    text-align: center;
}

.command-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.command-grid button {
    background: #FFFFFF;
    color: #374151;
    border: 1px solid #D1D5DB;
    padding: 14px 20px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.command-grid button:hover {
    background: #F9FAFB;
}

.command-grid button:active {
    background: #F3F4F6;
}

/* ========== MIC TOGGLE ========== */
.mic-toggle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.heard-text {
    color: #5F6670;
    font-size: 0.875rem;
    font-style: italic;
    min-height: 1.25rem;
}

.mic-toggle-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #5F734A;
    color: #FFFFFF;
    border: none;
    padding: 14px 28px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.mic-toggle-btn:hover {
    opacity: 0.9;
}

.mic-toggle-btn.off {
    background: #FFFFFF;
    color: #374151;
    border: 1px solid #D1D5DB;
}

.mic-toggle-btn.off:hover {
    background: #F9FAFB;
}

.mic-toggle-btn .mic-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #5F6670;
}

.mic-toggle-btn.listening .mic-indicator {
    background: #FFFFFF;
}

.mic-toggle-btn.off .mic-indicator {
    background: #5F6670;
}

/* ========== NO-SPEECH MODE ========== */
.no-speech .mic-toggle-container {
    display: none;
}

.no-speech .command-panel-header {
    display: none;
}

/* ========== HERO ========== */
.hero {
    position: relative;
    background: #EDE8E1;
    padding: 48px 40px;
    margin-bottom: 20px;
    overflow: hidden;
    /* Full-bleed: break out of .page-content padding */
    margin-left: -32px;
    margin-right: -20px;
    /* Stretch to the right edge of the viewport */
    padding-right: calc(100vw - 100%);
    margin-right: calc(-100vw + 100%);
    /* Extend to top of viewport */
    margin-top: -20px;
    padding-top: 60px;
}

.hero-inner {
    position: relative;
    max-width: 800px;
}

.hero-text {
    position: relative;
    z-index: 1;
    max-width: 480px;
}

.hero-eyebrow {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #5F734A;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.hero-tagline {
    font-size: 2rem;
    font-weight: 700;
    color: #2B2B2B;
    line-height: 1.2;
    margin-bottom: 16px;
}

.hero-explainer {
    font-size: 1rem;
    color: #5F6670;
    line-height: 1.6;
    max-width: 420px;
}

.hero-breadcrumb {
    display: inline-block;
    font-size: 0.875rem;
    color: #5F734A;
    text-decoration: none;
    margin-bottom: 12px;
    transition: opacity 0.15s;
}

.hero-breadcrumb:hover {
    opacity: 0.7;
}

.hero-meta {
    font-size: 0.875rem;
    color: #5F6670;
    margin-top: 4px;
}

.hero-image {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 320px;
    height: auto;
    pointer-events: none;
    opacity: 0.45;
}

/* ========== ABOUT TOGGLE ========== */
.about-toggle {
    margin-bottom: 16px;
}

.about-toggle summary {
    font-size: 0.875rem;
    font-weight: 500;
    color: #5F734A;
    cursor: pointer;
    padding: 8px 0;
    list-style: none;
}

.about-toggle summary::-webkit-details-marker {
    display: none;
}

.about-toggle summary::before {
    content: '+ ';
    font-weight: 600;
}

.about-toggle[open] summary::before {
    content: '− ';
}

.about-content {
    padding: 16px 0 8px;
}

.about-content p {
    font-size: 1rem;
    color: #5F6670;
    max-width: 560px;
    line-height: 1.6;
    margin-bottom: 0.75em;
}

/* ========== HOME PAGE ========== */

.category-section {
    border-top: 1px solid #E2E2E2;
    padding: 24px 0;
}

.category-section h2 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #5F6670;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.recipe-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recipe-link-card {
    display: block;
    background: #F4F1ED;
    padding: 16px 20px;
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s;
}

.recipe-link-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.recipe-link-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2B2B2B;
    margin-bottom: 4px;
}

.recipe-link-meta {
    font-size: 0.875rem;
    color: #6B7280;
}

.category-empty {
    font-size: 0.9rem;
    color: #6B7280;
    font-style: italic;
}

/* Backlog / "to be written" lists */
.backlog-subcategory {
    font-size: 0.8rem;
    font-weight: 600;
    color: #5F6670;
    margin-top: 16px;
    margin-bottom: 6px;
}

.backlog-list {
    list-style: none;
    padding: 0;
}

.backlog-list li {
    padding: 2px 0;
    font-size: 0.9rem;
    color: #6B7280;
    line-height: 1.5;
}

.backlog-list li::before {
    content: "—";
    color: #D1D5DB;
    margin-right: 10px;
}

/* ========== RECIPE CARD PAGE ========== */
.breadcrumb {
    font-size: 0.875rem;
    color: #5F6670;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
}

.breadcrumb:hover {
    color: #2B2B2B;
}

.recipe-card-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.recipe-nav {
    flex-shrink: 0;
    width: 200px;
    position: sticky;
    top: 20px;
}

.recipe-nav-item {
    display: block;
    font-size: 0.875rem;
    color: #5F6670;
    padding: 8px 0;
    line-height: 1.4;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s;
}

.recipe-nav-item:hover {
    color: #2B2B2B;
}

.recipe-nav-item.current {
    color: #2B2B2B;
    font-weight: 600;
}

.recipe-nav-divider {
    border-top: 1px solid #E2E2E2;
    margin: 12px 0;
}

.recipe-nav-begin {
    display: block;
    background: #5F734A;
    color: #FFFFFF;
    padding: 10px 16px;
    border-radius: 4px;
    font-weight: 500;
    margin-top: 8px;
    text-align: center;
}

.recipe-nav-begin:hover {
    opacity: 0.9;
    color: #FFFFFF;
}

.recipe-card-content {
    flex: 1;
    min-width: 0;
}

.recipe-section {
    border-top: 1px solid #E2E2E2;
    padding: 20px 0;
    scroll-margin-top: 20px;
}

.recipe-section:first-child {
    border-top: none;
    padding-top: 0;
}

.recipe-section h2 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #5F6670;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.recipe-section ul {
    list-style: none;
    padding: 0;
}

.recipe-section li {
    padding: 4px 0;
    line-height: 1.5;
    color: #2B2B2B;
}

.recipe-section li::before {
    content: none;
}

.recipe-overview-stats {
    background: #F4F1ED;
    padding: 16px 20px;
    border-radius: 4px;
}

.recipe-overview-stats div {
    padding: 2px 0;
}

.overview-notes {
    list-style: none;
    padding: 0;
    margin-top: 16px;
}

.overview-notes li {
    padding: 4px 0;
    line-height: 1.5;
    color: #5F6670;
    font-size: 0.9rem;
}

.overview-notes li::before {
    content: none;
}

.instruction-step {
    padding: 10px 0;
    border-bottom: 1px solid #F0F0F0;
    list-style: none;
}

.instruction-step-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 4px;
}

.instruction-step-number {
    font-family: 'IBM Plex Mono', 'SF Mono', Monaco, monospace;
    color: #5F6670;
    font-size: 0.875rem;
}

.instruction-step-title {
    font-weight: 600;
    color: #2B2B2B;
}

.instruction-step-content {
    color: #2B2B2B;
    line-height: 1.5;
    font-size: 0.9rem;
}

.instruction-step-content strong {
    font-weight: 600;
}

.instruction-step-content em {
    display: block;
    margin-top: 8px;
    color: #5F6670;
    font-size: 0.85rem;
    font-style: normal;
}

.instruction-step-timer {
    font-size: 0.875rem;
    color: #9A4A2F;
    margin-top: 8px;
}

.storage-item {
    padding: 4px 0;
    line-height: 1.5;
}

.storage-label {
    font-weight: 600;
    color: #2B2B2B;
}

.storage-value {
    color: #5F6670;
}

/* ========== SIDEBAR ONION ========== */
.sidebar-onion {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    max-width: 280px;
    height: auto;
    opacity: 0.8;
    pointer-events: none;
}

/* ========== PRINT ========== */
@media print {
    .site-title-sidebar {
        display: none;
    }

    .page-layout {
        display: block;
    }

    .page-content {
        padding: 0;
    }

    .recipe-nav,
    .breadcrumb {
        display: none;
    }

    .recipe-card-layout {
        display: block;
    }

    .recipe-section {
        padding: 12px 0;
    }

    .instruction-step {
        padding: 6px 0;
    }

    body {
        padding: 0;
        font-size: 0.85rem;
    }
}