/* --- DESIGN TOKENS (Source of Truth) --- */
:root {
    /* Colors */
    --braun-yellow: #fbc02d;
    --braun-yellow-dark: #f9a825;
    --braun-black: #222222;
    --braun-black-light: #333333;
    --braun-case: #f4f4f4;
    --braun-grey: #444444;
    --braun-grey-light: #555555;
    --braun-green: #2e7d32;
    --braun-green-light: #388e3c;

    --text-main: #333333;
    --text-secondary: #666666;
    --text-light: #f0f0f0;
    --bg-page: #e8e8e8;

    /* Shadows */
    --shadow-device: 0 30px 60px -12px rgba(0,0,0,0.15), 0 10px 20px -5px rgba(0,0,0,0.05), inset 0 1px 0 rgba(255,255,255,0.8);
    --shadow-display: inset 0 3px 6px rgba(0,0,0,0.4);
    --shadow-btn: 3px 3px 8px rgba(0,0,0,0.2), -1px -1px 2px rgba(255,255,255,0.1);
    --shadow-btn-pressed: inset 2px 2px 5px rgba(0,0,0,0.25);
    --shadow-sheet: 0 -10px 40px rgba(0,0,0,0.15);
}

/* --- GLOBAL RESET & TYPOGRAPHY --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

/* --- ACCESSIBILITY --- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- NAVIGATION --- */
.top-nav {
    width: 100%;
    padding: 20px 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    z-index: 500;
}

/* Flyout Container (Wraps Logo + Menu) */
.dropdown {
    position: relative;
    display: inline-block;
}

/* Invisible Bridge to connect Trigger and Content across the gap */
.dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 15px;
    background: transparent;
}

/* The Trigger (Icon + Text + Arrow) */
.nav-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 20px;
    transition: background-color 0.2s ease;
}

.nav-trigger:hover {
    background-color: rgba(255, 255, 255, 0.6);
}

.nav-logo {
    font-weight: 700;
    font-size: 1.2rem;
    color: #333;
    letter-spacing: -0.5px;
    user-select: none;
}

.nav-icon-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    line-height: 0;
    transition: opacity 0.2s ease;
}

.nav-icon-link:hover {
    opacity: 0.8;
}

.app-icon-small {
    height: 40px;
    width: auto;
    margin-right: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    vertical-align: middle;
}

.arrow-icon {
    width: 10px;
    height: 10px;
    color: #666;
    transition: transform 0.2s ease;
}

.dropdown:hover .arrow-icon {
    transform: rotate(180deg);
}

/* Dropdown Menu Content */
.dropdown-content {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 100%;
    margin-top: 8px;
    background-color: #ffffff;
    min-width: 180px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    border-radius: 12px;
    z-index: 1000;
    padding: 8px;
    overflow: hidden;
    animation: slideDown 0.2s ease-out;
}

/* Additional bridge for safety */
.dropdown-content::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: 10px;
    background: transparent;
}

@keyframes slideDown {
    from { opacity: 0; transform: translate(-50%, -10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: #333;
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.1s;
    text-align: center;
}

.dropdown-content a:hover {
    background-color: #f5f5f7;
}

/* Nav CTA Button (Download) in Dropdown */
.nav-cta {
    margin-top: 8px;
    border-radius: 8px;
}

.dropdown-content .nav-cta:hover {
    background-color: var(--braun-yellow-dark);
}

/* --- HERO DEMO SECTION --- */
.hero-demo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    width: 100%;
}

@media (min-width: 768px) {
    .hero-demo {
        flex-direction: row;
        justify-content: center;
        gap: 80px;
    }
}

/* --- APP STORE BADGE --- */
.app-store-badge-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 50px;
    margin-bottom: 50px;
    clear: both;
}

