/* Ibraheem Al-Halabi, resume site.
   Visual language: a print shop. Paper and ink as the base, the four process inks (C, M, Y, K)
   as the brand system, magenta as the single interface accent. All corners are square, like a trimmed sheet. */

/* ---------- Tokens ---------- */
:root {
  --paper: #f3f3f0;
  --paper-raised: #fbfbf9;
  --ink: #141417;
  --ink-soft: #4a4c53;
  --ink-faint: #74767d;
  --rule: rgba(20, 20, 23, 0.14);

  --process-cyan: #009fe3;
  --process-magenta: #e4007c;
  --process-yellow: #ffd900;
  --process-key: #16161a;

  --accent: var(--process-magenta);
  --accent-text: #b5006a;
  --ghost-blend: multiply;
  --proof-shadow: 0 18px 40px -18px rgba(40, 30, 50, 0.35);

  --font-display: "Noto Kufi Arabic", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Arabic", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --gutter: clamp(16px, 4vw, 56px);
  --content-width: 1320px;
  --header-height: 68px;
  --section-space: clamp(80px, 11vw, 150px);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e0f11;
    --paper-raised: #17181b;
    --ink: #ecebe7;
    --ink-soft: #b4b5ba;
    --ink-faint: #8b8d94;
    --rule: rgba(236, 235, 231, 0.14);
    --accent-text: #ff5cb4;
    --ghost-blend: screen;
    --proof-shadow: 0 22px 50px -20px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #0e0f11;
  --paper-raised: #17181b;
  --ink: #ecebe7;
  --ink-soft: #b4b5ba;
  --ink-faint: #8b8d94;
  --rule: rgba(236, 235, 231, 0.14);
  --accent-text: #ff5cb4;
  --ghost-blend: screen;
  --proof-shadow: 0 22px 50px -20px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.8;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

.intro-playing body { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }

:lang(en) .section-title,
:lang(en) .hero__name,
:lang(en) .contact__title { letter-spacing: -0.025em; }

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

.skip-link {
  position: fixed;
  inset-block-start: 8px;
  inset-inline-start: 8px;
  z-index: 60;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-150%);
}
.skip-link:focus { transform: none; }

/* ---------- Press intro ---------- */
.press-intro { display: none; }

.intro-playing .press-intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: #f3f3f0;
  clip-path: inset(0 0 0 0);
  animation: intro-wipe 0.8s var(--ease-in-out) 2.9s forwards;
}

@keyframes intro-wipe {
  to { clip-path: inset(0 0 100% 0); }
}

.press-intro__sheet {
  position: relative;
  padding: clamp(36px, 7vw, 90px) clamp(28px, 7vw, 110px);
}

.press-intro__name {
  display: grid;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 9.5vw, 7.6rem);
  line-height: 1.5;
  white-space: nowrap;
}

