/* ============================================================
   Portfolio — Youcef Zemmar
   Neobrutalism redesign
   ============================================================ */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body { overflow-x: hidden; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--background);
  border-bottom: var(--border-width) solid var(--border);
}
.nav__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-3) var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--foreground);
  font-weight: 700;
}
.nav__brand-mark {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--main);
  color: var(--main-foreground);
  border: var(--border-width) solid var(--border);
  border-radius: var(--border-radius);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.02em;
  box-shadow: 2px 2px 0 0 var(--border);
  overflow: hidden;
  flex-shrink: 0;
}
.nav__brand-mark--photo {
  background: var(--secondary-background);
  padding: 0;
}
.nav__brand-mark--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.nav__brand-name {
  font-size: var(--text-base);
  letter-spacing: -0.01em;
}
.nav__links {
  display: flex;
  gap: var(--space-1);
  margin-left: var(--space-6);
}
.nav__links a {
  text-decoration: none;
  padding: 6px 12px;
  font-weight: 600;
  font-size: var(--text-sm);
  border-radius: var(--border-radius);
  border: var(--border-width) solid transparent;
  color: var(--foreground);
  opacity: 0.7;
  transition: opacity 120ms ease, background 120ms ease;
}
.nav__links a:hover { opacity: 1; }
.nav__links a.is-active {
  opacity: 1;
  background: var(--main);
  color: var(--main-foreground);
  border-color: var(--border);
  box-shadow: 2px 2px 0 0 var(--border);
}
.nav__cta {
  margin-left: auto;
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.nav__menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: var(--secondary-background);
  color: var(--foreground);
  border: var(--border-width) solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: 2px 2px 0 0 var(--border);
  cursor: pointer;
  margin-left: auto;
  padding: 0;
  flex-shrink: 0;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.nav__menu-btn:hover {
  transform: translate(2px, 2px);
  box-shadow: none;
}

@media (max-width: 820px) {
  .nav__inner { gap: var(--space-3); padding: var(--space-3) var(--space-4); }
  .nav__menu-btn { display: inline-flex; order: 5; margin-left: 0; } /* hamburger -> far right */
  .nav__cta { margin-left: auto; }                                   /* controls move into the menu's old spot */
  .nav__cta #themeToggle { order: 0; }                               /* light/dark first (where the menu was) */
  .nav__cta .mode-switch { order: 1; }
  .nav__cta .nav__say-hello { display: none; }
  .nav__brand-name { font-size: var(--text-sm); }

  .nav__links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: var(--space-3);
    background: var(--background);
    border-top: var(--border-width) solid var(--border);
    border-bottom: 4px solid var(--border);
    box-shadow: 0 6px 0 0 var(--border);
    z-index: 60;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    border-radius: var(--border-radius);
    opacity: 1;
    font-weight: 700;
  }
  .nav__links a + a { margin-top: 4px; }
  .nav__links a.is-active {
    background: var(--main);
    color: var(--main-foreground);
    border-color: var(--border);
  }
}

@media (max-width: 480px) {
  .container { padding: 0 var(--space-4); }
  .nav__inner { padding: var(--space-2) var(--space-3); gap: var(--space-2); }
  .nav__brand-name { display: none; }
  #themeToggleLabel { display: none; }
  #themeToggle { width: 40px; padding: 0; }
}

/* ============================================================
   GENERAL
   ============================================================ */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--foreground);
  opacity: 0.7;
  margin-bottom: var(--space-4);
}
.eyebrow__mark {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  line-height: 0;
  color: var(--main);
  -webkit-text-stroke: 1px var(--border);
  opacity: 1;
}

.hl {
  font-style: italic;
  background: var(--main);
  color: var(--main-foreground);
  padding: 0 .2em .05em;
  border: var(--border-width) solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: 3px 3px 0 0 var(--border);
  display: inline-block;
  line-height: 1.05;
  transform: rotate(-1deg);
}

