/* Maisam Haider - portfolio. Paper, ink and one red sun. Edit here, then run build.ps1. */

:root {
  color-scheme: light;
  --paper: #E9E7E2;
  --card: #F3F2EE;
  --ink: #141414;
  --red: #BE1E17;
  --red-on-ink: #FF6A5E;
  --mute-on-ink: #B9B6AF;
  --rule-on-ink: #55534F;
  --display: 'Antonio', 'Oswald', 'Arial Narrow', sans-serif;
  --cond: 'IBM Plex Sans Condensed', 'Arial Narrow', sans-serif;
  --body: 'IBM Plex Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--paper);
  /* Paper grain: two dot screens at different pitches, so no grid shows. */
  background-image: radial-gradient(rgba(20, 20, 20, .05) .8px, transparent 1px), radial-gradient(rgba(20, 20, 20, .04) .8px, transparent 1px);
  background-size: 5px 5px, 7px 7px;
  background-position: 0 0, 2px 3px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
}
main { display: block; overflow-x: clip; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: inherit; }

.wrap { max-width: 1440px; margin: 0 auto; padding-left: clamp(20px, 4.45vw, 64px); padding-right: clamp(20px, 4.45vw, 64px); }
.an { font-family: var(--display); text-transform: uppercase; }
.cap { font-family: var(--cond); font-size: 12px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; }
.red { color: var(--red); }
.hot { font-weight: 700; color: var(--red); }
.skip { position: absolute; left: -999px; top: 0; padding: 12px 16px; background: var(--ink); color: var(--paper); }
.skip:focus { left: 0; z-index: 10; }

/* ---- links and buttons -------------------------------------------------- */
.navl { position: relative; display: inline-block; padding: 16px 0; }
.navl::after { content: ""; position: absolute; left: 0; right: 0; bottom: 10px; height: 1px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .35s ease; }
.navl:hover::after, .navl[aria-current]::after { transform: scaleX(1); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; height: 52px; padding: 0 28px; font-family: var(--cond); font-size: 13px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; transition: transform .25s ease, background-color .25s ease, color .25s ease; }
.btn:hover { transform: translateY(-3px); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--red { background: var(--red); color: #fff; }
.btn--line { border: 1px solid var(--ink); }
.btn--line:hover { background: var(--ink); color: var(--paper); }
.btn svg, .es svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- header ------------------------------------------------------------- */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 24px; min-height: 72px; }
.top__name { font-weight: 600; }
.top nav { display: flex; flex-wrap: wrap; gap: 0 36px; }
.pill { display: inline-flex; align-items: center; gap: 12px; }
.dot { position: relative; width: 8px; height: 8px; }
.dot::before, .dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--red); }
.dot::before { animation: pulse 1.8s ease-out infinite; }
@media (max-width: 700px) {
  .top { padding-top: 8px; }
  .top nav { order: 3; width: 100%; gap: 0 28px; }
}
@keyframes pulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(3.2); opacity: 0; } }

