/* ── Graeme Richardson — Tiled Portfolio ─────────────
   Full-screen tile grid: 4×6 dense grid with
   project cards and a chat entry point.
   ─────────────────────────────────────────────────── */

/* ── Design Tokens ──────────────────────────────── */
:root {
    --bg: #000000;
    --bg-card: #0F0F0F;
    --border: #1A1A1A;
    --text: #FFFFFF;
    --text-secondary: #A3A3A3;
    --text-muted: #666666;
    --accent: #00B8CC;
    --accent-glow: rgba(0, 184, 204, 0.15);
    --accent-subtle: rgba(0, 184, 204, 0.08);
    --user-bubble: #0F1A1C;
    --success: #16A34A;
    --font-display: 'DM Sans', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-chat: 'Roboto', system-ui, -apple-system, sans-serif;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

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

html, body {
    min-height: 100dvh; overflow-x: hidden;
    font-family: var(--font-body);
    background: var(--bg); color: var(--text);
    font-size: 14px; line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Ambient glow ──────────────────────────────── */
body::before {
    content: '';
    position: fixed; inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% 30%, rgba(0,184,204,0.03) 0%, transparent 70%),
        radial-gradient(ellipse 40% 40% at 50% 100%, rgba(0,184,204,0.02) 0%, transparent 70%);
    pointer-events: none; z-index: 0;
}

/* ── Tile Grid (4×6) ───────────────────────────── */
.tile-grid {
    position: relative; z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 1px;
    width: 100%; height: 100vh; height: 100dvh;
    background: var(--border);
}

/* ── Project Tile ──────────────────────────────── */
.project-tile {
    position: relative;
    background: var(--bg-card);
    background-size: cover;
    background-position: center;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    cursor: pointer; overflow: hidden;
    transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    padding: 20px;
    text-align: center;
    user-select: none;
}

.project-tile::after {
    content: '';
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.55);
    transition: background 0.3s ease;
    z-index: 0;
}

.project-tile:hover::after {
    background: rgba(0,0,0,0.3);
}

/* Tiles with hero images — no extra overlay, inline gradient handles it */
.project-tile.has-hero::after {
    background: transparent;
}
.project-tile.has-hero:hover::after {
    background: transparent;
}

.project-tile::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at center, var(--accent-subtle) 0%, transparent 60%);
    opacity: 0; transition: opacity 0.4s ease;
    z-index: 1;
}

.project-tile:hover { z-index: 2; }
.project-tile:hover::before { opacity: 1; }
.project-tile:hover .tile-border { opacity: 1; }

.tile-border {
    position: absolute; inset: 0;
    border: 1px solid var(--accent);
    opacity: 0; transition: opacity 0.4s ease;
    pointer-events: none; z-index: 2;
}

.tile-content { position: relative; z-index: 2; }

