/* ═══════════════════════════════════════════════════════
   Intro flashcards - "Quick intro"
   Styled as a technical index-card deck rather than a generic
   dots-and-arrows carousel: numbered reference cards with
   corner tick marks, a monospace tab rail, and a literal
   card-flip transition (rotateY) between them. Launched from
   a folder tab that peeks off the right edge of the viewport.
   Landing page only.
   ═══════════════════════════════════════════════════════ */

/* ── Launcher: a folder tab peeking off the edge ── */
.ic-launcher {
    position: fixed; top: 50%; right: 0; z-index: 950;
    transform: translateY(-50%) translateX(calc(100% - 38px));
    display: flex; align-items: center; gap: 0.55rem;
    padding: 0.9rem 0.85rem;
    background: var(--text-primary); color: #FAFAF8;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    box-shadow: var(--shadow-md); cursor: pointer; border: none;
    writing-mode: vertical-rl; text-orientation: mixed;
    font-family: 'Inter', sans-serif; font-size: 0.72rem; font-weight: 700;
    letter-spacing: 1.5px; text-transform: uppercase;
    transition: transform 0.35s var(--ease), background 0.25s ease;
}
.ic-launcher:hover, .ic-launcher:focus-visible {
    transform: translateY(-50%) translateX(0);
    background: var(--accent-espresso);
}
.ic-launcher:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 2px; }
.ic-launcher-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ic-launcher-icon svg { width: 14px; height: 14px; transform: rotate(90deg); }
.ic-launcher-label { white-space: nowrap; }

/* ── Overlay + modal shell ── */
.ic-overlay {
    position: fixed; inset: 0; z-index: 970;
    display: flex; align-items: center; justify-content: center; padding: 1.5rem;
    background: rgba(9,15,26,0.62); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
    opacity: 0; pointer-events: none; transition: opacity 0.3s var(--ease);
}
.ic-overlay.is-open { opacity: 1; pointer-events: auto; }

.ic-modal {
    position: relative; z-index: 1; width: min(600px, 100%); background: transparent;
    transform: translateY(18px) rotate(-0.6deg) scale(0.97); opacity: 0;
    transition: transform 0.36s var(--ease), opacity 0.36s var(--ease);
}
.ic-overlay.is-open .ic-modal { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }

.ic-close {
    position: absolute; top: -16px; right: -16px; z-index: 4;
    width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--glass-border); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-primary); color: var(--text-primary); box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.ic-close:hover { background: var(--accent-gold-light); border-color: var(--accent-gold); }
.ic-close:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 2px; }


/* ── Deck: perspective wrapper for the flip transition ── */
.ic-stage { position: relative; }
.ic-deck {
    position: relative; min-height: 420px; perspective: 1600px;
}

/* Ghost cards - a fanned stack peeking out behind the active
   card, for the "hand of cards" depth from the reference. */
.ic-ghost {
    position: absolute; inset: 0; border-radius: var(--radius-md);
    background: var(--bg-secondary); border: 1px solid var(--glass-border);
    box-shadow: 0 16px 36px rgba(10,20,40,0.16); pointer-events: none;
}
.ic-ghost-1 { transform: rotate(-2.4deg) translate(-6px, 4px) scale(0.97); opacity: 0.9; }
.ic-ghost-2 { transform: rotate(1.8deg) translate(6px, 8px) scale(0.94); opacity: 0.55; background: var(--bg-primary); }

/* ── Each card: a flat index card with corner ticks ── */
.ic-card {
    position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; justify-content: center;
    padding: 3rem 2.75rem; background: var(--bg-primary);
    border: 1px solid var(--glass-border); border-radius: var(--radius-md);
    box-shadow: 0 24px 60px rgba(10,20,40,0.24);
    backface-visibility: hidden; transform-style: preserve-3d;
    transform-origin: center; transform: rotateY(78deg) scale(0.96); opacity: 0; pointer-events: none;
    transition: transform 0.55s cubic-bezier(0.34, 1, 0.42, 1), opacity 0.3s ease;
}
.ic-card.is-active { opacity: 1; transform: rotateY(0deg) scale(1); pointer-events: auto; }
.ic-card.is-leaving { opacity: 0; transform: rotateY(-78deg) scale(0.96); }

/* Corner tick marks - the site's recurring technical-detail motif */
.ic-card::before, .ic-card::after {
    content: ''; position: absolute; width: 18px; height: 18px; opacity: 0.65; pointer-events: none;
}
.ic-card::before { top: 16px; left: 16px; border-top: 2px solid var(--accent-gold); border-left: 2px solid var(--accent-gold); }
.ic-card::after { bottom: 16px; right: 16px; border-bottom: 2px solid var(--accent-gold); border-right: 2px solid var(--accent-gold); }

