/* ============================================
   LLITTL.com - Frutiger Aero Pastoral Dashboard
   ============================================ */

/* --- Color Palette ---
   Mist (Background):  #E8ECF1
   Frost (Panel):      #F4F6F9  (at 72% opacity)
   Slate (Primary):    #2C3340
   Pewter (Secondary): #6B7A8D
   Heron Blue (Accent):#5B7FA6
   Wild Rose (Warm):   #B8687B
   Veil (Border):      #D1D8E0
   Morning (Glow):     #C9D4E2
   Charcoal (Dark):    #1E242E
   ------------------------------------ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.9375rem;
    line-height: 1.8;
    color: #2C3340;
    background-color: #E8ECF1;
    overflow-x: hidden;
}

/* --- Board (Full-viewport sections) --- */

.board {
    min-height: 100vh;
    width: 100%;
    padding: 24px;
    display: flex;
    align-items: stretch;
}

.board-inner {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* --- Top Band --- */

.top-band {
    min-height: 18vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 40px;
    background: rgba(244, 246, 249, 0.72);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow:
        0 8px 32px rgba(100, 110, 130, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    background-image: linear-gradient(to bottom, rgba(255,255,255,0.15), transparent);
}

/* --- Site Title --- */

.site-title {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.75rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #2C3340;
    margin-bottom: 16px;
}

.board-heading {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.75rem);
    letter-spacing: 0.06em;
    color: #2C3340;
    margin-bottom: 8px;
}

.board-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.875rem;
    color: #6B7A8D;
    min-height: 1.5em;
}

/* --- Typewriter --- */

.typewriter-line {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 1rem;
    color: #6B7A8D;
    min-height: 1.5em;
}

.typewriter-text {
    white-space: nowrap;
}

.typewriter-cursor {
    color: #5B7FA6;
    animation: cursorBlink 1.06s steps(1) infinite;
    margin-left: 1px;
    font-weight: 400;
}

