*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
}

/* Hide native scrollbar only where the JS rail is active. */
html.has-custom-scrollbar {
  scrollbar-width: none;
}

html.has-custom-scrollbar::-webkit-scrollbar {
  display: none;
}

.custom-scrollbar {
  position: fixed;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: clamp(60px, 18vh, 140px);
  z-index: 9999;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.09);
  border-radius: 999px;
}

.custom-scrollbar__thumb {
  position: absolute;
  width: 100%;
  background: var(--accent);
  border-radius: 999px;
  pointer-events: auto;
  cursor: grab;
}

/* Drawer open: hide the page rail, but not the drawer's own rail. */
html.drawer-open .custom-scrollbar:not(.drawer-scrollbar) {
  display: none;
}

/* ── Theme tokens ───────────────────────────── */
:root {
  --accent: #4a78f5;
  --warm-yellow: #b8860b;
  --color-bg: #ffffff;
  --color-fg: #111111;
  --color-muted: rgba(0, 0, 0, 0.55);
  --color-border: rgba(0, 0, 0, 0.12);
  --surface: #ffffff;
  --surface-border: rgba(0, 0, 0, 0.1);
  /* Aliases used by index.html's inline styles. */
  --bg: var(--color-bg);
  --fg: var(--color-fg);
  --fg-muted: var(--color-muted);
  --border: var(--color-border);
}

body {
  background-color: var(--color-bg);
  color: var(--color-fg);
  /* Site default; index overrides to Inter in its own inline styles. */
  font-family: 'Satoshi', sans-serif;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}


:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Page shell ─────────────────────────────── */
/* Shared content envelope; one place to change the max width. */
.page-shell {
  width: 100%;
  max-width: 980px;
  margin-inline: auto;
}

/* ── CTA button (shared across all pages) ───── */
.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 2.5rem;
  height: 2.5rem;
  background: #ecfead;
  color: #000;
  font-family: 'Clash Display', sans-serif;
  border: 0.5px solid #000;
  border-radius: 0;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
}

.cta__ring {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cta__ring svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
  transform: rotate(45deg);
}

.cta__label {
  overflow: hidden;
  white-space: nowrap;
  font-family: 'Clash Display', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  word-spacing: 0.18em;
}

.cta:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, #EF1212 35%, transparent);
}

@media (max-width: 768px) {
  .cta__label {
    font-size: 0.9rem;
  }
}

/* Work sample sub-pages: centered article column. */
.sample-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4rem 2rem;
}

/* ── Shared nav ── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1.35rem 0;
  background: var(--color-bg);
}

.site-nav-inner {
  max-width: 980px;
  margin-inline: auto;
  /* 2rem gutter to match the hero and footer. */
  padding-inline: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Name as a stroke-halo: ink glyphs over a pale-lime outline, two stacked
   SVG <text> layers. */
.site-nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.site-nav-logo svg {
  height: 2.4rem;
  width: auto;
  overflow: visible;
  display: block;
  font-family: 'Clash Display', sans-serif;
}

.site-nav-logo .nav-logo-halo {
  fill: none;
  stroke: #ecfead;
  stroke-width: 26;
  stroke-linejoin: round;
  stroke-linecap: round;
  paint-order: stroke;
}

.site-nav-logo .nav-logo-ink {
  fill: var(--color-fg);
}

.site-nav-links {
  display: flex;
  gap: 2.75rem;
  list-style: none;
  align-items: center;
  padding: 0;
  margin: 0;
}

.site-nav-links a {
  font-family: 'Clash Display', sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--color-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-nav-links a:hover {
  color: var(--color-fg);
}

@media (max-width: 768px) {
  .site-nav-links {
    gap: 1.5rem;
  }

  .site-nav-logo svg {
    height: 1.75rem;
    max-width: 55vw;
  }
}

/* ── Footer ─────────────────────────────────── */
footer {
  position: relative;
  padding: 1.25rem 0 2rem;
}

/* 2rem gutter to match the nav and hero. */
footer .page-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 2rem;
}

/* Small uppercase meta text across the footer. */
.footer-meta {
  font-family: 'Bitcount Prop Single', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
}

