/* ===========================================================
   Pixelcraft Portfolio — design tokens
   bg: #14161A (charcoal) / #F6F4EF (paper, light mode)
   accent: #E8A33D (amber) — one accent, used sparingly
   secondary: #4FD1C5 (teal) — status/online dots only
   display: 'Sora' · body: 'Manrope' · utility: 'JetBrains Mono'
=========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700;800&family=Manrope:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0,1');

:root {
  --bg: #14161a;
  --bg-elev: #1b1e24;
  --bg-elev-2: #21242b;
  --border: #2b2f38;
  --text: #edeef0;
  --text-dim: #9ba0ab;
  --accent: #e8a33d;
  --accent-dim: #b9822f;
  --teal: #4fd1c5;
  --radius: 14px;
  --font-display: 'Sora', sans-serif;
  --font-body: 'Manrope', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="light"] {
  --bg: #f6f4ef;
  --bg-elev: #ffffff;
  --bg-elev-2: #edeae2;
  --border: #dedad0;
  --text: #1a1b1e;
  --text-dim: #6b6f78;
  --accent: #c9791f;
  --accent-dim: #a8631a;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  transition: background .25s ease, color .25s ease;
  background-image:
    radial-gradient(circle, var(--border) 1px, transparent 1px);
  background-size: 28px 28px;
  background-attachment: fixed;
}

a { color: inherit; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* ---------- Material Icons global ---------- */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  line-height: 1;
}

/* ---------- topbar (editor-tab style nav) ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
}

.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.tabs a {
  text-decoration: none;
  color: var(--text-dim);
  padding: 7px 12px;
  border-radius: 7px;
  transition: background .15s, color .15s;
}

.tabs a:hover { color: var(--text); background: var(--bg-elev-2); }

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

/* ---------- eyebrow labels (file-path style) ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: .02em;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.eyebrow::before { content: "// "; color: var(--text-dim); }

/* ---------- bento grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.span-12 { grid-column: span 12; }
.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; }

/* ---------- hero card ---------- */
.hero {
  display: flex;
  gap: 20px;
  align-items: center;
}

.avatar {
  width: 84px;
  height: 84px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  color: #14161a;
  flex-shrink: 0;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 4px;
}

.hero .role { color: var(--text-dim); font-size: 13.5px; margin: 0 0 2px; }

.status-line {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--teal);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(79,209,197,.15);
}

.hero-actions { margin-left: auto; display: flex; gap: 8px; flex-shrink: 0; }

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform .12s ease, border-color .12s ease;
}

.btn:hover { border-color: var(--accent); transform: translateY(-1px); }

.btn-accent {
  background: var(--accent);
  color: #14161a;
  border-color: var(--accent);
}

/* ---------- about / experience ---------- */
.about p { color: var(--text-dim); margin: 0 0 12px; font-size: 14.5px; }
.about p:last-child { margin-bottom: 0; }

.exp-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.exp-item:last-child { border-bottom: none; padding-bottom: 0; }
.exp-item .left h4 { margin: 0 0 3px; font-size: 14px; font-weight: 600; }
.exp-item .left p { margin: 0; font-size: 12.5px; color: var(--text-dim); }
.exp-item .period {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  white-space: nowrap;
}

/* ---------- stack chips ---------- */
.stack-group { margin-bottom: 14px; }
.stack-group:last-child { margin-bottom: 0; }
.stack-group h5 {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text);
}

/* ---------- projects ---------- */
.project-card {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}
.project-card .tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.project-card h4 { margin: 0; font-size: 15px; font-family: var(--font-display); font-weight: 700; }
.project-card p { margin: 0; font-size: 13px; color: var(--text-dim); flex-grow: 1; }
.project-card .chips { margin-top: 4px; }
.project-card a { font-size: 12px; color: var(--accent); text-decoration: none; font-weight: 600; }
.project-card a:hover { text-decoration: underline; }

.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ---------- contact / social ---------- */
.contact-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.contact-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-radius: 9px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  transition: border-color .12s;
}
.contact-link:hover { border-color: var(--accent); }
.contact-link .arrow { color: var(--text-dim); font-family: var(--font-mono); }

footer {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 40px;
}

/* ---------- project links ---------- */
.project-links { display: flex; gap: 8px; margin-top: 2px; }
.project-links a, .project-links span {
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  text-decoration: none;
  border: 1px solid var(--border);
}
.project-links a { color: var(--accent); border-color: var(--accent-dim); }
.project-links a:hover { background: rgba(232,163,61,.1); }
.project-links span.disabled { color: var(--text-dim); cursor: default; }

/* ---------- carousels (seamless autoscroll, no snap-reset) ---------- */
.carousel-viewport {
  overflow: hidden;
  width: 100%;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.carousel-track {
  display: flex;
  width: max-content;
  gap: 14px;
  animation: carousel-scroll linear infinite;
  animation-duration: var(--carousel-duration, 30s);
}

.carousel-viewport:hover .carousel-track,
.carousel-viewport:focus-within .carousel-track {
  animation-play-state: paused;
}

@keyframes carousel-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.carousel-track .project-card { width: 260px; flex-shrink: 0; }

.gallery-item {
  width: 220px;
  height: 150px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  overflow: hidden;
  position: relative;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-item .cap {
  position: absolute; bottom: 0; left: 0; right: 0;
  font-size: 11px; font-family: var(--font-mono);
  background: linear-gradient(0deg, rgba(0,0,0,.7), transparent);
  color: #fff; padding: 16px 8px 6px;
}
.gallery-empty {
  width: 100%;
  padding: 30px 16px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: 10px;
}

@media (prefers-reduced-motion: reduce) {
  .carousel-track { animation: none; overflow-x: auto; }
}

/* ---------- chat widget ---------- */
#chat-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--accent);
  color: #14161a;
  border: none;
  cursor: pointer;
  font-size: 28px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
}

#chat-panel {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 320px;
  max-width: calc(100vw - 32px);
  height: 420px;
  max-height: calc(100vh - 140px);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 40;
  box-shadow: 0 16px 40px rgba(0,0,0,.4);
}
#chat-panel.open { display: flex; }

#chat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12.5px;
}
#chat-header .status-dot { margin-left: auto; }

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg {
  max-width: 85%;
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 10px;
  line-height: 1.5;
}
.msg.bot { background: var(--bg-elev-2); align-self: flex-start; border: 1px solid var(--border); }
.msg.user { background: var(--accent); color: #14161a; align-self: flex-end; }

#chat-input-row {
  display: flex;
  gap: 6px;
  padding: 10px;
  border-top: 1px solid var(--border);
}
#chat-input {
  flex: 1;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 11px;
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
}
#chat-send {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  width: 38px;
  cursor: pointer;
  color: #14161a;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .span-7, .span-5, .span-6, .span-4 { grid-column: span 12; }
  .projects-grid { grid-template-columns: 1fr; }
  .hero { flex-wrap: wrap; }
  .hero-actions { margin-left: 0; width: 100%; }
  .tabs a { padding: 7px 9px; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover { transform: none; }
}

/* keyboard focus */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}