@keyframes cursorBlink {
    0%, 49.9% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* --- Middle Band --- */

.middle-band {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 16px;
    min-height: 55vh;
}

.middle-band-centered {
    align-content: center;
}

/* --- Card Base --- */

.card {
    background: rgba(244, 246, 249, 0.72);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-radius: 12px;
    border: 1px solid #D1D8E0;
    box-shadow:
        0 8px 32px rgba(100, 110, 130, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    background-image: linear-gradient(to bottom, rgba(255,255,255,0.15), transparent);
    padding: 24px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition:
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.3s ease,
        backdrop-filter 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.card.visible {
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(91, 127, 166, 0.4);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
}

/* --- Card Sizes (Grid Placement) --- */

/* Board 1 */
.board-1 .card-large {
    grid-column: 1 / 8;
    grid-row: 1 / 3;
}
.board-1 .card-medium {
    grid-column: 8 / 13;
    grid-row: 1 / 2;
}
.board-1 .card-small {
    grid-column: 8 / 13;
    grid-row: 2 / 3;
}

/* Board 2 */
.board-2 .card-letter {
    grid-column: 1 / 7;
    grid-row: 1 / 2;
}
.board-2 .card-typo {
    grid-column: 7 / 13;
    grid-row: 1 / 2;
}
.board-2 .middle-band .card-medium {
    grid-column: 1 / 5;
    grid-row: 2 / 3;
}
.board-2 .middle-band .card-small:nth-child(4) {
    grid-column: 5 / 9;
    grid-row: 2 / 3;
}
.board-2 .middle-band .card-small:nth-child(5) {
    grid-column: 9 / 13;
    grid-row: 2 / 3;
}

/* Board 3 */
.board-3 .middle-band .card-medium {
    grid-column: 1 / 6;
    grid-row: 1 / 2;
}
.board-3 .card-large {
    grid-column: 6 / 13;
    grid-row: 1 / 3;
}
.board-3 .card-small {
    grid-column: 1 / 6;
    grid-row: 2 / 3;
}

/* Board 4 */
.board-4 .middle-band .card-medium:nth-child(1) {
    grid-column: 1 / 5;
    grid-row: 1 / 2;
}
.board-4 .middle-band .card-medium:nth-child(2) {
    grid-column: 5 / 9;
    grid-row: 1 / 2;
}
.board-4 .middle-band .card-medium:nth-child(3) {
    grid-column: 9 / 13;
    grid-row: 1 / 2;
}
.board-4 .card-wide {
    grid-column: 1 / 13;
    grid-row: 2 / 3;
}

/* Board 5 */
.board-5 .card-large {
    grid-column: 1 / 8;
    grid-row: 1 / 3;
}
.board-5 .card-medium {
    grid-column: 8 / 13;
    grid-row: 1 / 2;
}
.board-5 .card-small {
    grid-column: 8 / 13;
    grid-row: 2 / 3;
}

/* Board 6 */
.board-6 .card-wide {
    grid-column: 2 / 12;
    grid-row: 1 / 2;
}
.board-6 .middle-band .card-medium:nth-child(2) {
    grid-column: 1 / 5;
    grid-row: 2 / 3;
}
.board-6 .middle-band .card-medium:nth-child(3) {
    grid-column: 5 / 9;
    grid-row: 2 / 3;
}
.board-6 .middle-band .card-medium:nth-child(4) {
    grid-column: 9 / 13;
    grid-row: 2 / 3;
}

/* --- Card Content --- */

.card-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    color: #6B7A8D;
    letter-spacing: 0.03em;
    display: block;
    margin-top: 8px;
}

.card-body {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.9375rem;
    line-height: 1.8;
    color: #2C3340;
    min-height: 2em;
}

.card-quote {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 1.125rem;
    line-height: 1.7;
    color: #B8687B;
    padding: 8px 0;
}

.card-quote em {
    font-style: italic;
}

.large-quote {
    font-size: 1.25rem;
    line-height: 1.75;
}

.card-text-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.centered-text {
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 16px;
}

/* --- Photo Areas --- */

.card-photo-area {
    flex: 1;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    min-height: 100px;
}

.photo-placeholder {
    width: 100%;
    height: 100%;
    min-height: 120px;
    border-radius: 8px;
    filter: grayscale(0.7) sepia(0.05) brightness(1.05) contrast(0.95);
}

.photo-wheat {
    background: linear-gradient(
        135deg,
        #C9D4E2 0%,
        #D1D8E0 20%,
        #B8C5D4 40%,
        #C5CED9 55%,
        #D6DDE5 70%,
        #C1CCD8 85%,
        #BECAD7 100%
    );
    background-size: 200% 200%;
}

.photo-window {
    background: linear-gradient(
        180deg,
        #C9D4E2 0%,
        #D5DCE4 30%,
        rgba(91, 127, 166, 0.15) 50%,
        #D1D8E0 70%,
        #E0E5EB 100%
    );
}

.photo-berries {
    background: radial-gradient(
        ellipse at 40% 50%,
        rgba(184, 104, 123, 0.25) 0%,
        #C9D4E2 40%,
        #D1D8E0 70%,
        #DDE2E8 100%
    );
}

.photo-cup {
    background: radial-gradient(
        ellipse at 50% 60%,
        #D1D8E0 0%,
        #C9D4E2 30%,
        #E0E5EB 60%,
        #E8ECF1 100%
    );
}

.photo-fog {
    background: linear-gradient(
        180deg,
        #D8DFE7 0%,
        #E0E5EB 15%,
        #E8ECF1 35%,
        #D1D8E0 55%,
        #C9D4E2 75%,
        #D5DCE4 100%
    );
}

/* --- SVG Drawings --- */

.svg-drawing {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    min-height: 100px;
}

.svg-drawing svg {
    width: 100%;
    height: 100%;
    max-height: 200px;
}

.draw-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2s ease-in-out;
}

.draw-line.animated {
    stroke-dashoffset: 0;
}

/* Replay on hover */
.card:hover .draw-line.animated {
    stroke-dashoffset: 1000;
    animation: drawStroke 2s ease-in-out forwards;
}

@keyframes drawStroke {
    from { stroke-dashoffset: 1000; }
    to { stroke-dashoffset: 0; }
}

/* --- Wax Seal --- */

.wax-seal {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #B8687B;
    color: #F4F6F9;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.6875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(184, 104, 123, 0.3);
}

/* --- Address Block --- */

.address-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.8125rem;
    color: #6B7A8D;
    line-height: 1.9;
    margin-bottom: 16px;
    padding-right: 8px;
}

