/* ==========================================================================
   Components
   ========================================================================== */

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast);
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; transition: transform var(--dur-fast) var(--ease-out); }

.btn-primary {
  background: var(--grad-primary);
  color: var(--ink-0);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--glow-blue);
}
.btn-primary:hover svg { transform: translateX(3px); }

.btn-ghost {
  border: 1px solid var(--line-strong);
  color: var(--text-0);
}
.btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  transform: translateY(-3px);
}

.btn-sm { padding: 0.6rem 1.1rem; font-size: var(--fs-xs); }

/* ---- Badges / tech tags ---- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-2);
  transition: border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
}
.tag:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  transform: translateY(-2px);
}
.tag svg { width: 12px; height: 12px; }

/* ---- Cards, generic ---- */
.card {
  background: linear-gradient(180deg, var(--ink-2), var(--ink-1));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  position: relative;
}

.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, transparent 30%, rgba(41, 211, 240, 0.5), transparent 70%);
  background-size: 220% 220%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--dur-fast);
  pointer-events: none;
}

.card:hover::before {
  opacity: 1;
  animation: border-sweep 2.6s linear infinite;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card);
}

/* ---- Hero ---- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--sp-8);
}

.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--sp-7);
  align-items: center;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.hero-eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, var(--fs-4xl));
  margin-bottom: var(--sp-4);
}

.hero-role {
  font-family: var(--font-mono);
  font-size: var(--fs-md);
  color: var(--blue-bright);
  min-height: 1.6em;
  margin-bottom: var(--sp-5);
}

.hero p.lede {
  max-width: 520px;
  font-size: var(--fs-md);
  color: var(--text-2);
  margin-bottom: var(--sp-6);
}

.hero-actions {
  display: flex;
  gap: var(--sp-4);
  align-items: center;
  flex-wrap: wrap;
}

.hero-meta {
  margin-top: var(--sp-8);
  display: flex;
  gap: var(--sp-7);
}

.hero-meta div strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  color: var(--text-0);
}

.hero-meta div span {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-3);
}

/* ---- Signature wireframe cube ---- */
.cube-stage {
  perspective: 900px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 420px;
}

.cube {
  width: 220px;
  height: 220px;
  position: relative;
  transform-style: preserve-3d;
  animation: spin-y 16s linear infinite;
}

.cube .face {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(105, 158, 255, 0.55);
  background: linear-gradient(135deg, rgba(61, 125, 255, 0.08), rgba(41, 211, 240, 0.03));
  box-shadow: inset 0 0 30px rgba(61, 125, 255, 0.12);
}

.cube .face-front  { transform: translateZ(110px); }
.cube .face-back   { transform: translateZ(-110px) rotateY(180deg); }
.cube .face-right  { transform: rotateY(90deg) translateZ(110px); }
.cube .face-left   { transform: rotateY(-90deg) translateZ(110px); }
.cube .face-top    { transform: rotateX(90deg) translateZ(110px); }
.cube .face-bottom { transform: rotateX(-90deg) translateZ(110px); }

.orbit-node {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
}

.orbit-ring {
  position: absolute;
  border: 1px dashed var(--line-strong);
  border-radius: 50%;
}

/* ---- Logo dropzone (navbar brand mark) ---- */
.logo-mark {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  background: var(--ink-2);
  flex-shrink: 0;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.logo-mark:hover {
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-mark .logo-fallback {
  width: 60%;
  height: 60%;
  transform-style: preserve-3d;
  animation: spin-y 10s linear infinite;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-mark .edit-badge {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 12, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--dur-fast);
}
.logo-mark:hover .edit-badge { opacity: 1; }
.logo-mark .edit-badge svg { width: 16px; height: 16px; color: var(--cyan); }

.logo-mark input[type="file"] { display: none; }

/* Bigger dropzone used on the profile page for the identity photo */
.upload-zone {
  width: 100%;
  aspect-ratio: 1;
  max-width: 320px;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--line-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: var(--sp-5);
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.upload-zone:hover {
  border-color: var(--cyan);
  background: rgba(41, 211, 240, 0.04);
}
.upload-zone img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.upload-zone .hint {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-3);
}
.upload-zone svg { width: 30px; height: 30px; color: var(--text-2); }
.upload-zone input[type="file"] { display: none; }
.upload-zone .remove-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(4, 6, 12, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.upload-zone .remove-btn svg { width: 14px; height: 14px; color: var(--text-0); }
.upload-zone.has-image .remove-btn { display: flex; }
.upload-zone.has-image .hint,
.upload-zone.has-image svg.upload-icon { display: none; }

/* ---- Stats ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-5);
}
.stat-card {
  text-align: center;
  padding: var(--sp-6) var(--sp-4);
}
.stat-num {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-label {
  margin-top: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-3);
  text-transform: lowercase;
}

/* ---- Marquee tech strip ---- */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding-block: var(--sp-5);
}
.marquee-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding-inline: var(--sp-6);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--text-2);
  white-space: nowrap;
}
.marquee-item svg { width: 18px; height: 18px; color: var(--blue-bright); }
.marquee-item::after {
  content: "";
  width: 5px; height: 5px;
  margin-left: var(--sp-6);
  border-radius: 50%;
  background: var(--text-3);
}