.ink-plate {
  grid-area: 1 / 1;
  mix-blend-mode: multiply;
  animation: plate-in 1.7s var(--ease-out) both;
}
.ink-plate--cyan    { color: #00aeef; --from-x: -14vw; --from-y: -9vh; --from-r: -4deg; animation-delay: 0.05s; }
.ink-plate--magenta { color: #ec008c; --from-x: 12vw;  --from-y: -6vh; --from-r: 3deg;  animation-delay: 0.2s; }
.ink-plate--yellow  { color: #fff200; --from-x: -9vw;  --from-y: 10vh; --from-r: 2.5deg; animation-delay: 0.35s; }
.ink-plate--key     { color: #231f20; --from-x: 7vw;   --from-y: 7vh;  --from-r: -2deg; animation-delay: 0.85s; }

@keyframes plate-in {
  from { opacity: 0; transform: translate(var(--from-x), var(--from-y)) rotate(var(--from-r)); }
  20% { opacity: 1; }
  55% { transform: translate(calc(var(--from-x) * 0.12), calc(var(--from-y) * 0.12)) rotate(calc(var(--from-r) * 0.2)); }
  to { opacity: 1; transform: none; }
}

.registration-mark {
  position: absolute;
  width: 34px;
  height: 34px;
  opacity: 0;
  animation: mark-in 0.5s var(--ease-out) 1.9s forwards;
}
.registration-mark::before,
.registration-mark::after {
  content: "";
  position: absolute;
  inset: 0;
}
.registration-mark::before {
  inset: 7px;
  border: 1.5px solid #231f20;
  border-radius: 50%;
}
.registration-mark::after {
  background:
    linear-gradient(#231f20, #231f20) center / 1.5px 100% no-repeat,
    linear-gradient(#231f20, #231f20) center / 100% 1.5px no-repeat;
}
.registration-mark--top-start    { inset-block-start: 0; inset-inline-start: 0; }
.registration-mark--top-end      { inset-block-start: 0; inset-inline-end: 0; }
.registration-mark--bottom-start { inset-block-end: 0; inset-inline-start: 0; }
.registration-mark--bottom-end   { inset-block-end: 0; inset-inline-end: 0; }

@keyframes mark-in {
  from { opacity: 0; transform: scale(0.4) rotate(-90deg); }
  to { opacity: 1; transform: none; }
}

.press-intro__color-bar {
  position: absolute;
  inset-block-end: 6px;
  inset-inline-start: 50%;
  display: flex;
  gap: 4px;
  transform: translateX(-50%);
}
[dir="rtl"] .press-intro__color-bar { transform: translateX(50%); }
.press-intro__color-bar span {
  width: 18px;
  height: 18px;
  opacity: 0;
  animation: swatch-in 0.3s ease-out forwards;
}
.press-intro__color-bar span:nth-child(1) { background: #00aeef; animation-delay: 2.0s; }
.press-intro__color-bar span:nth-child(2) { background: #ec008c; animation-delay: 2.1s; }
.press-intro__color-bar span:nth-child(3) { background: #fff200; animation-delay: 2.2s; }
.press-intro__color-bar span:nth-child(4) { background: #231f20; animation-delay: 2.3s; }

@keyframes swatch-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.press-intro__skip {
  position: absolute;
  inset-block-end: max(20px, env(safe-area-inset-bottom));
  inset-inline-end: 24px;
  padding: 8px 16px;
  border: 1px solid rgba(35, 31, 32, 0.3);
  background: transparent;
  color: #231f20;
  font-size: 0.9rem;
  cursor: pointer;
}
.press-intro__skip:hover { background: #231f20; color: #f3f3f0; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-height);
  padding-inline: var(--gutter);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-block-end: 1px solid transparent;
  transition: border-color 0.3s ease, background-color 0.4s ease;
}
.site-header.is-scrolled { border-block-end-color: var(--rule); }

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  gap: clamp(14px, 2.4vw, 34px);
  margin-inline-start: auto;
}
.site-nav a {
  position: relative;
  padding-block: 6px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.site-nav a::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.35s var(--ease-out);
}
.site-nav a:hover,
.site-nav a.is-current { color: var(--ink); }
.site-nav a.is-current::after,
.site-nav a:hover::after { transform: scaleX(1); }

.site-header__tools { display: flex; gap: 6px; }

.tool-button {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding-inline: 8px;
  border: 1px solid var(--rule);
  background: transparent;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.9rem;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.tool-button:hover { border-color: var(--ink); }
.tool-button:active { transform: translateY(1px); }
.tool-button i { font-size: 1.2rem; grid-area: 1 / 1; }

.theme-icon--sun { display: none; }
:root[data-theme="dark"] .theme-icon--sun { display: block; }
:root[data-theme="dark"] .theme-icon--moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon--sun { display: block; }
  :root:not([data-theme="light"]) .theme-icon--moon { display: none; }
}

/* ---------- Layout helpers ---------- */
main > section {
  width: min(100%, var(--content-width));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section-title {
  margin-block-end: clamp(32px, 4vw, 56px);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4.4vw, 3.6rem);
  line-height: 1.2;
}

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 24px;
  border: 1.5px solid var(--ink);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.3s var(--ease-out), background-color 0.25s ease, color 0.25s ease, box-shadow 0.3s var(--ease-out);
}
.button i { font-size: 1.15rem; }
.button--primary { background: var(--ink); color: var(--paper); }
.button--primary:hover { box-shadow: 4px 4px 0 var(--process-cyan), -4px -4px 0 var(--process-magenta); }
.button--ghost { background: transparent; color: var(--ink); }
.button--ghost:hover { background: var(--ink); color: var(--paper); }
.button:active { transform: translateY(1px) scale(0.98); }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  justify-items: center;
  min-height: 100dvh;
  padding-block: calc(var(--header-height) + 28px) 0;
  overflow-x: clip;
}
.hero__copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero__role {
  margin-block-end: 18px;
  color: var(--accent-text);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
}

.hero__name {
  display: grid;
  margin-block-end: 30px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.8rem, 7vw, 6.2rem);
  line-height: 1.4;
}
.hero__name > span { grid-area: 1 / 1; }
.hero__name-ink { position: relative; color: var(--ink); }
/* Colour plates sit exactly under the black ink; they only show while settling into registration on load. */
.hero__name-ghost { mix-blend-mode: var(--ghost-blend); }
.hero__name-ghost--cyan    { color: var(--process-cyan); }
.hero__name-ghost--magenta { color: var(--process-magenta); }
.hero__name-ghost--yellow  { color: var(--process-yellow); }

.hero__summary {
  max-width: 44ch;
  margin-block-end: 36px;
  color: var(--ink-soft);
  font-size: clamp(1.1rem, 1.5vw, 1.3rem);
  line-height: 1.85;
}

.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }

.hero__wheel-stage {
  --card-width: clamp(150px, 15vw, 228px);
  --card-height: calc(var(--card-width) * 1.25 + 48px);
  --card-gap: clamp(14px, 1.5vw, 26px);
  --card-step: 9deg;
  /* Radius chosen so neighbouring cards sit one card width plus a gap apart (9deg = 0.15708 rad). */
  --wheel-radius: calc((var(--card-width) + var(--card-gap)) / 0.15708);
  position: relative;
  width: 100vw;
  max-width: none;
  justify-self: center;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  height: clamp(300px, 40vh, 420px);
  margin-block-start: clamp(28px, 4vh, 48px);
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10%, #000 90%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 10%, #000 90%, transparent 100%);
}
.hero__wheel {
  position: absolute;
  inset-inline-start: 50%;
  top: calc(34px + var(--wheel-radius) + var(--card-height) / 2);
  width: 0;
  height: 0;
  transform: rotate(var(--wheel-rotation, 0deg));
  transition: transform 1.4s var(--ease-in-out);
}
[dir="rtl"] .hero__wheel { inset-inline-start: auto; right: 50%; }
.hero__wheel-stage.is-dragging { cursor: grabbing; }

.wheel-card {
  position: absolute;
  left: calc(var(--card-width) / -2);
  top: calc(var(--card-height) / -2);
  width: var(--card-width);
  height: var(--card-height);
  transform: rotate(var(--card-angle)) translateY(calc(var(--wheel-radius) * -1));
}
.wheel-card__sheet {
  height: 100%;
  padding: 8px 8px 0;
  background: var(--paper-raised);
  box-shadow: var(--proof-shadow);
  transition: transform 1.4s var(--ease-in-out), background-color 0.4s ease;
}
.wheel-card.is-top .wheel-card__sheet { transform: translateY(-14px); }
@media (hover: hover) {
  .wheel-card:hover .wheel-card__sheet { transform: translateY(-8px); transition-duration: 0.4s; }
  .wheel-card.is-top:hover .wheel-card__sheet { transform: translateY(-20px); }
}
.wheel-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: color-mix(in srgb, var(--ink) 6%, var(--paper));
}
.wheel-card__title {
  overflow: hidden;
  padding: 10px 4px 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(0.78rem, 0.9vw, 0.92rem);
  line-height: 1.6;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Hero entrance, played once the press intro hands over (or immediately when there is no intro). */
@media (prefers-reduced-motion: no-preference) {
  .js:not(.hero-ready) .hero__role,
  .js:not(.hero-ready) .hero__name-ink,
  .js:not(.hero-ready) .hero__summary,
  .js:not(.hero-ready) .hero__actions,
  .js:not(.hero-ready) .hero__wheel-stage { opacity: 0; }

  .hero-ready .hero__role,
  .hero-ready .hero__name-ink,
  .hero-ready .hero__summary,
  .hero-ready .hero__actions { animation: rise-in 0.9s var(--ease-out) both; }
  .hero-ready .hero__name-ink { animation-delay: 0.05s; }
  .hero-ready .hero__summary { animation-delay: 0.18s; }
  .hero-ready .hero__actions { animation-delay: 0.28s; }

  .hero-ready .hero__name-ghost { animation: ghost-settle 1.4s var(--ease-out) both; }
  .hero-ready .hero__name-ghost--magenta { animation-delay: 0.08s; }
  .hero-ready .hero__name-ghost--yellow { animation-delay: 0.16s; }

  .hero-ready .hero__wheel-stage { animation: proof-drop 1.3s var(--ease-out) 0.25s both; }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: none; }
}
@keyframes ghost-settle {
  from { translate: 18px -10px; opacity: 0; }
  40% { opacity: 1; }
  to { translate: 0 0; opacity: 1; }
}
@keyframes proof-drop {
  from { opacity: 0; translate: 0 120px; }
  to { opacity: 1; translate: 0 0; }
}

/* ---------- Figures ---------- */
.figures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid var(--rule);
  padding-block: clamp(28px, 4vw, 48px) !important;
}
.figure-item {
  padding-inline: clamp(12px, 2vw, 28px);
  border-inline-start: 1px solid var(--rule);
}
.figure-item:first-child { border-inline-start: 0; padding-inline-start: 0; }
.figure-item__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 4.4vw, 3.5rem);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.figure-item__value small { font-size: 0.45em; font-weight: 500; color: var(--ink-faint); }
.figure-item__label { margin-block-start: 6px; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.6; }

/* ---------- About ---------- */
.about { padding-block: var(--section-space) 0; }
.about__body {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.about__text p {
  max-width: 62ch;
  font-size: clamp(1.08rem, 1.3vw, 1.2rem);
  line-height: 1.95;
}
.about__text p + p { margin-block-start: 1.2em; }
.about__aside {
  padding: 28px;
  background: var(--paper-raised);
  border-block-start: 4px solid var(--process-cyan);
  color: var(--ink-soft);
  line-height: 1.85;
}
.about__aside-title {
  margin-block-end: 10px;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
}

/* ---------- Experience ---------- */
.experience { padding-block: var(--section-space) 0; }
.job-list { margin: 0; padding: 0; list-style: none; }
.job {
  display: grid;
  grid-template-columns: minmax(170px, 0.32fr) minmax(0, 1fr);
  gap: clamp(16px, 4vw, 64px);
  padding-block: clamp(24px, 3vw, 36px);
  border-block-start: 1px solid var(--rule);
}
.job__dates {
  color: var(--ink-faint);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
}
.job__role {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.4;
}
.job__company { margin-block: 4px 12px; color: var(--accent-text); font-weight: 500; }
.job__text { max-width: 68ch; color: var(--ink-soft); }
.job--education {
  margin-block-start: 12px;
  padding-inline: clamp(16px, 2.5vw, 32px);
  border-block-start: 0;
  background: color-mix(in srgb, var(--process-yellow) 16%, var(--paper));
}

/* ---------- Works ---------- */
.works { padding-block: var(--section-space) 0; }
.works .section-title { margin-block-end: 12px; }
.works__intro { max-width: 52ch; margin-block-end: 32px; color: var(--ink-soft); font-size: 1.12rem; }

.works__filters {
  display: flex;
  gap: 8px;
  margin-block-end: 36px;
  padding-block-end: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.works__filters::-webkit-scrollbar { display: none; }

.filter-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  flex: none;
  padding: 9px 16px;
  border: 1px solid var(--rule);
  background: transparent;
  cursor: pointer;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.filter-chip small { color: var(--ink-faint); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.filter-chip:hover { border-color: var(--ink); }
.filter-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.filter-chip[aria-pressed="true"] small { color: inherit; opacity: 0.7; }

.works__grid {
  columns: 3 280px;
  column-gap: clamp(16px, 2vw, 28px);
}

.work-card {
  break-inside: avoid;
  margin: 0 0 clamp(22px, 2.6vw, 34px);
}
.work-card__button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--paper-raised);
  cursor: zoom-in;
}
.work-card__button img {
  width: 100%;
  transition: transform 0.6s var(--ease-out), filter 0.4s ease;
}
.work-card__button:hover img,
.work-card__button:focus-visible img {
  transform: translateY(-3px);
  filter:
    drop-shadow(5px 0 0 color-mix(in srgb, var(--process-cyan) 80%, transparent))
    drop-shadow(-5px 0 0 color-mix(in srgb, var(--process-magenta) 80%, transparent));
}
.work-card figcaption { padding-block-start: 12px; }
.work-card__title { font-family: var(--font-display); font-weight: 500; font-size: 1.02rem; line-height: 1.5; }
.work-card__meta { color: var(--ink-faint); font-size: 0.86rem; }

.works__more { display: flex; justify-content: center; margin-block-start: 12px; }
.works__noscript { color: var(--ink-soft); }

@media (prefers-reduced-motion: no-preference) {
  .work-card.is-entering { animation: rise-in 0.7s var(--ease-out) both; animation-delay: calc(var(--stagger, 0) * 45ms); }
}

/* ---------- Honors ---------- */
.honors { padding-block: var(--section-space) 0; }
.honors__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(190px, auto);
  gap: clamp(12px, 1.4vw, 18px);
}
.honor {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  padding: clamp(20px, 2.4vw, 32px);
  background: var(--paper-raised);
}
.honor__year { color: var(--ink-faint); font-family: var(--font-display); font-weight: 500; font-size: 0.92rem; }
.honor__title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.1rem, 1.6vw, 1.35rem); line-height: 1.45; }
.honor__text { font-size: 0.95rem; line-height: 1.7; opacity: 0.85; }
.honor__place {
  margin-block-end: auto;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.6rem, 7vw, 5.6rem);
  line-height: 1;
}