.ic-card-ref {
    position: absolute; top: 20px; right: 26px;
    font-family: 'SF Mono', 'Courier New', monospace; font-size: 0.76rem; font-weight: 600;
    color: var(--text-secondary); letter-spacing: 0.5px; opacity: 0.7;
}

.ic-card-mark {
    display: flex; align-items: center; justify-content: center;
    width: 54px; height: 54px; border-radius: 50%;
    background: var(--accent-gold-light); color: var(--accent-technical);
    margin-bottom: 1.4rem;
}
.ic-card-mark svg { width: 24px; height: 24px; }

.ic-card-eyebrow {
    font-size: 0.8rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
    color: var(--accent-technical); margin-bottom: 0.65rem;
}
.ic-card-title {
    font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 2.2rem;
    color: var(--text-primary); line-height: 1.16; margin-bottom: 0.85rem;
}
.ic-card-body {
    font-family: 'Inter', sans-serif; font-size: 1.02rem; line-height: 1.62;
    color: var(--text-secondary); max-width: 42ch;
}
.ic-card-cta.btn { margin-top: 1.5rem; padding: 0.75rem 1.6rem; font-size: 0.74rem; width: fit-content; }
.ic-card-cta svg { width: 13px; height: 13px; transition: transform 0.25s var(--ease); }
.ic-card-cta:hover svg { transform: translateX(3px); }

@media (prefers-reduced-motion: reduce) {
    .ic-card { transition: opacity 0.25s ease; transform: none !important; }
}

/* ── Control panel: one cohesive frosted-glass dock below the
   card, holding prev/next, the numbered tab rail, and replay -
   instead of controls floating loose on the backdrop. ── */
.ic-panel {
    margin-top: 1.1rem; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius-md); padding: 0.6rem 0.7rem;
}

.ic-tabs { display: flex; align-items: center; justify-content: center; gap: 0.4rem; flex-wrap: wrap; }
.ic-tab {
    width: 32px; height: 30px; border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,0.2);
    background: transparent; color: rgba(250,250,248,0.75); cursor: pointer;
    font-family: 'SF Mono', 'Courier New', monospace; font-size: 0.7rem; font-weight: 600;
    display: flex; align-items: center; justify-content: center; transition: var(--transition);
}
.ic-tab:hover { border-color: var(--accent-gold); color: #fff; }
.ic-tab:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 2px; }
.ic-tab.is-active { background: var(--accent-gold); border-color: var(--accent-gold); color: var(--bg-primary); }

.ic-arrow {
    flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.2);
    background: transparent; color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: var(--transition);
}
.ic-arrow svg { width: 15px; height: 15px; }
.ic-arrow:hover { background: rgba(255,255,255,0.14); border-color: var(--accent-gold); }
.ic-arrow:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 2px; }
.ic-arrow[disabled] { opacity: 0.3; cursor: not-allowed; }
.ic-arrow[disabled]:hover { background: transparent; border-color: rgba(255,255,255,0.2); }

.ic-replay {
    flex-shrink: 0; background: none; border: none; cursor: pointer; padding: 0.4rem;
    color: rgba(250,250,248,0.65); display: flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: var(--transition);
}
.ic-replay svg { width: 15px; height: 15px; }
.ic-replay:hover { color: #fff; background: rgba(255,255,255,0.14); }
.ic-replay:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 2px; }

@media (max-width: 640px) {
    .ic-card { padding: 2.25rem 1.75rem; }
    .ic-card-title { font-size: 1.85rem; }
    .ic-card-body { font-size: 0.94rem; }
    .ic-panel { padding: 0.5rem; gap: 0.4rem; }
    .ic-tab { width: 30px; height: 30px; }
    .ic-arrow { width: 34px; height: 34px; }
}

@media (max-width: 480px) {
    .ic-launcher { top: auto; bottom: calc(1.25rem + 66px); right: 0; transform: translateX(calc(100% - 34px)); padding: 0.7rem 0.6rem; }
    .ic-launcher:hover, .ic-launcher:focus-visible { transform: translateX(0); }
    .ic-modal { width: 100%; }
    .ic-deck { min-height: 380px; }
    .ic-card-title { font-size: 1.5rem; }
    .ic-panel { flex-wrap: wrap; justify-content: center; }
    .ic-tabs { order: 3; width: 100%; margin-top: 0.35rem; }
    .ic-tab { width: 28px; height: 28px; font-size: 0.66rem; }
}
