/* ==========================================================
   Design tokens
   ========================================================== */
:root,
html[data-theme="light"] {
  --bg: #F6F8F9;
  --surface: #FFFFFF;
  --ink: #172026;
  --slate: #5B6670;
  --slate-light: #8993A0;
  --teal-600: #0F6E64;
  --teal: #14877B;
  --teal-light: #7FE3D4;
  --teal-tint: #E7F7F4;
  --line: #E2E6E8;
  --overlay: rgba(15, 20, 23, 0.55);
  --shadow-color: rgba(15, 30, 28, 0.12);
  /* Admin mode — amber/gold so it stays visually distinct from
     the teal logo and reads as "elevated permissions". */
  --admin: #D97706;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  color-scheme: light;
}

/* Dark theme — applied via data-theme="dark" on <html>, set by theme.js
   (either from an explicit user choice, or from "system" following
   prefers-color-scheme). Every component already reads colors through
   these custom properties, so this single block re-themes the site. */
html[data-theme="dark"] {
  --bg: #0E1416;
  --surface: #161D20;
  --ink: #EDF3F2;
  --slate: #A9B4B8;
  --slate-light: #6E7A80;
  --teal-600: #4FE0CC;
  --teal: #2FBFAC;
  --teal-light: #8FF0DE;
  --teal-tint: rgba(47, 191, 172, 0.12);
  --line: #263034;
  --overlay: rgba(0, 0, 0, 0.65);
  --shadow-color: rgba(0, 0, 0, 0.4);
  /* Amber in dark mode: lighter so it stays readable on the
     dark surface, but still distinct from teal. */
  --admin: #FBBF24;

  color-scheme: dark;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  transition: background-color 0.25s ease, color 0.25s ease;
}

::selection {
  background: var(--teal-light);
  color: var(--ink);
}

h1, h2, h3, .font-display {
  font-family: var(--font-display);
}

.font-mono {
  font-family: var(--font-mono);
}

/* Visible keyboard focus everywhere */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 2px;
}

/* A soft tinted wash used to set the hero / projects / contact
   sections apart from the plain page background. */
.section-onblue {
  background: var(--teal-tint);
  transition: background-color 0.25s ease;
}

/* ==========================================================
   Dotted grid background texture — subtle dot lattice that
   fades out toward the edges, used behind the hero content.
   ========================================================== */
.dot-grid {
  position: relative;
  overflow: hidden;
}

.dot-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--slate-light) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
  opacity: 0.4;
  -webkit-mask-image: radial-gradient(ellipse 65% 55% at var(--mx, 25%) var(--my, 20%), black 30%, transparent 85%);
  mask-image: radial-gradient(ellipse 65% 55% at var(--mx, 25%) var(--my, 20%), black 30%, transparent 85%);
  pointer-events: none;
}

html[data-theme="dark"] .dot-grid::before {
  opacity: 0.55;
}

/* ==========================================================
   Eyebrow labels
   ========================================================== */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-600);
}

/* ==========================================================
   Signature element: the pipeline rail
   A vertical line with nodes that fill in as the reader
   scrolls past each section — a nod to the automation
   pipelines (RAG, ticket routing) this site is about.
   ========================================================== */
.pipeline-rail {
  position: fixed;
  left: 2.25rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

@media (min-width: 1024px) {
  .pipeline-rail {
    display: flex;
  }
}

.pipeline-rail__track {
  position: absolute;
  top: 0.5rem;
  bottom: 0.5rem;
  left: 50%;
  width: 2px;
  background: var(--line);
  transform: translateX(-50%);
}

.pipeline-rail__fill {
  position: absolute;
  top: 0.5rem;
  left: 50%;
  width: 2px;
  background: var(--teal);
  transform: translateX(-50%);
  height: 0%;
  transition: height 0.25s ease-out;
}

.pipeline-rail__node {
  position: relative;
  z-index: 2;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--surface);
  border: 2px solid var(--line);
  margin: 1.35rem 0;
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.2s ease;
}