.honor--lead {
  grid-column: span 2;
  background: var(--process-key);
  color: #f3f3f0;
}
:root[data-theme="dark"] .honor--lead { background: #f3f3f0; color: #141417; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .honor--lead { background: #f3f3f0; color: #141417; }
}
.honor--lead .honor__year { color: inherit; opacity: 0.65; }
.honor--lead .honor__title { font-size: clamp(1.5rem, 2.8vw, 2.3rem); }

.honor--cyan { background: var(--process-cyan); color: #101014; }
.honor--magenta { background: var(--process-magenta); color: #ffffff; }
.honor--yellow { background: var(--process-yellow); color: #101014; }
.honor--cyan .honor__year,
.honor--magenta .honor__year,
.honor--yellow .honor__year { color: inherit; }

.honor--image { padding: 0; overflow: hidden; }
.honor--image img { flex: 1; min-height: 0; width: 100%; object-fit: cover; }
.honor--image .honor__caption { display: grid; gap: 4px; padding: clamp(18px, 2vw, 26px); }
.honor--image:nth-child(2) { grid-column: span 2; grid-row: span 2; }
.honor--wide { grid-column: span 3; flex-direction: row; height: clamp(240px, 24vw, 320px); }
.honor--wide img { flex: 0 0 42%; height: 100%; object-position: center 45%; }
.honor--wide .honor__caption { align-content: end; }

/* ---------- Skills ---------- */
.skills { padding-block: var(--section-space) 0; }
.skills__groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 56px) clamp(28px, 5vw, 80px);
}
.skill-group { padding-block-start: 18px; border-block-start: 2px solid var(--ink); }
.skill-group__title { margin-block-end: 14px; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }
.skill-group__list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.skill-group__list li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; color: var(--ink-soft); }
.skill-group__list li span { color: var(--ink); }
.skill-group__list em { flex: none; color: var(--ink-faint); font-size: 0.9rem; font-style: normal; }

