/* Building blocks of the idea pages (/was-soll-ich-zeichnen/ and co.),
   written by scripts/build-ideas.mjs. Everything else on those pages is the
   homepage's own CSS, copied in at build time, so both always look the same.
   Uses the homepage tokens: --ring, --shadow-card, --ease-out, --press. */

/* Breadcrumb and author line in the hero */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #94a3b8;
}

.breadcrumb a {
    color: #64748b;
    text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
    .breadcrumb a:hover {
        color: #fb923c;
    }
}

.hero .byline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: -16px auto 0;
    font-size: 14px;
    color: #64748b;
}

.byline .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

/* Jump links to the groups: the homepage category chips, as links */
.toc {
    padding: 0 24px 56px;
}

.toc .category-grid {
    max-width: 900px;
    margin: 0 auto;
    gap: 12px;
}

.toc .category-tag {
    padding: 10px 18px;
    font-size: 14px;
}

.toc .category-tag .count {
    color: #94a3b8;
    font-weight: 600;
}

/* Idea of the day */
.today {
    padding: 0 24px 72px;
}

.today-box {
    position: relative;
    max-width: 680px;
    margin: 0 auto;
    padding: 36px 36px 32px;
    border-radius: 28px;
    background: linear-gradient(135deg, #fff7ed, #fdf2f8);
    box-shadow: 0 0 0 1px rgba(251, 146, 60, 0.22), 0 18px 48px -18px rgba(244, 114, 182, 0.45);
    text-align: left;
}

.today-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.today-head .drawing {
    width: 40px;
    height: 40px;
}

.today-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fb923c;
}

.today-date {
    font-size: 14px;
    color: #64748b;
}

.today-group {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 12px;
    border-radius: 50px;
    background: #fff;
    box-shadow: var(--ring);
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

.today-title {
    font-size: clamp(24px, 3.6vw, 30px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.025em;
    margin-bottom: 10px;
}

.today-text {
    color: #57534e;
    font-size: 17px;
    margin-bottom: 26px;
}

.today-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 24px;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--press) var(--ease-out), box-shadow 200ms ease;
}

.btn-primary {
    border: none;
    color: #fff;
    background: linear-gradient(135deg, #fb923c, #f472b6);
    box-shadow: var(--shadow-brand);
}

.btn-secondary {
    border: none;
    color: #292524;
    background: #fff;
    box-shadow: var(--ring), 0 1px 2px rgba(41, 37, 36, 0.04);
}

.btn-secondary .drawing {
    width: 22px;
    height: 22px;
}

@media (hover: hover) and (pointer: fine) {
    .btn-primary:hover {
        transform: translateY(-2px);
    }

    .btn-secondary:hover {
        transform: translateY(-2px);
        box-shadow: 0 0 0 1px rgba(251, 146, 60, 0.35), 0 8px 20px rgba(251, 146, 60, 0.14);
    }
}

.btn-primary:active,
.btn-secondary:active {
    transform: scale(0.97);
}

/* The new idea fades in instead of jumping */
.today-body.swap {
    animation: today-in 320ms var(--ease-out);
}

@keyframes today-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
}

/* Groups of ideas: alternate the homepage's two section backgrounds */
.idea-group {
    padding: 72px 24px;
}

.idea-group.alt {
    background: #f8fafc;
}

.idea-group-inner {
    max-width: 1000px;
    margin: 0 auto;
}

.idea-group-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.idea-group-head .feature-icon {
    margin-bottom: 0;
    flex-shrink: 0;
}

.idea-group h2 {
    font-size: clamp(26px, 3.6vw, 34px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.idea-group-intro {
    color: #64748b;
    font-size: 17px;
    max-width: 680px;
    margin-bottom: 32px;
}

.idea-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 16px;
    counter-reset: idea;
}

.idea {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 18px 20px;
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--ring), var(--shadow-card);
    scroll-margin-top: 110px;
    transition: box-shadow 250ms ease;
}

.idea-num {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #fb923c, #f472b6);
}

.idea h3 {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
    margin-bottom: 3px;
}

.idea p {
    color: #64748b;
    font-size: 15px;
    line-height: 1.5;
}

/* "Zur Idee" from the box: the card glows briefly */
.idea.highlight {
    box-shadow: 0 0 0 2px #fb923c, 0 12px 32px rgba(251, 146, 60, 0.22);
}