.section-head h2 {
  font-size: clamp(36px, 5.5vw, var(--text-6xl));
  letter-spacing: -0.025em;
}
.section-head--centered {
  text-align: center;
  margin: 0 auto var(--space-12);
  max-width: 720px;
}
.section-head--centered .eyebrow { justify-content: center; }
.section-head__lede {
  margin-top: var(--space-5);
  font-size: var(--text-lg);
  opacity: 0.75;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  border-bottom: 4px solid var(--border);
  padding: var(--space-20) 0 var(--space-16);
  overflow: hidden;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--space-12);
  align-items: center;
  position: relative;
  z-index: 2;
}
.hero__copy { min-width: 0; }
.hero__title {
  font-size: clamp(48px, 8.5vw, 104px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin-bottom: var(--space-6);
}
.hero__title .hl {
  font-size: 0.92em;
  margin-left: 0.06em;
}
.hero__lede {
  font-size: clamp(18px, 1.4vw, 22px);
  max-width: 620px;
  margin-bottom: var(--space-8);
  opacity: 0.85;
}
.hero__lede a {
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
}
.hero__actions {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}
.hero__meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.65;
}

.hero__star {
  position: absolute;
  pointer-events: none;
  z-index: 1;
}
.hero__star--a { top: 8%; right: 6%; width: 110px; transform: rotate(-12deg); opacity: 0.9; }
.hero__star--b { bottom: 12%; left: 4%; width: 56px; transform: rotate(8deg); }
.hero__star--c { top: 38%; right: 38%; width: 44px; opacity: 0.5; }

/* Hero card stack (right column) */
.hero__card-stack {
  display: grid;
  gap: var(--space-5);
  position: relative;
  z-index: 2;
}

.profile-card {
  background: var(--secondary-background);
  border: var(--border-width) solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-xl);
  padding: var(--space-5);
  display: flex;
  gap: var(--space-5);
  align-items: center;
  position: relative;
  transform: rotate(-1.5deg);
}
.profile-card__avatar {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  border: var(--border-width) solid var(--border);
  border-radius: var(--border-radius);
  background: var(--main);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 3px 3px 0 0 var(--border);
}
.profile-card__initials {
  font-size: 38px;
  font-weight: 800;
  color: var(--main-foreground);
  letter-spacing: -0.04em;
}
.profile-card__avatar--photo {
  overflow: hidden;
  padding: 0;
  background: var(--secondary-background);
}
.profile-card__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-card__avatar--photo .profile-card__sparkle {
  z-index: 2;
}
.profile-card__sparkle {
  position: absolute;
  top: -18px;
  right: -18px;
  width: 36px;
  transform: rotate(15deg);
}
.profile-card__name {
  font-weight: 800;
  font-size: var(--text-xl);
  letter-spacing: -0.02em;
}
.profile-card__role {
  font-size: var(--text-sm);
  opacity: 0.65;
  margin-bottom: 8px;
}
.profile-card__row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  background: var(--background);
  border: var(--border-width) solid var(--border);
  border-radius: var(--border-radius);
  padding: 3px 10px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: oklch(70% 0.18 145);
  border: 1px solid var(--border);
  box-shadow: 0 0 0 3px color-mix(in oklab, oklch(70% 0.18 145) 25%, transparent);
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  transform: rotate(1deg);
}
.stat {
  background: var(--secondary-background);
  border: var(--border-width) solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: var(--space-4) var(--space-5);
}
.stat--main {
  background: var(--main);
  color: var(--main-foreground);
}
.stat__value {
  font-size: var(--text-4xl);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.stat__value span {
  font-size: var(--text-base);
  font-weight: 600;
  opacity: 0.6;
}
.stat--main .stat__value span { opacity: 0.7; }
.stat__label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
}

@media (max-width: 980px) {
  .hero__grid { grid-template-columns: 1fr; gap: var(--space-10); }
  .hero__star--a { width: 70px; }
  .profile-card, .stat-grid { transform: none; }
}

/* ============================================================
   MARQUEE
   ============================================================ */