.app-store-badge-container a {
    display: inline-block;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.app-store-badge-container a:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.app-store-badge {
    height: 54px;
    width: auto;
}

.product-hunt-badge {
    height: 54px;
    width: auto;
}

@media (max-width: 480px) {
    .app-store-badge-container {
        margin-top: 30px;
        margin-bottom: 30px;
        gap: 12px;
    }

    .app-store-badge,
    .product-hunt-badge {
        height: 48px;
    }
}

/* --- FOOTER --- */
.site-footer {
    width: 100%;
    padding: 40px 20px;
    background-color: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 60px;
    border-top: none;
}

.footer-links, .social-links {
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.site-footer a {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.site-footer a:hover {
    color: #000;
}

.social-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* --- LAYOUT CONTAINER --- */
.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 40px;
    position: relative;
}

/* --- CALCULATOR CASE (DEVICE FRAME) --- */
.calculator {
    background-color: var(--braun-case);
    width: 320px;
    border-radius: 24px;
    box-shadow: var(--shadow-device);
    user-select: none;
    position: relative;
    z-index: 10;
    overflow: hidden;
    flex-shrink: 0;
    transform: translateZ(0);
}

/* Inner container for padding */
.calc-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* --- DISPLAY --- */
.display-window {
    background-color: #2b2b2b;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 5px;
    box-shadow: var(--shadow-display);
    min-height: 90px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

#screen-main,
.screen-main {
    width: 100%;
    color: var(--text-light);
    font-size: 2.2rem;
    text-align: right;
    font-weight: 300;
    letter-spacing: 1px;
    line-height: 1.2;
}

#screen-logic,
.screen-logic {
    width: 100%;
    color: #888;
    font-size: 0.85rem;
    text-align: right;
    font-weight: 400;
    margin-top: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* --- KEYPAD --- */
.keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* --- BUTTONS --- */
button {
    height: 58px; width: 58px;
    border-radius: 50%; border: none;
    font-size: 1.25rem; font-weight: 400;
    font-family: 'Inter', sans-serif;
    color: #fff;
    box-shadow: var(--shadow-btn);
    position: relative;
    cursor: pointer;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

button:active { transform: scale(0.97); box-shadow: var(--shadow-btn-pressed); }

button.active-click {
    transform: scale(0.95);
    box-shadow: var(--shadow-btn-pressed);
}

.btn-black { background: linear-gradient(145deg, var(--braun-black-light), var(--braun-black)); color: #fff; }
.btn-grey  { background: linear-gradient(145deg, var(--braun-grey-light), var(--braun-grey)); color: #fff; }
.btn-green { background: linear-gradient(145deg, var(--braun-green-light), var(--braun-green)); color: white; }
.btn-yellow {
    background: linear-gradient(145deg, var(--braun-yellow), var(--braun-yellow-dark));
    color: #222;
    display: flex;
    justify-content: center;
    align-items: center;
}

.span-v { grid-row: span 2; height: 128px; border-radius: 29px; }
.span-h { grid-column: span 2; width: 128px; border-radius: 29px; justify-content: flex-start; padding-left: 24px; }

.btn-pill { width: 118px; border-radius: 26px; justify-content: flex-start; padding-left: 24px; }
.btn-tall { height: 118px; border-radius: 26px; }

/* --- STYLE GUIDE: TACTILE BUTTONS --- */
.btn-calc {
    height: 58px;
    width: 58px;
    border-radius: 50%;
    border: none;
    font-size: 1.25rem;
    font-weight: 400;
    font-family: 'Inter', sans-serif;
    box-shadow: var(--shadow-btn);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn-calc:active {
    transform: scale(0.97);
    box-shadow: var(--shadow-btn-pressed);
}

.btn-calc.btn-black {
    background: linear-gradient(145deg, var(--braun-black-light), var(--braun-black));
    color: #fff;
}

.btn-calc.btn-grey {
    background: linear-gradient(145deg, var(--braun-grey-light), var(--braun-grey));
    color: #fff;
}

.btn-calc.btn-green {
    background: linear-gradient(145deg, var(--braun-green-light), var(--braun-green));
    color: #fff;
}

.btn-calc.btn-yellow {
    background: linear-gradient(145deg, var(--braun-yellow), var(--braun-yellow-dark));
    color: var(--braun-black);
}

.btn-calc.btn-pill {
    width: 118px;
    border-radius: 26px;
    justify-content: flex-start;
    padding-left: 24px;
}

.btn-calc.btn-tall {
    height: 118px;
    border-radius: 26px;
}

.mic-icon { width: 24px; height: 24px; fill: #222; pointer-events: none; }

.btn-yellow.listening {
    animation: pulse 1.6s infinite ease-in-out;
    background: linear-gradient(145deg, #d32f2f, #b71c1c) !important;
}
.btn-yellow.listening .mic-icon { fill: white; }

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.6); }
    70% { box-shadow: 0 0 0 12px rgba(211, 47, 47, 0); }
    100% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0); }
}

/* --- STANDARD INTERFACE BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    text-decoration: none;
    height: auto;
    width: auto;
    box-shadow: none;
}

.btn:active, .btn.active {
    transform: scale(0.98);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
}
.btn:disabled, .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Primary Button - Uses Brand Accent Yellow */
.btn-primary {
    background-color: var(--braun-yellow);  /* #fbc02d */
    color: var(--braun-black);              /* #222222 */
}
.btn-primary:hover {
    background-color: var(--braun-yellow-dark);  /* #f9a825 */
}

/* Secondary Button - Uses Brand Grey */
.btn-secondary {
    background-color: var(--braun-grey);     /* #444444 */
    color: #fff;
}
.btn-secondary:hover {
    background-color: var(--braun-grey-light);  /* #555555 */
}

/* Success Button - Uses Brand Green */
.btn-success {
    background-color: var(--braun-green);    /* #2e7d32 */
    color: #fff;
}
.btn-success:hover {
    background-color: var(--braun-green-light);  /* #388e3c */
}

/* Dark Button - Uses Brand Black */
.btn-dark {
    background-color: var(--braun-black);    /* #222222 */
    color: #fff;
}
.btn-dark:hover {
    background-color: var(--braun-black-light);  /* #333333 */
}

/* Light Button */
.btn-light {
    background-color: #fff;
    color: var(--text-main);
    border: 1px solid #ddd;
}
.btn-light:hover {
    background-color: #f5f5f5;
    border-color: #ccc;
}

/* Link Button */
.btn-link {
    background: transparent;
    color: var(--braun-yellow-dark);  /* #f9a825 */
    padding: 0;
}
.btn-link:hover {
    text-decoration: underline;
}

/* Outline Variants */
.btn-outline {
    background: transparent;
    border: 2px solid currentColor;
}
.btn-outline.primary {
    color: var(--braun-yellow-dark);  /* #f9a825 */
    border-color: var(--braun-yellow);
}
.btn-outline.primary:hover {
    background-color: var(--braun-yellow);
    color: var(--braun-black);
}
.btn-outline.secondary {
    color: var(--braun-grey);
    border-color: var(--braun-grey);
}
.btn-outline.secondary:hover {
    background-color: var(--braun-grey);
    color: #fff;
}

/* Button Sizes */
.btn-sm { padding: 8px 16px; font-size: 0.8rem; }
.btn-lg { padding: 16px 32px; font-size: 1rem; }
.btn-block { display: flex; width: 100%; justify-content: center; }

/* --- CAPTIONS (Voice Bubble) --- */
#captions {
    order: -1;
    width: 100%;
    max-width: 320px;
    min-height: 100px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 1.15rem;
    color: #555;
    font-weight: 500;
    text-align: center;
    line-height: 1.4;

    opacity: 0;
    transition: opacity 0.3s ease;
}

/* --- DESKTOP / IPAD MEDIA QUERY --- */
@media (min-width: 768px) {
    #captions {
        order: 0;
        width: 350px;
        max-width: 400px;
        height: auto;
        min-height: auto;

        text-align: left;
        justify-content: flex-start;
        font-size: 1.5rem;
    }
}

/* --- HISTORY SHEET (Updated UI) --- */
#history-sheet {
    position: absolute;
    bottom: -100%;
    left: 0;
    width: 100%;
    height: 92%;
    background: #ffffff;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    box-shadow: var(--shadow-sheet);
    transition: bottom 0.5s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 12px 24px 24px 24px;
}

#history-sheet.open {
    bottom: 0;
}

/* Handle Bar */
.sheet-handle {
    width: 36px;
    height: 5px;
    background-color: #E5E5EA;
    border-radius: 2.5px;
    margin: 0 auto 16px auto;
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.sheet-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #000;
    letter-spacing: -0.3px;
}

/* "Done" Text Button */
.close-btn {
    background: transparent;
    border: none;
    padding: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: #007AFF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;

    width: auto;
    height: auto;
    box-shadow: none;
    border-radius: 0;
}

.close-btn.active-click {
    box-shadow: none !important;
    transform: none !important;
    opacity: 0.6;
}

.close-btn:active { opacity: 0.6; box-shadow: none; transform: none; }

.history-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    scrollbar-width: none;
    padding-bottom: 40px;
}
.history-list::-webkit-scrollbar { display: none; }