/* Programming exercises: one card each, solution behind a details element */
.exercise-list {
    display: grid;
    gap: 20px;
}

.exercise {
    background: #fff;
    border-radius: 24px;
    padding: 28px;
    box-shadow: var(--ring), var(--shadow-card);
    scroll-margin-top: 110px;
    transition: box-shadow 250ms ease;
}

.exercise.highlight {
    box-shadow: 0 0 0 2px #fb923c, 0 12px 32px rgba(251, 146, 60, 0.22);
}

.exercise-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.exercise h3 {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.3;
}

.level {
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.level-1 {
    background: #dcfce7;
    color: #166534;
}

.level-2 {
    background: #fef3c7;
    color: #92400e;
}

.level-3 {
    background: #fce7f3;
    color: #9d174d;
}

.exercise > p {
    color: #57534e;
    font-size: 16px;
    margin-bottom: 10px;
}

.exercise .example {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 10px;
}

.exercise .hint {
    font-size: 15px;
    color: #64748b;
    margin-bottom: 14px;
}

.exercise .hint strong {
    color: #fb923c;
}

code {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.92em;
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 6px;
}

.solution {
    border-radius: 16px;
    box-shadow: var(--ring);
}

.solution summary {
    cursor: pointer;
    list-style: none;
    padding: 14px 48px 14px 18px;
    font-weight: 700;
    font-size: 15px;
    position: relative;
}

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

.solution summary::after {
    content: '+';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #fb923c;
    transition: transform 200ms var(--ease-out);
}

.solution[open] summary::after {
    transform: translateY(-50%) rotate(45deg);
}

.solution-body {
    padding: 0 18px 18px;
}

.lang-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 12px;
    border-radius: 12px;
    background: #f1f5f9;
}

.lang-tabs button {
    border: none;
    background: transparent;
    padding: 6px 14px;
    border-radius: 9px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
}

.lang-tabs button[aria-selected="true"] {
    background: #fff;
    color: #292524;
    box-shadow: 0 1px 3px rgba(41, 37, 36, 0.12);
}

pre {
    margin: 0;
    padding: 18px 20px;
    border-radius: 14px;
    background: #1e293b;
    color: #e2e8f0;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.6;
    tab-size: 4;
}

pre code {
    background: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
}

.solution-note {
    margin-top: 10px;
    font-size: 14px;
    color: #64748b;
}

/* "So gehst du vor": the homepage garden points on a white section */
.howto {
    padding: 80px 24px;
}

.howto-inner {
    max-width: 1000px;
    margin: 0 auto;
}

.howto h2,
.related h2 {
    text-align: center;
    font-size: clamp(30px, 4.4vw, 40px);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 48px;
    letter-spacing: -0.03em;
}

/* More idea pages */
.related {
    background: #f8fafc;
    padding: 80px 24px;
}

.related-grid {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

a.feature-card {
    display: block;
    color: inherit;
    text-decoration: none;
}

a.feature-card .more {
    display: inline-block;
    margin-top: 12px;
    font-weight: 700;
    font-size: 15px;
}

/* Waitlist form on the gradient call to action */
.cta-box .waitlist-form {
    margin-top: 8px;
}

.cta-box .waitlist-input-row input[type="email"] {
    border-color: transparent;
    background: #fff;
}

.cta-box .waitlist-input-row input[type="email"]:focus {
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.45);
}

.cta-box .waitlist-input-row button {
    background: #fff;
    color: #f97316;
    box-shadow: 0 8px 24px rgba(41, 37, 36, 0.12);
}

.cta-box .waitlist-consent {
    color: rgba(255, 255, 255, 0.92);
}

.cta-box .waitlist-consent a {
    color: #fff;
}

.cta-box .waitlist-message.success,
.cta-box .waitlist-message.error {
    color: #fff;
}

.cta-box p.cta-note {
    margin: 18px 0 0;
    font-size: 14px;
    opacity: 0.85;
}

@media (max-width: 640px) {
    .today-box {
        padding: 28px 22px 24px;
        border-radius: 24px;
    }

    .idea-group {
        padding: 56px 20px;
    }

    .idea-list {
        grid-template-columns: 1fr;
    }

    .exercise {
        padding: 22px 18px;
    }

    pre {
        font-size: 13px;
        padding: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .today-body.swap {
        animation: none;
    }
}
