/* ─────────────────────────────────────────────────────────────
   Lakshay Bhatia — portfolio
   Grid-first monospace system. Black on white, white on black.
   ───────────────────────────────────────────────────────────── */

:root {
  --bg: #ffffff;
  --fg: #000000;
  --muted: rgba(0, 0, 0, 0.58);
  --faint: rgba(0, 0, 0, 0.34);
  --hairline: rgba(0, 0, 0, 0.13);
  --dash: rgba(0, 0, 0, 0.16);
  --surface: rgba(0, 0, 0, 0.035);
  --overlay: rgba(0, 0, 0, 0.45);

  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --page: 1440px;
  --pad: clamp(20px, 4vw, 56px);
  --gap: 12px;
  --nav-h: 54px;
  --section-space: clamp(64px, 8vw, 116px);
}

html[data-theme="dark"] {
  --bg: #000000;
  --fg: #ffffff;
  --muted: rgba(255, 255, 255, 0.56);
  --faint: rgba(255, 255, 255, 0.36);
  --hairline: rgba(255, 255, 255, 0.15);
  --dash: rgba(255, 255, 255, 0.18);
  --surface: rgba(255, 255, 255, 0.05);
  --overlay: rgba(0, 0, 0, 0.72);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
  /* Reserve the gutter so locking scroll for the palette doesn't shift the page. */
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

h1,
h2,
h3,
h4,
p,
dl,
dd,
figure,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

img,
svg {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

/* ── Shared type ───────────────────────────────────────────── */

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 400;
  padding: 9px 13px;
  background: var(--fg);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 11px;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* ── Grid scaffolding ──────────────────────────────────────── */

.wrap {
  width: min(100%, var(--page));
  margin: 0 auto;
  padding-inline: var(--pad);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gap);
}

/* Decorative column guides — the drafting-table underlay. */
.guides {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  width: min(100%, var(--page));
  margin: 0 auto;
  padding-inline: var(--pad);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gap);
}

.guides span {
  border-right: 1px dashed var(--dash);
}

.guides span:last-child {
  border-right: 0;
}

.shell {
  position: relative;
  z-index: 1;
}

/* ── Scroll progress ───────────────────────────────────────── */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: var(--fg);
}

/* ── Navigation ────────────────────────────────────────────── */