.pipeline-rail__node:hover {
  transform: scale(1.25);
}

.pipeline-rail__node.is-active {
  background: var(--teal);
  border-color: var(--teal);
}

.pipeline-rail__node.is-passed {
  background: var(--teal-light);
  border-color: var(--teal-light);
}

.pipeline-rail__label {
  position: absolute;
  left: 1.4rem;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--slate);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.pipeline-rail__node:hover .pipeline-rail__label {
  opacity: 1;
}

/* Mobile progress bar (replaces the rail on small screens) */
.mobile-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--teal);
  z-index: 40;
  width: 0%;
  transition: width 0.15s ease-out;
}

@media (min-width: 1024px) {
  .mobile-progress {
    display: none;
  }
}

/* ==========================================================
   Scroll reveal
   ========================================================== */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
  .modal-panel,
  .theme-toggle__thumb {
    transition: none !important;
  }
}

/* ==========================================================
   Small components
   ========================================================== */
.tag-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--slate);
  background: var(--surface);
  white-space: nowrap;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, transform 0.15s ease;
}

.btn-primary:hover {
  background: var(--teal-600);
  color: var(--bg);
  transform: translateY(-1px);
}

.btn-secondary {
  border: 1px solid var(--ink);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.btn-secondary:hover {
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-1px);
}

.nav-link {
  position: relative;
  color: var(--slate);
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--ink);
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--teal);
}

/* ==========================================================
   Site logo — ALOE (ink) + dev (teal).
   ".admin" suffix appears in amber when admin mode is on.
   ========================================================== */
.site-logo {
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.05em;
}

.site-logo__aloe {
  color: var(--ink);
}

.site-logo__dev {
  color: var(--teal);
}

/* Admin-mode suffix — sits just after "dev" with no extra
   spacing so it reads as one word: "ALOEdev.admin". */
.site-logo__admin {
  color: var(--admin);
  margin-left: 0.1em;
}

/* When admin mode is active, soften the "dev" so the amber
   ".admin" is the loudest piece. */
.site-logo--admin .site-logo__dev {
  color: var(--admin);
  opacity: 0.7;
}

/* ==========================================================
   Experience — pill-badged cards
   ========================================================== */
.experience-card {
  background: var(--teal-tint);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  padding: 1.75rem 1.75rem 1.5rem;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.experience-card__period {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--teal);
  color: #ffffff;
}

/* ==========================================================
   Skills — hover-highlighted tag pills (display-only, not
   click-toggled). The edge picks up teal on hover/focus so the
   list still feels alive without a persisted "selected" state.
   ========================================================== */
.tag-pill--hover {
  transition: border-color 0.18s ease, color 0.18s ease;
}

.tag-pill--hover:hover,
.tag-pill--hover:focus-visible {
  border-color: var(--teal);
  color: var(--teal-600);
}

/* ==========================================================
   Project cards — small, centered "certificate" style cards
   that open a details modal on click. Cards carry a slight
   alternating tilt (a loose stack of cards) and straighten up
   with a lift on hover/focus.
   ========================================================== */
.project-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.25rem 1.25rem;
}

@media (min-width: 640px) {
  .project-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Wrapper: owns the scroll-reveal fade AND the permanent vertical
   stagger (--stagger), so cards settle at an uneven baseline like a
   loose stack instead of a rigid grid. Combining both into one rule
   (rather than relying on the generic .reveal rules) means this
   always wins on specificity, regardless of stylesheet order. */
.project-card-wrap {
  --stagger: 0px;
}

.project-card-wrap.reveal {
  transform: translateY(calc(18px + var(--stagger)));
}

.project-card-wrap.reveal.is-visible {
  transform: translateY(var(--stagger));
}

@media (max-width: 639px) {
  /* Keep the stack effect but tone the offset down on narrow phones
     so cards don't crowd their neighbors. */
  .project-card-wrap.reveal.is-visible {
    transform: translateY(calc(var(--stagger) * 0.4));
  }
}

.project-card {
  --tilt: 0deg;
  cursor: pointer;
  text-align: center;
  width: 100%;
  height: 100%;
  font: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.85rem 1.1rem 1.25rem;
  transform: rotate(var(--tilt));
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.project-card:hover,
.project-card:focus-visible {
  transform: rotate(0deg) translateY(-4px);
  border-color: var(--teal);
  box-shadow: 0 16px 30px var(--shadow-color);
  position: relative;
  z-index: 1;
}

.project-card__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.25;
}

.project-card__tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-light);
  margin-top: 0.35rem;
}

