:root {
  --ah-mustard: #f9cb50;
  --ah-mustard-600: #C99B1B;
  --ah-mustard-soft: rgba(224, 181, 40, 0.12);
}

/* Light theme */
[data-bs-theme="light"] {
  --ah-bg: #F2F2F0;
  --ah-surface: #FFFFFF;
  --ah-surface-2: #ECECE8;
  --ah-text: #111113;
  --ah-text-muted: #5C5C60;
  --ah-border: rgba(17,17,19,0.08);
  --ah-border-strong: rgba(17,17,19,0.16);
  --ah-shadow: 0 1px 2px rgba(17,17,19,0.04), 0 12px 30px -16px rgba(17,17,19,0.18);
}

/* Dark theme */
[data-bs-theme="dark"] {
  --ah-bg: #0B0B0C;
  --ah-surface: #131316;
  --ah-surface-2: #1B1B1F;
  --ah-text: #F4F4F2;
  --ah-text-muted: #9A9A9F;
  --ah-border: rgba(255,255,255,0.08);
  --ah-border-strong: rgba(255,255,255,0.16);
  --ah-shadow: 0 1px 2px rgba(0,0,0,0.4), 0 18px 40px -20px rgba(0,0,0,0.6);
}

html, body { background: var(--ah-bg); color: var(--ah-text); }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-feature-settings: "ss01","cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .25s ease, color .25s ease;
}

h1, h2, h3, h4, .display-font { font-family: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif; letter-spacing: -0.02em; }
.mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace; }