/* --- Envelope Fold --- */

.envelope-fold {
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, transparent 50%, rgba(209, 216, 224, 0.3) 50%);
    pointer-events: none;
}

/* --- Stamp Frame --- */

.stamp-frame {
    width: 52px;
    height: 52px;
    border: 2px dashed #D1D8E0;
    border-radius: 2px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    align-self: flex-end;
}

.stamp-inner {
    width: 100%;
    height: 100%;
}

.stamp-inner svg {
    width: 100%;
    height: 100%;
}

/* --- Word Grid (Typographic Composition) --- */

.word-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 8px;
    width: 100%;
    height: 100%;
    align-items: center;
    padding: 16px;
}

.word-grid-small {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 1fr);
}

.word-cell {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 1rem;
    color: #2C3340;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Bottom Band (Footer Widgets) --- */

.bottom-band {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    min-height: 12vh;
}

.widget {
    background: #1E242E;
    border-radius: 12px;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow:
        0 8px 32px rgba(100, 110, 130, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.widget-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.6875rem;
    color: #6B7A8D;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.widget-value {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 1rem;
    color: #F4F6F9;
    min-height: 1.3em;
}

/* --- Board Transition (scroll-driven) --- */

.card-fade {
    opacity: 0;
    transform: translateY(20px);
}

.card-fade.visible {
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-fade.exiting {
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Subtle ambient shift between boards --- */

.board-1 { background-color: #E8ECF1; }
.board-2 { background-color: #E6EAF0; }
.board-3 { background-color: #E4E8EF; }
.board-4 { background-color: #E2E6EE; }
.board-5 { background-color: #E0E4ED; }
.board-6 { background-color: #DEE3EC; }

/* --- Responsive: Mobile (<768px) --- */

@media (max-width: 768px) {
    .board {
        padding: 16px;
        min-height: auto;
    }

    .board-inner {
        gap: 12px;
    }

    .top-band {
        min-height: auto;
        padding: 24px 20px;
    }

    .site-title {
        font-size: 1.75rem;
    }

    .board-heading {
        font-size: 1.5rem;
    }

    .middle-band {
        display: flex;
        flex-direction: column;
        gap: 16px;
        min-height: auto;
    }

    .card {
        border-radius: 12px;
        padding: 20px;
    }

    .card-large,
    .card-medium,
    .card-small,
    .card-letter,
    .card-typo,
    .card-wide {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
    }

    .bottom-band {
        grid-template-columns: 1fr;
        gap: 12px;
        min-height: auto;
    }

    .svg-drawing svg {
        max-height: 160px;
    }

    .word-grid {
        padding: 12px;
        gap: 4px;
    }

    .large-quote {
        font-size: 1.1rem;
    }

    .typewriter-line {
        font-size: 0.875rem;
    }
}

/* --- Scrollbar Styling --- */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #E8ECF1;
}

::-webkit-scrollbar-thumb {
    background: #C9D4E2;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5B7FA6;
}

/* --- Selection Color --- */

::selection {
    background: rgba(91, 127, 166, 0.25);
    color: #2C3340;
}