.project-card__desc {
  font-size: 0.78rem;
  color: var(--slate);
  margin-top: 0.6rem;
  max-width: 100%;
}

.project-card__cta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--teal-600);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 1.1rem;
}

.project-card__cta svg {
  width: 13px;
  height: 13px;
}

@media (prefers-reduced-motion: reduce) {
  .project-card,
  .project-card-wrap.reveal,
  .project-card-wrap.reveal.is-visible {
    transform: none !important;
    transition: none !important;
  }
}

/* Modal picture */
.modal-image-wrap {
  border-radius: 0.85rem;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 0.5rem;
}

/* ==========================================================
   Code snippet — terminal-windowed block inside the project
   modal. Uses a dark surface regardless of site theme so the
   syntax-highlight colors stay legible.
   ========================================================== */
.code-snippet {
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  overflow: hidden;
  background: #0d1117;
}

.code-snippet__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  background: #161b22;
  border-bottom: 1px solid #21262d;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #8b949e;
}

.code-snippet__dots {
  display: inline-flex;
  gap: 0.3rem;
}

.code-snippet__dots span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #30363d;
}

.code-snippet__lang {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8b949e;
}

.code-snippet__copy {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid #30363d;
  border-radius: 999px;
  background: transparent;
  color: #8b949e;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.code-snippet__copy:hover {
  border-color: var(--teal);
  color: var(--teal-light);
}

.code-snippet__copy.is-copied {
  border-color: var(--teal);
  color: var(--teal-light);
  background: rgba(47, 191, 172, 0.1);
}

.code-snippet__copy svg {
  width: 12px;
  height: 12px;
}

.code-snippet__pre {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
  color: #c9d1d9;
  background: transparent;
}

.code-snippet__pre code {
  background: transparent;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.code-snippet__caption {
  padding: 0.55rem 0.85rem;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--slate-light);
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.modal-image-wrap img {
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: 0.5rem;
}

/* Modal video/embed — used instead of the image when a project has
   a `video` set (YouTube/Vimeo URL or a direct file). */
.modal-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0.85rem;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
}

.modal-video-wrap iframe,
.modal-video-wrap video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--overlay);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
  }
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.25rem 1.25rem 0 0;
  width: 100%;
  max-width: 880px;
  max-height: 92vh;
  overflow-y: auto;
  /* Smaller padding on phones — 1.75rem × 2 = 56px on a 320px viewport
     eats too much of the content area. */
  padding: 1rem;
  transform: translateY(24px);
  transition: transform 0.25s ease;
  box-shadow: 0 20px 50px var(--shadow-color);
}

@media (min-width: 640px) {
  .modal-panel {
    border-radius: 1.25rem;
    padding: 2.25rem;
  }
}

.modal-overlay.is-open .modal-panel {
  transform: translateY(0);
}

