/* ==========================================================================
   Zakariya Qureshi, personal website
   1. Tokens & base      5. Projects
   2. Shared pieces      6. Life & collection
   3. Hero               7. Hello & footer
   4. About              8. Menu (phones)
                         9. Lightbox
   Breakpoints: 1023px (tablet), 899px (projects accordion), 639px (phones)
   Sizes: rem, 1rem = 10px; hairlines and breakpoints stay px
   ========================================================================== */

/* 1. Tokens & base */
:root {
  --green: #5FC79A;
  --green-ink: #123524;
  --yellow: #F5C842;
  --ink: #1B1916;
  --cream: #F4EEE2;
  --paper: #FBEFE6;
  --navy-ink: #131F45;
  --pink: #F26C94;
  --pink-ink: #2A0E1C;
  --coral: #F0855C;

  --sans: 'Instrument Sans', system-ui, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --mono: 'DM Mono', ui-monospace, monospace;

  --gutter: clamp(2rem, 5vw, 6.4rem);
  --section-y: clamp(8rem, 10vw, 12rem);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-io: cubic-bezier(.65, 0, .25, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 62.5%; scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; } /* 1rem = 10px */
body {
  margin: 0;
  font-size: 1.6rem;
  background: var(--ink);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* Large screens: everything sized in rem grows with the root. Identical below 1800px; caps at 1.5x from 2800px. */
@media (min-width: 1800px) { html { font-size: 66.40625%; } }
@media (min-width: 2100px) { html { font-size: 74.21875%; } }
@media (min-width: 2400px) { html { font-size: 82.03125%; } }
@media (min-width: 2800px) { html { font-size: 93.75%; } }
a { color: inherit; text-decoration: none; }
a:hover { color: inherit; }
button { font: inherit; color: inherit; }
img { display: block; }
::selection { background: var(--yellow); color: var(--ink); }
/* Keyboard focus ring. Each section sets --focus to its main text colour, so every ring in it matches. */
:focus-visible { outline: 2px solid var(--focus, currentColor); outline-offset: .3rem; }
.hero, .hello { --focus: var(--pink-ink); }
.about { --focus: var(--green-ink); }
.projects, .menu { --focus: var(--paper); }
.life { --focus: var(--ink); }
.lightbox { --focus: var(--cream); }
.lightbox:focus { outline: none; } /* the viewer takes focus on open; only its buttons show a ring */

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

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

/* 2. Shared pieces */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; }
.eyebrow {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.eyebrow { margin: 0 0 1.4rem; }
i { font-style: normal; }

.section__inner {
  max-width: 128rem;
  margin: 0 auto;
  padding: var(--section-y) var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.section-title {
  margin: 0;
  font-weight: 700;
  font-size: clamp(min(7.2rem, 22.5vw), 11vw, 12.8rem); /* floor also capped by width, for larger browser text settings */
  line-height: 1.05;
  letter-spacing: -.05em;
}

.pills { display: flex; flex-wrap: wrap; gap: .8rem; margin: 0; padding: 0; list-style: none; }
.pill {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1.2rem;
  line-height: 1.3;
  padding: .7rem 1.3rem;
  border-radius: 99.9rem;
  white-space: nowrap;
}
.pill--navy { background: #1F2A66; color: var(--paper); }
.pill--periwinkle { background: #7E9BE6; color: var(--navy-ink); }
.pill--cream { background: var(--cream); color: var(--green-ink); }
.pill--sand { background: #C9A27A; color: #2B1A0C; }
.pill--lilac { background: #C9B8F0; color: #2A1D52; }
.pill--rose { background: #F06FA0; color: #2A0E1C; }
.pill--mint { background: #7FCBA0; color: var(--green-ink); }
.pill--coral { background: var(--coral); color: #33130A; }

/* 3. Hero */
.hero { background: var(--pink); color: var(--pink-ink); min-height: 100svh; display: flex; flex-direction: column; }
.hero__inner {
  width: 100%;
  max-width: 128rem;
  margin: 0 auto;
  padding: clamp(2.2rem, 3vw, 3.4rem) var(--gutter) min(clamp(4rem, 6vw, 7.2rem), 5vh);
  flex: 1;
  display: flex;
  flex-direction: column;
}
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.site-nav { display: flex; gap: clamp(1.4rem, 2.5vw, 3rem); }
.site-nav a { transition: opacity .2s; }
.site-nav a:hover { opacity: .6; }
.menu-button {
  display: none;
  align-items: center;
  gap: 1rem;
  height: 4rem;
  padding: 0 1.6rem;
  border: 0;
  border-radius: 99.9rem;
  background: var(--pink-ink);
  color: var(--cream);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
}
.menu-button__icon { display: flex; flex-direction: column; gap: .3rem; }
.menu-button__icon span { display: block; width: 1.4rem; height: 2px; border-radius: 2px; background: var(--cream); }
.menu-button__icon span:first-child { background: var(--yellow); }

.hero__intro {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: min(clamp(5.6rem, 8vw, 8.8rem), 7vh) 0 min(clamp(3.2rem, 5vw, 5.6rem), 4vh);
}
.hero__intro .eyebrow { color: rgba(42, 14, 28, .8); letter-spacing: .14em; padding-left: .14em; } /* tracking adds space after the last letter; this keeps the line optically centred */
.hero__name {
  margin: 0;
  padding-right: .055em; /* the tight tracking trims the last letter's box; this puts the name back on the centre line */
  font-weight: 700;
  font-size: min(20rem, max(14.4vw, min(20vw, 13.2rem)), max(19vh, min(16rem, 13vw))); /* shrinks on short windows, never below the section titles */
  line-height: .9;
  letter-spacing: -.055em;
}
.hero__name .serif { letter-spacing: -.025em; }
.hero__name i { color: var(--yellow); }
.hero__ruled {
  border-top: 2.5px solid var(--pink-ink);
  border-bottom: 2.5px solid var(--pink-ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.8rem;
  padding: clamp(2.2rem, 2.6vw, 3rem) 0;
  text-align: center;
}
.hero__tagline {
  max-width: 32ch;
  margin: 0;
  font-weight: 500;
  font-size: clamp(2.4rem, 2.8vw, 3.4rem);
  line-height: 1.22;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.highlight { background: var(--yellow); padding: 0 .08em; }
.hero__experience {
  margin: 0;
  padding-left: .16em; /* same optical centring as the eyebrow */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: .5rem 1em;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.hero__experience > span { white-space: nowrap; }

@media (max-width: 1023px) {
  .hero__intro { flex: 0 0 auto; margin-top: auto; }
  .hero__ruled { margin-bottom: auto; }
}
@media (max-width: 639px) {
  .site-nav { display: none; }
  .menu-button { display: inline-flex; }
  /* phones: the experience line stays on one line; tighter tracking, and the size eases down with the screen */
  .hero__experience { flex-wrap: nowrap; gap: .6em; padding-left: .12em; font-size: min(1.15rem, 2.95vw); letter-spacing: .12em; }
}

/* 4. About */
.about { background: var(--green); color: var(--green-ink); }
.about__inner { padding-bottom: clamp(8.8rem, 10.5vw, 12.8rem); justify-content: center; }
.about .section-title i { color: var(--yellow); }
.about__note {
  margin: 3.4rem 0 0;
  max-width: 30ch;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(2.6rem, 3.8vw, 4.2rem);
  line-height: 1.2;
  text-wrap: pretty;
}
.about__mark { background: var(--yellow); color: var(--green-ink); padding: 0 .08em; white-space: nowrap; }

@media (max-width: 1023px) {
  .about__inner { min-height: 72svh; }
}
@media (max-width: 639px) {
  .about__inner { min-height: 100svh; } /* one full screen, same as the hero */
}

/* 5. Projects
   Desktop: full-width list, name left and details right; hovering a finished project rolls its word into colour.
   Below 900px: an accordion, one project open at a time, all closed at first. */
.projects { background: var(--ink); color: var(--paper); }
.projects .section-title i { color: var(--yellow); }
.projects__lede { margin: 2rem 0 0; max-width: 40ch; font-size: clamp(1.7rem, 1.6vw, 2rem); line-height: 1.5; color: rgba(251, 239, 230, .82); }

.projects-grid {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-top: clamp(4rem, 5vw, 5.6rem);
  border-top: 2.5px solid var(--paper);
  border-bottom: 2.5px solid var(--paper);
}
.project { display: flex; flex-direction: column; align-items: center; padding: clamp(4rem, 4.5vw, 5.2rem) clamp(.8rem, 3vw, 4rem); }

.project--wip { --c: #7E9BE6; }
.project--memory { --c: var(--coral); }
.project--notes { --c: #F06FA0; }
.project--bistro { --c: #7FCBA0; }

.project__head { display: flex; flex-direction: column; align-items: center; }
.project__word {
  display: block;
  height: 1.1em;
  overflow: hidden;
  font-weight: 700;
  font-size: clamp(5.6rem, 7vw, 8.8rem);
  line-height: 1.1;
  letter-spacing: -.05em;
  color: var(--paper);
}
.project__reel { display: block; transition: transform .7s var(--ease-io); }
.project__reel > span { display: block; height: 1.1em; white-space: nowrap; }
.project__reel > span i { color: var(--c); }
.project__reel > span + span { margin-top: .35em; color: var(--c); } /* gap keeps descenders (the y in Memory) out of view after the roll */
.project__reel > span + span i { color: var(--paper); }
/* the in-progress word is outlined: the stroke is drawn outside the letters (paint-order) so lines never cross
   inside or between them, and it never rolls, so nothing is clipped (keeps the p's tail whole) */
.project--wip .project__word { overflow: visible; color: var(--ink); -webkit-text-stroke: 4px var(--paper); paint-order: stroke fill; }
.project--wip .project__word i { color: var(--ink); -webkit-text-stroke: 4px var(--c); paint-order: stroke fill; }

.project__meta { margin: 1rem 0 0; font-family: var(--mono); font-weight: 500; font-size: 1.15rem; letter-spacing: .16em; text-transform: uppercase; }
.project__toggle { display: none; }

.project__body { width: 100%; display: grid; grid-template-rows: 1fr; }
.project__inner { min-height: 0; overflow: hidden; }
.project__content { display: flex; flex-direction: column; align-items: center; }
.project__desc { margin: 1.6rem 0 0; max-width: 40ch; min-height: 10.4rem; font-size: 1.6rem; line-height: 1.62; color: rgba(251, 239, 230, .78); text-wrap: pretty; }
.project__pills { justify-content: center; margin-top: 2rem; }
.project .pill--cream { color: var(--ink); }
.project__links { margin: 2.2rem 0 0; display: flex; gap: 2.2rem; font-family: var(--mono); font-weight: 500; font-size: 1.15rem; letter-spacing: .16em; text-transform: uppercase; }
.project__links a {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  border-bottom: 1.5px solid rgba(251, 239, 230, .4);
  padding-bottom: .3rem;
  transition: color .2s, border-color .2s;
}
.project__links a:hover { color: var(--yellow); border-color: var(--yellow); }
.project__links svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.project__status { margin: 2.2rem 0 0; display: flex; align-items: center; gap: 1rem; font-family: var(--mono); font-weight: 500; font-size: 1.15rem; letter-spacing: .16em; text-transform: uppercase; }

@media (min-width: 900px) {
  .project {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: clamp(3.2rem, 5vw, 8rem);
    align-items: start;
    padding: clamp(4rem, 4.5vw, 5.6rem) 0;
    text-align: left;
  }
  .project + .project { border-top: 1.5px solid rgba(251, 239, 230, .35); }
  .project__head { align-items: flex-start; }
  .project__meta { white-space: nowrap; }
  .project__content { align-items: flex-start; }
  .project__desc { margin-top: 1.4rem; max-width: 52ch; min-height: 0; }
  .project__pills { justify-content: flex-start; }
}

@media (hover: hover) and (min-width: 900px) {
  .project:not(.project--wip):hover .project__reel { transform: translateY(-1.45em); }
}

@media (max-width: 899px) {
  .projects-grid { grid-template-columns: minmax(0, 1fr); margin-top: 4rem; text-align: left; }
  .project { padding: 0; align-items: stretch; border-right: 0 !important; border-bottom: 1.5px solid rgba(251, 239, 230, .35) !important; }
  .project:last-child { border-bottom: 0 !important; }
  .project__head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "word toggle" "meta toggle";
    column-gap: 1.2rem;
    align-items: center;
    padding: 2.2rem 0 2rem;
    cursor: pointer;
  }
  .project__word { grid-area: word; font-size: clamp(min(4.8rem, 15vw), 13vw, 7.2rem); }
  .project__meta { grid-area: meta; margin-top: 1rem; }
  .project__toggle {
    grid-area: toggle;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4.4rem;
    height: 4.4rem;
    margin-right: -1.1rem;
    padding: 0;
    border: 0;
    background: none;
    color: var(--paper);
    cursor: pointer;
  }
  .project__toggle svg { width: 2.2rem; height: 2.2rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s ease; }
  .project.is-open .project__toggle svg { transform: rotate(180deg); }
  .project:not(.project--wip).is-open .project__reel { transform: translateY(-1.45em); }
  .project--wip .project__word, .project--wip .project__word i { -webkit-text-stroke-width: 3px; }
  .project__body { grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease-io); }
  .project.is-open .project__body { grid-template-rows: 1fr; }
  .project__content { align-items: flex-start; padding-bottom: 2.8rem; }
  .project__desc { margin-top: 2px; max-width: none; min-height: 0; }
  .project__pills { justify-content: flex-start; margin-top: 1.8rem; }
  .project__links { margin-top: 1rem; gap: 2.4rem; }
  .project__links a { padding-top: 1rem; }
  .project__status { margin-top: 2rem; }
}

/* 6. Life & collection */
.life { background: var(--cream); color: var(--ink); }
.life .section-title i { color: var(--yellow); }
.life__text { margin: 2rem 0 0; max-width: 46ch; font-size: clamp(1.7rem, 1.5vw, 1.9rem); line-height: 1.6; color: rgba(27, 25, 22, .82); text-wrap: pretty; }

/* folder colours: --c tile/note colour, --stop the folder name's full stop */
.f-skies { --c: #B49CF2; --stop: #C058B8; }
.f-cats { --c: #F26C94; --stop: #CC1F5C; }
.f-cities { --c: #F5C842; --stop: #D28F07; }
.f-wildlife { --c: #5FC79A; --stop: #0E9A63; }
.f-nature { --c: #E8B0E0; --stop: #7A4FE0; }

.tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: .6rem clamp(1.8rem, 2.4vw, 3rem); margin-top: clamp(4.4rem, 5vw, 6.4rem); }
.tab { display: flex; flex-direction: column; align-items: center; gap: .8rem; padding: 0; border: 0; background: none; cursor: pointer; }
.tab__word { font-weight: 700; font-size: clamp(2.8rem, 3.4vw, 4rem); line-height: 1.1; letter-spacing: -.04em; color: rgba(27, 25, 22, .34); transition: color .25s; }
.tab__word i { color: transparent; transition: color .25s; }
.tab::after { content: ""; display: block; width: 0; height: 2.5px; background: var(--ink); transition: width .35s var(--ease-out); }
.tab[aria-selected="true"] .tab__word { color: var(--ink); }
.tab[aria-selected="true"] .tab__word i { color: var(--stop); }
.tab[aria-selected="true"]::after { width: 100%; }

.tray {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(.8rem, 1vw, 1.2rem);
  margin-top: 3.6rem;
  transition: opacity .28s ease, transform .36s var(--ease-out);
}
.tray.is-fading { opacity: 0; transform: translateY(.8rem); }
.tile {
  aspect-ratio: 4 / 5;
  padding: 0;
  border: 0;
  border-radius: 1.6rem;
  overflow: hidden;
  cursor: zoom-in;
  background: color-mix(in srgb, var(--c) 20%, transparent);
  display: block;
}
.tile img { width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); transform: scale(var(--s, 1)); transform-origin: var(--o, 50% 50%); transition: transform .5s var(--ease-out); }
.tile:hover img { transform: scale(calc(var(--s, 1) * 1.06)); }
.tile--skeleton { cursor: default; background: rgba(27, 25, 22, .09); animation: pulse 1.4s ease-in-out infinite; }
.tray__note { aspect-ratio: 4 / 5; border-radius: 1.6rem; background: var(--c); display: flex; align-items: center; justify-content: center; padding: 1.6rem; }
.tray__note span { font-family: var(--serif); font-style: italic; font-size: 2.2rem; line-height: 1.25; }
.tray-caption { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem 1.8rem; margin: 2rem 0 0; font-family: var(--mono); font-weight: 500; font-size: 1.15rem; letter-spacing: .16em; text-transform: uppercase; color: rgba(27, 25, 22, .62); }
.tray-caption__name { color: var(--ink); }

.folders { display: none; }
.folders { width: 100%; margin-top: 4rem; border-top: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); text-align: left; }
.folder + .folder { border-top: 1.5px solid rgba(27, 25, 22, .3); }
.folder__head { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; width: 100%; padding: 1.2rem 0 1rem; border: 0; background: none; cursor: pointer; text-align: left; }
.folder__label { flex: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .8rem; min-width: 0; } /* credit drops below the name only if it can't fit beside it */
.folder__word { font-weight: 700; font-size: 2.8rem; line-height: 1.1; letter-spacing: -.04em; }
.folder__word i { color: var(--stop); }
.folder__credit { white-space: nowrap; font-family: var(--mono); font-weight: 500; font-size: 1.1rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(27, 25, 22, .62); }
.folder__head svg { flex: none; width: 2rem; height: 2rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s ease; }
.folder.is-open .folder__head svg { transform: rotate(180deg); }
.folder__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease-io); }
.folder.is-open .folder__body { grid-template-rows: 1fr; }
.folder__inner { min-height: 0; overflow: hidden; }
.folder__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; padding: 2px 0 1.8rem; }
.folder__tile { position: relative; aspect-ratio: 4 / 5; padding: 0; border: 0; border-radius: 1.4rem; overflow: hidden; cursor: zoom-in; background: rgba(27, 25, 22, .06); display: block; }
.folder__tile::before { content: ""; position: absolute; inset: 0; background: rgba(27, 25, 22, .09); animation: pulse 1.4s ease-in-out infinite; }
.folder__tile img { position: relative; width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); transform: scale(var(--s, 1)); transform-origin: var(--o, 50% 50%); opacity: 0; transition: opacity .35s ease; }
.folder__tile.is-loaded::before { display: none; }
.folder__tile.is-loaded img { opacity: 1; }

@media (max-width: 1023px) {
  .tray { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tray__note { display: none; }
}
@media (max-width: 639px) {
  .tabs, .tray, .tray-caption { display: none; }
  .folders { display: block; }
}

/* 7. Hello & footer */
.hello { background: var(--pink); color: var(--pink-ink); }
.hello__inner {
  max-width: 128rem;
  margin: 0 auto;
  padding: clamp(4.8rem, 5.2vw, 6.2rem) var(--gutter) 2.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hello__title { margin: 0; font-weight: 600; font-size: clamp(3.4rem, 4vw, 4.4rem); line-height: 1.08; letter-spacing: -.03em; }
.hello__title i { color: var(--yellow); }
.hello__text { margin: 1.2rem 0 0; font-size: 1.7rem; color: rgba(42, 14, 28, .82); }
.contact { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: clamp(.8rem, 2vw, 1rem); margin-top: 2.8rem; }
.contact svg { width: 1.8rem; height: 1.8rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.contact__mail {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  height: 4.4rem;
  padding: 0 clamp(1.4rem, 4vw, 1.8rem) 0 clamp(1.2rem, 3.6vw, 1.5rem);
  border-radius: 99.9rem;
  background: var(--ink);
  color: var(--cream);
  transition: background .2s;
}
.contact__mail:hover { background: var(--pink-ink); color: var(--cream); }
.contact__mail span { font-family: var(--mono); font-size: clamp(min(1.2rem, 3.75vw), 3.2vw, 1.3rem); }
.contact__icon {
  width: 4.4rem;
  height: 4.4rem;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px rgba(42, 14, 28, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s;
}
.contact__icon:hover { background: var(--pink-ink); color: var(--pink); }
.site-footer {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .8rem 2.8rem;
  margin-top: clamp(4rem, 5vw, 5.4rem);
  padding-top: 1.6rem;
  border-top: 1px solid rgba(42, 14, 28, .2);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(42, 14, 28, .8);
}
.site-footer a { color: var(--pink-ink); }
.site-footer a:hover { color: var(--pink-ink); opacity: .6; }

@media (max-width: 1023px) {
  .site-footer { justify-content: space-between; gap: 1.2rem 1.6rem; }
}

/* 8. Menu (phones) */
.menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  overflow-y: auto; /* scrolls if the links are taller than the screen (short screens, large browser text) */
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s;
}
.menu.is-open { opacity: 1; visibility: visible; transition: opacity .3s ease, visibility 0s; }
.menu__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2.2rem calc(2rem + var(--sbw, 0px)) 0 2rem; /* --sbw is set by script.js while scrolling is locked */
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.menu__bar .site-header__mark { color: var(--paper); }
.menu__close {
  display: inline-flex;
  align-items: center;
  gap: .9rem;
  height: 4rem;
  padding: 0 1.6rem;
  border: 0;
  border-radius: 99.9rem;
  background: var(--paper);
  color: var(--ink);
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.menu__close span { font-size: 1.5rem; line-height: 1; }
.menu__nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 4.8rem calc(2rem + var(--sbw, 0px)) 4rem 2rem;
  transform: translateY(1.6rem);
  transition: transform .45s var(--ease-out);
}
.menu.is-open .menu__nav { transform: none; }
.menu__link {
  display: block;
  padding: 1rem 0 1.2rem;
  border-bottom: 1.5px solid rgba(251, 239, 230, .16);
  font-weight: 700;
  font-size: 4.8rem;
  line-height: 1.05;
  letter-spacing: -.05em;
  color: var(--paper);
  transition: color .25s;
}
.menu__link:first-child { border-top: 2.5px solid var(--paper); }
.menu__link:last-child { border-bottom: 2.5px solid var(--paper); }
.menu__link i { color: var(--c); }
.menu__link:hover, .menu__link:active { color: var(--c); }
/* each menu link's full stop has its own colour (not the page-wide yellow) */
.menu__link:focus-visible { outline-offset: -.6rem; } /* inside the divider lines */
.menu__link--about { --c: #6FA8F5; }
.menu__link--projects { --c: var(--pink); }
.menu__link--life { --c: var(--green); }
.menu__link--hello { --c: var(--yellow); }

/* 9. Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(20, 18, 15, .94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7.2rem 9.6rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s;
}
.lightbox.is-open { opacity: 1; visibility: visible; transition: opacity .25s ease, visibility 0s; }
.lightbox__bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2.2rem clamp(1.6rem, 3vw, 3.2rem);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(244, 238, 226, .8);
}
.lightbox__close { padding: 0; border: 0; background: none; color: var(--cream); letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 4.8rem;
  height: 4.8rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(244, 238, 226, .12);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s;
}
.lightbox__nav:hover { background: rgba(244, 238, 226, .24); }
.lightbox__nav svg { width: 2rem; height: 2rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lightbox__nav--prev { left: 2.4rem; }
.lightbox__nav--next { right: 2.4rem; }
.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 1rem;
  transition: opacity .24s ease, transform .32s var(--ease-out);
}
.lightbox__img.is-hidden { opacity: 0; transform: scale(.985); }
.lightbox__img.is-xfade { opacity: 0; transition: none; }
.lightbox__ghost {
  position: fixed;
  margin: 0;
  object-fit: contain;
  border-radius: 1rem;
  pointer-events: none;
  transition: opacity .6s ease-in-out;
}
@media (prefers-reduced-motion: reduce) { .lightbox__ghost { transition-duration: .01s; } }
.lightbox__skeleton {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(78vw, 57.6vh, 65.6rem);
  aspect-ratio: 4 / 5;
  border-radius: 1rem;
  background: rgba(244, 238, 226, .09);
  animation: pulse 1.4s ease-in-out infinite;
  pointer-events: none;
}
.lightbox.is-loading .lightbox__skeleton { display: block; }
.lightbox__credit {
  position: absolute;
  bottom: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 3.2rem);
  margin: 0;
  text-align: center;
  font-size: 1.5rem;
  color: rgba(244, 238, 226, .75);
}
.lightbox__credit a { color: var(--cream); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .3rem; }
.lightbox__credit a:hover { color: var(--yellow); }

@media (max-width: 639px) {
  /* one bottom bar: prev at the left edge, credit centred, next at the right edge */
  .lightbox { padding: 6.4rem 1.2rem 8.4rem; }
  .lightbox__nav { top: auto; bottom: 1.8rem; transform: none; }
  .lightbox__nav--prev { left: 1.2rem; }
  .lightbox__nav--next { right: 1.2rem; }
  .lightbox__credit { bottom: calc(4.2rem - .65em); max-width: calc(100% - 14.4rem); line-height: 1.3; } /* first line centred on the arrows; extra lines grow upward, never off-screen */
  .lightbox__credit a { white-space: nowrap; } /* a long name wraps as a whole, never mid-name */
}
