.wrap {
  width: min(100% - 2 * var(--gutter), var(--content-max));
  margin-inline: auto;
}

/* ---------- Bar ---------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--bar-height);
  background: color-mix(in srgb, var(--ground) 90%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-block-end: 2px solid transparent;
  transition: border-color 240ms var(--ease-out);
}
.bar.is-scrolled { border-block-end-color: var(--rule-strong); }
.bar__inner { display: flex; align-items: center; gap: 12px; height: 100%; }
.bar__nav { margin-inline: auto; }
.bar__tools { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }

.mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: -0.01em; }
.mark:hover { text-decoration: none; }
.mark__ab {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 34px;
  padding-inline: 8px;
  background: var(--ink);
  color: var(--ground);
  font-weight: 800;
  letter-spacing: -0.02em;
  transition: background-color 200ms, transform 240ms var(--ease-out);
}
.mark:hover .mark__ab { background: var(--blue); color: #fff; transform: rotate(-4deg); }
.mark__name { display: none; }
@media (min-width: 560px) { .mark__name { display: inline; } }

.bar__list { display: flex; flex-direction: column; gap: 4px; }
.bar__link {
  position: relative;
  display: inline-block;
  padding: 10px 6px;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  transition: color 160ms;
}
.bar__link::after {
  content: "";
  position: absolute;
  inset-inline: 6px;
  inset-block-end: 4px;
  height: 3px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 220ms var(--ease-out);
}
[dir="rtl"] .bar__link::after { transform-origin: right center; }
.bar__link:hover, .bar__link[aria-current="true"] { color: var(--ink); text-decoration: none; }
.bar__link:hover::after, .bar__link[aria-current="true"]::after { transform: scaleX(1); }

/* Tools */
.tool {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding-inline: 10px;
  border-radius: 999px;
  border: 2px solid var(--rule-strong);
  color: var(--ink);
  font-size: var(--step--1);
  font-weight: 700;
  transition: background-color 160ms, color 160ms;
}
.tool:hover { background: var(--ink); color: var(--ground); }
.tool__lamp {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--yellow);
  border: 2px solid currentColor;
  transition: transform 500ms var(--ease-out);
}
.tool--theme:hover .tool__lamp { transform: rotate(180deg); }
[data-theme="dark"] .tool__lamp { background: radial-gradient(circle at 68% 34%, transparent 0 38%, currentColor 40%); }

.bar__toggle {
  display: none;
  position: relative;
  width: 40px;
  height: 40px;
  font-size: 0;
  border-radius: 999px;
  border: 2px solid var(--rule-strong);
}
.bar__toggle::before, .bar__toggle::after {
  content: "";
  position: absolute;
  inset-inline: 10px;
  height: 2px;
  background: var(--ink);
  transition: transform 240ms var(--ease-out), inset-block-start 240ms var(--ease-out);
}
.bar__toggle::before { inset-block-start: 14px; }
.bar__toggle::after { inset-block-start: 22px; }
.bar.is-open .bar__toggle::before { inset-block-start: 18px; transform: rotate(45deg); }
.bar.is-open .bar__toggle::after { inset-block-start: 18px; transform: rotate(-45deg); }

/* Below desktop the list is a drawer, but only once nav.js has taken over; without it the links wrap under the bar. */
.bar:not(.is-enhanced) { height: auto; padding-block: 8px; }
.bar:not(.is-enhanced) .bar__inner { flex-wrap: wrap; height: auto; }
.bar:not(.is-enhanced) .bar__nav { display: block; order: 3; width: 100%; margin: 0; }
.bar:not(.is-enhanced) .bar__list { flex-direction: row; flex-wrap: wrap; gap: 4px 12px; }
.bar.is-enhanced .bar__toggle { display: inline-block; }
.bar.is-enhanced .bar__nav { display: none; }
.bar.is-enhanced.is-open .bar__nav {
  display: block;
  position: absolute;
  inset-inline: 0;
  inset-block-start: var(--bar-height);
  margin: 0;
  padding: 12px var(--gutter) 20px;
  background: var(--ground);
  border-block-end: 2px solid var(--rule-strong);
}