.modal-close {
  /* Bumped from 2rem so the hit target meets the 44px Apple HIG /
     48dp Material guideline on touch devices. The visible dot stays
     small via the inner SVG sizing — only the click area grew. */
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--slate);
  flex: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.modal-close:hover {
  background: var(--teal-tint);
  color: var(--teal-600);
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.modal-btn {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
}

.modal-btn svg {
  width: 15px;
  height: 15px;
}

/* ==========================================================
   Testimonials — star rating, quote-style cards, carousel
   ========================================================== */
.star-row {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.star-row__star {
  width: 15px;
  height: 15px;
  color: var(--line);
}

.star-row__star.is-filled {
  color: var(--teal);
}

.testimonial-carousel {
  position: relative;
}

.testimonial-track {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 0.25rem 0.25rem 0.75rem;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.testimonial-track::-webkit-scrollbar {
  display: none;
}

.testimonial-card {
  scroll-snap-align: start;
  flex: 0 0 calc(100% - 0.75rem);
  background: var(--teal-tint);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  padding: 1.5rem 1.5rem 1.35rem;
}

@media (min-width: 640px) {
  .testimonial-card {
    flex-basis: calc((100% - 1.25rem) / 2);
  }
}

@media (min-width: 1024px) {
  .testimonial-card {
    flex-basis: calc((100% - 2 * 1.25rem) / 3);
  }
}

.testimonial-card__quote {
  color: var(--slate);
  font-style: italic;
  line-height: 1.6;
  margin-top: 0.85rem;
}

.testimonial-card__quote::before {
  content: "\201C";
}

.testimonial-card__quote::after {
  content: "\201D";
}

.testimonial-card__author {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 1.1rem;
}

.testimonial-card__meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--slate-light);
  margin-top: 0.15rem;
}

.testimonial-carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  align-items: center;
  justify-content: center;
  color: var(--ink);
  box-shadow: 0 10px 24px var(--shadow-color);
  cursor: pointer;
  z-index: 2;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.testimonial-carousel__arrow svg {
  width: 16px;
  height: 16px;
}

.testimonial-carousel__arrow:hover {
  border-color: var(--teal);
  color: var(--teal-600);
}

.testimonial-carousel__arrow:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.testimonial-carousel__arrow--prev {
  left: -0.9rem;
}

.testimonial-carousel__arrow--next {
  right: -0.9rem;
}

.star-input {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.star-input__star {
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--line);
  cursor: pointer;
  transition: color 0.12s ease, transform 0.1s ease;
}

.star-input__star:hover,
.star-input__star:focus-visible {
  transform: scale(1.12);
}

.star-input__star.is-filled {
  color: var(--teal);
}

/* ==========================================================
   Feedback form — mirrors the experience-card visual treatment
   so the form reads as a focused, contained card on the page.
   ========================================================== */
.feedback-card {
  background: var(--teal-tint);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  padding: 1.75rem 1.75rem 1.5rem;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

/* ==========================================================
   Hidden admin mode — badge/actions layered onto existing
   .testimonial-card elements in place (see testimonials.js /
   adminPanel.js). The login step uses a small modal (reusing
   .modal-overlay/.modal-panel), everything after that happens
   directly in the Testimonials section — no separate page.
   ========================================================== */
.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  flex: none;
}

.admin-badge__dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
}

.admin-badge--pending {
  background: rgba(245, 166, 35, 0.15);
  color: #B9770E;
}

.admin-badge--approved {
  background: var(--surface);
  color: var(--teal-600);
}

.admin-badge--rejected {
  background: rgba(220, 38, 38, 0.1);
  color: #DC2626;
}

.admin-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--line);
}

.admin-btn {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--slate);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.admin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.admin-btn--show {
  border-color: var(--teal);
  color: var(--teal-600);
}

.admin-btn--show:hover:not(:disabled) {
  background: var(--teal);
  color: #fff;
}

.admin-btn--delete {
  border-color: rgba(220, 38, 38, 0.4);
  color: #DC2626;
}

.admin-btn--delete:hover:not(:disabled) {
  background: #DC2626;
  border-color: #DC2626;
  color: #fff;
}
/* ==========================================================
   Contact — icon rows + social icon links
   ========================================================== */
.contact-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.contact-row__icon {
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--teal-tint);
  color: var(--teal-600);
}