/* ---------- Contact ---------- */
.contact {
  position: relative;
  margin-block-start: var(--section-space);
  padding-block: clamp(72px, 10vw, 130px) !important;
  isolation: isolate;
}
/* Halftone screen, the dot pattern every print job is made of. */
.contact::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(color-mix(in srgb, var(--process-magenta) 55%, transparent) 1.3px, transparent 1.8px);
  background-size: 13px 13px;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 85% 50%, #000 0%, transparent 70%);
  mask-image: radial-gradient(ellipse 70% 80% at 85% 50%, #000 0%, transparent 70%);
  opacity: 0.55;
  pointer-events: none;
}
[dir="rtl"] .contact::before {
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 15% 50%, #000 0%, transparent 70%);
  mask-image: radial-gradient(ellipse 70% 80% at 15% 50%, #000 0%, transparent 70%);
}
.contact__title {
  margin-block-end: 18px;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
}
.contact__email {
  display: inline-block;
  max-width: 100%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 6.4vw, 5.6rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-decoration: none;
  overflow-wrap: anywhere;
  background: linear-gradient(var(--accent), var(--accent)) left bottom / 0 3px no-repeat;
  transition: background-size 0.5s var(--ease-out);
}
.contact__email:hover { background-size: 100% 3px; }
.contact__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}
.contact__links a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 18px;
  border: 1px solid var(--rule);
  background: var(--paper);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.3s var(--ease-out);
}
.contact__links a:hover { border-color: var(--ink); transform: translateY(-2px); }
.contact__links i { font-size: 1.2rem; }
.contact__location { display: flex; align-items: center; gap: 8px; margin-block-start: 28px; color: var(--ink-faint); }