.tile-company {
    font-family: var(--font-display);
    font-size: 13px; font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

.project-tile:hover .tile-company { color: var(--accent); }

.tile-title {
    font-family: var(--font-display);
    font-size: 18px; font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin-bottom: 4px;
}

.tile-role {
    font-family: var(--font-body);
    font-size: 11px; color: var(--text);
    letter-spacing: 0.02em;
}

.tile-indicator {
    position: absolute; bottom: 16px; right: 16px;
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transform: translateY(4px);
    transition: all 0.3s ease;
    z-index: 2;
}

.tile-indicator svg { color: var(--accent); filter: drop-shadow(0 0 4px rgba(0,0,0,0.5)); }

.project-tile:hover .tile-indicator {
    opacity: 1; transform: translateY(0);
}

/* ── Tile Positions (4×6 grid) ──────────────────── */
/* Row 1 */
.tile-equinox  { grid-column: 1 / 4; grid-row: 1 / 3; }
.tile-cedar    { grid-column: 4; grid-row: 1; }
/* Row 2 */
.tile-jet      { grid-column: 4; grid-row: 2; }
/* Row 3 */
.tile-walmart  { grid-column: 1 / 3; grid-row: 3; }
/* Row 4 */
.tile-priceline { grid-column: 1 / 3; grid-row: 4; }
/* Row 5 */
.tile-cbs      { grid-column: 1 / 3; grid-row: 5; }
.tile-chase    { grid-column: 3 / 5; grid-row: 5; }
/* Row 6 */
.tile-nbc      { grid-column: 1; grid-row: 6; }
.tile-mtv      { grid-column: 2; grid-row: 6; }
.tile-akurtz   { grid-column: 3; grid-row: 6; }
.tile-grnewyork { grid-column: 4; grid-row: 6; }

/* ── Chat Tile (2×2, entry point) ────────────────── */
.chat-tile {
    grid-column: 3 / 5; grid-row: 3 / 5;
    background: #000000;
    display: flex; flex-direction: column;
    position: relative; overflow: hidden;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    cursor: default;
}

/* ── Chat Entry State ───────────────────────────── */
.chat-entry {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 16px;
    height: 100%;
    padding: 24px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.chat-entry:hover {
    background: rgba(0,184,204,0.02);
}

.chat-entry-avatar {
    position: relative;
    width: 80px; height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.12);
    box-shadow: 0 0 32px var(--accent-glow);
    flex-shrink: 0;
}

.chat-entry-avatar img {
    width: 100%; height: 100%; object-fit: cover;
}

.chat-entry-avatar-glow {
    position: absolute; inset: -8px; border-radius: 50%;
    background: transparent;
    border: 1px solid rgba(0,184,204,0.12);
    animation: avatarPulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes avatarPulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.08); opacity: 0.15; }
}

.chat-entry-text {
    text-align: center;
    max-width: 300px;
}

.chat-entry-heading {
    font-family: var(--font-display);
    font-size: 18px; font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    margin-bottom: 6px;
}


.chat-entry-role {
    font-family: var(--font-body);
    font-size: 13px; font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.chat-entry-sub {
    font-family: var(--font-body);
    font-size: 14px; color: var(--text);
    line-height: 1.5;
}

.chat-entry-cta {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 20px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(0,184,204,0.3);
    background: rgba(0,184,204,0.06);
    color: var(--accent);
    font-family: var(--font-body);
    font-size: 12px; font-weight: 600;
    transition: all 0.2s ease;
}

.chat-entry-cta:hover {
    background: rgba(0,184,204,0.15);
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(0,184,204,0.15);
}

.chat-entry-cta svg {
    transition: transform 0.2s ease;
}

.chat-entry:hover .chat-entry-cta svg {
    transform: translate(2px, -2px);
}

/* ── Message bubbles (used in fullscreen overlay) ── */
.tile-msg {
    display: flex; flex-wrap: wrap; gap: 10px; max-width: 94%;
    animation: tileMsgIn 0.25s ease-out;
}

@keyframes tileMsgIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.tile-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.tile-msg.bot  { align-self: flex-start; }

.tile-msg-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    flex-shrink: 0; overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
}

.tile-msg-avatar img {
    width: 100%; height: 100%; object-fit: cover;
}

.tile-msg.user .tile-msg-avatar {
    background: rgba(0,184,204,0.15);
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(0,184,204,0.2);
}

.tile-msg.user .tile-msg-avatar::after {
    content: 'G'; color: var(--accent);
    font-size: 12px; font-weight: 600;
    font-family: var(--font-display);
}

.tile-msg-bubble {
    padding: 10px 14px; border-radius: var(--radius);
    font-family: var(--font-chat);
    font-size: 16px; line-height: 1.8;
    word-wrap: break-word; overflow-wrap: break-word;
    letter-spacing: 0.01em;
}

.tile-msg.bot .tile-msg-bubble {
    background: var(--bg);
    border: 1px solid var(--border);
    border-bottom-left-radius: var(--radius-sm);
}