.contact-row__icon svg {
  width: 17px;
  height: 17px;
}

.contact-row__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.contact-row__label {
  font-size: 0.7rem;
  color: var(--slate-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.contact-row__value {
  color: var(--ink);
  transition: color 0.15s ease;
}

a.contact-row__value:hover {
  color: var(--teal-600);
}

/* ==========================================================
   Theme toggle — Light / Dark / System segmented control
   ========================================================== */
.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.theme-toggle__option {
  position: relative;
  z-index: 1;
  /* Default (in-navbar) — compact 28×28. The thumb sits on top of
     the active option, so its size must match. */
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--slate-light);
  transition: color 0.2s ease;
}

/* In the mobile menu drawer there's room, so the toggle grows to
   44px and the thumb has to grow with it. The CSS variables are
   scoped to #theme-toggle-mobile so the in-navbar toggle keeps its
   1.75rem dimensions and the thumb slides correctly in both
   contexts. */
#theme-toggle-mobile .theme-toggle__option {
  width: 44px;
  height: 44px;
}

#theme-toggle-mobile .theme-toggle__thumb {
  width: 44px;
  height: 44px;
}

.theme-toggle__option svg {
  width: 14px;
  height: 14px;
}

#theme-toggle-mobile .theme-toggle__option svg {
  width: 20px;
  height: 20px;
}

.theme-toggle__option.is-active {
  color: var(--surface);
}

.theme-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: var(--ink);
  transition: transform 0.22s ease;
  z-index: 0;
}

/* ==========================================================
   Tech-iconified tag pills. Adds a small inline icon (16px) on
   the left of the label, using simple-icons via techIcons.js.
   The slot reserves space so the row doesn't reflow when icons
   finish loading.
   ========================================================== */
.tag-pill--tech {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding-left: 0.65rem;
}

.tag-pill--tech .tech-icon {
  width: 14px;
  height: 14px;
  flex: none;
  /* Use --ink so icons read clearly in both light and dark mode.
     In dark mode --ink is near-white, which makes the icon stand
     out from the surrounding pill text. */
  color: var(--ink);
  opacity: 0.78;
  transition: color 0.18s ease, opacity 0.18s ease, filter 0.18s ease;
}

.tag-pill--tech .tech-icon-slot {
  width: 14px;
  height: 14px;
  flex: none;
  display: inline-block;
}

.tag-pill--tech .tech-icon-slot[data-pending="1"] {
  background: var(--line);
  border-radius: 3px;
  opacity: 0.5;
}

/* Hover lighting — icon goes full teal, opacity bumps to 1, and a
   soft teal glow surrounds it so the logo visibly "lights up". */
.tag-pill--tech:hover .tech-icon,
.tag-pill--tech:focus-visible .tech-icon {
  color: var(--teal-600);
  opacity: 1;
  filter: drop-shadow(0 0 4px rgba(20, 135, 123, 0.55));
}

.tag-pill--tech .tech-label {
  /* keep mono font + small size consistent with other pills */
}

/* Hover lighting — border + text go teal so the pill clearly
   "lights up" at the corners without changing size or layout. */
.tag-pill--tech {
  transition: border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  cursor: default;
}

.tag-pill--tech:hover,
.tag-pill--tech:focus-visible {
  border-color: var(--teal);
  color: var(--teal-600);
  box-shadow: 0 0 0 3px var(--teal-tint);
}

/* ==========================================================
   Hero photo — plain <img>, no hover effect. Sized to match
   the lg+ grid column, rounded corners, soft shadow.
   ========================================================== */
.hero-photo-wrap {
  /* Vertical centering helper on lg+ */
  align-self: center;
}

.hero-photo {
  display: block;
  width: clamp(200px, 28vw, 340px);
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center;
  border-radius: 1.5rem;
  box-shadow: 0 20px 50px -20px var(--shadow-color);
}