@media (min-width: 1180px) {
  .bar:not(.is-enhanced) { height: var(--bar-height); padding-block: 0; }
  .bar:not(.is-enhanced) .bar__inner { flex-wrap: nowrap; height: 100%; }
  .bar__nav, .bar.is-enhanced .bar__nav, .bar:not(.is-enhanced) .bar__nav { display: block; position: static; padding: 0; background: none; border: 0; margin-inline: auto; order: 0; width: auto; }
  .bar.is-enhanced .bar__toggle { display: none; }
  .bar__list, .bar:not(.is-enhanced) .bar__list { flex-direction: row; flex-wrap: nowrap; gap: 4px; }
  .bar__inner { gap: 16px; }
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: var(--step--1);
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out), background-color 180ms, color 180ms, border-color 180ms;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

/* Hire me: red pill, white label, yellow envelope disc. The one loud control on the page. */
.btn--hire {
  padding-block: 8px;
  padding-inline: 20px 8px;
  background: var(--action);
  color: var(--on-action);
  box-shadow: var(--shadow);
}
.btn--hire:hover, .btn--hire:focus-visible { background: var(--action-hover); color: var(--on-action-hover); }
.btn__mail {
  box-sizing: content-box;
  width: 22px;
  height: 22px;
  padding: 8px;
  border-radius: 50%;
  background: var(--yellow);
  fill: none;
  stroke: #101114;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 320ms var(--ease-out), background-color 180ms;
}
.btn--hire:hover .btn__mail { transform: rotate(-12deg) scale(1.1); }
[data-theme="dark"] .btn--hire:hover .btn__mail { background: #101114; stroke: #FFC800; }

.btn--ghost { border: 2px solid var(--rule-strong); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--ground); }

.btn--lg { font-size: var(--step-1); padding-block: 10px; padding-inline: 28px 10px; gap: 16px; }
.btn--lg .btn__mail { width: 26px; height: 26px; padding: 10px; }
.btn--lg.btn--ghost { padding-inline: 28px; padding-block: 18px; }
.btn--xl { font-size: var(--step-2); padding-block: 12px; padding-inline: 40px 12px; gap: 22px; }
.btn--xl .btn__mail { width: 32px; height: 32px; padding: 12px; }
.btn--bar { font-size: var(--step--1); padding-block: 4px; padding-inline: 16px 4px; gap: 8px; }
.btn--bar .btn__mail { width: 16px; height: 16px; padding: 6px; }