.nav {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 150;
  min-height: var(--nav-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 0 var(--pad);
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nav-links {
  /* The brand used to hold column 1; keep the links centred without it. */
  grid-column: 2;
  display: flex;
  justify-content: center;
  gap: 20px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.nav-links > a {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  text-decoration: none;
  opacity: 0.58;
  transition: opacity 0.15s;
}

.nav-links > a:hover,
.nav-links > a:focus-visible {
  opacity: 1;
}

.nav-links > a[aria-current="true"] {
  opacity: 1;
}

.nav-links > a[aria-current="true"] .n {
  opacity: 1;
}

.nav-links .n {
  opacity: 0.42;
}

.nav-right {
  grid-column: 3;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 1px solid var(--fg);
  background: var(--bg);
  color: var(--fg);
  /* Set in the sans, in real casing, like the addresses they sit beside.
     Both are stated outright so a mono container cannot inherit into them. */
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: -0.01em;
  text-transform: none;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.cta:hover {
  background: var(--fg);
  color: var(--bg);
}

.cta--solid {
  background: var(--fg);
  color: var(--bg);
}

.cta--solid:hover {
  background: var(--bg);
  color: var(--fg);
}

.cta svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.nav-ghost {
  padding: 5px 8px;
  border: 1px solid transparent;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.15s, border-color 0.15s;
}

.nav-ghost:hover {
  color: var(--fg);
  border-color: var(--hairline);
}

.nav-ghost kbd {
  font: inherit;
  letter-spacing: 0.02em;
}

/* Only surfaced inside the mobile menu panel. */
.nav-mobile-ctas {
  display: none;
}

.nav-burger {
  display: none;
  padding: 5px 9px;
  border: 1px solid var(--fg);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Sections ──────────────────────────────────────────────── */

main {
  padding-top: var(--nav-h);
}

.section {
  padding-block: var(--section-space);
  border-top: 1px solid var(--hairline);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 14px;
  margin-bottom: clamp(28px, 4vw, 52px);
  border-bottom: 1px solid var(--fg);
}

.section-head h2 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-head .count {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
}

/* ── Hero ──────────────────────────────────────────────────── */

.hero {
  padding-block: clamp(52px, 7vw, 96px) clamp(44px, 6vw, 80px);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  padding-bottom: 16px;
  margin-bottom: clamp(26px, 4vw, 44px);
  border-bottom: 1px solid var(--hairline);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-meta .live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--fg);
}

.hero-meta .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fg);
}

.hero-title {
  font-size: clamp(46px, 11.5vw, 172px);
  font-weight: 400;
  line-height: 0.87;
  letter-spacing: -0.05em;
  text-transform: uppercase;
}

.hero-title .sub {
  display: block;
  margin-top: 0.1em;
  font-family: var(--mono);
  font-size: clamp(12px, 1.5vw, 21px);
  line-height: 1.2;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}

.hero-body {
  margin-top: clamp(34px, 4.5vw, 56px);
  align-items: end;
  row-gap: 30px;
}

.hero-precis {
  grid-column: 1 / 8;
  font-size: clamp(17px, 1.55vw, 22px);
  line-height: 1.42;
  letter-spacing: -0.014em;
  max-width: 34em;
}

.hero-actions {
  grid-column: 9 / 13;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.hero-mail {
  flex: 1 0 100%;
  /* Set in the sans like the address in Contact, not in the button mono. */
  font-size: 15px;
  color: var(--muted);
  text-align: right;
}

.hero-mail a {
  color: var(--fg);
  font-size: 17px;
  letter-spacing: -0.03em;
  border-bottom: 1px solid var(--fg);
  padding-bottom: 2px;
}

.hero-mail a:hover {
  opacity: 0.62;
}

.hero-specs {
  margin-top: clamp(34px, 4.5vw, 54px);
  border-top: 1px solid var(--fg);
}

.hero-specs > div {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 20px;
  padding: 11px 0;
  border-bottom: 1px solid var(--hairline);
}

.hero-specs dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-specs dd {
  font-size: 15px;
}

/* ── About ─────────────────────────────────────────────────── */

.about-grid {
  row-gap: 36px;
  align-items: start;
}

/* Portrait sits in a square frame that reads alongside the copy
   rather than running past it. */
.portrait {
  grid-column: 1 / 5;
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 420px;
  border: 1px solid var(--fg);
  background:
    repeating-linear-gradient(90deg, transparent 0 7px, var(--hairline) 7px 8px),
    repeating-linear-gradient(0deg, transparent 0 7px, var(--hairline) 7px 8px),
    var(--bg);
}

.portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  /* The page is otherwise strictly black and white; colour arrives on hover. */
  filter: grayscale(1);
  transition: filter 0.35s ease;
}

.portrait:hover img,
.portrait:focus-within img {
  filter: grayscale(0);
}

@media (hover: none) {
  .portrait img {
    filter: grayscale(0);
  }
}

.portrait figcaption {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 2;
  padding: 4px 7px;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.corner {
  position: absolute;
  z-index: 3;
  width: 9px;
  height: 9px;
  border: 1px solid var(--fg);
  background: var(--bg);
}

.corner.tl { top: -5px; left: -5px; }
.corner.tr { top: -5px; right: -5px; }
.corner.bl { bottom: -5px; left: -5px; }
.corner.br { bottom: -5px; right: -5px; }

.about-copy {
  grid-column: 6 / 13;
}

.about-copy .lead {
  font-size: clamp(22px, 2.3vw, 33px);
  line-height: 1.2;
  letter-spacing: -0.032em;
  margin-bottom: 22px;
}

.about-copy p + p {
  margin-top: 16px;
}

.about-copy p:not(.lead) {
  font-size: 15px;
  line-height: 1.62;
  color: var(--muted);
  max-width: 46em;
}

.kv {
  margin-top: 32px;
  border-top: 1px solid var(--fg);
}

.kv > div {
  display: grid;
  grid-template-columns: 152px 1fr;
  gap: 20px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline);
}

.kv dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.kv dd {
  font-size: 14px;
}

/* ── Experience ────────────────────────────────────────────── */

.exp-item {
  row-gap: 18px;
  padding-block: clamp(26px, 3.2vw, 40px);
  border-bottom: 1px dashed var(--dash);
}

.exp-item:first-child {
  padding-top: 0;
}

.exp-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.exp-when {
  grid-column: 1 / 3;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.exp-when .now {
  color: var(--fg);
}

.exp-who {
  grid-column: 3 / 6;
}

.exp-who h3 {
  font-size: clamp(19px, 1.7vw, 25px);
  font-weight: 400;
  letter-spacing: -0.028em;
}

.exp-who .role {
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.roles {
  margin-top: 12px;
  border-left: 1px solid var(--hairline);
}

.roles li {
  position: relative;
  padding: 5px 0 5px 16px;
}

.roles li::before {
  content: "";
  position: absolute;
  top: 12px;
  left: -4px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--fg);
  background: var(--bg);
}

.roles li.current::before {
  background: var(--fg);
}

.roles .title {
  font-size: 14px;
}

.roles .when {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.exp-body {
  grid-column: 6 / 13;
}

.exp-body li {
  position: relative;
  padding-left: 20px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}

.exp-body li + li {
  margin-top: 10px;
}

.exp-body li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--faint);
}

.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 22px;
  border-top: 1px solid var(--hairline);
}

.metrics > div {
  flex: 1 1 110px;
  padding: 12px 14px 12px 0;
  border-right: 1px dashed var(--dash);
}

.metrics > div:last-child {
  border-right: 0;
}

.metrics > div:not(:first-child) {
  padding-left: 14px;
}

.metrics strong {
  display: block;
  font-size: clamp(19px, 1.8vw, 26px);
  font-weight: 400;
  letter-spacing: -0.03em;
}

.metrics span {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Projects ──────────────────────────────────────────────── */

.projects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.project {
  border: 1px solid var(--hairline);
  transition: border-color 0.15s;
}

.project:hover {
  border-color: var(--fg);
}

.project > a {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
}

.project-media {
  position: relative;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface);
}

.project-media img {
  width: 100%;
  height: auto;
}

html[data-theme="dark"] .project-media img {
  filter: invert(1);
}

.project-media .no {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 7px;
  background: var(--fg);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.project-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  padding: 18px;
}

.project-body .tag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.project-body h3 {
  margin-top: 6px;
  font-size: 19px;
  font-weight: 400;
  letter-spacing: -0.028em;
}

.project-body .blurb {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
}

.stack li {
  padding: 3px 7px;
  border: 1px solid var(--hairline);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.project-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--dash);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.project:hover .project-foot .go {
  color: var(--fg);
}

/* ── Toolkit ───────────────────────────────────────────────── */

/* Two columns so the chip rows fill the measure instead of trailing
   off into dead space on the right. */
.toolkit {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(4, auto);
  grid-auto-flow: column;
  column-gap: clamp(24px, 4vw, 64px);
}

.toolkit > div {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
  align-items: baseline;
}


.toolkit h3 {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.toolkit ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.toolkit li {
  padding: 4px 9px;
  border: 1px solid var(--hairline);
  font-size: 12px;
  transition: border-color 0.15s;
}

.toolkit li:hover {
  border-color: var(--fg);
}

/* ── Writing & notes ───────────────────────────────────────── */

.writing-grid {
  row-gap: 44px;
}

.writing-col:first-child {
  grid-column: 1 / 7;
}

.writing-col:last-child {
  grid-column: 8 / 13;
}

.col-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--fg);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.col-label .count {
  color: var(--muted);
}

.entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--hairline);
  text-decoration: none;
  transition: padding-left 0.15s;
}