.hero-caret {
  display: inline-block;
  width: 0.55ch;
  height: 1.05em;
  background: var(--teal);
  margin-left: 0.15ch;
  vertical-align: -0.15em;
  animation: hero-blink 1.05s steps(1) infinite;
}

.hero-caret--inline {
  margin-left: 0.35ch;
  background: var(--teal-600);
}

@keyframes hero-blink {
  0%, 50%   { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-caret { animation: none; opacity: 0.6; }
}

/* ==========================================================
   Command palette (Ctrl/⌘+K) — top-anchored, terminal-themed
   overlay for jumping between sections, projects, and social
   links. Reuses the .modal-overlay / .modal-panel shell but
   overrides the panel sizing, anchoring, and inner styling.
   ========================================================== */
.command-palette-panel {
  width: 100%;
  max-width: 640px;
  padding: 0;
  overflow: hidden;
  border-radius: 1rem;
}

@media (min-width: 640px) {
  .command-palette-panel {
    margin-top: -8vh;
  }
}

.command-palette-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.command-palette-prompt {
  font-family: var(--font-mono);
  color: var(--teal-600);
  font-weight: 500;
  font-size: 1.05rem;
  user-select: none;
}

#command-palette-input {
  flex: 1;
  border: 0;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--ink);
  outline: none;
  padding: 0.25rem 0;
}

#command-palette-input::placeholder {
  color: var(--slate-light);
}

.command-palette-kbd {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--slate);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  background: var(--bg);
}

.command-palette-list {
  list-style: none;
  margin: 0;
  padding: 0.4rem;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--surface);
}

.command-palette-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--slate-light);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.command-palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 0.5rem;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
  transition: background 0.12s ease, color 0.12s ease;
}

.command-palette-item.is-active,
.command-palette-item:hover {
  background: var(--teal-tint);
}

.command-palette-item.is-active .palette-label,
.command-palette-item.is-active .palette-sub,
.command-palette-item.is-active .palette-kind {
  color: var(--teal-600);
}

.palette-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.palette-label {
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.palette-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--slate-light);
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.palette-kind {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--slate-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex: none;
}

.palette-hit {
  background: transparent;
  color: var(--teal-600);
  font-weight: 700;
  padding: 0;
}

.command-palette-foot {
  display: flex;
  gap: 1.25rem;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--slate-light);
  background: var(--bg);
}

.command-palette-foot kbd {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  background: var(--surface);
  color: var(--slate);
  margin-right: 0.25rem;
}

@media (max-width: 480px) {
  .command-palette-foot span:nth-child(3) { display: none; }
}

/* Nav kbd hint for opening the palette (sits next to the resume button) */
.nav-palette-hint {
  display: none;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--slate-light);
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

@media (min-width: 768px) {
  .nav-palette-hint { display: inline-flex; }
}

.nav-palette-hint:hover {
  border-color: var(--teal);
  color: var(--teal-600);
}

.nav-palette-hint kbd {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 0.3rem;
  background: var(--bg);
  color: var(--ink);
}

/* ==========================================================
   Easter-egg terminal (Ctrl+`). Independent overlay so it can
   stack on top of the command palette. Uses a dark surface
   regardless of site theme to feel like a real terminal.
   ========================================================== */
.terminal-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--overlay);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

@media (min-width: 768px) {
  .terminal-overlay { align-items: center; }
}

.terminal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.terminal-window {
  width: 100%;
  max-width: 760px;
  max-height: 80vh;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 0.85rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #c9d1d9;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(20px) scale(0.98);
  transition: transform 0.22s ease;
}

.terminal-overlay.is-open .terminal-window {
  transform: translateY(0) scale(1);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  background: #161b22;
  border-bottom: 1px solid #21262d;
  color: #8b949e;
  font-size: 0.72rem;
}

.terminal-dots {
  display: inline-flex;
  gap: 0.3rem;
}

.terminal-dots span {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #30363d;
}

