/* ============================================================
   Amol Ghuge — portfolio
   Design tokens
   ============================================================ */
:root {
  /* Surfaces — warm near-black, layered */
  --ink-900: #0e0e0c;
  --ink-850: #12120f;
  --ink-800: #171714;
  --ink-750: #1c1c18;
  --ink-700: #22221d;

  /* Type */
  --fg: #e8e4db;
  --fg-soft: #a9a59b;
  --fg-mute: #6f6c63;

  /* Lines */
  --rule: #262620;
  --rule-strong: #34342c;

  /* Accent — terracotta */
  --hot: #d98055;
  --hot-lift: #ec9a70;
  --hot-wash: rgba(217, 128, 85, 0.12);

  /* Type families */
  --display: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --text: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;

  /* Rhythm */
  --shell: 1140px;
  --edge: clamp(1.25rem, 4vw, 3.5rem);
  --band-y: clamp(4rem, 9vw, 7.5rem);
  --head-h: 4.25rem;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  color-scheme: dark;
}

/* ============================================================
   Reset & base
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--head-h) + 1.5rem);
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--ink-850);
  color: var(--fg-soft);
  font-family: var(--text);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: rgba(217, 128, 85, 0.28);
  color: var(--fg);
}

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

ul,
ol {
  list-style: none;
}

a {
  color: var(--hot);
  text-decoration: none;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

a:hover {
  color: var(--hot-lift);
}

b,
strong {
  color: var(--fg);
  font-weight: 600;
}

em {
  font-style: italic;
}

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

.shell {
  width: min(100% - var(--edge) * 2, var(--shell));
  margin-inline: auto;
}

.skiplink {
  position: fixed;
  top: -200%;
  left: 1rem;
  z-index: 300;
  padding: 0.6rem 1rem;
  background: var(--fg);
  color: var(--ink-900);
  font-size: 0.8125rem;
  font-weight: 500;
}

.skiplink:focus {
  top: 1rem;
  color: var(--ink-900);
}

/* Scroll progress hairline */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--hot), #e8b48f);
  z-index: 200;
  pointer-events: none;
}

/* ============================================================
   Masthead
   ============================================================ */
.masthead {
  position: sticky;
  top: 0;
  z-index: 150;
  height: var(--head-h);
  background: rgba(18, 18, 15, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.masthead.is-stuck {
  border-bottom-color: var(--rule);
  background: rgba(14, 14, 12, 0.88);
}

.masthead__row {
  height: 100%;
  display: flex;
  align-items: center;
  gap: clamp(1rem, 4vw, 3rem);
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  color: var(--fg);
  flex-shrink: 0;
}

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

.wordmark__initial {
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--hot);
}

.wordmark__name {
  font-family: var(--display);
  font-size: 1.1875rem;
  letter-spacing: 0.005em;
}

.mainnav {
  margin-left: auto;
}

.mainnav__list {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.2vw, 1.9rem);
}

.mainnav__list a {
  position: relative;
  display: inline-block;
  padding: 0.35rem 0;
  color: var(--fg-soft);
  font-size: 0.8125rem;
  font-weight: 450;
  letter-spacing: 0.01em;
}

.mainnav__list a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0.1rem;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.25s var(--ease);
}

.mainnav__list a:hover,
.mainnav__list a.is-active {
  color: var(--fg);
}

.mainnav__list a:hover::after,
.mainnav__list a.is-active::after {
  transform: scaleX(1);
}

.mainnav__list a.is-active {
  color: var(--hot);
}

.mainnav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0 8px;
  background: none;
  border: 1px solid var(--rule);
  border-radius: 3px;
  cursor: pointer;
}

.mainnav__toggle span {
  display: block;
  height: 1.5px;
  background: var(--fg);
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}

.mainnav__toggle[aria-expanded='true'] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.mainnav__toggle[aria-expanded='true'] span:nth-child(2) {
  opacity: 0;
}

.mainnav__toggle[aria-expanded='true'] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.35rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  border-radius: 3px;
  white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
    border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn--solid {
  background: var(--fg);
  color: var(--ink-900);
  border-color: var(--fg);
}