.marquee {
  background: var(--main);
  color: var(--main-foreground);
  border-bottom: 4px solid var(--border);
  overflow: hidden;
  padding: var(--space-3) 0;
}
.marquee__track {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  white-space: nowrap;
  animation: marquee 40s linear infinite;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--text-base);
  letter-spacing: -0.01em;
  width: max-content;
}
.marquee__track img {
  width: 16px;
  height: 16px;
  filter: brightness(0);
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============================================================
   NOW
   ============================================================ */
.now {
  padding: var(--space-20) 0;
  border-bottom: 4px solid var(--border);
}
.now .section-head { margin-bottom: var(--space-10); }
.now .section-head h2 { max-width: 700px; }

.now-card {
  background: var(--secondary-background);
  border: var(--border-width) solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.now-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-8);
  background: var(--main);
  color: var(--main-foreground);
  border-bottom: var(--border-width) solid var(--border);
  flex-wrap: wrap;
}
.now-card__title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.now-card__title h3 {
  font-size: var(--text-4xl);
  letter-spacing: -0.025em;
}
.now-card__title .nb-badge {
  background: var(--secondary-background);
  color: var(--foreground);
}
.now-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  background: var(--background);
  color: var(--foreground);
  border: var(--border-width) solid var(--border);
  border-radius: var(--border-radius);
  padding: 6px 12px;
  box-shadow: 3px 3px 0 0 var(--border);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.now-card__link:hover {
  transform: translate(3px, 3px);
  box-shadow: none;
}
.now-card__body {
  padding: var(--space-8);
  display: grid;
  gap: var(--space-5);
  font-size: var(--text-lg);
  line-height: 1.55;
}

/* Chips */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  background: var(--background);
  color: var(--foreground);
  border: var(--border-width) solid var(--border);
  border-radius: var(--border-radius);
  padding: 5px 10px;
}
.chip--main {
  background: var(--main);
  color: var(--main-foreground);
  box-shadow: 2px 2px 0 0 var(--border);
}
.chip--on-main {
  background: var(--background);
  color: var(--foreground);
}

/* ============================================================
   ABOUT
   ============================================================ */
.about {
  padding: var(--space-20) 0;
  border-bottom: 4px solid var(--border);
}
.about__grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: var(--space-12);
  align-items: start;
}
.about__side {
  position: sticky;
  top: 90px;
}
.about__side .section-head h2 {
  font-size: clamp(40px, 5vw, 64px);
  margin-bottom: var(--space-8);
}
.about__main {
  display: grid;
  gap: var(--space-5);
}

.prose-card {
  background: var(--secondary-background);
  border: var(--border-width) solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: var(--space-8);
}
.prose-card h3 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-4);
  letter-spacing: -0.02em;
}
.prose-card p {
  font-size: var(--text-lg);
  line-height: 1.6;
  margin-bottom: var(--space-4);
}
.prose-card p:last-of-type { margin-bottom: 0; }
.prose-card--main {
  background: var(--main);
  color: var(--main-foreground);
}
.prose-card--main a { color: inherit; }

.bullet-row {
  list-style: none;
  padding: 0;
  margin: var(--space-5) 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.bullet-row li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  background: var(--secondary-background);
  color: var(--foreground);
  border: var(--border-width) solid var(--border);
  border-radius: var(--border-radius);
  padding: 6px 12px;
}
.bullet-row li img { width: 14px; }

.kbd-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.kbd-row kbd {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  background: var(--background);
  border: var(--border-width) solid var(--border);
  border-bottom-width: 3px;
  border-radius: var(--border-radius);
  padding: 4px 10px;
  font-weight: 600;
}

/* Fact card */
.fact-card {
  background: var(--main);
  color: var(--main-foreground);
  border: var(--border-width) solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
}
.fact-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding: var(--space-4) var(--space-5);
  border-bottom: var(--border-width) solid var(--border);
}
.fact-card__head img { width: 18px; filter: brightness(0); }
.fact-card__list {
  margin: 0;
  padding: var(--space-2) var(--space-5) var(--space-5);
}
.fact-card__list > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px dashed color-mix(in oklab, var(--border) 30%, transparent);
  font-size: var(--text-sm);
}
.fact-card__list > div:last-child { border-bottom: 0; }
.fact-card__list dt {
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
  opacity: 0.7;
  align-self: center;
}
.fact-card__list dd { margin: 0; font-weight: 600; }

@media (max-width: 880px) {
  .about__grid { grid-template-columns: 1fr; gap: var(--space-8); }
  .about__side { position: static; }
}

/* ============================================================
   WORK / TIMELINE
   ============================================================ */