/* ── Footer responsive ──────────────────────── */
.footer-location-time {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* ── Footer tagline ─────────────────────────── */
.footer-tagline {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* Mobile: each footer group stacks its two pieces; left/right stay side-by-side. */
@media (max-width: 767px) {
  footer .page-shell {
    align-items: flex-start;
    gap: 1rem;
  }

  .footer-tagline,
  .footer-location-time {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }

  .footer-location-time {
    align-items: flex-end;
    text-align: right;
  }

  .footer-pipe {
    display: none;
  }
}

/* ── Nav right group (links + avatar) ── */
.site-nav-right {
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* ── Nav avatar ── */
.nav-avatar-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
}

.nav-avatar {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  /* Promote to its own layer so the hover scale doesn't snap on return. */
  transform: translateZ(0);
  backface-visibility: hidden;
  transition: transform 0.2s ease;
}

.nav-avatar img,
.nav-avatar-svg {
  width: 2.4rem;
  height: 2.4rem;
  display: block;
}

.nav-avatar:hover {
  transform: translateZ(0) scale(1.06);
}

/* Online status dot with a "live" ping ring. */
.avatar-status {
  position: absolute;
  bottom: 0;
  right: 0;
  z-index: 2;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #22C55E;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.avatar-status::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #22C55E;
  animation: avatar-status-ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Retire the ping once the visitor has opened the drawer. */
html.about-seen .avatar-status {
  opacity: 0;
  transform: scale(0);
}

html.about-seen .avatar-status::after {
  animation: none;
  opacity: 0;
}

@keyframes avatar-status-ping {

  75%,
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .avatar-status::after {
    animation: none;
  }
}


/* ── About drawer ── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 201;
  height: 100dvh;
  width: min(440px, 92vw);
  background: var(--surface);
  border-left: 1px solid var(--surface-border);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* Native bar hidden; JS drives a floating rail (see main.js). */
  scrollbar-width: none;
}

.drawer::-webkit-scrollbar {
  display: none;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.35rem 1.75rem;
  border-bottom: 1px solid var(--surface-border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.drawer-close {
  background: none;
  border: none;
  color: var(--color-muted);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 0;
  margin-left: auto;
  transition: color 0.2s ease;
}

.drawer-close:hover {
  color: var(--color-fg);
}

.drawer-close svg {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}

.drawer-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  flex: 1;
  min-height: 0;
}

.drawer-bio {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-family: 'Satoshi', sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-fg);
}

/* Reset UA margins so spacing comes only from the flex gap. */
.drawer-bio p {
  margin: 0;
}

/* Auto top-margin pushes the socials to the foot of the drawer. */
.drawer-contact {
  margin-top: auto;
  padding-top: 1.5rem;
}

.drawer-socials {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

/* Contact links: legible by default, warming to the accent on hover. */
.neon-cta {
  font-family: 'Clash Display', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  word-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-fg);
  background: none;
  border: none;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
}

.neon-cta:hover {
  color: var(--warm-yellow);
}

@media (min-width: 769px) {

  /* Sized to a comfortable reading column on desktop. */
  .drawer {
    overflow-y: auto;
    width: clamp(440px, 40vw, 560px);
  }

  .drawer-overlay {
    background: transparent;
  }

  .drawer-header {
    padding: 1rem 1.5rem;
  }

  .drawer-body {
    padding: 1.5rem;
    gap: 1.75rem;
  }

  .drawer-bio {
    font-size: 0.875rem;
    line-height: 1.55;
    gap: 0.75rem;
  }

  .drawer-contact .neon-cta {
    font-size: 0.875rem;
  }
}

@media (max-width: 768px) {
  .drawer {
    width: 100vw;
    border-left: none;
  }
}

/* ── About drawer: identity header ──────────── */
.drawer-id {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

/* ── About drawer: sections ─────────────────── */
.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.drawer-section-label {
  font-family: 'Bitcount Prop Single', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.drawer-header .drawer-section-label {
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: var(--color-fg);
}

/* Skills as pill chips. */
.drawer-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Skills as a 2-up card grid; the wide set spans both columns. */
.skill-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.skill-card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 0.85rem 0.9rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.skill-card--wide {
  grid-column: 1 / -1;
}

@media (hover: hover) {
  .skill-card:hover {
    border-color: var(--color-muted);
    transform: translateY(-2px);
  }
}

.skill-card-label {
  font-family: 'Bitcount Prop Single', monospace;
  font-size: 0.56rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.skill-card-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* Static skill labels — display only. */
.drawer-chip {
  font-family: 'Satoshi', sans-serif;
  font-size: 0.74rem;
  color: var(--color-fg);
  padding: 0.26rem 0.6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-fg) 5%, transparent);
  white-space: nowrap;
}

@media (max-width: 360px) {
  .skill-cards {
    grid-template-columns: 1fr;
  }

  .skill-card--wide {
    grid-column: auto;
  }
}

/* Closing aside under the skill cards — reads as prose, not a chip. */
.skill-note {
  font-family: 'Satoshi', sans-serif;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--color-muted);
  margin-top: 1rem;
}

/* Contact section: text links pushed to opposite ends of the drawer. */
.drawer-contact .drawer-socials {
  flex-direction: row;
  align-items: center;
  gap: 1.5rem;
  justify-content: space-between;
}

/* Social links sit on the yellow highlight halo, in Bitcount. */
.drawer-contact .neon-cta {
  font-family: 'Bitcount Prop Single', monospace;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0;
  word-spacing: normal;
  text-transform: none;
  color: var(--color-fg);
  -webkit-text-stroke: 6px #ecfead;
  paint-order: stroke fill;
}

.drawer-contact .neon-cta:hover {
  color: var(--color-fg);
}

/* Résumé is highlighted by default, not just on hover. */
.drawer-resume-link {
  color: inherit;
  text-decoration: none;
  -webkit-text-stroke: 6px #ecfead;
  paint-order: stroke fill;
  /* Extend the lime slightly past the word. */
  padding: 0 0.15em;
}

/* ── Sample CTA group ───────────────────────── */
.sample-links {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-self: flex-start;
}

/* ── Sample detail page ─────────────────────── */
/* Shared layout for every work-*.html sample page. */
.sample-detail {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.sample-detail .back-link {
  font-family: 'Bitcount Prop Single', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  text-decoration: none;
  transition: color 0.2s;
  align-self: flex-start;
}

@media (hover: hover) {
  .sample-detail .back-link:hover {
    color: var(--warm-yellow);
  }
}

.sample-detail .sample-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sample-detail .sample-type {
  font-family: 'Bitcount Prop Single', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-muted);
}

.sample-detail h1 {
  font-family: 'Clash Display', sans-serif;
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-fg);
}

.sample-detail section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.sample-detail section h2 {
  font-family: 'Satoshi', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.sample-detail section p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-fg);
}