.btn--solid:hover {
  background: var(--hot);
  border-color: var(--hot);
  color: var(--ink-900);
  transform: translateY(-1px);
}

.btn--line {
  color: var(--fg);
  border-color: var(--rule-strong);
}

.btn--line:hover {
  color: var(--fg);
  border-color: var(--fg-soft);
  background: rgba(255, 255, 255, 0.03);
  transform: translateY(-1px);
}

.masthead__cta {
  flex-shrink: 0;
  padding: 0.5rem 1.05rem;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding: clamp(1.5rem, 3.2vw, 2.75rem) 0 clamp(2.5rem, 5vw, 4rem);
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 460px;
  background: radial-gradient(
    120% 100% at 15% 0%,
    rgba(217, 128, 85, 0.07) 0%,
    transparent 62%
  );
  pointer-events: none;
}

/* Fine grain — keeps the flat dark surface from looking synthetic */
.hero__grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.055'/%3E%3C/svg%3E");
}

.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
  gap: clamp(2.5rem, 6vw, 4.5rem);
  align-items: center;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.75rem;
  padding: 0.35rem 0.85rem 0.35rem 0.7rem;
  border: 1px solid var(--rule-strong);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 450;
  letter-spacing: 0.03em;
  color: var(--fg-soft);
  background: rgba(255, 255, 255, 0.02);
}

.status__pulse {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7bc47f;
  flex-shrink: 0;
}

.status__pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(123, 196, 127, 0.55);
  animation: ripple 2.4s ease-out infinite;
}

@keyframes ripple {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(1.5); opacity: 0; }
}

.hero__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.35rem, 5.6vw, 4.15rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-bottom: 1.5rem;
  text-wrap: balance;
}

.hero__title em {
  color: var(--hot);
  font-style: italic;
}

.hero__standfirst {
  font-size: clamp(1rem, 1.35vw, 1.125rem);
  line-height: 1.75;
  max-width: 46ch;
  margin-bottom: 2.25rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 2.75rem;
}

.hero__resume {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.35rem;
  font-size: 0.8125rem;
  color: var(--fg-soft);
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 1px;
}

.hero__resume:hover {
  color: var(--fg);
  border-bottom-color: var(--hot);
}

.hero__resume span {
  font-size: 0.75rem;
  transition: transform 0.22s var(--ease);
}

.hero__resume:hover span {
  transform: translate(2px, -2px);
}

.factbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
}

.factbar dt {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-mute);
  margin-bottom: 0.3rem;
}

.factbar dd {
  font-size: 0.9375rem;
  color: var(--fg);
  font-weight: 450;
}

/* Portrait — duotone plate with nameplate */
.portrait {
  position: relative;
  isolation: isolate;
}

/* Hairline rule stepping out behind the plate */
.portrait::before {
  content: '';
  position: absolute;
  inset: 1.75rem -1.25rem -1.25rem 1.75rem;
  border: 1px solid var(--rule-strong);
  transition: inset 0.5s var(--ease), border-color 0.5s var(--ease);
}

.portrait:hover::before {
  inset: 1.15rem -0.75rem -0.75rem 1.15rem;
  border-color: rgba(217, 128, 85, 0.5);
}

.portrait__plate {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--ink-800);
  border: 1px solid var(--rule-strong);
  box-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.85);
}

.portrait__plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.015);
  filter: grayscale(0.55) contrast(1.06) brightness(0.97);
  transition: transform 1s var(--ease), filter 0.7s var(--ease);
}

.portrait:hover .portrait__plate img {
  transform: scale(1.055);
  filter: grayscale(0) contrast(1) brightness(1);
}

/* Warm wash tying the photo to the palette; clears on hover */
.portrait__wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(165deg, rgba(217, 128, 85, 0.4) 0%, rgba(14, 14, 12, 0.55) 100%);
  mix-blend-mode: color;
  transition: opacity 0.7s var(--ease);
}

.portrait:hover .portrait__wash {
  opacity: 0;
}