.tile-msg.user .tile-msg-bubble {
    background: var(--user-bubble);
    border: 1px solid rgba(0,184,204,0.15);
    border-bottom-right-radius: var(--radius-sm);
}

.tile-msg-bubble p { margin-bottom: 12px; }
.tile-msg-bubble p:last-child { margin-bottom: 0; }
.tile-msg-bubble strong { font-weight: 700; color: #fff; }
.tile-msg-bubble a { color: var(--accent); text-decoration: none; }
.tile-msg-bubble a:hover { color: #00D4E8; text-decoration: underline; }

.tile-msg-bubble h1, .tile-msg-bubble h2, .tile-msg-bubble h3 {
    font-family: var(--font-display);
    font-size: 17px; font-weight: 700;
    margin: 12px 0 6px; color: #fff;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.tile-msg-bubble ul, .tile-msg-bubble ol { margin: 6px 0; padding-left: 18px; }
.tile-msg-bubble li { margin-bottom: 3px; }

.tile-msg-bubble blockquote {
    border-left: 2px solid var(--accent); padding-left: 12px;
    margin: 8px 0; color: var(--text-secondary);
    font-style: italic;
}

/* ── Thinking indicator ─────────────────────────── */
.tile-thinking { opacity: 0.8; }
.tile-typing { display: flex; gap: 4px; padding: 4px 0 2px; }

.tile-typing span {
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--accent);
    animation: tileBounce 1.4s ease-in-out infinite;
}

.tile-typing span:nth-child(2) { animation-delay: 0.2s; }
.tile-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes tileBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-5px); opacity: 1; }
}

.tile-thinking-label {
    font-family: var(--font-body);
    font-size: 10px; color: var(--accent);
    font-weight: 500; letter-spacing: 0.02em;
    margin-left: 38px; margin-top: 2px;
}

/* ── LinkedIn Interactive Card ──────────────────── */
.linkedin-card {
    margin-top: 10px;
}

.li-card {
    background: linear-gradient(135deg, rgba(10,102,194,0.08) 0%, rgba(10,102,194,0.02) 100%);
    border: 1px solid rgba(10,102,194,0.2);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex; flex-direction: column; gap: 10px;
}

.li-card-header {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-display);
    font-size: 13px; font-weight: 600;
    color: #0A66C2;
}

.li-card-btn, .li-card-msg {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: 11px; font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    width: 100%;
}

.li-card-btn {
    background: #0A66C2;
    color: #fff;
    justify-content: center;
}

.li-card-btn:hover {
    background: #084e96;
    box-shadow: 0 0 16px rgba(10,102,194,0.3);
}

.li-card-msg {
    background: transparent;
    color: #0A66C2;
    border: 1px solid rgba(10,102,194,0.3);
    justify-content: center;
}

.li-card-msg:hover {
    background: rgba(10,102,194,0.08);
    border-color: #0A66C2;
    box-shadow: 0 0 12px rgba(10,102,194,0.15);
}

/* ── FAQ Buttons (below welcome message) ─────────── */
.faq-buttons {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
    width: 100%;
    margin-top: 8px;
    padding-left: 40px; /* align with bubble after avatar */
}

.faq-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 12px;
    border-radius: var(--radius);
    border: 1px solid rgba(0,184,204,0.2);
    background: rgba(0,184,204,0.04);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    letter-spacing: 0.01em;
}

.faq-btn::before {
    content: '+';
    color: var(--accent);
    font-size: 16px; font-weight: 400;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.faq-btn:hover {
    background: rgba(0,184,204,0.1);
    border-color: rgba(0,184,204,0.4);
    box-shadow: 0 0 16px rgba(0,184,204,0.1);
}

.faq-btn:hover::before {
    transform: rotate(90deg);
}

@media (max-width: 600px) {
    .faq-buttons {
        grid-template-columns: 1fr;
        padding-left: 0;
    }
}