.history-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-bottom: 1px solid #f2f2f7;
    padding-bottom: 20px;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.history-item:last-child { border-bottom: none; }

.h-question,
.h-q {
    font-size: 0.95rem;
    color: #8e8e93;
    font-weight: 400;
    line-height: 1.4;
}

.h-answer,
.h-a {
    font-size: 1.5rem;
    font-weight: 600;
    color: #000;
    letter-spacing: -0.5px;
}

/* Updated Logic Styling (Lighter Yellow & Black Text) */
.h-logic-container,
.h-l-box {
    margin-top: 8px;
    background-color: #FFFDE7;
    border-radius: 8px;
    padding: 12px;
    border-left: 3px solid var(--braun-yellow);
}

.h-logic-label,
.h-l-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

/* BULLETED LOGIC STYLING */
.h-logic-content,
.h-l-text {
    font-size: 0.9rem;
    color: #000;
    font-weight: 500;
    line-height: 1.5;
}

.h-logic-content ul {
    margin: 0;
    padding-left: 18px;
    list-style-type: disc;
}

.h-logic-content li {
    margin-bottom: 6px;
    padding-left: 2px;
}

.h-logic-content li:last-child {
    margin-bottom: 0;
}

/* --- CLICK FINGER (Cursor Simulator) --- */
#cursor {
    position: fixed;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.4);
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: left 0.6s cubic-bezier(0.25, 1, 0.5, 1), top 0.6s cubic-bezier(0.25, 1, 0.5, 1), transform 0.1s;
    opacity: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    margin-left: -12px;
    margin-top: -12px;
}