/* Bottom-edge gradient so the plaque stays legible */
.portrait__plate::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 45%;
  background: linear-gradient(to top, rgba(9, 9, 8, 0.9), transparent);
  pointer-events: none;
}

.portrait__plaque {
  position: absolute;
  left: 1.15rem;
  right: 1.15rem;
  bottom: 1.1rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.portrait__name {
  font-family: var(--display);
  font-size: 1.4rem;
  line-height: 1.1;
  color: var(--fg);
}

.portrait__role {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--fg-soft);
}

/* ============================================================
   Metrics band
   ============================================================ */
.metrics {
  border-block: 1px solid var(--rule);
  background: var(--ink-800);
}

.metrics__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.metric {
  padding: clamp(1.75rem, 3.5vw, 2.75rem) clamp(1rem, 2.5vw, 2rem);
  border-left: 1px solid var(--rule);
}

.metric:first-child {
  border-left: none;
  padding-left: 0;
}

.metric:last-child {
  padding-right: 0;
}

.metric__value {
  display: block;
  font-family: var(--display);
  font-size: clamp(2.25rem, 4.2vw, 3.25rem);
  line-height: 1;
  color: var(--fg);
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
  font-variant-numeric: tabular-nums;
}

.metric__label {
  display: block;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--fg-mute);
  max-width: 22ch;
}

/* ============================================================
   Bands & headings
   ============================================================ */
.band {
  padding: var(--band-y) 0;
}

.band--ruled {
  border-top: 1px solid var(--rule);
}

.bandhead {
  max-width: 62ch;
  margin-bottom: clamp(2.5rem, 5vw, 3.75rem);
}

.kicker {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--fg-mute);
  margin-bottom: 1.15rem;
}

.kicker__num {
  color: var(--hot);
  font-variant-numeric: tabular-nums;
}

.kicker::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
  max-width: 5rem;
}

.bandhead__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.75rem, 3.4vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.018em;
  color: var(--fg);
  text-wrap: balance;
}

.bandhead__sub {
  margin-top: 0.9rem;
  font-size: 0.9375rem;
  color: var(--fg-mute);
  max-width: 58ch;
}

.bandfoot {
  margin-top: 2rem;
  font-size: 0.875rem;
}

.bandfoot a {
  color: var(--fg);
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 2px;
}

.bandfoot a:hover {
  color: var(--hot);
  border-bottom-color: var(--hot);
}

/* Sub-block — a labelled group inside a band */
.subblock {
  margin-top: clamp(3rem, 6vw, 4.5rem);
}

.subhead {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--fg-soft);
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

.subhead::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.lead {
  font-size: 1.0625rem;
  color: var(--fg);
  line-height: 1.7;
}

/* ============================================================
   About
   ============================================================ */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(250px, 0.85fr);
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: start;
}

.about__prose p + p {
  margin-top: 1.15rem;
}

.about__rail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  padding: 1.4rem 1.5rem;
  background: var(--ink-800);
  border: 1px solid var(--rule);
  border-radius: 4px;
  transition: border-color 0.25s var(--ease);
}

.card:hover {
  border-color: var(--rule-strong);
}

.card__label {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--hot);
  margin-bottom: 1rem;
}

.card__strong {
  color: var(--fg);
  font-weight: 500;
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
}

.card__meta {
  font-size: 0.8125rem;
  color: var(--fg-mute);
  line-height: 1.6;
}

/* ============================================================
   Roles / experience
   ============================================================ */
.roles {
  display: flex;
  flex-direction: column;
}

.role {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding: clamp(2rem, 4vw, 2.75rem) 0;
  border-top: 1px solid var(--rule);
}

.role:last-child {
  border-bottom: 1px solid var(--rule);
}

.role__aside {
  position: sticky;
  top: calc(var(--head-h) + 2rem);
  align-self: start;
}

.role__company {
  font-family: var(--display);
  font-size: 1.375rem;
  color: var(--fg);
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.role__dates {
  font-size: 0.8125rem;
  color: var(--hot);
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.15rem;
}

.role__place {
  font-size: 0.8125rem;
  color: var(--fg-mute);
}

.role__title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.005em;
  margin-bottom: 0.65rem;
}

