/* ============================================================
   Musa Rioba — components: about, services, projects, journey,
   guestbook, contact, footer, modal, palette
   ============================================================ */

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(30px, 5vw, 64px); align-items: center; }
.avatar-card {
  position: relative; aspect-ratio: 1; max-width: 420px; margin-inline: auto;
  display: grid; place-items: center;
}
.avatar-card__ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent);
  animation: spin 26s linear infinite;
}
.avatar-card__ring::after {
  content: ""; position: absolute; top: -6px; left: 50%;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent-2); transform: translateX(-50%);
  box-shadow: 0 0 14px var(--accent-2);
}
@keyframes spin { to { transform: rotate(360deg); } }
.avatar-card__face {
  position: relative; overflow: hidden;
  width: 72%; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center;
  font-size: clamp(3rem, 8vw, 5rem); font-weight: 700; color: #fff;
  background: var(--grad);
  box-shadow: 0 24px 70px rgba(124, 92, 255, 0.45), inset 0 0 60px rgba(255, 255, 255, 0.18);
}
.avatar-card__face img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 22%;
  transition: transform 0.6s var(--ease);
}
.avatar-card:hover .avatar-card__face img { transform: scale(1.06); }
.badge-float {
  position: absolute; padding: 7px 14px; border-radius: 99px;
  font-family: var(--mono); font-size: 0.74rem;
  background: var(--bg-alt); border: 1px solid var(--border);
  box-shadow: var(--shadow); animation: bob 5s ease-in-out infinite;
}
.badge-float--1 { top: 6%; left: -2%; }
.badge-float--2 { top: 18%; right: -6%; animation-delay: -1.2s; }
.badge-float--3 { bottom: 16%; left: -8%; animation-delay: -2.4s; }
.badge-float--4 { bottom: 4%; right: 2%; animation-delay: -3.6s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

.about__lead { font-size: clamp(1.05rem, 2vw, 1.25rem); line-height: 1.65; }
.about__body p + p { margin-top: 14px; color: var(--muted); }

.skills { margin-top: 30px; display: grid; gap: 14px; }
.skill { display: grid; grid-template-columns: 150px 1fr 48px; align-items: center; gap: 14px; font-size: 0.88rem; }
.skill__name { color: var(--muted); }
.skill__bar { height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.skill__bar i { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 99px; transition: width 1.3s var(--ease); }
.skill__val { font-family: var(--mono); font-size: 0.76rem; color: var(--accent-2); text-align: right; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.chip {
  padding: 6px 13px; border-radius: 99px; font-size: 0.78rem; font-family: var(--mono);
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  transition: transform 0.25s var(--ease), color 0.25s, border-color 0.25s;
}
.chip:hover { transform: translateY(-3px); color: var(--text); border-color: var(--accent); }

/* ---------- stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-top: clamp(46px, 7vw, 80px);
}
.stat {
  padding: 26px 20px; text-align: center; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
  transition: transform 0.35s var(--ease), border-color 0.35s;
}
.stat:hover { transform: translateY(-6px); border-color: var(--accent); }
.stat__num, .stat__plus {
  font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 700;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat p { margin-top: 6px; font-size: 0.85rem; color: var(--muted); }

/* ---------- services ---------- */
.services { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.service {
  position: relative; overflow: hidden;
  padding: 28px 24px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
  transition: transform 0.35s var(--ease), border-color 0.35s, box-shadow 0.35s;
}
.service:hover { transform: translateY(-8px); border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: var(--shadow); }
.service__icon { font-size: 1.9rem; margin-bottom: 16px; }
.service h3 { font-size: 1.08rem; margin-bottom: 10px; }
.service p { font-size: 0.9rem; color: var(--muted); }
.service ul { list-style: none; margin-top: 16px; display: grid; gap: 7px; }
.service li { font-size: 0.82rem; font-family: var(--mono); color: var(--muted); padding-left: 18px; position: relative; }
.service li::before { content: "▸"; position: absolute; left: 0; color: var(--accent-2); }

.card-spotlight::before {
  content: ""; position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(124, 92, 255, 0.18), transparent 65%);
  transition: opacity 0.35s; pointer-events: none;
}
.card-spotlight:hover::before { opacity: 1; }

/* ---------- projects ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 34px; }
.filter {
  padding: 9px 20px; border-radius: 99px; font-size: 0.88rem; font-weight: 500;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  transition: all 0.3s var(--ease);
}
.filter:hover { color: var(--text); border-color: var(--accent); transform: translateY(-2px); }
.filter.is-active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 8px 22px rgba(124, 92, 255, 0.35); }

.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.project {
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface);
  display: flex; flex-direction: column;
  transition: transform 0.4s var(--ease), border-color 0.4s, box-shadow 0.4s, opacity 0.35s;
}
.project:hover, .project:focus-visible { transform: translateY(-8px); border-color: color-mix(in srgb, var(--accent) 65%, transparent); box-shadow: var(--shadow); outline: none; }
.project.is-hidden { display: none; }
.project__thumb {
  position: relative; aspect-ratio: 16/9; display: grid; place-items: center;
  overflow: hidden;
}
.project__thumb span {
  font-family: var(--mono); font-weight: 700; font-size: 1.6rem; letter-spacing: 0.25em;
  color: rgba(255, 255, 255, 0.9); text-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  z-index: 1;
}
.project__thumb::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.14) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.14) 1px, transparent 1px);
  background-size: 26px 26px; opacity: 0.5;
  transition: transform 0.6s var(--ease);
}
.project:hover .project__thumb::after { transform: scale(1.12) rotate(2deg); }
.project__thumb--a { background: linear-gradient(135deg, #7c5cff, #3b1d8f); }
.project__thumb--b { background: linear-gradient(135deg, #22d3ee, #0e7490); }
.project__thumb--c { background: linear-gradient(135deg, #ff5c8a, #9d174d); }
.project__thumb--d { background: linear-gradient(135deg, #34d399, #065f46); }
.project__thumb--e { background: linear-gradient(135deg, #f59e0b, #b45309); }
.project__thumb--f { background: linear-gradient(135deg, #60a5fa, #1e40af); }

.project__info { padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.project__top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.project__top h3 { font-size: 1.08rem; }
.project__year { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
.project__info p { font-size: 0.88rem; color: var(--muted); flex: 1; }
.project__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.project__tags span {
  font-family: var(--mono); font-size: 0.68rem; padding: 4px 9px;
  border-radius: 6px; background: var(--surface-2); color: var(--muted);
}
.project__foot { margin-top: 4px; }
.project__open { font-size: 0.84rem; font-weight: 600; color: var(--accent-2); }
.projects__more { text-align: center; margin-top: 40px; }

/* ---------- timeline ---------- */
.timeline { position: relative; display: grid; gap: 26px; padding-left: 34px; }
.timeline::before {
  content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(var(--accent), var(--accent-2), transparent);
}
.tl { position: relative; }
.tl__dot {
  position: absolute; left: -34px; top: 22px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--bg-alt); border: 3px solid var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent);
}
.tl__card {
  padding: 22px 26px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
  transition: transform 0.35s var(--ease), border-color 0.35s;
}
.tl__card:hover { transform: translateX(8px); border-color: var(--accent); }
.tl__date { font-family: var(--mono); font-size: 0.74rem; color: var(--accent-2); letter-spacing: 0.08em; }
.tl__card h3 { margin-top: 8px; font-size: 1.12rem; }
.tl__card h4 { font-size: 0.88rem; font-weight: 500; color: var(--muted); margin-top: 2px; }
.tl__card p { margin-top: 10px; font-size: 0.9rem; color: var(--muted); }

/* ---------- heatmap ---------- */
.heatmap {
  margin-top: clamp(44px, 6vw, 70px); padding: 26px;
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface);
  overflow-x: auto;
}
.heatmap__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.heatmap__head h3 { font-size: 1rem; }
.heatmap__legend { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; color: var(--muted); font-family: var(--mono); }
.heatmap__legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.l0 { background: var(--surface-2); }
.l1 { background: rgba(124, 92, 255, 0.3); }
.l2 { background: rgba(124, 92, 255, 0.55); }
.l3 { background: rgba(124, 92, 255, 0.8); }
.l4 { background: var(--accent); }
.heatmap__grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 11px); gap: 4px; min-width: 720px; }
.heatmap__grid i { width: 11px; height: 11px; border-radius: 3px; background: var(--surface-2); transition: transform 0.2s; }
.heatmap__grid i:hover { transform: scale(1.5); outline: 1px solid var(--text); }
.heatmap__grid i.l1 { background: rgba(124, 92, 255, 0.3); }
.heatmap__grid i.l2 { background: rgba(124, 92, 255, 0.55); }
.heatmap__grid i.l3 { background: rgba(124, 92, 255, 0.8); }
.heatmap__grid i.l4 { background: var(--accent); }