#cursor.tap {
    transform: scale(0.8);
    background: rgba(255, 255, 255, 0.8);
}

/* ======================================
   STYLE GUIDE SPECIFIC STYLES
   ====================================== */

/* Style guide uses white background */
body.styleguide {
    background-color: #ffffff;
}

/* Style guide container override */
body.styleguide .container {
    max-width: 1000px;
    padding: 40px;
    flex-direction: column;
    align-items: stretch;
}

body.styleguide .site-footer {
    border-top: 1px solid #eee;
}

/* Style guide nav trigger background */
body.styleguide .nav-trigger {
    background-color: #f9f9f9;
}

body.styleguide .nav-trigger:hover {
    background-color: #f0f0f0;
}

/* Style guide header */
.styleguide header {
    margin-bottom: 60px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.styleguide h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #111;
}

.styleguide .subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.styleguide section {
    margin-bottom: 80px;
}

.styleguide h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #111;
}

.styleguide h2::before {
    content: '';
    display: block;
    width: 4px;
    height: 24px;
    background: var(--braun-yellow);
    border-radius: 2px;
}

/* --- PALETTE GRID --- */
.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.color-card {
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.color-swatch {
    height: 100px;
    width: 100%;
}

.color-info {
    padding: 15px;
}

.color-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 5px; display: block; }
.color-hex { font-family: monospace; color: var(--text-secondary); font-size: 0.8rem; }
.color-var { font-family: monospace; color: #888; font-size: 0.7rem; margin-top: 5px; display: block; }

/* --- TYPOGRAPHY --- */
.type-row {
    display: flex;
    align-items: baseline;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f9f9f9;
}
.type-label { width: 200px; font-family: monospace; color: var(--text-secondary); font-size: 0.8rem; }
.type-example { flex: 1; }

/* --- UI COMPONENTS --- */
.component-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 40px;
}