.work {
  padding: var(--space-20) 0;
  border-bottom: 4px solid var(--border);
}
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
  display: grid;
  gap: var(--space-6);
}
.timeline::before {
  content: "";
  position: absolute;
  left: 180px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--border);
  border-radius: 2px;
}
.timeline__entry {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: var(--space-8);
  align-items: start;
  position: relative;
}
.timeline__entry::before {
  content: "";
  position: absolute;
  left: 173px;
  top: 22px;
  width: 18px;
  height: 18px;
  background: var(--main);
  border: var(--border-width) solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: 2px 2px 0 0 var(--border);
  z-index: 1;
}
.timeline__entry--feature::before {
  width: 24px;
  height: 24px;
  left: 170px;
  top: 22px;
}
.timeline__year {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
  padding-top: 22px;
  text-align: right;
  padding-right: var(--space-6);
  opacity: 0.7;
}
.timeline__card {
  background: var(--secondary-background);
  border: var(--border-width) solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: var(--space-6) var(--space-8);
  transition: transform 120ms ease, box-shadow 120ms ease;
  margin-left: var(--space-4);
}
.timeline__card:hover {
  transform: translate(var(--box-shadow-x), var(--box-shadow-y));
  box-shadow: none;
}
.timeline__card--main {
  background: var(--main);
  color: var(--main-foreground);
  box-shadow: var(--shadow-xl);
}
.timeline__card header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}
.timeline__card h3 {
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
}
.timeline__card--main h3 { font-size: var(--text-3xl); }
.timeline__tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.timeline__card p {
  font-size: var(--text-base);
  line-height: 1.55;
  opacity: 0.92;
}
.timeline__card--main p { opacity: 1; font-size: var(--text-lg); }

.region-row {
  list-style: none;
  padding: 0;
  margin: var(--space-4) 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.region-row li {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  background: var(--background);
  border: var(--border-width) solid var(--border);
  border-radius: var(--border-radius);
  padding: 4px 10px;
}

@media (max-width: 760px) {
  .timeline::before, .timeline__entry::before { display: none; }
  .timeline__entry { grid-template-columns: 1fr; gap: var(--space-2); }
  .timeline__year { text-align: left; padding: 0; }
  .timeline__card { margin-left: 0; }
}

/* ============================================================
   STACK
   ============================================================ */
.stack {
  padding: var(--space-20) 0;
  border-bottom: 4px solid var(--border);
}
.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}
.stack-card {
  background: var(--secondary-background);
  border: var(--border-width) solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: var(--space-6);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.stack-card:hover {
  transform: translate(var(--box-shadow-x), var(--box-shadow-y));
  box-shadow: none;
}
.stack-card--main {
  background: var(--main);
  color: var(--main-foreground);
}
.stack-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: var(--space-4);
  border-bottom: var(--border-width) dashed color-mix(in oklab, var(--border) 35%, transparent);
  margin-bottom: var(--space-4);
}
.stack-card__head img { width: 24px; }
.stack-card--main .stack-card__head img { filter: brightness(0); }
.stack-card__head h3 {
  font-size: var(--text-xl);
  letter-spacing: -0.02em;
}

.stack-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.stack-list li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 8px 0;
  font-size: var(--text-base);
  font-weight: 500;
  border-bottom: 1px dashed color-mix(in oklab, var(--border) 20%, transparent);
}
.stack-list li:last-child { border-bottom: 0; }
.stack-list li strong { font-weight: 700; }
.stack-list li em {
  font-style: normal;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--background);
  border: var(--border-width) solid var(--border);
  border-radius: var(--border-radius);
  padding: 2px 8px;
  font-weight: 700;
  opacity: 0.85;
}
.stack-list--on-main li em {
  background: var(--secondary-background);
}
.dot {
  width: 10px;
  height: 10px;
  border: var(--border-width) solid var(--border);
  border-radius: 50%;
  background: var(--secondary-background);
  flex-shrink: 0;
}
.dot--main {
  background: var(--main);
  box-shadow: 2px 2px 0 0 var(--border);
}
.stack-card--main .dot--main {
  background: var(--background);
}
.dot--dark { background: var(--foreground); }