/* ---------- forms / guestbook ---------- */
.field { position: relative; display: grid; gap: 7px; margin-bottom: 16px; }
.field > span { font-size: 0.8rem; font-family: var(--mono); color: var(--muted); letter-spacing: 0.05em; }
.field > span em { font-style: normal; opacity: 0.6; }
.field input, .field textarea {
  width: 100%; padding: 13px 16px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-size: 0.95rem; resize: vertical;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.field input::placeholder, .field textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.field__count { position: absolute; right: 12px; bottom: 12px; font-family: var(--mono); font-size: 0.7rem; color: var(--muted); }
.msg-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.msg-form__foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 6px; }
.msg-form__note { font-size: 0.78rem; color: var(--muted); font-family: var(--mono); }
.field.is-error input, .field.is-error textarea { border-color: var(--accent-3); animation: shake 0.3s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.messages { margin-top: 38px; display: grid; gap: 14px; }
.messages__loading { color: var(--muted); font-family: var(--mono); font-size: 0.85rem; animation: blink 1.2s infinite; }
.messages__empty { color: var(--muted); font-size: 0.9rem; text-align: center; padding: 22px; border: 1px dashed var(--border); border-radius: var(--radius); }
.msg {
  display: grid; grid-template-columns: auto 1fr; gap: 16px;
  padding: 18px 20px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
  animation: msgIn 0.5s var(--ease);
  transition: transform 0.3s var(--ease), border-color 0.3s;
}
.msg:hover { transform: translateX(6px); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
@keyframes msgIn { from { opacity: 0; transform: translateY(14px); } }
.msg__avatar {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; color: #fff; background: var(--grad); font-size: 0.95rem;
}
.msg__head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.msg__name { font-weight: 600; font-size: 0.98rem; }
.msg__title { font-family: var(--mono); font-size: 0.7rem; color: var(--accent-2); border: 1px solid var(--border); padding: 2px 8px; border-radius: 99px; }
.msg__time { font-size: 0.72rem; color: var(--muted); font-family: var(--mono); margin-left: auto; }
.msg__text { margin-top: 6px; font-size: 0.92rem; color: var(--muted); overflow-wrap: anywhere; }
.msg__del { font-size: 0.72rem; color: var(--muted); opacity: 0; transition: opacity 0.25s, color 0.25s; }
.msg:hover .msg__del { opacity: 1; }
.msg__del:hover { color: var(--accent-3); }

/* ---------- contact ---------- */
.contact { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: clamp(26px, 4vw, 46px); align-items: start; }
.contact__aside { display: grid; gap: 14px; }
.contact__card {
  position: relative; overflow: hidden;
  padding: 20px 22px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
  display: grid; gap: 5px;
  transition: transform 0.3s var(--ease), border-color 0.3s;
}
.contact__card:hover { transform: translateY(-4px); border-color: var(--accent); }
.contact__label { font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--muted); }
.contact__value { font-size: 1rem; font-weight: 600; text-align: left; overflow-wrap: anywhere; transition: color 0.25s; }
a.contact__value:hover, button.contact__value:hover { color: var(--accent-2); }
.contact__sub { font-size: 0.78rem; color: var(--muted); font-family: var(--mono); }
.contact__copied {
  position: absolute; right: 16px; top: 16px; font-size: 0.74rem; font-family: var(--mono);
  color: #34d399; opacity: 0; transform: translateY(-6px); transition: all 0.3s var(--ease);
}
.contact__copied.is-show { opacity: 1; transform: none; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--bg-alt); padding-top: 54px; }
.footer__inner {
  display: flex; justify-content: space-between; align-items: center; gap: 28px; flex-wrap: wrap;
  padding-bottom: 34px;
}
.footer__brand { display: flex; align-items: center; gap: 14px; }
.footer__brand p { font-weight: 700; line-height: 1.35; }
.footer__brand em { font-style: normal; font-weight: 400; font-size: 0.84rem; color: var(--muted); }
.footer__links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer__links a { font-size: 0.9rem; color: var(--muted); transition: color 0.25s; }
.footer__links a:hover { color: var(--text); }
.footer__bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 20px 0 26px; border-top: 1px solid var(--border);
  font-size: 0.8rem; color: var(--muted); font-family: var(--mono);
}
.to-top { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); transition: color 0.25s, transform 0.25s; }
.to-top:hover { color: var(--text); transform: translateY(-3px); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(5, 5, 12, 0.75); backdrop-filter: blur(8px); animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal__panel {
  position: relative; width: min(640px, 100%); max-height: 86vh; overflow-y: auto;
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: 22px;
  padding: clamp(26px, 4vw, 42px); box-shadow: var(--shadow);
  animation: panelIn 0.4s var(--ease);
}
@keyframes panelIn { from { opacity: 0; transform: translateY(28px) scale(0.97); } }
.modal__close {
  position: absolute; top: 16px; right: 16px; width: 38px; height: 38px;
  border-radius: 50%; border: 1px solid var(--border); background: var(--surface);
  display: grid; place-items: center; transition: transform 0.25s, border-color 0.25s;
}
.modal__close:hover { transform: rotate(90deg); border-color: var(--accent-3); color: var(--accent-3); }
.modal__cat { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-2); }
.modal__panel h3 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-top: 10px; }
.modal__year { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); margin-top: 4px; }
.modal__body { margin-top: 18px; display: grid; gap: 12px; color: var(--muted); font-size: 0.95rem; }
.modal__body strong { color: var(--text); }
.modal__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.modal__tags span {
  font-family: var(--mono); font-size: 0.72rem; padding: 5px 11px;
  border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border);
}
.modal__actions { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }

/* ---------- command palette ---------- */
.palette { position: fixed; inset: 0; z-index: 160; display: grid; place-items: start center; padding-top: 14vh; }
.palette[hidden] { display: none; }
.palette__backdrop { position: absolute; inset: 0; background: rgba(5, 5, 12, 0.7); backdrop-filter: blur(6px); animation: fadeIn 0.25s; }
.palette__panel {
  position: relative; width: min(560px, 92vw);
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow); overflow: hidden; animation: panelIn 0.3s var(--ease);
}
.palette__panel input {
  width: 100%; padding: 18px 20px; border: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 1rem; border-bottom: 1px solid var(--border);
}
.palette__panel input:focus { outline: none; }
.palette__panel ul { list-style: none; max-height: 300px; overflow-y: auto; padding: 8px; }
.palette__panel li {
  padding: 11px 14px; border-radius: 10px; font-size: 0.92rem; color: var(--muted);
  display: flex; justify-content: space-between; gap: 12px; cursor: pointer;
}
.palette__panel li kbd { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); opacity: 0.7; }
.palette__panel li.is-sel { background: var(--surface-2); color: var(--text); }
.palette__hint {
  padding: 10px 16px; border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: 0.68rem; color: var(--muted);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.palette__hint kbd {
  padding: 2px 6px; border-radius: 5px; border: 1px solid var(--border);
  background: var(--surface); font-family: var(--mono); font-size: 0.66rem;
}

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .services { grid-template-columns: repeat(2, 1fr); }
  .projects { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .avatar-card { max-width: 320px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .contact { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .projects { grid-template-columns: 1fr; }
  .services { grid-template-columns: 1fr; }
  .msg-form__row { grid-template-columns: 1fr; gap: 0; }
  .skill { grid-template-columns: 110px 1fr 42px; gap: 10px; }
  .msg { grid-template-columns: 1fr; }
  .msg__avatar { display: none; }
}
