/* Preview only (?palette=tomato): the earlier cream, ink, tomato option. */
:root[data-palette="tomato"] {
  --bg: #f3eee3; --fg: #141414;
  --alt-bg: #141414; --alt-fg: #f3eee3;
  --accent: #ff4b1f; --accent-fg: #141414;
}

/* Two main colors + one accent: cobalt, cream, lime. */
:root {
  --bg: #2234e8; --fg: #f3eee3;
  --alt-bg: #f3eee3; --alt-fg: #2234e8;
  --accent: #d7ff3a; --accent-fg: #10164f;
}
:root {
  --display: "Bricolage Grotesque", "Arial Black", sans-serif;
  --body: "Instrument Sans", system-ui, sans-serif;
  --gutter: clamp(16px, 3vw, 40px);
  --ease: cubic-bezier(.2, .7, .1, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 17px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
::selection { background: var(--accent); color: var(--accent-fg); }

/* ---------- shared type ---------- */
.mega, .big, .rows__brand, .card__t, .posts__t, .foot__hey, .foot__mail, .series__t {
  font-family: var(--display); font-weight: 800; letter-spacing: -.035em; line-height: .86;
  font-variation-settings: "wdth" 85;
}
.big { font-size: clamp(56px, 11vw, 168px); }
.ul { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size .35s var(--ease); }
.ul:hover { background-size: 100% 1.5px; }
.arrow { display: inline-block; font-style: normal; transition: transform .35s var(--ease); }

/* ---------- top bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto; z-index: 30;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px var(--gutter); font-weight: 600; font-size: 15px;
  background: var(--bg); color: var(--fg);
  transition: transform .4s var(--ease);
}
.bar.is-hidden { transform: translateY(-100%); }
.bar__nav { display: flex; gap: clamp(12px, 2vw, 28px); }
.bar a { position: relative; }
.bar__nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease);
}
.bar__nav a:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- hero ---------- */
.hero {
  min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 96px var(--gutter) clamp(24px, 4vw, 48px);
}
/* sized so "Rostampisheh" spans the page width */
.mega { font-size: min(17.4vw, 330px); margin-left: -.04em; }
.mega .line { display: block; overflow: hidden; padding-bottom: .04em; }
.mega .split { white-space: nowrap; }
.mega .char { display: inline-block; transform: translateY(105%); transition: transform .9s var(--ease); transition-delay: calc(var(--i) * 28ms + 120ms); }
.is-ready .mega .char { transform: none; }
.mega .char:hover { color: var(--accent); transition: color .15s, transform .9s var(--ease); }
.hero__row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px 32px; flex-wrap: wrap;
  margin-top: clamp(20px, 3vw, 36px); padding-top: 16px; border-top: 2px solid currentColor;
  font-size: clamp(18px, 1.8vw, 24px); font-weight: 500;
}
.hero__route { display: flex; align-items: center; gap: 12px; }

/* ---------- brand marquee ---------- */
.marquee { overflow: hidden; background: var(--accent); color: var(--accent-fg); padding: 14px 0; }
.marquee__track { display: flex; width: max-content; animation: slide 60s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee span {
  font: 800 clamp(28px, 4vw, 52px)/1 var(--display); letter-spacing: -.02em; font-variation-settings: "wdth" 85;
  padding: 0 .5em; white-space: nowrap;
}
.marquee span::after { content: "✳"; display: inline-block; margin-left: 1em; font-size: .6em; vertical-align: .25em; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.sec { padding: clamp(80px, 12vw, 180px) var(--gutter); }
.sec--ink { background: var(--alt-bg); color: var(--alt-fg); }
.sec--accent { background: var(--accent); color: var(--accent-fg); }
.sec__head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 24px; flex-wrap: wrap;
  margin-bottom: clamp(32px, 5vw, 72px);
}
.sec__meta { font-weight: 500; font-size: 15px; padding-bottom: .6em; }

/* ---------- work rows ---------- */
.rows { list-style: none; margin: 0; padding: 0; border-top: 2px solid currentColor; }
.rows li { border-bottom: 2px solid currentColor; }
.rows button {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%;
  display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 8px 16px;
  padding: clamp(14px, 2vw, 22px) 0; position: relative; isolation: isolate;
}
.rows button::before { /* accent wipe */
  content: ""; position: absolute; inset: 0 calc(var(--gutter) * -1); z-index: -1; background: var(--accent);
  transform: scaleY(0); transform-origin: bottom; transition: transform .45s var(--ease);
}
.rows button:hover::before, .rows button:focus-visible::before { transform: scaleY(1); }
.rows button:hover, .rows button:focus-visible { color: var(--accent-fg); }
.rows__brand {
  font-size: clamp(40px, 7.5vw, 120px);
  transition: font-variation-settings .5s var(--ease), transform .5s var(--ease);
}
.rows button:hover .rows__brand { font-variation-settings: "wdth" 100; transform: translateX(.08em); }
.rows__meta { text-align: right; font-size: 15px; font-weight: 500; line-height: 1.3; }
.rows__meta b { display: block; font-weight: 600; }

/* cursor-follow peek image */
.peek {
  position: fixed; left: 0; top: 0; z-index: 25; pointer-events: none;
  width: clamp(220px, 22vw, 340px); aspect-ratio: 16/10; overflow: hidden;
  opacity: 0; scale: .85; rotate: -3deg; transition: opacity .25s, scale .35s var(--ease), rotate .35s var(--ease);
  translate: var(--x, 0) var(--y, 0);
}
.peek.is-on { opacity: 1; scale: 1; rotate: 2deg; }
.peek img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- project cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: clamp(16px, 2vw, 28px); }
.card {
  display: grid; align-content: start; gap: 14px; min-height: clamp(380px, 40vw, 560px);
  padding: clamp(20px, 2.6vw, 36px); background: var(--bg); color: var(--fg);
  border-radius: 28px; position: relative; overflow: hidden;
  transition: transform .5s var(--ease), border-radius .5s var(--ease);
}
.card--alt { background: var(--accent); color: var(--accent-fg); }
.card:hover { transform: translateY(-6px) rotate(-.6deg); border-radius: 44px; }
.card__t { font-size: clamp(72px, 10vw, 150px); margin-top: auto; transition: letter-spacing .5s var(--ease); }
.card:hover .card__t { letter-spacing: -.01em; }
.card__line { font-size: clamp(20px, 2vw, 26px); font-weight: 600; }
.card__d { max-width: 44ch; }
.card__go { font-weight: 600; margin-top: 8px; }
.card:hover .arrow, .posts a:hover .arrow { transform: translateX(8px); }

/* ---------- writing ---------- */
.posts { list-style: none; margin: 0; padding: 0; border-top: 2px solid currentColor; }
.posts li { border-bottom: 2px solid currentColor; }
.posts a {
  display: grid; grid-template-columns: 6.5em 1fr auto; align-items: baseline; gap: 16px;
  padding: clamp(18px, 2.4vw, 30px) 0;
}
.posts time { font-weight: 600; font-size: 15px; }
.posts__t { font-size: clamp(30px, 4.2vw, 64px); line-height: .95; transition: color .3s; }
.posts a:hover .posts__t { color: var(--accent); }
.posts .arrow { font-size: clamp(28px, 3vw, 44px); }

/* ---------- photography ---------- */
.photo { padding-left: 0; padding-right: 0; }
.photo .sec__head { padding: 0 var(--gutter); }
.series + .series { margin-top: clamp(64px, 9vw, 140px); }
.series__cover { height: 100svh; min-height: 440px; overflow: hidden; position: relative; }
.series__cover img { width: 100%; height: 115%; object-fit: cover; translate: 0 var(--py, 0); will-change: translate; }
/* On upright screens (phones), show the whole horizontal cover instead of cropping it to screen height. */
@media (max-aspect-ratio: 1/1) {
  .series__cover { height: auto; min-height: 0; }
  .series__cover img { height: auto; translate: none; }
}
.series__label {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap;
  padding: 20px var(--gutter) 24px;
}
.series__t { font-size: clamp(48px, 8vw, 128px); }
.series__meta { text-align: right; font-weight: 600; font-size: 14px; padding-bottom: .5em; }
.series__intro { padding: 0 var(--gutter) 28px; max-width: 72ch; font-size: clamp(17px, 1.4vw, 20px); }
.series__intro p + p { margin-top: .8em; }
.strip {
  display: flex; gap: 10px; overflow-x: auto; padding: 0 var(--gutter) 14px;
  scrollbar-width: none;
}
.strip::-webkit-scrollbar { display: none; }
.strip img {
  height: clamp(260px, 56vh, 600px); width: auto; max-width: none; flex: none; /* landscape shots can be wider than a phone screen */
  border-radius: 6px; transition: border-radius .4s var(--ease), transform .4s var(--ease);
}
.strip img:hover { border-radius: 24px; transform: translateY(-4px); }

/* ---------- about ---------- */
.about__grid { display: grid; grid-template-columns: minmax(220px, 380px) 1fr; gap: clamp(32px, 6vw, 112px); align-items: start; }
.about__pic { margin: 0; position: sticky; top: 90px; }
.about__pic img { rotate: -3deg; transition: rotate .6s var(--ease); }
.about__pic:hover img { rotate: 1deg; }
.about__bio { font-size: clamp(19px, 1.7vw, 23px); line-height: 1.5; max-width: 58ch; }
.about__bio p + p { margin-top: 1em; }
.about__bio p:first-child { font-family: var(--display); font-weight: 700; font-size: clamp(26px, 2.8vw, 40px); line-height: 1.12; letter-spacing: -.02em; font-variation-settings: "wdth" 90; }

/* ---------- footer ---------- */
.foot { padding: clamp(80px, 12vw, 180px) var(--gutter) 24px; }
.foot__hey { font-size: clamp(64px, 14vw, 240px); color: var(--bg); }
.foot__mail { display: inline-block; margin-top: 12px; font-size: clamp(30px, 6.6vw, 112px); word-break: break-all; }
.foot__mail .char { display: inline-block; transition: transform .3s var(--ease), color .3s; }
.foot__mail:hover .char { transform: translateY(-.12em); color: var(--bg); transition-delay: calc(var(--i) * 18ms); }
.foot__row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: clamp(48px, 8vw, 120px); font-size: 14px; font-weight: 500; }