.stack-note {
  margin-top: var(--space-10);
  display: flex;
  align-items: center;
  gap: var(--space-5);
  background: var(--background);
  border: var(--border-width) solid var(--border);
  border-left-width: 8px;
  border-radius: var(--border-radius);
  padding: var(--space-5) var(--space-6);
}
.stack-note img { width: 28px; flex-shrink: 0; }
.stack-note p {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.5;
  margin: 0;
}

@media (max-width: 980px) { .stack-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .stack-grid { grid-template-columns: 1fr; } }

/* ============================================================
   CONTACT
   ============================================================ */
.contact {
  padding: var(--space-20) 0;
  position: relative;
  overflow: hidden;
}
.contact__star {
  position: absolute;
  pointer-events: none;
  z-index: 1;
}
.contact__star--a { top: 8%; left: 6%; width: 80px; transform: rotate(-15deg); }
.contact__star--b { bottom: 10%; right: 5%; width: 110px; opacity: 0.85; }
.contact__inner { position: relative; z-index: 2; }

.contact__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-10);
}
.contact-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  text-decoration: none;
  background: var(--secondary-background);
  color: var(--foreground);
  border: var(--border-width) solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  padding: var(--space-5);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.contact-card:hover {
  transform: translate(var(--box-shadow-x), var(--box-shadow-y));
  box-shadow: none;
}
.contact-card--main { background: var(--main); color: var(--main-foreground); }
.contact-card__icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--background);
  border: var(--border-width) solid var(--border);
  border-radius: var(--border-radius);
}
.contact-card--main .contact-card__icon { background: var(--secondary-background); color: var(--foreground); }
.contact-card__body { flex: 1; min-width: 0; }
.contact-card__label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
  margin-bottom: 2px;
}
.contact-card__value {
  font-weight: 700;
  font-size: var(--text-base);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contact-card__arrow { flex-shrink: 0; opacity: 0.7; }

.contact__signoff {
  text-align: center;
  display: grid;
  gap: var(--space-2);
}
.contact__signoff-name {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.contact__signoff-name img { width: 16px; }
.contact__signoff p {
  font-size: var(--text-sm);
  opacity: 0.65;
}

@media (max-width: 780px) {
  .contact__grid { grid-template-columns: 1fr; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--foreground);
  color: var(--background);
  padding: var(--space-12) 0 var(--space-8);
}
.dark .footer { background: var(--secondary-background); color: var(--foreground); }
.footer__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-8);
  align-items: center;
}
.footer__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.footer__brand .nav__brand-mark { background: var(--main); color: var(--main-foreground); }
.footer__name { font-weight: 800; font-size: var(--text-lg); letter-spacing: -0.02em; }
.footer__role {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.65;
}
.footer__nav {
  display: flex;
  gap: var(--space-5);
  justify-content: center;
}
.footer__nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: var(--text-sm);
  opacity: 0.75;
}
.footer__nav a:hover { opacity: 1; }
.footer__meta {
  text-align: right;
  display: grid;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  opacity: 0.75;
}
.footer__meta a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

@media (max-width: 780px) {
  .footer__inner { grid-template-columns: 1fr; text-align: center; }
  .footer__brand, .footer__nav, .footer__meta { justify-content: center; }
  .footer__meta { text-align: center; }
}


/* ============================================================
   GLOBAL MOBILE TUNING
   Layered after all section media-queries so it wins specifically
   for small viewports — typography, padding, density.
   ============================================================ */

