/* components.css — buttons, cards, theme menu, timeline, carousel, skills cloud, modal. */

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 0.85rem 1.9rem;
    border-radius: 3px;
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.4px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.btn-primary {
    background: var(--accent);
    color: var(--on-accent);
    box-shadow: 0 4px 15px color-mix(in srgb, var(--accent) 25%, transparent);
}
.btn-primary:hover {
    background: var(--accent-dim);
    color: var(--on-accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 22px color-mix(in srgb, var(--accent) 35%, transparent);
}
.btn-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Tags ---------- */
.tag-row { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.tag {
    padding: 0.4rem 0.9rem;
    background: var(--tag-bg);
    color: var(--accent);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 3px;
    border: 1px solid var(--tag-border);
}

/* ---------- Info cards & stats ---------- */
.info-card {
    display: flex;
    align-items: flex-start;
    gap: 1.1rem;
    padding: 1.4rem 1.5rem;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: border-color 0.3s ease, transform 0.3s ease;
}
.info-card:hover { border-color: var(--accent); transform: translateX(8px); }
.info-card-link { text-decoration: none; color: inherit; cursor: pointer; }
.info-icon {
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px;
    border-radius: 10px;
    background: var(--tag-bg);
    color: var(--accent);
    border: 1px solid var(--tag-border);
}
.info-icon svg { width: 22px; height: 22px; }
.info-ext { font-size: 0.8em; color: var(--accent); }
.info-text { color: var(--text-muted); line-height: 1.5; }

/* Headshot area in the intro (drop a photo at assets/headshot.jpg) */
.headshot {
    position: relative;
    float: left;
    width: 150px; height: 150px;
    margin: 0.2rem 1.5rem 0.6rem 0;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.headshot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.headshot-monogram {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3.4rem; font-weight: 700;
    color: var(--on-accent);
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
    letter-spacing: 1px;
}
@media (max-width: 560px) {
    .headshot { width: 110px; height: 110px; }
    .headshot-monogram { font-size: 2.5rem; }
}
.info-text strong { display: block; color: var(--text); font-size: 1.05rem; margin-bottom: 0.2rem; }
.info-text strong a { color: var(--text); }
.info-text strong a:hover { color: var(--accent); }
.info-sub { display: block; font-size: 0.88rem; color: var(--text-faint); margin-top: 0.15rem; }

.stat-item {
    padding: 1.75rem;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-align: center;
    transition: border-color 0.3s ease, transform 0.3s ease;
}
.stat-item:hover { border-color: var(--accent); transform: translateY(-4px); }
.stat-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.75rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 0.4rem;
}
.stat-label { color: var(--text-muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 1px; }

/* ---------- Theme switcher ---------- */
.theme-switcher { position: relative; }
.theme-btn {
    display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-elev);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.25s ease, border-color 0.25s ease;
}
.theme-btn:hover { color: var(--accent); border-color: var(--accent); }
.theme-menu {
    position: absolute;
    right: 0; top: calc(100% + 0.6rem);
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.5rem;
    box-shadow: var(--shadow);
    min-width: 168px;
    z-index: 60;
}
.theme-option {
    display: flex; align-items: center; gap: 0.7rem;
    width: 100%;
    padding: 0.6rem 0.7rem;
    background: transparent;
    border: none;
    border-radius: 7px;
    color: var(--text);
    font-size: 0.92rem;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.theme-option:hover { background: var(--bg-elev-2); }
.theme-option[aria-checked='true'] { color: var(--accent); font-weight: 500; }
.theme-swatch { width: 16px; height: 16px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--text) 25%, transparent); }

/* ---------- Timeline (vertical, alternating sides, hover-expand) ---------- */
.timeline {
    position: relative;
    max-width: 920px;
    margin: 0 auto;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 50%; transform: translateX(-50%);
    top: 8px; bottom: 8px;
    width: 2px;
    background: var(--border);
}
.timeline-item {
    position: relative;
    display: flex;
    margin-bottom: 1rem;
    outline: none;
}
.timeline-item:nth-child(even) { justify-content: flex-end; }
.timeline-dot {
    position: absolute;
    left: 50%; margin-left: -20px; top: 4px;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--bg-elev);
    border: 2px solid var(--border);
    color: var(--text-muted);
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
    z-index: 1;
}
.timeline-dot svg { width: 20px; height: 20px; }
.timeline-content {
    width: calc(50% - 2.5rem);
    box-sizing: border-box;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.timeline-item.interactive .timeline-content { cursor: pointer; }
.tl-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.15rem; }
.tl-year { font-size: 0.8rem; font-weight: 600; color: var(--accent); }
.tl-type { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-faint); font-weight: 600; }
.tl-title { font-family: 'Space Grotesk', sans-serif; font-size: 1.15rem; font-weight: 600; line-height: 1.25; }

