/* ===================================================================
   PilotDezzy – Bento Portfolio
   Glassmorphism · Dark-first · Responsive
=================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Fira+Code:wght@400;500;600&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'Fira Code', 'Cascadia Code', monospace;

  /* accent */
  --accent: #22d3ee;
  --accent-dark: #06b6d4;
  --accent-glow: rgba(34, 211, 238, 0.35);
  --accent-subtle: rgba(34, 211, 238, 0.08);

  /* dark palette (default) */
  --bg-body: #060610;
  --bg-tile: rgba(255, 255, 255, 0.045);
  --bg-tile-hover: rgba(255, 255, 255, 0.07);
  --border-tile: rgba(255, 255, 255, 0.08);
  --border-tile-hover: rgba(255, 255, 255, 0.16);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* timing */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 0.2s;
  --t-norm: 0.35s;
  --t-slow: 0.6s;
}

/* ---------- Light mode overrides ---------- */
html.light {
  --bg-body: #f0f4f8;
  --bg-tile: rgba(255, 255, 255, 0.6);
  --bg-tile-hover: rgba(255, 255, 255, 0.8);
  --border-tile: rgba(0, 0, 0, 0.06);
  --border-tile-hover: rgba(0, 0, 0, 0.12);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent-subtle: rgba(6, 182, 212, 0.1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--t-norm) var(--ease), color var(--t-norm) var(--ease);
  overflow-x: hidden;
}

/* ---------- Background Gradient Blobs ---------- */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.45;
  animation: blobDrift 14s ease-in-out infinite alternate;
}

.bg-blob--1 {
  width: 600px; height: 600px;
  top: -15%; left: -8%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.22), transparent 70%);
}
.bg-blob--2 {
  width: 500px; height: 500px;
  bottom: -10%; right: -5%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2), transparent 70%);
  animation-delay: -7s;
}
.bg-blob--3 {
  width: 380px; height: 380px;
  top: 40%; left: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.12), transparent 70%);
  animation-delay: -3.5s;
}

html.light .bg-blob { opacity: 0.25; }

@keyframes blobDrift {
  0%   { transform: translateY(0) scale(1); }
  100% { transform: translateY(-30px) scale(1.05); }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--accent-dark);
  border-radius: 99px;
}
::selection { background: var(--accent-dark); color: #fff; }

/* ============================================================
   HEADER / NAV BAR
============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(6, 6, 16, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-tile);
  transition: background var(--t-norm) var(--ease);
}
html.light .site-header {
  background: rgba(240, 244, 248, 0.7);
}

.site-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ---------- Theme Toggle ---------- */
.theme-toggle {
  width: 48px; height: 28px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-tile);
  border-radius: 9999px;
  position: relative;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
  flex-shrink: 0;
}
.theme-toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: var(--accent);
  border-radius: 50%;
  transition: transform var(--t-norm) var(--ease);
  box-shadow: 0 0 8px var(--accent-glow);
}
html.light .theme-toggle::after {
  transform: translateX(20px);
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.theme-toggle-icons {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.theme-toggle-icons svg {
  width: 16px; height: 16px;
  opacity: 0.5;
}

/* ============================================================
   BENTO GRID
============================================================ */
.bento-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 5.5rem 1rem 3rem;
}

.bento-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .bento-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================================
   TILE – Glassmorphism Base
============================================================ */
.tile {
  background: var(--bg-tile);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-tile);
  border-radius: 1.25rem;
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
  transition:
    background var(--t-norm) var(--ease),
    border-color var(--t-norm) var(--ease),
    transform var(--t-norm) var(--ease),
    box-shadow var(--t-norm) var(--ease);
}
.tile:hover {
  background: var(--bg-tile-hover);
  border-color: var(--border-tile-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--border-tile-hover);
}

/* Subtle inner glow on hover */
.tile::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 0%, var(--accent-subtle), transparent 60%);
  opacity: 0;
  transition: opacity var(--t-norm) var(--ease);
  pointer-events: none;
}
.tile:hover::before { opacity: 1; }