.component-card {
    background: var(--bg-page);
    padding: 40px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.icon-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    width: 100%;
    place-items: center;
}

.icon-variant {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.icon-label {
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
}

.app-icon-svg {
    width: 180px;
    height: 180px;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.15));
    border-radius: 22%;
}

.component-label {
    position: absolute;
    top: 10px;
    left: 15px;
    font-family: monospace;
    font-size: 0.75rem;
    color: #888;
}

/* ======================================
   CONTENT PAGE STYLES
   ====================================== */

/* Content page layout container */
.content-page {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 24px 80px;
}

/* Page title (from layout) */
.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 40px;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

/* Page content wrapper */
.page-content {
    font-size: 1.05rem;
}

/* Headings hierarchy */
.content-page h2 {
    font-size: 1.6rem;
    font-weight: 600;
    color: #111;
    margin-top: 48px;
    margin-bottom: 20px;
    letter-spacing: -0.3px;
    line-height: 1.3;
}

.content-page h2:first-child {
    margin-top: 0;
}

.content-page h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #222;
    margin-top: 36px;
    margin-bottom: 16px;
    line-height: 1.4;
}

.content-page h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-top: 28px;
    margin-bottom: 12px;
}

/* Paragraphs */
.content-page p {
    color: #4a4a4a;
    line-height: 1.75;
    margin-bottom: 24px;
}

/* Lists */
.content-page ul,
.content-page ol {
    color: #4a4a4a;
    line-height: 1.75;
    margin-bottom: 24px;
    padding-left: 28px;
}

.content-page ul {
    list-style-type: disc;
}

.content-page ol {
    list-style-type: decimal;
}

.content-page li {
    margin-bottom: 12px;
    padding-left: 4px;
}

.content-page li:last-child {
    margin-bottom: 0;
}

/* Nested lists */
.content-page li > ul,
.content-page li > ol {
    margin-top: 12px;
    margin-bottom: 0;
}

/* Links */
.content-page a {
    color: #c78f00;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.content-page a:hover {
    border-bottom-color: currentColor;
}

/* Bold text */
.content-page strong {
    color: #111;
    font-weight: 600;
}

/* Horizontal rule */
.content-page hr {
    border: none;
    height: 1px;
    background-color: #e0e0e0;
    margin: 48px 0;
}

/* Blockquotes */
.content-page blockquote {
    border-left: 4px solid var(--braun-yellow);
    padding: 16px 24px;
    margin: 28px 0;
    background-color: #fafafa;
    border-radius: 0 8px 8px 0;
}

.content-page blockquote p {
    color: #555;
    font-style: italic;
    margin-bottom: 0;
}

/* Code inline */
.content-page code {
    background-color: #f5f5f5;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
    color: var(--braun-black);
}

/* Code blocks */
.content-page pre {
    background-color: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 24px;
}

.content-page pre code {
    padding: 0;
    background: none;
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .content-page {
        padding: 40px 20px 60px;
    }

    .page-title {
        font-size: 2rem;
        margin-bottom: 32px;
    }

    .page-content {
        font-size: 1rem;
    }

    .content-page h2 {
        font-size: 1.4rem;
        margin-top: 40px;
    }

    .content-page h3 {
        font-size: 1.15rem;
        margin-top: 32px;
    }
}