.role__brief {
  font-size: 0.9375rem;
  color: var(--fg-soft);
  margin-bottom: 1.35rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px dashed var(--rule);
  max-width: 62ch;
}

.bullets {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 1.5rem;
}

.bullets li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.65;
  max-width: 68ch;
}

.bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 9px;
  height: 1px;
  background: var(--fg-mute);
}

/* Pointer from the timeline back to the matching case study */
.role__ref {
  margin-bottom: 1.35rem;
  font-size: 0.8125rem;
}

.role__ref a {
  color: var(--fg-mute);
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}

.role__ref a:hover {
  color: var(--hot);
  border-bottom-color: var(--hot);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chips li {
  padding: 0.25rem 0.65rem;
  font-size: 0.7188rem;
  letter-spacing: 0.02em;
  color: var(--fg-mute);
  border: 1px solid var(--rule);
  border-radius: 100px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.chips li:hover {
  color: var(--fg);
  border-color: var(--rule-strong);
}

/* ============================================================
   Case studies
   ============================================================ */
.studies {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.study {
  display: flex;
  flex-direction: column;
  padding: clamp(1.5rem, 3vw, 2.15rem);
  background: var(--ink-800);
  border: 1px solid var(--rule);
  border-radius: 4px;
  transition: border-color 0.28s var(--ease), background 0.28s var(--ease),
    transform 0.28s var(--ease);
}

.study:hover {
  border-color: var(--rule-strong);
  background: var(--ink-750);
  transform: translateY(-3px);
}

.study__head {
  padding-bottom: 1.15rem;
  margin-bottom: 1.35rem;
  border-bottom: 1px solid var(--rule);
}

.study__index {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--hot);
  margin-bottom: 0.7rem;
}

.study__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.22;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin-bottom: 0.4rem;
}

.study__org {
  font-size: 0.8125rem;
  color: var(--fg-mute);
}

.study__body {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-bottom: 1.6rem;
  flex: 1;
}

.study__body dt {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-mute);
  margin-bottom: 0.35rem;
}

.study__body dd {
  font-size: 0.9063rem;
  line-height: 1.65;
}

/* ============================================================
   Repos / open source
   ============================================================ */
.repos {
  border-top: 1px solid var(--rule);
}

.repo {
  border-bottom: 1px solid var(--rule);
}

.repo__link {
  display: block;
  padding: clamp(1.35rem, 2.5vw, 1.85rem) clamp(0.75rem, 2vw, 1.25rem);
  margin-inline: clamp(-1.25rem, -2vw, -0.75rem);
  color: inherit;
  transition: background 0.25s var(--ease);
}

.repo__link:hover {
  background: var(--ink-800);
  color: inherit;
}

.repo__name {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--display);
  font-size: clamp(1.2rem, 2vw, 1.4375rem);
  color: var(--fg);
  letter-spacing: -0.005em;
  margin-bottom: 0.55rem;
  transition: color 0.2s var(--ease);
}

.repo__link:hover .repo__name {
  color: var(--hot);
}

.repo__arrow {
  font-family: var(--text);
  font-size: 0.875rem;
  opacity: 0.35;
  transform: translateX(0);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}

.repo__link:hover .repo__arrow {
  opacity: 1;
  transform: translate(3px, -3px);
}

.repo__desc {
  font-size: 0.9375rem;
  line-height: 1.68;
  max-width: 74ch;
  margin-bottom: 0.9rem;
}

.repo__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.repo__tags span {
  padding: 0.2rem 0.6rem;
  font-size: 0.7188rem;
  color: var(--fg-mute);
  border: 1px solid var(--rule);
  border-radius: 100px;
}

/* ============================================================
   Essays / writing
   ============================================================ */
.essays {
  border-top: 1px solid var(--rule);
}

.essay {
  border-bottom: 1px solid var(--rule);
}

.essay__link {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 0 1rem;
  padding: clamp(1.4rem, 2.6vw, 2rem) clamp(0.75rem, 2vw, 1.25rem);
  margin-inline: clamp(-1.25rem, -2vw, -0.75rem);
  color: inherit;
  transition: background 0.25s var(--ease);
}