.entry:hover {
  padding-left: 8px;
}

.entry .t {
  font-size: 16px;
  letter-spacing: -0.018em;
}

.entry .m {
  grid-column: 1 / 2;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.entry .go {
  grid-row: 1 / 3;
  grid-column: 2 / 3;
  align-self: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}

.entry:hover .go {
  color: var(--fg);
}

.all-link {
  display: inline-block;
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 3px;
}

.all-link:hover {
  color: var(--fg);
  border-color: var(--fg);
}

/* ── Credentials ───────────────────────────────────────────── */

.cred-grid {
  row-gap: 44px;
}

.cred-col {
  grid-column: span 4;
}

.cred-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
}

.cred-item .when {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.cred-item h3 {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -0.018em;
}

.cred-item .sub {
  margin-top: 5px;
  font-size: 13px;
  color: var(--muted);
}

/* ── Contact ───────────────────────────────────────────────── */

.contact {
  border-top: 1px solid var(--fg);
}

.contact .display {
  font-size: clamp(38px, 7vw, 104px);
  line-height: 0.94;
  letter-spacing: -0.05em;
  text-transform: uppercase;
}

.contact p:not(.display):not(.count) {
  margin-top: 24px;
  max-width: 30em;
  font-size: clamp(16px, 1.4vw, 20px);
  line-height: 1.45;
  color: var(--muted);
}

.contact .mail {
  display: inline-block;
  margin-top: 30px;
  font-size: clamp(18px, 2.1vw, 30px);
  letter-spacing: -0.03em;
  text-decoration: none;
  border-bottom: 1px solid var(--fg);
  padding-bottom: 4px;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 34px;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 46px;
  border-top: 1px solid var(--hairline);
}

.socials a {
  flex: 1 1 140px;
  padding: 16px 14px 16px 0;
  border-right: 1px dashed var(--dash);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.15s;
}

.socials a:not(:first-child) {
  padding-left: 14px;
}

.socials a:last-child {
  border-right: 0;
}

.socials a:hover {
  color: var(--fg);
}

/* ── Footer ────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--hairline);
  padding-block: 26px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.to-top {
  /* The only route back up since the nav wordmark went; #top is the hero. */
  color: var(--fg);
  border-bottom: 1px solid var(--hairline);
}