/* Tile label */
.tile-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.tile-label i { width: 14px; height: 14px; }

.tile h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.tile p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ============================================================
   Grid Span Utilities (desktop)
============================================================ */
@media (min-width: 1024px) {
  .col-2 { grid-column: span 2; }
  .col-3 { grid-column: span 3; }
  .row-2 { grid-row: span 2; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .sm-col-2 { grid-column: span 2; }
}

/* ============================================================
   HERO TILE
============================================================ */
.tile-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 320px;
}

.hero-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
  margin-bottom: 1.25rem;
}

.hero-name {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #fff 30%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
html.light .hero-name {
  background: linear-gradient(135deg, #0f172a 30%, var(--accent-dark));
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-slogan {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.hero-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 9999px;
  text-decoration: none;
  transition: all var(--t-fast) var(--ease);
}
.hero-link:hover {
  background: var(--accent);
  color: #060610;
  box-shadow: 0 0 20px var(--accent-glow);
}
.hero-link i { width: 14px; height: 14px; }

/* ============================================================
   TECH TILE
============================================================ */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.tech-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  transition: all var(--t-fast) var(--ease);
  cursor: default;
}
html.light .tech-pill {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}
.tech-pill:hover {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.04);
}
.tech-pill i { width: 14px; height: 14px; }

/* ============================================================
   CODE SNIPPET TILE
============================================================ */
.code-window {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 0.75rem;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.7;
}
html.light .code-window { background: rgba(15, 23, 42, 0.06); }

.code-window-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.6rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.code-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.code-dot--r { background: #ef4444; }
.code-dot--y { background: #f59e0b; }
.code-dot--g { background: #22c55e; }

.code-body {
  padding: 0.85rem;
  white-space: pre;
  overflow-x: auto;
  color: var(--text-secondary);
}
.code-body .kw   { color: #c084fc; }
.code-body .fn   { color: #60a5fa; }
.code-body .str  { color: #34d399; }
.code-body .cm   { color: var(--text-muted); }
.code-body .var  { color: var(--accent); }
.code-body .num  { color: #fb923c; }

/* ============================================================
   HOMELAB TILE
============================================================ */
.homelab-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  margin-top: 1rem;
}

.homelab-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: border-color var(--t-fast) var(--ease);
}
html.light .homelab-item {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.05);
}
.homelab-item:hover { border-color: var(--accent); }
.homelab-item i { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }

/* ============================================================
   TILE WITH COVER IMAGE
============================================================ */
.tile-cover {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.tile-cover-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 1.25rem 1.25rem 0 0;
}

.tile-cover-body {
  padding: 1.25rem 1.5rem 1.5rem;
}

/* ============================================================
   WORLD MAP / TRAVEL
============================================================ */
.travel-map {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 0.75rem;
  margin-top: 1rem;
  opacity: 0.75;
  transition: opacity var(--t-norm) var(--ease);
}
.tile:hover .travel-map { opacity: 1; }

.travel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.85rem;
}
.travel-tag {
  padding: 0.25rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 500;
  border-radius: 9999px;
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid rgba(34, 211, 238, 0.15);
}

/* ============================================================
   HOBBY TILES – Icons + Stats
============================================================ */
.hobby-icon {
  width: 48px; height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  background: var(--accent-subtle);
  margin-bottom: 1rem;
  color: var(--accent);
}
.hobby-icon i { width: 24px; height: 24px; }

.hobby-stats {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
}
.hobby-stat-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.hobby-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* ============================================================
   MTG TILE – Card Shimmer
============================================================ */
.mtg-cards {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
}
.mtg-card {
  width: 60px; height: 84px;
  border-radius: 0.45rem;
  background: linear-gradient(135deg, #1a1035, #2d1b69, #1a1035);
  border: 1px solid rgba(139, 92, 246, 0.3);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
  cursor: default;
}
.mtg-card::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: conic-gradient(
    transparent,
    rgba(139, 92, 246, 0.15),
    transparent,
    rgba(34, 211, 238, 0.1),
    transparent
  );
  animation: shimmer 4s linear infinite;
}
.mtg-card:hover {
  transform: translateY(-4px) rotateZ(-2deg);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3);
}

@keyframes shimmer {
  to { transform: rotate(360deg); }
}

/* ============================================================
   CRAFT – COFFEE & STICKERS
============================================================ */
.sticker-gallery {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.sticker {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  border: 2px solid var(--border-tile);
  background: rgba(255, 255, 255, 0.05);
  transition: all var(--t-fast) var(--ease);
  cursor: default;
}
html.light .sticker { background: rgba(0, 0, 0, 0.04); }
.sticker:hover {
  transform: scale(1.15) rotate(-8deg);
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}

/* ============================================================
   SCROLL REVEAL
============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px) scale(0.98);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ============================================================
   FOOTER
============================================================ */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  position: relative;
  z-index: 1;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}
.site-footer a:hover { text-decoration: underline; }

/* ============================================================
   PING ANIMATION (map dots)
============================================================ */
.ping-dot {
  animation: pingPulse 2.5s ease-in-out infinite;
}
@keyframes pingPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50%      { box-shadow: 0 0 0 8px transparent; }
}

/* ============================================================
   TILE AS LINK
============================================================ */
a.tile-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 1.25rem;
}
a.tile-link .tile { cursor: pointer; height: 100%; }

/* ============================================================
   DETAIL PAGES
============================================================ */

/* --- Back link --- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: opacity var(--t-fast) var(--ease);
}
.back-link:hover { opacity: 0.7; }
.back-link i { width: 16px; height: 16px; }

/* --- Detail Hero --- */
.detail-hero {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem 1.5rem 2.5rem;
}

.detail-hero-icon {
  width: 64px; height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: var(--accent-subtle);
  border: 1px solid rgba(34, 211, 238, 0.15);
  margin-bottom: 1.25rem;
  color: var(--accent);
}
.detail-hero-icon i { width: 32px; height: 32px; }

.detail-title {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #fff 30%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
html.light .detail-title {
  background: linear-gradient(135deg, #0f172a 30%, var(--accent-dark));
  -webkit-background-clip: text;
  background-clip: text;
}

.detail-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.65;
}

/* --- Detail Content --- */
.detail-content {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 640px) {
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .detail-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Full-width tile in detail grid */
.detail-full { grid-column: 1 / -1; }

/* --- Detail Image Gallery --- */
.detail-img {
  width: 100%;
  border-radius: 1rem;
  object-fit: cover;
  border: 1px solid var(--border-tile);
  transition: transform var(--t-norm) var(--ease);
}
.detail-img:hover { transform: scale(1.015); }

.detail-img-tall  { height: 320px; }
.detail-img-wide  { height: 240px; }
.detail-img-auto  { height: auto; max-height: 400px; }

/* --- Embed containers --- */
.embed-container {
  background: var(--bg-tile);
  border: 1px solid var(--border-tile);
  border-radius: 1rem;
  padding: 1.5rem;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.embed-container iframe {
  border-radius: 0.75rem;
  border: none;
  max-width: 100%;
}

.embed-placeholder {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
  border: 2px dashed var(--border-tile);
  border-radius: 0.75rem;
}

/* --- Stat Row on Detail Pages --- */
.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.stat-block {
  text-align: center;
}

.stat-big {
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}

.stat-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* --- Info List --- */
.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.info-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.info-list li i {
  width: 18px; height: 18px;
  color: var(--accent);
  flex-shrink: 0;
}

/* ============================================================
   RESPONSIVE TWEAKS
============================================================ */
@media (max-width: 639px) {
  .hero-name     { font-size: 2rem; }
  .hero-slogan   { font-size: 0.82rem; }
  .tile          { padding: 1.25rem; }
  .bento-wrapper { padding-top: 4.5rem; }
  .detail-title  { font-size: 1.8rem; }
  .detail-hero   { padding-top: 5rem; }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .hero-name { font-size: 2.3rem; }
}