/* ---------- Intake chips ---------- */
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; }
.chip span {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  border: 2px solid currentColor;
  font-weight: 700;
  transition: background-color 180ms, color 180ms, transform 200ms var(--ease-out);
}
.chip:hover span { transform: translateY(-2px); }
.chip input:checked + span { background: #101114; border-color: #101114; color: #fff; }
.chip:has(input:focus-visible) span { outline: 3px solid var(--blue); outline-offset: 3px; }

/* ---------- Hire me dialog ---------- */
.hire {
  width: min(92vw, 440px);
  padding: 28px;
  border: 3px solid var(--rule-strong);
  border-radius: 6px;
  background: var(--ground);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.hire::backdrop { background: rgba(0, 0, 0, 0.6); }
.hire[open] { animation: pop 260ms var(--ease-out); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(0.97); } }
.hire__close { position: absolute; inset-block-start: 12px; inset-inline-end: 12px; margin: 0; }
.hire__close button { padding: 6px 12px; border: 2px solid var(--rule-strong); border-radius: 999px; font-weight: 700; font-size: var(--step--1); transition: background-color 160ms, color 160ms; }
.hire__close button:hover { background: var(--ink); color: var(--ground); }
.hire__title { font-size: var(--step-2); font-weight: 800; letter-spacing: var(--track); }
.hire__topic { margin-block: 4px 18px; color: var(--muted); }
.hire__options { display: grid; gap: 8px; }
.hire__opt {
  display: block;
  padding: 14px 16px;
  border: 2px solid var(--rule-strong);
  border-radius: 6px;
  font-weight: 700;
  text-align: start;
  text-decoration: none;
  transition: background-color 160ms, color 160ms, transform 200ms var(--ease-out);
}
.hire__opt--book { background: var(--yellow); color: #101114; }
.hire__opt:hover { background: var(--yellow); color: #101114; text-decoration: none; transform: translateX(4px); }
[dir="rtl"] .hire__opt:hover { transform: translateX(-4px); }
.hire__addr { margin-block-start: 16px; font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted); direction: ltr; text-align: start; overflow-wrap: anywhere; }
.hire__status { min-height: 1.5em; margin-block-start: 6px; font-weight: 700; }

/* ---------- Section rhythm and footer ---------- */
main > section:not(.hero) { padding-block-start: var(--section-gap); }
main > section:last-of-type { padding-block-end: var(--section-gap); }

.footer { padding: 28px 0 36px; border-block-start: 2px solid var(--rule-strong); color: var(--muted); font-size: var(--step--1); }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.footer__line { color: var(--ink); font-weight: 600; max-width: 52ch; }

/* ---------- Phone-first: action bar, tap targets, bottom sheet ---------- */
.dock {
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: 40;
  display: flex;
  gap: 10px;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--ground) 94%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-block-start: 2px solid var(--rule-strong);
  transition: transform 300ms var(--ease-out);
}
.dock .btn { flex: 1; min-height: 48px; justify-content: center; font-size: var(--step-0); }
.dock .btn--hire { padding-inline: 18px 6px; }
body { padding-block-end: 76px; }

.tool, .bar__toggle { min-width: 44px; height: 44px; }
.chip span { display: inline-flex; align-items: center; min-height: 44px; }
.item__ask { display: inline-flex; align-items: center; min-height: 44px; }
.hero__links a, .contact__links a { display: inline-block; padding-block: 10px; }
.bar.is-enhanced.is-open .bar__link { display: flex; align-items: center; min-height: 48px; font-size: var(--step-1); }
.hire__opt { min-height: 52px; display: flex; align-items: center; }

@media (max-width: 639px) {
  :root { --section-gap: 72px; }
  .btn--bar { display: none; }
  .hero__proof { display: none; }
  .art { max-width: 150px; }
  .item { min-height: 0; padding: 18px 18px 20px; }
  .skillband { padding: 20px; }
  .hire { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 12px 12px 0 0; padding-block-end: calc(28px + env(safe-area-inset-bottom)); }
  .hire[open] { animation: sheet 280ms var(--ease-out); }
}
@keyframes sheet { from { transform: translateY(100%); } }

@media (min-width: 768px) {
  .dock { display: none; }
  body { padding-block-end: 0; }
  .tool, .bar__toggle { min-width: 40px; height: 40px; }
}

/* Touch screens have no hover: cancel lifts so effects never stick after a tap. */
@media (hover: none) {
  .item:hover, .btn:hover, .chip:hover span, .step:hover .step__n, .tags li:hover, .tool:hover, .item__ask:hover, .mark:hover .mark__ab { transform: none !important; box-shadow: none; }
  .item:hover .art__move, .item:nth-child(n):hover .art__move { transform: none !important; }
  .beyond__photos:hover img { transform: none !important; }
}
.mark { min-height: 44px; }
.contact__addr a { display: inline-block; padding-block: 10px; }

/* The phone bar stays out of the way while the hero (which has its own buttons) is on screen. */
.js .dock:not(.is-shown) { transform: translateY(110%); visibility: hidden; transition: transform 300ms var(--ease-out), visibility 0s linear 300ms; }
.js .dock.is-shown { visibility: visible; transition: transform 300ms var(--ease-out); }