.essay__link:hover {
  background: var(--ink-800);
  color: inherit;
}

.essay__index {
  font-family: var(--display);
  font-size: 1.75rem;
  line-height: 1;
  color: var(--rule-strong);
  font-variant-numeric: tabular-nums;
  transition: color 0.25s var(--ease);
}

.essay__link:hover .essay__index {
  color: var(--hot);
}

.essay__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-mute);
  margin-bottom: 0.6rem;
}

.essay__dot {
  opacity: 0.5;
}

.essay__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.2rem, 2.1vw, 1.5rem);
  line-height: 1.22;
  letter-spacing: -0.008em;
  color: var(--fg);
  margin-bottom: 0.6rem;
  transition: color 0.2s var(--ease);
}

.essay__link:hover .essay__title {
  color: var(--hot);
}

.essay__arrow {
  display: inline-block;
  margin-left: 0.45rem;
  font-family: var(--text);
  font-size: 0.8125rem;
  opacity: 0.35;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}

.essay__link:hover .essay__arrow {
  opacity: 1;
  transform: translate(3px, -3px);
}

.essay__excerpt {
  font-size: 0.9375rem;
  line-height: 1.68;
  max-width: 72ch;
  margin-bottom: 0.9rem;
}

.essay__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.essay__tags span {
  padding: 0.2rem 0.6rem;
  font-size: 0.7188rem;
  color: var(--fg-mute);
  border: 1px solid var(--rule);
  border-radius: 100px;
}

/* ============================================================
   Skills
   ============================================================ */
.skillgrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
}

.skillset {
  padding: 1.5rem 1.4rem;
  background: var(--ink-850);
  transition: background 0.25s var(--ease);
}

.skillset:hover {
  background: var(--ink-800);
}

.skillset__name {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--hot);
  padding-bottom: 0.85rem;
  margin-bottom: 0.95rem;
  border-bottom: 1px solid var(--rule);
}

.skillset ul {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.skillset li {
  font-size: 0.8438rem;
  line-height: 1.45;
  color: var(--fg-soft);
}

/* ============================================================
   Tenets / how I work
   ============================================================ */
.tenets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
}

.tenet {
  position: relative;
  padding: clamp(1.75rem, 3.5vw, 2.5rem);
  background: var(--ink-850);
  transition: background 0.25s var(--ease);
}

.tenet:hover {
  background: var(--ink-800);
}

.tenet__num {
  display: block;
  font-family: var(--display);
  font-size: 1.5rem;
  color: var(--hot);
  opacity: 0.6;
  margin-bottom: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.tenet h4 {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.6rem;
  letter-spacing: -0.005em;
}

.tenet p {
  font-size: 0.9063rem;
  line-height: 1.68;
  max-width: 46ch;
}

/* ============================================================
   Closing / contact
   ============================================================ */
.closing__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(250px, 0.8fr);
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: start;
}

.closing__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-bottom: 1.25rem;
  text-wrap: balance;
}

.closing__pitch p {
  font-size: 1rem;
  max-width: 50ch;
  margin-bottom: 2rem;
}

.mailto {
  display: inline-block;
  font-family: var(--display);
  font-size: clamp(1.35rem, 3vw, 2rem);
  color: var(--fg);
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 0.15rem;
  word-break: break-word;
}

.mailto:hover {
  color: var(--hot);
  border-bottom-color: var(--hot);
}

.channels {
  border-top: 1px solid var(--rule);
}

.channels li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.875rem;
}

.channels__label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-mute);
  flex-shrink: 0;
}

.channels li a {
  color: var(--fg);
  text-align: right;
  border-bottom: 1px solid transparent;
}

.channels li a:hover {
  color: var(--hot);
  border-bottom-color: var(--hot);
}

.channels__plain {
  color: var(--fg-soft);
  text-align: right;
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  border-top: 1px solid var(--rule);
  padding: 1.75rem 0 2.5rem;
  background: var(--ink-900);
}

.footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  font-size: 0.8125rem;
  color: var(--fg-mute);
}