.to-top:hover {
  border-bottom-color: var(--fg);
}

/* ── Command palette ───────────────────────────────────────── */

.palette {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(60px, 12vh, 140px) 20px 20px;
  background: var(--overlay);
}

.palette.is-open {
  display: flex;
}

.palette-panel {
  width: min(100%, 560px);
  max-height: min(62vh, 520px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--fg);
  background: var(--bg);
}

.palette-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--hairline);
}

.palette-field .prompt {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.palette-field input {
  flex: 1;
  border: 0;
  outline: 0;
  background: none;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.01em;
}

.palette-field input::placeholder {
  color: var(--faint);
}

.palette-list {
  overflow-y: auto;
  padding: 6px 0;
}

.palette-list li[aria-selected="true"] {
  background: var(--fg);
  color: var(--bg);
}

.palette-list li[aria-selected="true"] .kind,
.palette-list li[aria-selected="true"] .hint {
  color: inherit;
  opacity: 0.7;
}

.palette-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 15px;
  cursor: pointer;
}

.palette-item .kind {
  flex-shrink: 0;
  width: 62px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.palette-item .name {
  flex: 1;
  font-size: 14px;
}

.palette-item .hint {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.palette-empty {
  padding: 18px 15px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.palette-foot {
  display: flex;
  gap: 16px;
  padding: 9px 15px;
  border-top: 1px solid var(--hairline);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 1180px) {
  /* Only the header's icon-bearing CTAs may drop their label. */
  .nav-right .cta span {
    display: none;
  }

  .hero-precis {
    grid-column: 1 / 9;
  }

  .hero-actions {
    grid-column: 1 / 13;
    justify-content: flex-start;
  }

  .hero-mail {
    text-align: left;
  }
}

@media (max-width: 960px) {
  .exp-when,
  .exp-who,
  .exp-body {
    grid-column: 1 / 13;
  }

  .exp-body {
    margin-top: 4px;
  }

  .projects {
    grid-template-columns: repeat(2, 1fr);
  }

  .portrait {
    grid-column: 1 / 6;
  }

  .about-copy {
    grid-column: 7 / 13;
  }

  .writing-col:first-child,
  .writing-col:last-child {
    grid-column: 1 / 13;
  }

  .toolkit {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-flow: row;
  }

  .cred-col {
    grid-column: span 6;
  }
}

@media (max-width: 780px) {
  :root {
    --gap: 8px;
    --section-space: 62px;
  }

  .guides {
    display: none;
  }

  .nav {
    grid-template-columns: 1fr;
  }

  .nav-right {
    grid-column: 1;
  }

  .nav-links {
    /* A placed grid item takes its grid area as containing block, which would
       pin the fixed panel inside column 2 instead of spanning the bar. */
    grid-column: auto;
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    gap: 0;
    padding: 8px var(--pad) 24px;
    border-bottom: 1px solid var(--hairline);
    background: var(--bg);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
  }

  .nav-links.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
  }

  .nav-links > a {
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--hairline);
    font-size: 12px;
    opacity: 1;
  }

  .nav-mobile-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 18px;
  }

  .nav-right .cta,
  .nav-right .nav-ghost {
    display: none;
  }

  .nav-burger {
    display: inline-flex;
  }

  .nav-right .nav-ghost.theme-toggle {
    display: inline-flex;
    border-color: var(--hairline);
  }

  .portrait,
  .about-copy {
    grid-column: 1 / 13;
  }

  .portrait {
    max-width: 300px;
  }

  .projects {
    grid-template-columns: 1fr;
  }

  .toolkit > div,
  .kv > div,
  .hero-specs > div {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .cred-col {
    grid-column: 1 / 13;
  }

  .socials a {
    flex-basis: 50%;
    border-right: 0;
    border-bottom: 1px dashed var(--dash);
    padding-left: 0;
  }

  .socials a:not(:first-child) {
    padding-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media print {
  .nav,
  .guides,
  .scroll-progress,
  .palette {
    display: none !important;
  }
}