/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, var(--content-width));
  margin-inline: auto;
  padding: 28px var(--gutter) max(28px, env(safe-area-inset-bottom));
  border-block-start: 1px solid var(--rule);
  color: var(--ink-faint);
  font-size: 0.9rem;
}

/* ---------- Lightbox ---------- */
.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ecebe7;
}
.lightbox::backdrop {
  background: rgba(10, 10, 12, 0.92);
  backdrop-filter: blur(6px);
}
.lightbox__frame {
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
  padding: clamp(56px, 7vh, 80px) clamp(16px, 8vw, 120px) 24px;
}
.lightbox__figure { display: grid; justify-items: center; gap: 18px; margin: 0; max-width: 100%; }
.lightbox__image {
  max-width: 100%;
  max-height: calc(100dvh - 240px);
  width: auto;
  object-fit: contain;
  background: #1b1c1f;
}
.lightbox__image.is-swapping { animation: lightbox-in 0.45s var(--ease-out) both; }
@keyframes lightbox-in {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: none; }
}
.lightbox__caption { max-width: 60ch; text-align: center; }
.lightbox__meta { color: #9a9ca3; font-size: 0.88rem; }
.lightbox__title { margin-block: 2px 4px; font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; }
.lightbox__note { color: #c4c5ca; font-size: 0.98rem; line-height: 1.7; }

.lightbox__close,
.lightbox__nav {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(236, 235, 231, 0.25);
  background: rgba(20, 20, 23, 0.6);
  color: #ecebe7;
  cursor: pointer;
  font-size: 1.3rem;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.lightbox__close:hover,
.lightbox__nav:hover { background: #ecebe7; color: #141417; }
.lightbox__close { inset-block-start: 14px; inset-inline-end: 14px; }
.lightbox__nav { inset-block-start: 50%; transform: translateY(-50%); }
.lightbox__nav--previous { inset-inline-start: clamp(8px, 2vw, 32px); }
.lightbox__nav--next { inset-inline-end: clamp(8px, 2vw, 32px); }
[dir="ltr"] .lightbox__nav i { transform: scaleX(-1); }

/* ---------- Scroll reveal ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  }
  .js .reveal.is-visible { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .honors__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .honor--image:nth-child(2) { grid-row: span 1; }
  .honor--image:nth-child(2) img { aspect-ratio: 4 / 3; }
  .honor--wide { grid-column: span 2; }
}

@media (max-width: 860px) {
  .site-nav { display: none; }
  .site-header__tools { margin-inline-start: auto; }

  .hero { padding-block-start: calc(var(--header-height) + 36px); }
  .hero__wheel-stage { --card-width: 140px; height: 290px; }

  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; }
  .figure-item:nth-child(3) { border-inline-start: 0; padding-inline-start: 0; }

  .about__body { grid-template-columns: 1fr; }
  .job { grid-template-columns: 1fr; gap: 6px; }
  .skills__groups { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .honors__grid { grid-template-columns: 1fr; }
  .honor--lead,
  .honor--image:nth-child(2),
  .honor--wide { grid-column: auto; }
  .honor--wide { flex-direction: column; height: auto; }
  .honor--wide img { flex: none; aspect-ratio: 4 / 3; }
  .works__grid { columns: 2; column-gap: 12px; }
  .work-card__title { font-size: 0.92rem; }
  .button { padding-inline: 18px; }
  .hero__actions .button { flex: 1 1 auto; justify-content: center; }
  .hero__wheel-stage { --card-width: 124px; --card-gap: 12px; height: 250px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