/* ======================================
   ABOUT PAGE: EXAMPLES GRID
   ====================================== */

.examples-grid {
    margin: 32px 0 48px;
}

.examples-grid h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--braun-black);
    margin: 32px 0 12px;
}

.examples-grid h4:first-child {
    margin-top: 0;
}

/* History items on content pages */
.content-page .history-item {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-bottom: 0;
    border-bottom: none;
}

.content-page .history-item .h-question {
    font-size: 0.95rem;
    color: #666;
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: 8px;
}

.content-page .history-item .h-answer {
    font-size: 1.4rem;
    font-weight: 600;
    color: #000;
    letter-spacing: -0.3px;
    margin-bottom: 12px;
}

.content-page .history-item .h-logic-container {
    margin-top: 0;
}

.content-page .history-item .h-logic-content ul {
    margin-bottom: 0;
    padding-left: 18px;
    color: #000;
}

.content-page .history-item .h-logic-content li {
    margin-bottom: 6px;
    padding-left: 2px;
    font-size: 0.9rem;
}

/* ======================================
   FAQ ACCORDION STYLES
   ====================================== */

.faq-accordion {
    margin-top: 8px;
}

.faq-category {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin: 40px 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.faq-category:first-child {
    margin-top: 0;
}

.faq-item {
    border: 1px solid #eee;
    border-radius: 12px;
    margin-bottom: 12px;
    background: #fff;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.faq-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.faq-item[open] {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    color: var(--braun-black);
    list-style: none;
    user-select: none;
    transition: background-color 0.2s ease;
}

.faq-question:hover {
    background-color: #fafafa;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question::marker {
    display: none;
}

.faq-question span {
    flex: 1;
    padding-right: 16px;
}

.faq-chevron {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #999;
    transition: transform 0.3s ease;
}

.faq-item[open] .faq-chevron {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 20px 20px;
    color: #555;
    line-height: 1.7;
}

.faq-answer p {
    margin: 0 0 16px;
}

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

.faq-answer ul,
.faq-answer ol {
    margin: 12px 0 0;
    padding-left: 24px;
}

.faq-answer li {
    margin-bottom: 8px;
}

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

.faq-answer a {
    color: #c78f00;
    text-decoration: none;
}

.faq-answer a:hover {
    text-decoration: underline;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .faq-question {
        padding: 16px;
        font-size: 0.95rem;
    }

    .faq-answer {
        padding: 0 16px 16px;
    }
}

/* ======================================
   404 ERROR PAGE STYLES
   ====================================== */

.error-page-content {
    width: 100%;
    max-width: 600px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    margin: 0 auto;
    min-height: 60vh;
}

.error-code {
    font-size: 8rem;
    font-weight: 800;
    color: var(--braun-yellow);
    line-height: 1;
    margin-bottom: 20px;
    text-shadow: 4px 4px 0 rgba(0,0,0,0.1);
    position: relative;
    display: inline-block;
}

/* Fun calculator decoration */
.error-code::after {
    content: '÷0';
    position: absolute;
    font-size: 1.5rem;
    color: #333;
    bottom: 20px;
    right: -30px;
    transform: rotate(-15deg);
    background: #fff;
    padding: 4px 8px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.error-page-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--braun-black);
}

.error-page-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.6;
}

.btn-home {
    background-color: var(--braun-black);
    color: white;
    padding: 14px 28px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, background-color 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: inline-block;
}

.btn-home:hover {
    background-color: #000;
    transform: translateY(-2px);
}

.btn-home:active {
    transform: scale(0.98);
}

@media (max-width: 600px) {
    .error-code {
        font-size: 6rem;
    }

    .error-code::after {
        font-size: 1.2rem;
        bottom: 15px;
        right: -20px;
    }

    .error-page-content h1 {
        font-size: 1.6rem;
    }

    .error-page-content p {
        font-size: 1rem;
    }
}