/* ---- Project cards ---- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-5); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }

.project-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.project-thumb {
  aspect-ratio: 16/10;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--deep), var(--ink-2) 60%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
}
.project-thumb svg {
  width: 46px;
  height: 46px;
  color: var(--blue-bright);
  opacity: 0.85;
}
.project-thumb .grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(112, 148, 255, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(112, 148, 255, 0.09) 1px, transparent 1px);
  background-size: 24px 24px;
}
.project-thumb .scan {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(41, 211, 240, 0.18), transparent);
  transform: translateY(-100%);
  transition: transform 1s var(--ease-in-out);
}
.project-card:hover .scan { transform: translateY(100%); }

.project-card h3 { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.project-card .tags { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-block: var(--sp-2) var(--sp-1); }
.project-card p { font-size: var(--fs-sm); color: var(--text-2); }
.project-links { display: flex; gap: var(--sp-3); margin-top: var(--sp-2); }
.project-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-2);
  transition: color var(--dur-fast);
}
.project-links a:hover { color: var(--cyan); }
.project-links a svg { width: 14px; height: 14px; }

.status-pill {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line-strong);
  color: var(--text-3);
  white-space: nowrap;
}
.status-pill.live { color: var(--cyan); border-color: var(--cyan); }

/* ---- Filter bar ---- */
.filter-bar {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-7);
}
.filter-btn {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  transition: all var(--dur-fast) var(--ease-out);
}
.filter-btn:hover { color: var(--text-0); border-color: var(--cyan); }
.filter-btn.active {
  background: var(--grad-primary);
  color: var(--ink-0);
  border-color: transparent;
}

/* ---- Skills ---- */
.skill-row {
  display: grid;
  grid-template-columns: 160px 1fr 40px;
  align-items: center;
  gap: var(--sp-4);
  padding-block: var(--sp-3);
  border-bottom: 1px solid var(--line);
}
.skill-row .name {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--text-0);
}
.skill-row .name svg { width: 16px; height: 16px; color: var(--blue-bright); }
.skill-bar {
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--ink-3);
  overflow: hidden;
}
.skill-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--grad-primary);
  width: 0%;
  transition: width 1.4s var(--ease-out);
}
.skill-row .pct {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-3);
  text-align: right;
}

/* Icon grid (tools) */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--sp-4);
}
.icon-tile {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast);
}
.icon-tile:hover { transform: translateY(-6px); border-color: var(--cyan); }
.icon-tile svg { width: 26px; height: 26px; color: var(--blue-bright); }
.icon-tile span { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-3); }

/* ---- Timeline ---- */
.timeline {
  position: relative;
  padding-left: var(--sp-6);
}
.timeline::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--line-strong);
  transform: scaleY(0);
  transform-origin: top;
  animation: draw-line 1.6s var(--ease-out) forwards;
  animation-timeline: view();
}
.timeline-item {
  position: relative;
  padding-bottom: var(--sp-7);
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}
.timeline-item .when {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-3);
  margin-bottom: var(--sp-1);
}
.timeline-item h3 { margin-bottom: var(--sp-1); }
.timeline-item .org { color: var(--blue-bright); font-size: var(--fs-sm); margin-bottom: var(--sp-2); }
.timeline-item p { font-size: var(--fs-sm); }

/* ---- Contact ---- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: var(--sp-7);
}
.contact-card {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  padding: var(--sp-5);
}
.contact-card .icon-box {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: rgba(61, 125, 255, 0.1);
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.contact-card .icon-box svg { width: 20px; height: 20px; color: var(--cyan); }
.contact-card h3 { font-size: var(--fs-base); margin-bottom: 2px; }
.contact-card p { font-size: var(--fs-sm); color: var(--text-2); }
.contact-card a { color: var(--text-1); transition: color var(--dur-fast); }
.contact-card a:hover { color: var(--cyan); }

.field {
  margin-bottom: var(--sp-5);
  position: relative;
}
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-3);
  margin-bottom: var(--sp-2);
  text-transform: lowercase;
}
.field input,
.field textarea {
  width: 100%;
  background: var(--ink-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  color: var(--text-0);
  font-family: var(--font-body);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.field input:focus,
.field textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(41, 211, 240, 0.12);
  outline: none;
}
.field textarea { resize: vertical; min-height: 130px; }

.form-note {
  margin-top: var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.form-note svg { width: 14px; height: 14px; }

.toast {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  background: var(--ink-2);
  border: 1px solid var(--cyan);
  border-radius: var(--radius-md);
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  transform: translateY(140%);
  opacity: 0;
  transition: transform 0.5s var(--ease-out), opacity 0.5s var(--ease-out);
  z-index: 300;
  box-shadow: var(--shadow-card);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast svg { width: 20px; height: 20px; color: var(--cyan); }

/* ---- Divider cube bullet (signature motif reused) ---- */
.cube-bullet {
  width: 8px;
  height: 8px;
  border: 1px solid var(--cyan);
  transform: rotate(45deg);
  display: inline-block;
}

/* ---- Node mesh legend badge (about page detail) ---- */
.node-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-2);
}
