/* =========================================================
   CRAFT PAGE
   ========================================================= */

.craft-toggle-page {
    --craft-lab: #88849d;
    --craft-work: #8199b1;

    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
    text-align: center;
}

/* =========================================================
   INTRO
   ========================================================= */

.craft-title {
    font-size: 26px;
    font-weight: 500;
    margin: 0 0 12px;
}

.craft-subtitle {
    max-width: 460px;
    margin: 0 auto 2.5rem;
    font-size: 15px;
    line-height: 1.6;
    color: #666;
}

/* =========================================================
   LAB / WORK SWITCHER
   ========================================================= */

.mode-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    margin-bottom: 0.8rem;
}

.switch-word {
    position: relative;
    padding: 6px 4px;

    background: none;
    border: none;
    cursor: pointer;

    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    color: #b3b3b3;

    transition: color 0.25s ease;
}

.switch-word--active {
    font-weight: 700;
}

.switch-word--lab.switch-word--active {
    color: var(--craft-lab);
}

.switch-word--work.switch-word--active {
    color: var(--craft-work);
}


.mode-panel--lab .mode-link {
    color: var(--craft-lab);
}

.mode-panel--work .mode-link {
    color: var(--craft-work);
}

/* Hand-drawn selection circles */

.circle-mark {
    position: absolute;
    top: -8px;
    left: -10px;
    width: calc(100% + 20px);
    height: calc(100% + 16px);

    pointer-events: none;
    opacity: 0;
}

.circle-mark path {
    stroke-width: 2.5;
    stroke-dasharray: 220;
    stroke-dashoffset: 220;

    transition: stroke-dashoffset 0.4s ease;
}

.circle-mark--lab path {
    stroke: var(--craft-lab);
}

.circle-mark--work path {
    stroke: var(--craft-work);
}

.switch-word--active .circle-mark {
    opacity: 1;
}

.switch-word--active .circle-mark path {
    stroke-dashoffset: 0;
}

/* Initial interaction hint */

.click-hint {
    margin: -14px 0 1rem;
    font-size: 11px;
    color: #000;
    transition: opacity 0.3s ease;
}

.click-hint.is-hidden {
    opacity: 0;
    pointer-events: none;
}

/* =========================================================
   CRAFT PANELS
   ========================================================= */

.mode-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;

    max-width: 900px;
    margin: 2rem auto 0;
}

.mode-panel {
    display: block;
    color: inherit;
    text-decoration: none;

    transition: opacity 0.3s ease, transform 0.3s ease;
}

.mode-panel:hover {
    transform: translateY(-4px);
}

/* Selection states */

.mode-panel:not(.is-active) {
    opacity: 0.5;
}

.mode-panel.is-active {
    opacity: 1;
}

.mode-panel:not(.is-active):hover,
.mode-panel:not(.is-active):focus-visible {
    opacity: 0.85;
}

/* =========================================================
   ILLUSTRATIONS
   ========================================================= */

.mode-illustration {
    display: flex;
    align-items: flex-end;
    justify-content: center;

    width: 100%;
    height: 230px;
    margin-bottom: 0.5rem;

    overflow: hidden;
}

.mode-illustration img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* =========================================================
   PANEL CONTENT
   ========================================================= */

.mode-content {
    padding: 0 0.5rem;
    text-align: left;
}

.mode-title-line {
    position: relative;
    display: inline-block;

    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
}

/* Hand-drawn title underlines */

.underline {
    position: absolute;
    left: 0;
    bottom: -6px;

    width: 100%;
    height: 5px;
}

.underline path {
    stroke-width: 2.5;
    opacity: 0.55;
}

.underline--lab path {
    stroke: var(--craft-lab);
}

.underline--work path {
    stroke: var(--craft-work);
}

/* Descriptions */

.mode-line {
    max-width: 380px;
    margin: 1.25rem 0 1rem;

    font-size: 0.85rem;
    line-height: 1.6;
    opacity: 0.85;
}

/* Panel links */

.mode-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;

    font-size: 0.8rem;
    font-weight: 700;
}

.mode-link .work-arrow {
    width: 20px;
    height: 15px;
    flex-shrink: 0;

    transition: transform 0.2s ease;
}

.mode-panel:hover .work-arrow {
    transform: translate(3px, -2px);
}

/* =========================================================
   FOOTPRINTS LINK
   ========================================================= */

.craft-end {
    margin: 4rem auto 0;
    color: #666;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

    .mode-panels {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        padding: 0 0.5rem;
    }

    .mode-panel {
        display: grid;
        grid-template-columns: 34% 1fr;
        gap: 1rem;
        align-items: center;

        max-width: 500px;
        width: 100%;
        margin: 0 auto;

        order: 1;
    }

    .mode-panel.is-active {
        order: 0;
    }

    .mode-illustration {
        height: 150px;
        margin: 0;
    }

    .mode-content {
        padding: 0;
        text-align: left;
    }

    .mode-title-line {
        font-size: 1.1rem;
    }

    .mode-line {
        margin: 0.9rem 0 0.75rem;
        font-size: 0.78rem;
        line-height: 1.5;
    }

    .mode-link {
        font-size: 0.75rem;
    }
}