.terminal-title {
  flex: 1;
  text-align: center;
  user-select: none;
}

.terminal-close {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: #8b949e;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

.terminal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f0f6fc;
}

.terminal-body {
  flex: 1;
  padding: 1rem 1.1rem;
  overflow-y: auto;
  min-height: 14rem;
  background: #0d1117;
}

.terminal-line {
  white-space: pre-wrap;
  line-height: 1.55;
}

.terminal-echo {
  color: var(--teal-light);
}

.terminal-err {
  color: #f85149;
}

.terminal-hint {
  color: #6e7681;
  font-style: italic;
}

.terminal-prompt-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  border-top: 1px solid #21262d;
  background: #161b22;
}

.terminal-prompt-sigil {
  color: var(--teal);
  font-weight: 500;
  user-select: none;
}

#terminal-input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: #c9d1d9;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.2rem 0;
}

#terminal-input::placeholder { color: #6e7681; }

/* ==========================================================
   Presence widget — "N people viewing now"
   ========================================================== */
.presence-widget {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.presence-widget__stack {
  display: flex;
  align-items: center;
}

.presence-widget__avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 2px solid var(--bg);
  background: var(--teal-tint);
  overflow: hidden;
  margin-left: -0.5rem;
  flex: none;
}

.presence-widget__avatar:first-child {
  margin-left: 0;
}

.presence-widget__avatar img {
  width: 100%;
  height: 100%;
  display: block;
}

.presence-widget__overflow {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 2px solid var(--bg);
  margin-left: -0.5rem;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.presence-widget__text {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--slate);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.presence-widget__dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 0 0 rgba(20, 135, 123, 0.5);
  animation: presence-pulse 2s infinite;
}

@keyframes presence-pulse {
  0% { box-shadow: 0 0 0 0 rgba(20, 135, 123, 0.45); }
  70% { box-shadow: 0 0 0 6px rgba(20, 135, 123, 0); }
  100% { box-shadow: 0 0 0 0 rgba(20, 135, 123, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .presence-widget__dot {
    animation: none;
  }
}

/* ==========================================================
   "View all projects" CTA — homepage, beneath featured grid.
   ========================================================== */
.projects-seeall {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--teal-600);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.25rem;
  transition: color 0.2s ease, border-color 0.2s ease, gap 0.2s ease;
}
.projects-seeall:hover {
  color: var(--ink);
  border-color: var(--teal-600);
  gap: 0.7rem;
}
.projects-seeall svg {
  width: 14px;
  height: 14px;
}

/* ==========================================================
   Compact row layout for /projects.html (full catalog).
   ========================================================== */
.project-row-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1rem 1.15rem;
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.project-row:hover {
  border-color: var(--teal);
  transform: translateY(-1px);
}

.project-row__main {
  min-width: 0;
  flex: 1 1 auto;
}
.project-row__head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.project-row__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}
.project-row__tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-light);
}
.project-row__desc {
  margin-top: 0.2rem;
  font-size: 0.85rem;
  color: var(--slate);
  line-height: 1.45;
}
.project-row__btn {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.5rem 0.95rem;
}
.project-row__btn svg {
  width: 12px;
  height: 12px;
}

.see-home-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--slate);
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.see-home-link:hover {
  color: var(--teal-600);
  border-color: var(--teal-600);
}
.see-home-link svg {
  width: 12px;
  height: 12px;
}

@media (max-width: 639px) {
  .project-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .project-row__btn {
    align-self: stretch;
    text-align: center;
    justify-content: center;
  }
}

/* ==========================================================
   Category filter chips — /projects.html only.
   "All" + one chip per category; clicking hides non-matching
   groups (see allProjects.js for the toggle).
   ========================================================== */
.project-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--slate);
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.project-chip:hover {
  border-color: var(--teal);
  color: var(--teal-600);
}

.project-chip.is-active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.project-row-group.is-hidden-by-filter {
  display: none;
}