/* Tablet & smaller */
@media (max-width: 760px) {
  /* Section vertical rhythm */
  .hero { padding: var(--space-12) 0 var(--space-10); }
  .now,
  .about,
  .work,
  .stack,
  .contact { padding: var(--space-16) 0; }

  .section-head--centered .section-head__lede { font-size: var(--text-base); }
  .section-head h2 { font-size: clamp(30px, 7vw, 44px); }

  /* Hero text */
  .hero__title { font-size: clamp(40px, 11vw, 72px); }
  .hero__lede { font-size: var(--text-base); }
  .hero__actions { gap: var(--space-2); }
  .hero__actions .nb-btn { flex: 1 1 0; min-width: 140px; }
  .hero__meta { gap: var(--space-3) var(--space-4); font-size: 11px; }
  .hero__star--a { width: 64px; top: 4%; right: 4%; }
  .hero__star--b { width: 40px; bottom: 6%; left: 2%; }
  .hero__star--c { display: none; }

  /* Profile card */
  .profile-card { padding: var(--space-4); gap: var(--space-4); }
  .profile-card__avatar { width: 72px; height: 72px; }
  .profile-card__name { font-size: var(--text-lg); }
  .profile-card__role { font-size: 13px; }
  .profile-card__row { font-size: 11px; padding: 3px 8px; }

  /* Stats */
  .stat { padding: var(--space-3) var(--space-4); }
  .stat__value { font-size: var(--text-3xl); }

  /* Marquee — slower & smaller for taller screens */
  .marquee__track { font-size: var(--text-sm); gap: var(--space-4); animation-duration: 30s; }
  .marquee__track img { width: 12px; height: 12px; }

  /* Now card */
  .now-card__head { padding: var(--space-4) var(--space-5); gap: var(--space-2); }
  .now-card__title { gap: var(--space-2); }
  .now-card__title h3 { font-size: var(--text-3xl); }
  .now-card__body { padding: var(--space-5); font-size: var(--text-base); gap: var(--space-4); }

  /* About */
  .prose-card { padding: var(--space-5); }
  .prose-card h3 { font-size: var(--text-xl); }
  .prose-card p { font-size: var(--text-base); }
  .fact-card__list > div { grid-template-columns: 100px 1fr; }

  /* Timeline */
  .timeline__card { padding: var(--space-4) var(--space-5); }
  .timeline__card h3 { font-size: var(--text-xl); }
  .timeline__card--main h3 { font-size: var(--text-2xl); }
  .timeline__card p { font-size: 15px; }
  .timeline__year {
    display: inline-block;
    background: var(--main);
    color: var(--main-foreground);
    border: var(--border-width) solid var(--border);
    border-radius: var(--border-radius);
    padding: 4px 10px;
    font-size: 11px;
    box-shadow: 2px 2px 0 0 var(--border);
    margin-bottom: var(--space-2);
  }

  /* Stack */
  .stack-card { padding: var(--space-5); }
  .stack-card__head h3 { font-size: var(--text-lg); }
  .stack-note { flex-direction: column; align-items: flex-start; gap: var(--space-3); padding: var(--space-4) var(--space-5); }
  .stack-note p { font-size: 13px; }

  /* Contact */
  .contact-card { padding: var(--space-4); gap: var(--space-3); }
  .contact-card__icon { width: 44px; height: 44px; }
  .contact-card__value { font-size: 15px; }
  .contact__star--a { width: 56px; }
  .contact__star--b { width: 70px; }

  /* Footer */
  .footer { padding: var(--space-10) 0 var(--space-6); }
  .footer__nav { flex-wrap: wrap; gap: var(--space-3) var(--space-4); }

  /* HL inline pill — smaller shadow on mobile */
  .hl { box-shadow: 2px 2px 0 0 var(--border); }
}

/* Phone */
@media (max-width: 480px) {
  .hero { padding: var(--space-10) 0 var(--space-8); }
  .hero__title { font-size: clamp(36px, 12vw, 60px); letter-spacing: -0.03em; }
  .hero__lede { font-size: 15px; }
  .hero__actions .nb-btn--lg { height: 44px; font-size: var(--text-sm); padding: 0 16px; }
  .hero__meta li { font-size: 10px; }

  .profile-card { transform: rotate(-1deg); }
  .stat-grid { gap: var(--space-2); transform: none; }
  .stat__value { font-size: var(--text-2xl); }
  .stat__label { font-size: 10px; }

  .nb-card, .now-card, .prose-card, .timeline__card, .stack-card, .contact-card {
    box-shadow: 3px 3px 0 0 var(--border);
  }
  :root {
    --box-shadow-x: 3px;
    --box-shadow-y: 3px;
  }

  .now-card__head { flex-direction: column; align-items: flex-start; }
  .now-card__title h3 { font-size: var(--text-2xl); }
  .now-card__link { width: 100%; justify-content: space-between; }

  .stack-list li em { display: none; } /* tiny "lead" labels — hide on phone for breathing room */

  .footer__nav { font-size: 13px; }
  .footer__brand { gap: var(--space-2); }
  .footer__name { font-size: var(--text-base); }

  .contact__signoff-name { font-size: 11px; gap: var(--space-2); }

  /* Section eyebrow more compact */
  .eyebrow { font-size: 11px; margin-bottom: var(--space-3); }
}

