/* Base variables and resets */
:root {
  --bg: #08130a;
  --bg-elev: #0d1b10;
  --card: #112417;
  --text: #eef7e9;
  --muted: #b7c9a7;
  --brand: #84cc16;
  --accent: #65a30d;
  --ring: rgba(132, 204, 22, 0.35);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji"; color: var(--text); background: var(--bg); line-height: 1.6; }

/* Disable text selection */
body, body * { user-select: none; -webkit-user-select: none; -ms-user-select: none; -moz-user-select: none; }

/* Layout helpers */
.container { width: min(1100px, 92%); margin-inline: auto; }
.layout { display: grid; grid-template-columns: 1fr; }
.content { min-width: 0; }

/* Sections */
.section { padding: 42px 0; scroll-margin-top: 72px; }
.content > .section { position: relative; background: color-mix(in srgb, var(--bg-elev) 50%, transparent); }
.content > .section:nth-of-type(even) { background: color-mix(in srgb, var(--card) 70%, transparent); }
.content > .section + .section { border-top: 1px solid rgba(133, 160, 120, 0.22); }
.hero + .section { border-top: none; }
.section h2 { margin: 0 0 16px; font-size: clamp(22px, 3vw, 28px); }
.source-note { color: var(--muted); font-size: 14px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px; background: var(--card); color: #fff; text-decoration: none; border: 1px solid rgba(148, 163, 184, 0.18); transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, box-shadow 120ms ease; }
.btn:hover { transform: translateY(-1px); border-color: rgba(148, 163, 184, 0.3); }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--accent)); border-color: transparent; box-shadow: 0 0 0 3px var(--ring); color: #0b1a0f; }
.section#contact .btn.primary { background: linear-gradient(135deg, var(--accent), var(--brand)); color: #0b1a0f; border-color: transparent; box-shadow: 0 0 0 3px var(--ring); }
.section#contact .btn.primary:hover { transform: translateY(-2px); }

/* Hero */
.hero { padding: 86px 0 42px; background: linear-gradient(180deg, rgba(132, 204, 22, 0.10), rgba(101, 163, 13, 0.06)); border-bottom: 1px solid rgba(133, 160, 120, 0.22); }
.hero-card { background: color-mix(in srgb, var(--card) 92%, transparent); border: 1px solid rgba(133, 160, 120, 0.22); border-radius: 16px; padding: 20px; display: grid; grid-template-columns: 1fr; gap: 16px; }
.hero-media { display: grid; place-items: center; }
.hero-content { text-align: center; }
.hero-name { font-family: "Space Grotesk", ui-sans-serif, system-ui, sans-serif; font-weight: 700; font-size: clamp(40px, 7.5vw, 72px); line-height: 0.98; letter-spacing: -0.5px; margin: 0 0 8px; color: #f2ffe6; }
.hero .social-links { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.hero .social-link { color: #eef7e9; background: rgba(132, 204, 22, 0.12); border: 1px solid rgba(101, 163, 13, 0.25); padding: 8px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; position: relative; }
.hero .social-link:hover { color: #0b1a0f; background: linear-gradient(135deg, var(--brand), var(--accent)); }
.hero .social-link:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.hero .social-link::after { content: attr(data-tooltip); position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -0%) scale(0.95); background: rgba(20, 30, 18, 0.97); color: #fff; font-size: 14px; font-weight: 500; padding: 7px 14px; border-radius: 8px; white-space: nowrap; box-shadow: 0 2px 12px rgba(0,0,0,0.18); opacity: 0; pointer-events: none; transition: opacity 0.18s, transform 0.18s; z-index: 2; }
.hero .social-link[data-tooltip]:hover::after, .hero .social-link[data-tooltip]:focus-visible::after { opacity: 1; pointer-events: auto; transform: translate(-50%, -30%) scale(1); }
.hero {
  padding: 86px 0 42px;
  background: linear-gradient(180deg, rgba(132, 204, 22, 0.10), rgba(101, 163, 13, 0.06));
  border-bottom: 1px solid rgba(133, 160, 120, 0.22);
}
.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(34px, 5vw, 56px);
  letter-spacing: -0.5px;
}
.tagline {
  margin: 0 auto 8px;
  font-size: clamp(16px, 2.5vw, 20px);
  color: var(--muted);
}
.location { margin-top: 0; color: var(--muted); }
.cta-group { display: none; }

.avatar-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  margin-bottom: 14px;
}

.avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.6);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4), 0 0 0 6px var(--ring);
  object-fit: cover;
  background: #08130a;
}