/* ---- hero: the poster --------------------------------------------------- */
.hero { padding-top: 28px; padding-bottom: 72px; text-align: center; }
.hero__name { margin-top: 12px; padding-left: .42em; font-size: clamp(26px, 7.5vw, 110px); line-height: 1.1; font-weight: 500; letter-spacing: .42em; }
/* The name gathers from a wide spread. Only transform and opacity move, so it stays smooth. */
.hero__name .w { display: inline-block; white-space: nowrap; }
.hero__name .ch { display: inline-block; will-change: transform, opacity; animation: gather 1.6s var(--ease) both; }
@keyframes gather { from { opacity: 0; transform: translateX(calc(var(--o) * .5em)); } to { opacity: 1; transform: translateX(0); } }
.credits { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 14px; margin-top: 18px; }
.credits i { font-family: var(--cond); font-size: 12px; font-style: normal; color: #6B6862; }
@media (max-width: 900px) {
  .credits { gap: 6px 22px; }
  .credits i { display: none; }
}
.fade { animation: fade 1s ease both; animation-delay: var(--d, 0s); }
@keyframes fade { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }

.poster { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px 16px; margin-top: 20px; }
.poster__say { flex: 1 1 200px; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; text-align: right; }
.poster__say p { font-size: clamp(28px, 3.3vw, 49px); line-height: 1.04; font-weight: 600; letter-spacing: .04em; color: var(--red); }
.poster__art { flex: 0 1 clamp(340px, 60vh, 580px); align-self: flex-start; position: relative; aspect-ratio: 620 / 740; }
.poster__bio { flex: 1 1 200px; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 16px; padding-bottom: 48px; text-align: left; }
.poster__bio p { max-width: 300px; font-size: 15px; line-height: 1.55; text-wrap: pretty; }
.poster__year { font-size: 30px; line-height: 1; font-weight: 500; letter-spacing: .12em; color: var(--red); }
@media (max-width: 1100px) {
  .poster__say, .poster__bio { flex-basis: 100%; align-items: center; text-align: center; padding-bottom: 0; }
}

.sun { position: absolute; left: 10%; top: 5%; width: 80%; aspect-ratio: 1 / 1; border-radius: 50%; background: var(--red); animation: sunin 1.5s var(--ease) .25s both; }
@keyframes sunin { from { scale: 0; } to { scale: 1; } }
.lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: none; stroke: var(--ink); stroke-width: 1; opacity: .4; }
.lines * { stroke-dasharray: 2000; animation: draw 2.8s ease .5s both; }
@keyframes draw { from { stroke-dashoffset: 2000; } to { stroke-dashoffset: 0; } }
.figure { position: absolute; left: 50%; top: 12%; width: 56%; translate: -50% 0; fill: var(--ink); animation: figin 1.3s var(--ease) .7s both; }
.figure--photo { top: auto; bottom: 25%; width: auto; height: 64%; filter: grayscale(1) contrast(1.12); -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent); mask-image: linear-gradient(to bottom, #000 82%, transparent); }
@keyframes figin { from { opacity: 0; translate: -50% 48px; } to { opacity: 1; translate: -50% 0; } }
.drips { position: absolute; left: 25.5%; top: 74%; width: 49%; height: 26%; display: flex; align-items: flex-start; }
.drips span { flex: var(--w) 1 0; height: var(--h); background: var(--ink); transform-origin: top; animation: drip 1.8s cubic-bezier(.5, 0, .2, 1) var(--d) both, ooze 5s ease-in-out calc(var(--d) + 1.8s) infinite alternate; }
.drips .gap { background: transparent; }
@keyframes drip { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes ooze { from { transform: scaleY(1); } to { transform: scaleY(.76); } }
/* A finished artwork brings its own sun and lines: it opens from the sun's centre. */
.poster__art--artwork { aspect-ratio: auto; }
.artwork { display: block; width: 100%; height: auto; filter: saturate(.85); animation: open 3.4s cubic-bezier(.45, 0, .25, 1) .35s both; }
/* Slow on purpose: the circle only has to reach 90% to uncover the whole picture, so none of the time is spent off-canvas. */
@keyframes open { from { opacity: 0; clip-path: circle(0% at var(--fx, 50%) var(--fy, 30%)); } 35% { opacity: 1; } to { opacity: 1; clip-path: circle(95% at var(--fx, 50%) var(--fy, 30%)); } }
/* Thin streaks that run on from the painted ones; their tops fade into the picture. */
/* A colour photograph: kept in colour (the chair is the red), the drawing behind it, the bottom running into ink. */
.poster__art--photo { flex-basis: clamp(360px, 76vh, 640px); aspect-ratio: auto; }
.poster__art--photo .lines { z-index: 0; }
.photo { position: relative; z-index: 1; display: block; width: 88%; height: auto; margin: 0 auto; filter: saturate(.88) contrast(1.03); -webkit-mask-image: linear-gradient(to bottom, #000 72%, rgba(0, 0, 0, .55) 86%, transparent 97%); mask-image: linear-gradient(to bottom, #000 72%, rgba(0, 0, 0, .55) 86%, transparent 97%); animation: photoin 1.6s var(--ease) .35s both; }
@keyframes photoin { from { opacity: 0; translate: 0 36px; } to { opacity: 1; translate: 0 0; } }
.poster__art--photo .drips { left: 18%; top: 76%; width: 64%; height: 28%; z-index: 2; }
.poster__art--artwork .drips, .poster__art--photo .drips { left: 16%; top: 80%; width: 62%; height: 23%; justify-content: space-between; -webkit-mask-image: linear-gradient(to bottom, transparent, #000 45%); mask-image: linear-gradient(to bottom, transparent, #000 45%); }
.poster__art--artwork .drips span, .poster__art--photo .drips span { flex: 0 0 calc(var(--w) * 1.4px); animation-delay: calc(var(--d) + 2.2s), calc(var(--d) + 4s); }
.poster__art--photo .drips { top: 76%; height: 28%; }
.poster__art--photo .drips span { animation-delay: calc(var(--d) + 1.2s), calc(var(--d) + 3s); }
.drips .hot { background: var(--red); }
.hero__cta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin-top: 20px; }
.hero__cta .btn { padding: 0 22px; }
@media (max-width: 1100px) {
  .hero__cta { justify-content: center; }
}

/* ---- the rule: one line, set as large as the name ---------------------------- */
.rule { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.rule > .wrap { padding-top: 56px; padding-bottom: 56px; }
.rule__line { margin: 28px 0 20px; font-size: clamp(40px, 8.4vw, 124px); line-height: 1; font-weight: 500; letter-spacing: .04em; }
.rule__line span { display: inline-block; white-space: nowrap; }
.rule__line b { font-weight: inherit; color: var(--red); }
.rule__note { max-width: 520px; font-size: 18px; line-height: 1.55; text-wrap: pretty; }

/* ---- about -------------------------------------------------------------- */
.about { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 64px; padding-top: 96px; padding-bottom: 96px; }
.about__lead { flex: 1 1 520px; max-width: 720px; }
.about__lead .measure { margin-bottom: 32px; }
.about__lead p { font-size: clamp(34px, 3.9vw, 56px); line-height: 1.08; font-weight: 500; letter-spacing: .02em; text-wrap: balance; }
.about__facts { flex: 0 1 480px; }
.about__facts > p { margin-bottom: 24px; line-height: 1.65; text-wrap: pretty; }
.facts { margin: 0; border-bottom: 1px solid var(--ink); }
.facts div { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding: 16px 0; border-top: 1px solid var(--ink); }
.facts dd { margin: 0; font-size: 16px; text-align: right; }
.about__facts .btn { margin-top: 32px; }
.xp { flex: 1 1 100%; }
.xp__row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px 48px; align-items: start; margin-top: 16px; padding: 28px 0; border-bottom: 1px solid var(--ink); }
.xp__years { padding-top: 0; }
.xp__what h3 { font-size: clamp(28px, 2.8vw, 38px); line-height: 1.1; font-weight: 400; letter-spacing: .12em; }
.xp__what p { margin-top: 10px; line-height: 1.6; }
.xp__points { margin: 0; padding: 0; list-style: none; font-size: 16px; line-height: 1.55; }
.xp__points li { position: relative; padding-left: 20px; }
.xp__points li + li { margin-top: 10px; }
.xp__points li::before { content: ""; position: absolute; left: 0; top: .62em; width: 6px; height: 6px; background: var(--ink); }
@media (min-width: 900px) {
  .xp__row { grid-template-columns: 160px minmax(0, 1fr) minmax(0, 1.5fr); }
  .xp__years { padding-top: 12px; }
}

/* ---- work: poster rows, then a list ---------------------------------------- */
.band { border-top: 1px solid var(--ink); }
.band > .wrap { padding-top: 96px; padding-bottom: 96px; }
.title { margin-bottom: 48px; text-align: center; }
.title .cap { margin-bottom: 12px; }
.title h1, .title h2 { padding-left: .42em; font-size: clamp(26px, 3.9vw, 56px); line-height: 1.1; font-weight: 300; letter-spacing: .42em; }

.film { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); align-items: center; gap: 32px 64px; padding: 40px 0; border-top: 1px solid var(--ink); }
.film__head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 20px; }
.film__text h3 { font-size: clamp(34px, 4.6vw, 68px); line-height: 1.05; font-weight: 300; letter-spacing: .2em; }
/* An app's real icon, with the rounded square the store gives it. */
.appicon { flex: none; width: 72px; height: 72px; border-radius: 22%; box-shadow: 0 0 0 1px rgba(20, 20, 20, .28); }
.appicon--none { border-radius: 50%; box-shadow: none; border: 1px solid var(--ink); opacity: .45; }
.idx .appicon { width: 40px; height: 40px; }
.film__line { max-width: 420px; margin: 16px 0 20px; font-size: 20px; line-height: 1.45; }
.film__tags { margin-bottom: 32px; }
/* Only the stage is clipped (it holds the oversized number and the drawing); the text side is left alone so nothing at its edge gets shaved. */
.film__stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 600px; overflow: clip; view-timeline: --stage block; }
.film__no { position: absolute; right: -2%; bottom: -8%; font-size: clamp(220px, 30vw, 420px); line-height: .8; font-weight: 700; letter-spacing: -.02em; color: #DAD7CF; }
.motif { position: absolute; left: 50%; top: 50%; width: 600px; height: 600px; translate: -50% -50%; overflow: visible; fill: none; stroke: var(--ink); stroke-width: 1; }
.motif > * { opacity: .45; }
.motif .fill { fill: var(--red); stroke: none; opacity: 1; }
.film__shot { position: relative; width: 250px; height: auto; border: 1px solid var(--ink); border-radius: 26px; transition: transform .45s var(--ease), box-shadow .45s ease; }
.film:hover .film__shot { transform: translate(-6px, -6px); box-shadow: 12px 12px 0 var(--ink); }
/* Three phones side by side, none hiding another; the middle one sits a little higher. */
.film__shots { position: relative; display: flex; align-items: center; justify-content: center; gap: 3%; width: 100%; max-width: 600px; }
.film__shots .film__shot { width: 31.3%; border-radius: 20px; }
.film__shots .film__shot--c { translate: 0 -5%; }
.film:hover .film__shots .film__shot { transform: translateY(-8px); box-shadow: 8px 8px 0 var(--ink); }
@media (min-width: 900px) {
  .film:nth-child(even) .film__stage { order: -1; }
  .film:nth-child(even) .film__no { right: auto; left: -2%; }
}
@media (max-width: 899px) {
  .film__stage { min-height: 560px; }
}

/* A dimension line, as on a drawing: label, then a rule with a tick at each end. */
.measure { display: flex; align-items: center; gap: 16px; }
.measure i { flex: 1; height: 9px; border-left: 1px solid var(--ink); border-right: 1px solid var(--ink); background: linear-gradient(var(--ink), var(--ink)) center / 100% 1px no-repeat; }
.more-work { margin-top: 72px; }
.idxlist { margin-top: 16px; border-bottom: 1px solid var(--ink); }
.idx { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 24px 0; border-top: 1px solid var(--ink); }
.idxlist .idx:first-child { border-top: 0; }
.idx__no { width: 32px; }
.idx__name { flex: 1 1 240px; font-size: 26px; line-height: 1.2; font-weight: 400; letter-spacing: .2em; transition: transform .35s var(--ease), color .25s ease; }
.idx__line { flex: 1.5 1 300px; font-size: 16px; line-height: 1.5; }
.idx__tags { width: 240px; line-height: 1.7; }
.idx__status { width: 170px; }
.idx svg, .idx__sp { width: 26px; height: 26px; }
.idx svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s ease, color .25s ease; }
a.idx:hover .idx__name { transform: translateX(12px); color: var(--red); }
a.idx:hover svg { transform: translate(4px, -4px); color: var(--red); }

/* ---- essays ------------------------------------------------------------- */
.night { position: relative; overflow: clip; background: var(--ink); color: var(--paper); }
.night > .wrap { position: relative; padding-top: 96px; padding-bottom: 96px; }
.night__sun { position: absolute; right: -130px; top: -150px; width: 440px; height: 440px; border-radius: 50%; background: var(--red); animation: float 9s ease-in-out infinite alternate; }
@keyframes float { from { translate: 0 0; } to { translate: -18px 22px; } }
.night h2 { margin: 12px 0 40px; font-size: clamp(26px, 3.9vw, 56px); line-height: 1.1; font-weight: 300; letter-spacing: .42em; }
.night .hot { color: var(--red-on-ink); }
.eslist { max-width: 960px; border-bottom: 1px solid var(--rule); --rule: var(--ink); --soft: #55534F; --hover: var(--red); }
.night .eslist { --rule: var(--rule-on-ink); --soft: var(--mute-on-ink); --hover: var(--red-on-ink); }
.es { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 28px 0; border-top: 1px solid var(--rule); }
.es__date { width: 130px; color: var(--soft); }
.es__kind { width: 70px; color: var(--soft); }
.es__title { flex: 1 1 320px; font-size: clamp(22px, 2.1vw, 30px); line-height: 1.2; font-weight: 500; transition: transform .35s var(--ease), color .25s ease; }
.es__title small { display: block; margin-top: 6px; font-size: 15px; font-weight: 400; line-height: 1.5; color: var(--soft); }
.es svg { opacity: 0; transform: translateX(-12px); transition: opacity .3s ease, transform .3s ease; color: var(--hover); }
.es:hover .es__title { transform: translateX(16px); color: var(--hover); }
.es:hover .es__title small { color: var(--soft); }
.es:hover svg { opacity: 1; transform: none; }
.soon { max-width: 560px; font-size: 20px; line-height: 1.5; }
.more { margin-top: 32px; }

/* ---- an essay ----------------------------------------------------------- */
.essay { max-width: 760px; margin: 0 auto; padding: 56px clamp(20px, 4.45vw, 40px) 96px; }
.essay__meta { margin: 40px 0 16px; color: var(--red); }
.essay__title { font-size: clamp(36px, 5.6vw, 64px); line-height: 1.05; font-weight: 500; letter-spacing: .01em; text-wrap: balance; }
.essay__sum { margin-top: 20px; font-size: 21px; line-height: 1.5; text-wrap: pretty; }
.essay__mark { display: flex; align-items: center; gap: 16px; margin: 40px 0; }
.essay__mark i { width: 28px; height: 28px; border-radius: 50%; background: var(--red); }
.essay__mark b { flex: 1; height: 1px; background: var(--ink); }
.prose { font-size: 19px; line-height: 1.75; }
.prose > * + * { margin-top: 1.2em; }
.prose h2 { margin-top: 2em; font-family: var(--display); font-size: 30px; line-height: 1.15; font-weight: 500; letter-spacing: .03em; text-transform: uppercase; }
.prose a { text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 4px; }
.prose blockquote { margin: 1.6em 0; font-family: var(--display); font-size: 30px; line-height: 1.25; font-weight: 500; letter-spacing: .02em; text-transform: uppercase; color: var(--red); }
.prose code { font-size: .9em; padding: 2px 6px; background: var(--card); border: 1px solid #C9C6BF; }
.prose img { max-width: 100%; height: auto; }
.essay__end { margin-top: 64px; padding-top: 8px; border-top: 1px solid var(--ink); }

/* ---- contact and footer ------------------------------------------------- */
.contact { text-align: center; }
.contact > .wrap { padding-top: 96px; }
.contact h2 { margin-top: 16px; padding-left: .3em; font-size: clamp(36px, 8.3vw, 120px); line-height: 1.1; font-weight: 300; letter-spacing: .3em; }
.contact__say { max-width: 480px; margin: 24px auto 16px; }
.contact__mail { display: block; width: fit-content; margin: 0 auto; font-size: clamp(24px, 3.4vw, 34px); line-height: 1.2; font-weight: 500; letter-spacing: .08em; text-transform: none; }
.contact__mail--caps { text-transform: uppercase; letter-spacing: .14em; }
.contact__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 36px; max-width: 860px; margin: 20px auto 0; }
.dawn { position: relative; height: 260px; margin-top: 64px; overflow: clip; }
.dawn__sun { position: absolute; left: 50%; top: 0; width: min(620px, 92%); aspect-ratio: 1 / 1; margin-left: max(-310px, -46%); border-radius: 50%; background: var(--red); }
.dawn__foot { position: absolute; left: 0; right: 0; bottom: 20px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0 32px; color: #fff; }
.dawn__foot .navl::after { background: #fff; }
.plainfoot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0 24px; border-top: 1px solid var(--ink); }

/* ---- lost --------------------------------------------------------------- */
.lost { padding-top: 96px; padding-bottom: 120px; text-align: center; }
.lost h1 { font-size: clamp(80px, 20vw, 240px); line-height: 1; font-weight: 700; color: var(--red); }
.lost p { margin: 16px 0 32px; }

/* ---- reveal on scroll (browsers that can); everything is visible without it */
@keyframes grow { from { scale: 0; } to { scale: 1; } }
@keyframes rv { from { opacity: 0; translate: 0 48px; } to { opacity: 1; translate: 0 0; } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .rv { animation: rv linear both; animation-timeline: view(); animation-range: entry 5% entry 75%; }
    .motif > * { stroke-dasharray: 2000; animation: draw linear both; animation-timeline: --stage; animation-range: entry 15% cover 45%; }
    .motif .fill { stroke-dasharray: none; transform-box: fill-box; transform-origin: center; animation-name: grow; }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