.footer__note {
  order: 3;
  flex-basis: 100%;
  color: var(--fg-mute);
  opacity: 0.75;
}

.footer a {
  color: var(--fg-mute);
}

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

/* ============================================================
   Reveal on scroll
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1080px) {
  .skillgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .metric {
    border-top: 1px solid var(--rule);
  }

  .metric:nth-child(1),
  .metric:nth-child(2) {
    border-top: none;
  }

  .metric:nth-child(odd) {
    border-left: none;
    padding-left: 0;
  }

  .metric:nth-child(even) {
    padding-right: 0;
  }
}

@media (max-width: 960px) {
  .masthead__cta {
    display: none;
  }

  .mainnav__toggle {
    display: flex;
  }

  .mainnav {
    position: relative;
  }

  .mainnav__list {
    position: absolute;
    top: calc(100% + 0.9rem);
    right: 0;
    min-width: 230px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem;
    background: var(--ink-800);
    border: 1px solid var(--rule-strong);
    border-radius: 5px;
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.7);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.22s var(--ease), transform 0.22s var(--ease),
      visibility 0.22s;
  }

  .mainnav__list.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .mainnav__list a {
    display: block;
    padding: 0.65rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 3px;
  }

  .mainnav__list a::after {
    display: none;
  }

  .mainnav__list a:hover,
  .mainnav__list a.is-active {
    background: rgba(255, 255, 255, 0.04);
  }

  .hero__grid,
  .about,
  .closing__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero__grid {
    gap: 2.5rem;
  }

  .portrait {
    order: -1;
    max-width: 320px;
  }

  .portrait::before {
    inset: 1.15rem -0.85rem -0.85rem 1.15rem;
  }

  .studies,
  .tenets {
    grid-template-columns: minmax(0, 1fr);
  }

  .tenets {
    gap: 1px;
  }

  .role {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.35rem;
  }

  .role__aside {
    position: static;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 1rem;
    padding-bottom: 0.15rem;
  }

  .role__company {
    margin-bottom: 0;
  }

  .role__dates,
  .role__place {
    margin-bottom: 0;
  }

  .essay__link {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
  }

  .essay__index {
    font-size: 1.25rem;
  }
}

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

  .metric {
    padding-inline: 0;
    border-left: none;
    border-top: 1px solid var(--rule);
  }

  .metric:first-child {
    border-top: none;
  }

  .metric__label {
    max-width: none;
  }

  .skillgrid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero__actions .btn {
    flex: 1 1 100%;
  }

  .hero__resume {
    margin-left: 0;
    margin-top: 0.35rem;
  }

  .factbar {
    gap: 1.15rem 2rem;
  }

  .channels li {
    flex-direction: column;
    gap: 0.15rem;
  }

  .channels li a,
  .channels__plain {
    text-align: left;
  }

  .portrait {
    max-width: 300px;
  }

  .portrait__name {
    font-size: 1.25rem;
  }
}

/* ============================================================
   Print
   ============================================================ */
@media print {
  .masthead,
  .progress,
  .skiplink,
  .hero__actions,
  .status,
  .footer__note,
  .bandfoot {
    display: none !important;
  }

  body {
    background: #fff;
    color: #111;
    font-size: 10.5pt;
    line-height: 1.45;
  }

  .hero__title,
  .bandhead__title,
  .study__title,
  .closing__title,
  .repo__name,
  .role__company,
  .mailto,
  .metric__value,
  b,
  strong {
    color: #000;
  }

  .band {
    padding: 1rem 0;
    break-inside: avoid;
  }

  .study,
  .card,
  .skillset,
  .tenet {
    background: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  .hero__grain,
  .portrait__wash,
  .portrait::before,
  .portrait__plate::after {
    display: none !important;
  }

  .portrait {
    max-width: 200px;
  }

  .portrait__plate {
    box-shadow: none;
  }

  .portrait__plate img {
    transform: none;
    filter: none;
  }

  .portrait__plaque {
    position: static;
    margin-top: 0.5rem;
  }

  .portrait__name,
  .portrait__role {
    color: #111;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}

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

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}