@media (min-width: 880px) {
  .hero-card { grid-template-columns: auto 1fr; align-items: center; gap: 24px; }
  .hero-content { text-align: left; }
  .hero .social-links { justify-content: start; }
}

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.card { background: color-mix(in srgb, var(--card) 92%, transparent); border: 1px solid rgba(133, 160, 120, 0.22); border-radius: 14px; padding: 18px; overflow: hidden; }
.card h3 + .summary { margin-top: 6px; }
.screenshot { width: 100%; aspect-ratio: 16/9; border-radius: 10px; border: 1px solid rgba(133, 160, 120, 0.22); background: #0e1a12; object-fit: cover; display: block; box-sizing: border-box; }
.card .screenshot + h3 { margin-top: 10px; }

/* Portfolio cards */
#portfolio .card { padding: 0; }
#portfolio .card .screenshot { border: 0; border-radius: 0; }
#portfolio .card h3 { margin: 12px 16px 6px; }
#portfolio .card .summary { margin: 0 16px 12px; color: var(--muted); }
#portfolio .card .skills { margin: 0 16px 16px; }
#portfolio .card .media { position: relative; width: 100%; aspect-ratio: 16/10; overflow: hidden; background: #0e1a12; }
#portfolio .card .media img, #portfolio .card .media iframe { width: 100%; height: 100%; object-fit: cover; display: block; }
#portfolio .cards { align-items: stretch; }
#portfolio .card { display: grid; grid-template-rows: auto 1fr auto; }
#portfolio .card .media::after { content: ""; position: absolute; inset: 0; background: rgba(11, 26, 15, 0.55); transition: opacity 180ms ease; }
#portfolio .card:hover .media::after { opacity: 0; }

/* Quotes */
.quotes { display: grid; grid-template-columns: 1fr; gap: 16px; }
blockquote { margin: 0; padding: 16px 18px; background: color-mix(in srgb, var(--card) 92%, transparent); border-left: 3px solid var(--brand); border-radius: 8px; }
blockquote footer { margin-top: 8px; color: var(--muted); font-size: 14px; }
@media (min-width: 880px) { .quotes { grid-template-columns: repeat(2, 1fr); } }

/* Roles/Experience */
.roles { display: grid; grid-template-columns: 1fr; gap: 16px; }
.role-card { background: color-mix(in srgb, var(--card) 92%, transparent); border: 1px solid rgba(148, 163, 184, 0.18); border-radius: 14px; padding: 18px; }
.role-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.role-title { margin: 0; }
.duration-badge { background: linear-gradient(135deg, var(--brand), var(--accent)); color: #0b1a0f; font-weight: 700; padding: 6px 10px; border-radius: 999px; font-size: 13px; box-shadow: 0 0 0 3px var(--ring); min-width: 120px; text-align: center; }
.role-card .org { color: #fff; font-weight: 600; }
.role-card .period { color: var(--muted); font-size: 14px; margin-top: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.role-card .summary { margin-top: 8px; }
.duration-note { color: var(--muted); font-size: 13px; margin-top: 12px; }
.role-meta { color: var(--muted); font-size: 14px; margin-top: 2px; }
.bullets { margin: 10px 0 0 18px; }
.bullets li { margin: 4px 0; }
.skills { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.skill { background: rgba(132, 204, 22, 0.15); color: #efffd0; border: 1px solid rgba(101, 163, 13, 0.25); padding: 4px 8px; border-radius: 999px; font-size: 12px; }
@media (min-width: 880px) {
  .roles {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Sidebar */
.sidebar { display: none; border-right: 1px solid rgba(133, 160, 120, 0.22); background: color-mix(in srgb, var(--bg-elev) 85%, transparent); }
.sidebar-inner { position: sticky; top: 64px; padding: 24px 16px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; align-content: start; min-height: calc(100vh - 64px); }
.sidebar-name { margin: 0; font-size: 20px; text-align: left; color: #fff; }
.sidebar-role { margin: 0; color: var(--muted); font-size: 14px; }
.sidebar-nav { display: grid; gap: 6px; justify-items: start; }
.sidebar a { color: var(--muted); text-decoration: none; }
.sidebar-nav a:hover { color: #fff; }
.sidebar-ctas { display: none; }
.sidebar-social { margin-top: 8px; width: 100%; }
.sidebar-avatar { width: 120px; height: 120px; box-shadow: 0 8px 24px rgba(0,0,0,0.35), 0 0 0 6px var(--ring); border: 2px solid rgba(255,255,255,0.6); border-radius: 38% 62% 68% 32% / 41% 32% 68% 59% ; object-fit: cover; }

/* Footer */
.site-footer { border-top: 1px solid rgba(148, 163, 184, 0.12); padding: 24px 0 56px; color: var(--muted); }

/* Background animation canvas */
#bg-anim { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; display: block; }

/* Playlist thumb */
.playlist-thumb { cursor: pointer !important; transition: transform 0.2s ease; position: relative; z-index: 1; pointer-events: auto; }
.playlist-thumb:hover { transform: scale(1.02); }
.playlist-thumb::before { content: "▶"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(132, 204, 22, 0.9); color: #08130a; width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: bold; z-index: 2; opacity: 0.8; transition: opacity 0.2s ease; }
.playlist-thumb:hover::before { opacity: 1; }

/* Modal */
.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 50; }
.modal[aria-hidden="false"] { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.modal-dialog { position: relative; width: min(960px, 92vw); border-radius: 12px; overflow: hidden; background: #0f1a12; border: 1px solid rgba(133, 160, 120, 0.22); }
.modal-media { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; }
.modal-media iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.modal-close { position: absolute; top: 8px; right: 8px; background: rgba(15, 26, 18, 0.8); color: #eaf7e1; border: 1px solid rgba(133, 160, 120, 0.3); border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.modal-close:hover { background: rgba(15, 26, 18, 1); }

/* Intro overlay */
.intro-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: radial-gradient(1200px 800px at 20% 10%, rgba(12, 30, 18, 0.8), transparent 60%), radial-gradient(1000px 800px at 80% 90%, rgba(8, 20, 14, 0.8), transparent 55%), linear-gradient(180deg, #0c1a12, #0f2417 40%, #0a1710); color: var(--text); transition: opacity 600ms ease, visibility 600ms ease; }
.intro-overlay[aria-hidden="true"] { opacity: 0; visibility: hidden; }
.intro-inner { text-align: center; padding: 24px; min-height: 100vh; display: flex; align-items: center; justify-content: center; width: 100%; position: absolute; }
.intro-stack { display: flex; flex-direction: column; align-items: center; gap: 32px; }
.loader { width: 46px; height: 46px; border-radius: 50%; border: 3px solid #6b6b6b; border-top-color: #fff; animation: spinLoader 900ms linear infinite; }
@keyframes spinLoader { to { transform: rotate(360deg); } }

/* Slot reels */
.slot-words { display: flex; gap: clamp(8px, 1.5vw, 14px); align-items: center; justify-content: center; flex-wrap: nowrap; }
.slot-word { display: flex; gap: clamp(4px, 0.9vw, 8px); align-items: center; }
.letter-window { width: clamp(28px, 5vw, 52px); height: clamp(40px, 7vw, 70px); border-radius: 8px; background: color-mix(in srgb, var(--card) 86%, transparent); overflow: hidden; position: relative; }
.letter-track { position: absolute; left: 0; top: 0; width: 100%; will-change: transform; }
.letter-cell { width: 100%; height: clamp(40px, 7vw, 70px); display: grid; place-items: center; font-family: "Space Grotesk", system-ui, sans-serif; font-weight: 800; color: #f2ffe6; font-size: clamp(22px, 4.4vw, 40px); }
.intro-overlay .letter-window { width: 52px; height: 68px; }
.intro-overlay .letter-cell { height: 68px; font-size: 36px; }
@media (max-width: 640px) { #slot-words { scale: 0.5; } }

/* Desktop layout: show sidebar */
@media (min-width: 1000px) {
  .layout { grid-template-columns: 280px 1fr; }
  .sidebar { display: block; }
}