/* Very small */
@media (max-width: 360px) {
  .hero__title { font-size: 36px; }
  .nb-btn--lg { height: 42px; font-size: 13px; padding: 0 12px; }
  .profile-card { flex-direction: column; align-items: flex-start; text-align: left; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* Touch-target floor for any pointer-coarse device */
@media (pointer: coarse) {
  .nb-btn, .nb-btn--sm, .nav__menu-btn, .contact-card, .timeline__card, .now-card__link {
    min-height: 44px;
  }
}

/* ============================================================
   BUILDING — GitHub activity (in the open)
   ============================================================ */
.building {
  padding: var(--space-20) 0;
  border-bottom: 4px solid var(--border);
}
.building .section-head { margin-bottom: var(--space-10); }
.building .section-head h2 { max-width: 760px; }
.building .section-head__lede { max-width: 720px; }

.gh-card {
  background: var(--secondary-background);
  border: var(--border-width) solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.gh-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-8);
  background: var(--main);
  color: var(--main-foreground);
  border-bottom: var(--border-width) solid var(--border);
  flex-wrap: wrap;
}
.gh-card__title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.gh-card__title h3 { font-size: var(--text-2xl); letter-spacing: -0.02em; }
.gh-card__logo { width: 26px; height: 26px; flex-shrink: 0; }
.gh-card__title .nb-badge {
  background: var(--secondary-background);
  color: var(--foreground);
  font-family: var(--font-mono);
}
.gh-card__body {
  padding: var(--space-8);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
}
.gh-card__body > * { min-width: 0; }

.gh-contrib__count {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  margin-bottom: var(--space-4);
}
.gh-contrib__count strong { font-size: var(--text-2xl); font-weight: 800; }

.gh-months {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.6;
  margin-bottom: var(--space-2);
  padding: 0 2px;
}
.gh-graph-scroll { overflow-x: auto; padding-bottom: var(--space-2); }
.gh-graph {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  min-width: 620px;
}
.gh-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  border: 1px solid color-mix(in oklab, var(--border) 16%, transparent);
  background: color-mix(in oklab, var(--foreground) 7%, var(--secondary-background));
}
.gh-cell.lvl-1 { background: color-mix(in oklab, var(--main) 32%, var(--secondary-background)); }
.gh-cell.lvl-2 { background: color-mix(in oklab, var(--main) 55%, var(--secondary-background)); }
.gh-cell.lvl-3 { background: color-mix(in oklab, var(--main) 78%, var(--secondary-background)); }
.gh-cell.lvl-4 {
  background: var(--main);
  border-color: color-mix(in oklab, var(--border) 40%, transparent);
}

.gh-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.7;
  margin-top: var(--space-3);
}
.gh-legend .gh-cell { width: 12px; height: 12px; aspect-ratio: auto; }

.gh-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  border-top: var(--border-width) dashed color-mix(in oklab, var(--border) 30%, transparent);
  padding-top: var(--space-6);
}
.gh-stat {
  background: var(--background);
  border: var(--border-width) solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: 3px 3px 0 0 var(--border);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gh-stat__value { font-size: var(--text-2xl); font-weight: 800; line-height: 1; }
.gh-stat__label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
}

.gh-orgs { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.gh-org {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  background: var(--background);
  color: var(--foreground);
  border: var(--border-width) solid var(--border);
  border-radius: var(--border-radius);
  padding: 5px 10px;
  box-shadow: 2px 2px 0 0 var(--border);
}

.gh-foot {
  font-size: var(--text-sm);
  line-height: 1.6;
  opacity: 0.9;
  border-top: var(--border-width) dashed color-mix(in oklab, var(--border) 30%, transparent);
  padding-top: var(--space-5);
}

@media (max-width: 760px) {
  .gh-card__body { padding: var(--space-5); }
  .gh-stats { grid-template-columns: 1fr 1fr; }
  .gh-card__title h3 { font-size: var(--text-xl); }
}
@media (max-width: 480px) {
  .gh-card { box-shadow: 3px 3px 0 0 var(--border); }
}