/* ---------- Navbar ---------- */
.ah-nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--ah-bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--ah-border);
}
.ah-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; letter-spacing: -0.02em;
  color: var(--ah-text); text-decoration: none;
  display: inline-flex; align-items: center; gap: .55rem;
}
.ah-brand .dot { width:.5rem; height:.5rem; background: #f9cb50; border-radius: 999px; box-shadow: 0 0 0 4px var(--ah-mustard-soft); }
.ah-nav .nav-link {
  color: var(--ah-text-muted); font-weight: 500; padding: .4rem .9rem; border-radius: 999px;
}
.ah-nav .nav-link:hover { color: var(--ah-text); background: var(--ah-surface-2); }
.ah-nav .nav-link.active { color: var(--ah-text); }

.theme-toggle {
  width: 38px; height: 38px; border-radius: 999px;
  border: 1px solid var(--ah-border-strong);
  background: var(--ah-surface);
  color: var(--ah-text);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .2s ease, background .2s ease;
}
.theme-toggle:hover { background: var(--ah-surface-2); transform: rotate(-12deg); }
.theme-toggle .bi-sun-fill, .theme-toggle .bi-moon-stars-fill { font-size: 1rem; }
[data-bs-theme="dark"] .theme-toggle .bi-sun-fill { display: inline-block; }
[data-bs-theme="dark"] .theme-toggle .bi-moon-stars-fill { display: none; }
[data-bs-theme="light"] .theme-toggle .bi-sun-fill { display: none; }
[data-bs-theme="light"] .theme-toggle .bi-moon-stars-fill { display: inline-block; }

/* ---------- Hero ---------- */
.ah-hero { padding: clamp(3rem, 7vw, 6rem) 0 clamp(2.5rem, 5vw, 4.5rem); position: relative; }
.ah-hero .eyebrow {
  display: inline-flex; align-items: center; gap:.5rem;
  padding: .35rem .75rem; border-radius: 999px;
  background: var(--ah-mustard-soft); color: #f9cb50;
  font-weight: 600; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase;
}
.ah-hero h1 {
  font-size: clamp(2.2rem, 5.2vw, 4rem); font-weight: 700; line-height: 1.04; margin: 1.1rem 0 1rem;
}
.ah-hero h1 .accent { color: #f9cb50; }
.ah-hero .lede { color: var(--ah-text-muted); font-size: 1.08rem; max-width: 52ch; }
.ah-hero .meta-row { display: flex; flex-wrap: wrap; gap: .9rem 1.25rem; margin-top: 1.5rem; color: var(--ah-text-muted); }
.ah-hero .meta-row a { color: var(--ah-text); text-decoration: none; display: inline-flex; align-items: center; gap:.5rem; font-weight: 500; }
.ah-hero .meta-row a:hover { color: #f9cb50; }
.ah-hero .meta-row .bi { color: #f9cb50; }

.ah-avatar-wrap {
  position: relative; aspect-ratio: 1/1; max-width: 320px; margin-inline: auto;
  display: grid; place-items: center;
}
.ah-avatar {
  width: 100%; aspect-ratio: 1/1; border-radius: 50%;
  background: #fbc229;
  /* background: var(--ah-surface-2); */
  border: 1px solid var(--ah-border);
  overflow: hidden; position: relative;
  box-shadow: var(--ah-shadow);
  opacity: 0.86;
}

.ah-avatar img {
  transform: scale(0.75);
  object-position: -16px -63px;
  object-fit: cover;
  position: absolute;
  top: -1px;
  left: -33px;
}
.ah-avatar .ph {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(135deg, var(--ah-surface-2) 0 12px, var(--ah-surface) 12px 24px);
  display: grid; place-items: center;
  color: var(--ah-text-muted); font-family: 'JetBrains Mono', monospace; font-size: .8rem;
}
.ah-avatar .ph span { background: var(--ah-surface); padding: .35rem .65rem; border-radius: 6px; border: 1px solid var(--ah-border); }
.ah-avatar-ring {
  position: absolute; inset: -14px; border-radius: 50%;
  border: 1.5px dashed #f9cb50;
  opacity: .55;
  animation: spin 28s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ah-avatar-badge {
  position: absolute; bottom: 6%; right: 6%;
  background: #f9cb50; color: #111;
  padding: .45rem .7rem; border-radius: 999px;
  font-weight: 600; font-size: .78rem;
  display: inline-flex; align-items: center; gap:.4rem;
  box-shadow: var(--ah-shadow);
}
.ah-avatar-badge .pulse { width:.5rem; height:.5rem; border-radius: 999px; background:#1a6b2c; box-shadow: 0 0 0 0 rgba(26,107,44,.6); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(26,107,44,0); } 100% { box-shadow: 0 0 0 0 rgba(26,107,44,0); } }

/* ---------- Buttons ---------- */
.btn-mustard {
  background: #f9cb50; color:#111; border:1px solid #f9cb50;
  font-weight: 600; padding:.7rem 1.25rem; border-radius: 999px;
  display: inline-flex; align-items: center; gap:.5rem;
  transition: transform .15s ease, background .2s ease;
}
.btn-mustard:hover { background: var(--ah-mustard-600); color:#111; transform: translateY(-1px); }
.btn-ghost {
  background: transparent; color: var(--ah-text); border:1px solid var(--ah-border-strong);
  font-weight: 600; padding:.7rem 1.25rem; border-radius: 999px;
  display: inline-flex; align-items: center; gap:.5rem;
}
.btn-ghost:hover { background: var(--ah-surface-2); color: var(--ah-text); }

/* ---------- Sections ---------- */
section { padding: clamp(3.5rem, 6vw, 5.5rem) 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; margin-bottom: 2.25rem; flex-wrap: wrap; }
.section-eyebrow {
  display: inline-flex; align-items: center; gap:.5rem;
  color: #f9cb50; font-family: 'JetBrains Mono', monospace;
  font-size: .8rem; letter-spacing: .08em; text-transform: uppercase;
}
.section-eyebrow .bar { width: 28px; height: 1px; background: #f9cb50; }
.section-title { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 700; margin: .5rem 0 0; }
.section-sub { color: var(--ah-text-muted); max-width: 56ch; margin-top: .6rem; }

/* ---------- Skills grid ---------- */
.skill-card {
  background: var(--ah-surface); border: 1px solid var(--ah-border);
  border-radius: 16px; padding: 1.5rem; height: 100%;
  transition: border-color .2s ease, transform .2s ease, background .2s ease;
  position: relative; overflow: hidden;
}
.skill-card::after {
  content: ""; position: absolute; left: 1.5rem; right: 1.5rem; bottom: 0; height: 2px;
  background: #f9cb50; transform: scaleX(0); transform-origin: left;
  transition: transform .35s ease;
}
.skill-card:hover { border-color: var(--ah-border-strong); transform: translateY(-3px); }
.skill-card:hover::after { transform: scaleX(1); }
.skill-num {
  font-family: 'JetBrains Mono', monospace; font-size: .78rem; color: var(--ah-text-muted);
  letter-spacing: .08em;
}
.skill-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--ah-mustard-soft); color: #f9cb50;
  display: grid; place-items: center; font-size: 1.25rem; margin: .9rem 0 1rem;
}
.skill-title { font-weight: 600; font-size: 1.06rem; margin-bottom: .35rem; }
.skill-desc { color: var(--ah-text-muted); font-size: .92rem; line-height: 1.55; }

/* ---------- Tech chips ---------- */
.tech-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem;
}
.tech-chip {
  background: var(--ah-surface); border: 1px solid var(--ah-border);
  padding: .85rem 1rem; border-radius: 12px;
  display: flex; align-items: center; gap:.7rem;
  font-weight: 500; font-size: .95rem;
  transition: border-color .2s ease, background .2s ease;
}
.tech-chip:hover { border-color: #f9cb50; background: var(--ah-surface-2); }
.tech-chip .dot { width:.5rem; height:.5rem; border-radius: 999px; background: #f9cb50; flex: 0 0 auto; }
.tech-chip .num { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: .72rem; color: var(--ah-text-muted); }

/* ---------- Projects slider ---------- */
.projects-viewport { position: relative; }
.projects-track {
  display: flex; gap: 1.25rem; overflow-x: auto;
  scroll-snap-type: x mandatory; scroll-padding-inline: 1rem;
  padding-bottom: 1rem;
  scrollbar-width: thin;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.projects-track:active { cursor: grabbing; }
.projects-track::-webkit-scrollbar { height: 8px; }
.projects-track::-webkit-scrollbar-thumb { background: var(--ah-border-strong); border-radius: 999px; }
.project-card {
  flex: 0 0 min(360px, 82vw); scroll-snap-align: start;
  background: var(--ah-surface); border: 1px solid var(--ah-border);
  border-radius: 18px; overflow: hidden;
  transition: border-color .2s ease, transform .2s ease;
}
.project-card:hover { border-color: var(--ah-border-strong); transform: translateY(-3px); }
.project-thumb {
  aspect-ratio: 16/10; position: relative; overflow: hidden;
  background: var(--ah-surface-2);
  display: grid; place-items: center;
}
.project-thumb svg { width: 100%; height: 100%; display: block; }
.project-body { padding: 1.1rem 1.2rem 1.3rem; }
.project-meta {
  display: flex; align-items: center; gap:.6rem; color: var(--ah-text-muted);
  font-family: 'JetBrains Mono', monospace; font-size: .75rem; letter-spacing: .04em;
}
.project-meta .tag { background: var(--ah-mustard-soft); color: #f9cb50; padding: .15rem .5rem; border-radius: 6px; font-size: .7rem; }
.project-title { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 1.12rem; margin: .55rem 0 .35rem; letter-spacing: -.01em; }
.project-desc { color: var(--ah-text-muted); font-size: .92rem; line-height: 1.55; }
.project-stack { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .9rem; }
.project-stack span { font-size: .72rem; padding: .2rem .55rem; border-radius: 999px; border: 1px solid var(--ah-border-strong); color: var(--ah-text-muted); }

.slider-controls { display: flex; gap: .5rem; }
.slider-btn {
  width: 42px; height: 42px; border-radius: 999px;
  border: 1px solid var(--ah-border-strong); background: var(--ah-surface);
  color: var(--ah-text); display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s ease;
}
.slider-btn:hover { background: #f9cb50; color: #111; border-color: #f9cb50; }
.slider-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- Clients marquee ---------- */
.marquee {
  position: relative; overflow: hidden; padding: 1.25rem 0;
  border-top: 1px solid var(--ah-border);
  border-bottom: 1px solid var(--ah-border);
  background: var(--ah-surface);
}
.marquee::before, .marquee::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 80px; z-index: 2; pointer-events: none;
}
.marquee::before { left: 0; background: linear-gradient(90deg, var(--ah-surface), transparent); }
.marquee::after  { right: 0; background: linear-gradient(-90deg, var(--ah-surface), transparent); }
.marquee-track {
  display: flex; gap: 3rem; width: max-content; align-items: center;
  animation: marquee 40s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.client-logo {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; letter-spacing: -.02em;
  color: var(--ah-text-muted); font-size: 1.35rem;
  display: inline-flex; align-items: center; gap:.55rem;
  opacity: .75; transition: opacity .2s ease, color .2s ease;
  white-space: nowrap;
}
.client-logo:hover { opacity: 1; color: var(--ah-text); }
.client-logo .glyph {
  width: 26px; height: 26px; display: inline-grid; place-items: center;
  border: 1.5px solid currentColor; border-radius: 6px;
  font-size: .85rem;
}
.client-logo .glyph.circle { border-radius: 999px; }
.client-logo .glyph.diamond { border-radius: 4px; transform: rotate(45deg); }
.client-logo .glyph.diamond span { transform: rotate(-45deg); display:inline-block; }

/* ---------- Contact / Footer ---------- */
.contact-card {
  background: var(--ah-surface); border: 1px solid var(--ah-border); border-radius: 22px;
  padding: clamp(1.75rem, 4vw, 3rem); display: flex; align-items: center; justify-content: space-between;
  gap: 2rem; flex-wrap: wrap;
}
.contact-card h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 0 0 .35rem; }
.contact-card p { color: var(--ah-text-muted); margin: 0; max-width: 50ch; }

footer.ah-footer {
  border-top: 1px solid var(--ah-border);
  padding: 1.75rem 0 2rem; color: var(--ah-text-muted); font-size: .9rem;
}
footer.ah-footer a { color: var(--ah-text-muted); text-decoration: none; }
footer.ah-footer a:hover { color: #f9cb50; }
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.socials { display: inline-flex; gap: .35rem; }
.socials a {
  width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--ah-border);
  display: inline-grid; place-items: center; color: var(--ah-text);
  transition: background .2s ease, border-color .2s ease;
}
.socials a:hover { background: #f9cb50; border-color: #f9cb50; color: #111; }

/* ---------- Mobile ---------- */
@media (max-width: 767.98px) {
  .ah-avatar-wrap { max-width: 240px; margin-top: 2rem; }
  .section-head { align-items: start; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .marquee-track, .ah-avatar-ring { animation: none; }
}

/* ---------- Tweaks panel ---------- */
.tweaks-panel {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 100;
  width: 320px; max-width: calc(100vw - 2rem);
  background: var(--ah-surface); border: 1px solid var(--ah-border-strong);
  border-radius: 16px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.5), 0 4px 12px rgba(0,0,0,.15);
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--ah-text);
  overflow: hidden;
  transform: translateY(8px); opacity: 0; pointer-events: none;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), opacity .2s ease;
}
.tweaks-panel.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
.tweaks-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1rem; border-bottom: 1px solid var(--ah-border);
  background: var(--ah-surface-2);
  cursor: grab;
}
.tweaks-head:active { cursor: grabbing; }
.tweaks-head h6 { margin: 0; font-family: 'Space Grotesk', sans-serif; font-size: .95rem; font-weight: 600; display: inline-flex; align-items: center; gap:.5rem; }
.tweaks-head h6 .dot { width:.5rem; height:.5rem; background: #f9cb50; border-radius:999px; }
.tweaks-close {
  width: 28px; height: 28px; border-radius: 999px;
  border: 1px solid var(--ah-border); background: transparent; color: var(--ah-text);
  display: inline-grid; place-items: center; cursor: pointer;
}
.tweaks-close:hover { background: var(--ah-surface); }
.tweaks-body { padding: 1rem; max-height: 60vh; overflow-y: auto; }
.tweak-row { margin-bottom: 1rem; }
.tweak-row:last-child { margin-bottom: 0; }
.tweak-row label.lbl {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .82rem; font-weight: 600; color: var(--ah-text); margin-bottom: .45rem;
}
.tweak-row .val { font-family: 'JetBrains Mono', monospace; font-size: .75rem; color: #f9cb50; }
.tweak-row input[type="range"] {
  width: 100%; accent-color: #f9cb50;
}
.tweak-row select {
  width: 100%; background: var(--ah-surface-2); color: var(--ah-text);
  border: 1px solid var(--ah-border-strong); border-radius: 8px;
  padding: .5rem .65rem; font-size: .9rem;
  font-family: 'JetBrains Mono', monospace;
}
.tweak-row select:focus { outline: 2px solid #f9cb50; outline-offset: 0; }
.tweak-toggle {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--ah-surface-2); border: 1px solid var(--ah-border);
  border-radius: 10px; padding: .55rem .75rem;
}
.tweak-toggle .switch {
  width: 36px; height: 20px; border-radius: 999px;
  background: var(--ah-border-strong); position: relative; cursor: pointer;
  transition: background .2s ease;
}
.tweak-toggle .switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 999px; background: #fff;
  transition: transform .2s ease;
}
.tweak-toggle.on .switch { background: #f9cb50; }
.tweak-toggle.on .switch::after { transform: translateX(16px); }
.tweak-test {
  width: 100%;
  background: #f9cb50; color: #111; border: none;
  padding: .65rem; border-radius: 10px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap:.5rem;
  cursor: pointer;
}
.tweak-test:hover { background: var(--ah-mustard-600); }
.tweak-hint {
  font-family: 'JetBrains Mono', monospace; font-size: .7rem;
  color: var(--ah-text-muted); line-height: 1.5; margin-top:.4rem;
}