/* ---------- player ---------- */
.player { border: 0; padding: 0; background: transparent; color: var(--alt-fg); width: min(1240px, 100vw - 2 * var(--gutter)); max-width: none; max-height: none; overflow: visible; }
.player::backdrop { background: var(--alt-bg); opacity: .96; }
.player[open] { animation: rise .5s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
.player__close { display: block; margin: 0 0 14px auto; background: none; border: 0; color: inherit; font: 600 15px var(--body); cursor: pointer; }
.player__inner { display: grid; grid-template-columns: 1fr 320px; gap: 28px; }
.player__screen { aspect-ratio: 16/9; background: #000; border-radius: 18px; overflow: hidden; }
.player video, .player iframe { width: 100%; height: 100%; border: 0; display: block; }
.player [hidden] { display: none; }
.player__sub { font-size: 14px; font-weight: 500; opacity: .7; }
.player h3 { font: 800 clamp(32px, 3.4vw, 48px)/.95 var(--display); letter-spacing: -.03em; font-variation-settings: "wdth" 85; margin: 8px 0 14px; }
.player__films { list-style: none; padding: 0; margin: 20px 0 0; border-top: 1.5px solid currentColor; }
.player__films button, .player__films a {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: flex; justify-content: space-between;
  padding: 10px 0; border-bottom: 1.5px solid currentColor; font-weight: 500; transition: padding .3s var(--ease), color .3s;
}
.player__films button:hover, .player__films a:hover { padding-left: 8px; }
.player__films button[aria-current="true"] { background: var(--accent); color: var(--accent-fg); padding-left: 8px; padding-right: 8px; }

/* ---------- reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }


/* ---------- article pages ---------- */
.article { padding: 120px var(--gutter) 96px; }
.article__wrap { max-width: 760px; margin: 0 auto; }
.article__meta { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; font-size: 15px; border-bottom: 2px solid currentColor; padding-bottom: 10px; }
.article h1 { font: 800 clamp(40px, 6.5vw, 96px)/.92 var(--display); letter-spacing: -.035em; font-variation-settings: "wdth" 85; margin: 40px 0 48px; }
.article__body { font-size: 21px; line-height: 1.6; }
.article__body p + p, .article__body p + div, .article__body div + p { margin-top: 1.1em; }
.article__body .placeholder { border: 2px dashed currentColor; padding: 48px 20px; text-align: center; font-size: 15px; font-weight: 600; }
.article__hero { margin: 0 0 48px; }
.article__hero img, .article__body figure img { width: auto; max-width: 100%; max-height: 80vh; margin: 0 auto; border-radius: 14px; }
.article__body figure { margin: 1.4em 0; }
.article__body blockquote { margin: 1.1em 0; padding-left: 20px; border-left: 4px solid var(--accent); font-style: italic; }
.article__body .ul { background-size: 100% 1.5px; }
.carousel {
  display: flex; gap: 10px; overflow-x: auto; margin: 1.4em calc(50% - 50vw + var(--gutter)) 1.4em 0;
  scroll-snap-type: x mandatory; padding-bottom: 10px; scrollbar-width: thin; scrollbar-color: currentColor transparent;
}
.carousel img { flex: none; width: min(78vw, 520px); aspect-ratio: 1; scroll-snap-align: start; border-radius: 10px; }
.article__foot { margin-top: 56px; padding-top: 14px; border-top: 2px solid currentColor; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-weight: 600; font-size: 15px; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .bar { font-size: 13px; flex-wrap: wrap; row-gap: 6px; }
  .bar__nav { width: 100%; justify-content: space-between; gap: 8px; }
  .rows button { grid-template-columns: 1fr; }
  .rows__meta { text-align: left; }
  .rows__meta b { display: inline; margin-right: 6px; }
  .posts a { grid-template-columns: 1fr auto; }
  .posts time { grid-column: 1 / -1; }
  .about__grid { grid-template-columns: 1fr; }
  .about__pic { position: static; max-width: 300px; }
  .player__inner { grid-template-columns: 1fr; }
  .peek { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal, .mega .char { opacity: 1; transform: none; }
}
