/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
    /* Orange–blue contrast palette */
    --canvas-bg:    #faf8f5;
    --dot-color:    rgba(21, 101, 192, 0.11);
    --dark:         #0a1929;           /* deep navy — headings, titles */
    --text-muted:   #7a6952;           /* warm gray — abstract body text */
    --primary:      #1565c0;           /* cobalt blue — structural, hover */
    --secondary:    #2979ff;           /* electric blue — lighter accents */
    --accent:       #e65100;           /* burnt orange — CTAs, links, tags */
    --accent-light: #ff7043;           /* coral orange — hover state */
    --card-bg:      #ffffff;
    --tag-bg:       rgba(230, 81, 0, 0.07);
    --tag-color:    #e65100;
    --shadow-sm:    0 2px 8px  rgba(10, 25, 41, 0.07);
    --shadow-md:    0 8px 24px rgba(10, 25, 41, 0.11);
    --shadow-lg:    0 18px 44px rgba(10, 25, 41, 0.16);
}

/* ── Reset & base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--canvas-bg);
    font-family: 'Inter', sans-serif;
    color: var(--dark);
    -webkit-font-smoothing: antialiased;
}

/* ── Viewport & world ──────────────────────────────────────────────────────── */
#viewport {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
    touch-action: none; /* hand all touch gestures to our JS handlers */
}

#world {
    position: absolute;
    transform-origin: 0 0;
    width: 8000px;
    height: 6000px;
    background-image: radial-gradient(var(--dot-color) 1.5px, transparent 1.5px);
    background-size: 40px 40px;
}

/* ── Grab cursor ───────────────────────────────────────────────────────────── */
.is-grabbing,
.is-grabbing * { cursor: grabbing !important; }

/* ── World item — outer wrapper for every canvas element ───────────────────── */
.world-item {
    position: absolute;
    opacity: 0;
    cursor: grab;
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.world-item.hidden  { opacity: 0; pointer-events: none; transform: translateY(14px); }
.world-item.revealed { opacity: 1; transform: translateY(0); }

/* ── Photo ─────────────────────────────────────────────────────────────────── */
.item-photo img {
    display: block;
    width: 250px;
    height: auto;
    padding: 10px 10px 38px;
    background: #fff;
    border-radius: 2px;
    box-shadow: var(--shadow-md), 5px 8px 20px rgba(10, 25, 41, 0.12);
    transform: rotate(-4deg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    user-select: none;
}

.item-photo:hover img {
    transform: rotate(-3deg) scale(1.02);
    box-shadow: var(--shadow-lg), 6px 12px 28px rgba(10, 25, 41, 0.18);
}

/* ── Greeting sticky note ──────────────────────────────────────────────────── */
.item-greeting {
    background: #fff3e0;
    padding: 22px 26px;
    border-radius: 3px;
    font-family: 'Caveat', cursive;
    font-size: 27px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--dark);
    transform: rotate(13deg);
    box-shadow: 3px 5px 18px rgba(10, 25, 41, 0.12), 0 1px 4px rgba(10, 25, 41, 0.07);
    max-width: 250px;
    user-select: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.item-greeting:hover {
    transform: rotate(12deg) scale(1.02);
    box-shadow: 5px 10px 28px rgba(10, 25, 41, 0.16), 0 2px 6px rgba(10, 25, 41, 0.09);
}

/* ── Section title ─────────────────────────────────────────────────────────── */
.section-title {
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    font-size: 36px;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.5px;
    white-space: nowrap;
    user-select: none;
    cursor: grab;
}

/* ── Card ──────────────────────────────────────────────────────────────────── */
.item-card {
    width: 310px;
    background: var(--card-bg);
    border: 1px solid rgba(10, 25, 41, 0.09);
    border-radius: 16px;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    cursor: grab;
}

.item-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(21, 101, 192, 0.25);
}

.card-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    color: var(--tag-color);
    background: var(--tag-bg);
    padding: 4px 10px;
    border-radius: 100px;
    width: fit-content;
}

.card-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.3;
}

.card-abstract {
    margin: 0;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1.7;
    flex: 1;
}

.card-link {
    display: inline-block;
    margin-top: 2px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s, letter-spacing 0.2s;
}

.card-link:hover {
    color: var(--accent-light);
    letter-spacing: 0.5px;
}

/* ── Links cluster ─────────────────────────────────────────────────────────── */
.links-cluster {
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: default;
}

.link-cv {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.1px;
    width: fit-content;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(230, 81, 0, 0.32);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.link-cv:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(230, 81, 0, 0.42);
}

.link-cv svg { width: 15px; height: 15px; flex-shrink: 0; }

.link-social-row {
    display: flex;
    gap: 8px;
}

.link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: #fff;
    border: 1.5px solid rgba(10, 25, 41, 0.12);
    border-radius: 50%;
    color: var(--dark);
    text-decoration: none;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.link-icon svg { width: 16px; height: 16px; }

.link-icon:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 7px 18px rgba(21, 101, 192, 0.32);
}

/* ── Sticky note (freeform text) ───────────────────────────────────────────── */
.item-sticky {
    background: #e8f4fd;
    padding: 16px 20px;
    border-radius: 3px;
    font-family: 'Caveat', cursive;
    font-size: 21px;
    font-weight: 400;
    line-height: 1.55;
    color: var(--primary);
    box-shadow: 2px 4px 14px rgba(10, 25, 41, 0.09);
    max-width: 210px;
    transform: rotate(-6deg);
    user-select: none;
    transition: transform 0.3s ease;
}

.item-sticky:hover { transform: rotate(-5deg) scale(1.02); }

/* ── Explore hint (canvas-native, disappears on zoom-out) ─────────────────── */
.item-explore-hint {
    font-family: 'Caveat', cursive;
    font-size: 19px;
    font-weight: 400;
    color: var(--accent);
    text-align: center;
    line-height: 1.5;
    opacity: 0.65;
    user-select: none;
    pointer-events: none;
    animation: floatHint 2.8s ease-in-out infinite;
}

@keyframes floatHint {
    0%, 100% { transform: translateY(0px);  }
    50%       { transform: translateY(-7px); }
}

/* ── Doodles ───────────────────────────────────────────────────────────────── */
.item-doodle {
    display: block;
    pointer-events: none;
    user-select: none;
}

.item-doodle svg { display: block; width: 100%; height: 100%; }

.item-doodle.orange       { color: var(--accent); }
.item-doodle.orange-light { color: var(--accent-light); }
.item-doodle.blue         { color: var(--primary); }
.item-doodle.blue-light   { color: var(--secondary); }

/* ── UI hint pill ──────────────────────────────────────────────────────────── */
#ui-hint {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 25, 41, 0.70);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #faf8f5;
    padding: 9px 22px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.3px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    animation: hintFadeOut 0.6s ease 5.5s forwards;
}

@keyframes hintFadeOut {
    to { opacity: 0; }
}