/* Collapsed by default; hover/focus expands and pushes the items below down. */
.tl-expand {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.42s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.35s ease, margin-top 0.42s ease;
}
.timeline-item:hover .tl-expand,
.timeline-item:focus-visible .tl-expand,
.timeline-item.active .tl-expand {
    max-height: 260px;
    opacity: 1;
    margin-top: 0.7rem;
}
.tl-org { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.tl-desc { font-size: 0.88rem; color: var(--text-faint); line-height: 1.55; }
.tl-cta { display: inline-block; margin-top: 0.6rem; font-size: 0.8rem; color: var(--accent); font-weight: 600; }

.timeline-item:hover .timeline-content,
.timeline-item:focus-visible .timeline-content {
    border-color: var(--accent);
    box-shadow: var(--shadow);
}
.timeline-item:hover .timeline-dot,
.timeline-item:focus-visible .timeline-dot,
.timeline-item.active .timeline-dot {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
    transform: scale(1.08);
}

@media (max-width: 720px) {
    .timeline::before { left: 19px; transform: none; }
    .timeline-item,
    .timeline-item:nth-child(even) { justify-content: flex-start; }
    .timeline-content { width: 100%; margin-left: 3.25rem; }
    .timeline-dot { left: 0; margin-left: 0; }
}
@media (max-width: 560px) {
    .timeline::before { left: 16px; }
    .timeline-content { margin-left: 2.75rem; }
    .timeline-dot { width: 34px; height: 34px; }
    .timeline-dot svg { width: 17px; height: 17px; }
}

/* ---------- Carousel ---------- */
.carousel { position: relative; z-index: 1; margin-top: 1rem; }
.carousel-stage {
    position: relative;
    height: 560px;
    perspective: 1500px;
    transform-style: preserve-3d;
}
.carousel-card {
    position: absolute;
    top: 0; left: 50%;
    width: 400px; max-width: 86vw;
    /* centre the card on the 50% line: pull left by half its rendered width */
    margin-left: calc(min(200px, 43vw) * -1);
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.6s cubic-bezier(0.22, 0.7, 0.2, 1), opacity 0.6s ease, filter 0.6s ease;
    will-change: transform, opacity;
    cursor: pointer;
}
.carousel-card.is-focused { cursor: default; border-color: var(--accent); }
.carousel-banner {
    height: 120px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
    display: flex; align-items: center; justify-content: center;
    color: var(--on-accent);
}
.carousel-banner svg { width: 46px; height: 46px; }
.carousel-body { padding: 1.6rem; }
.carousel-subtitle { color: var(--accent); font-size: 0.85rem; font-weight: 500; margin-bottom: 0.5rem; }
.carousel-title { font-family: 'Space Grotesk', sans-serif; font-size: 1.4rem; font-weight: 700; margin-bottom: 0.75rem; line-height: 1.2; }
.carousel-desc { color: var(--text-muted); font-size: 0.92rem; line-height: 1.55; margin-bottom: 0.9rem; }
.carousel-challenge {
    background: var(--soft-fill);
    border-left: 2px solid var(--accent);
    padding: 0.7rem 0.85rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1rem;
    border-radius: 0 4px 4px 0;
}
.carousel-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.carousel-tags .tag { font-size: 0.68rem; padding: 0.32rem 0.7rem; }

.carousel-controls { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 2rem; }
.carousel-arrow {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-elev);
    color: var(--text);
    cursor: pointer;
    transition: color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}
.carousel-arrow:hover { color: var(--accent); border-color: var(--accent); transform: scale(1.06); }
.carousel-toggle {
    padding: 0.65rem 1.4rem;
    border-radius: 30px;
    border: 1px solid var(--border);
    background: var(--bg-elev);
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    min-width: 100px;
    transition: color 0.25s ease, border-color 0.25s ease;
}
.carousel-toggle:hover { color: var(--accent); border-color: var(--accent); }

.carousel-dots { display: flex; justify-content: center; gap: 0.55rem; margin-top: 1.5rem; }
.carousel-dot {
    width: 9px; height: 9px; border-radius: 50%;
    border: none; padding: 0;
    background: var(--border);
    cursor: pointer;
    transition: background-color 0.25s ease, transform 0.25s ease;
}
.carousel-dot.active { background: var(--accent); transform: scale(1.3); }

/* ---------- Skills constellation ---------- */
.skills-clouds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.skill-cloud {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem 1.75rem;
    transition: border-color 0.3s ease;
}
.skill-cloud:hover { border-color: var(--accent); }
.skill-cloud-title { font-family: 'Space Grotesk', sans-serif; font-size: 1.3rem; color: var(--accent); margin-bottom: 0.75rem; }
.skill-cloud-desc { color: var(--text-faint); font-size: 0.88rem; line-height: 1.55; margin-bottom: 1.5rem; }
.skill-cloud-body {
    display: flex; flex-wrap: wrap; gap: 0.6rem;
    align-items: center; justify-content: center;
}
.skill-pill {
    display: inline-flex; align-items: center;
    padding: 0.4em 0.85em;
    border-radius: 40px;
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    line-height: 1;
    cursor: default;
    transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s ease, background-color 0.25s ease;
}
.skill-pill:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-3px); }
.skill-pill.w1 { font-size: 0.78rem; opacity: 0.85; }
.skill-pill.w2 { font-size: 0.9rem; }
.skill-pill.w3 { font-size: 1.05rem; }
.skill-pill.w4 { font-size: 1.25rem; font-weight: 500; }
.skill-pill.w5 {
    font-size: 1.5rem; font-weight: 600;
    color: var(--accent);
    background: var(--tag-bg);
    border-color: var(--tag-border);
}

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(3px); }
.modal-card {
    position: relative;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 2.5rem;
    max-width: 520px;
    width: 100%;
    box-shadow: var(--shadow);
    animation: modal-in 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.modal-close {
    position: absolute; top: 1rem; right: 1rem;
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.25s ease, border-color 0.25s ease;
}
.modal-close:hover { color: var(--accent); border-color: var(--accent); }
.modal-title { font-family: 'Space Grotesk', sans-serif; font-size: 2rem; margin: 0.5rem 0 1rem; }
.modal-body { color: var(--text-muted); margin-bottom: 1.75rem; line-height: 1.7; }

@media (max-width: 860px) {
    .skills-clouds { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .carousel-stage { height: 640px; }
}
