/* hamidmotahari.com
   Palette taken from the works: blackened metal, ivory wool, madder red, indigo, brass. */
:root {
  --ink: #14110f;
  --ink-2: #1b1714;
  --ink-3: #25201c;
  --ivory: #f3ede2;
  --paper: #faf6ee;
  --madder: #a8392b;
  --indigo: #2b3672;
  --brass: #b9955c;
  --brass-2: #d8ba86;
  --soft: #d5ccbe;
  --mute: #9a9085;
  --mute-d: #6a6157;
  --rule: rgba(185, 149, 92, .3);
  --rule-d: rgba(20, 17, 15, .16);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: Inter, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --wrap: 1240px;
  --gut: clamp(20px, 4.5vw, 64px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--ivory);
  font: 400 1rem/1.75 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, dl, dd, figure, ul { margin: 0; }
ul { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--brass-2); outline-offset: 4px; }
::selection { background: var(--madder); color: var(--ivory); }

.skip {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--ivory); color: var(--ink); padding: 10px 16px;
}
.skip:focus { left: 12px; top: 12px; }

.wrap { max-width: var(--wrap); margin: 0 auto; }
.eyebrow {
  font: 500 .7rem/1.4 var(--sans);
  letter-spacing: .24em; text-transform: uppercase; color: var(--brass-2);
}
.light .eyebrow { color: var(--madder); }

/* The weft: one short band of colour crossing the page's vertical order. */
.weft {
  display: block; width: 132px; height: 3px; margin: 30px 0;
  background: linear-gradient(90deg,
    var(--madder) 0 66%, transparent 66% 71%,
    var(--indigo) 71% 86%, transparent 86% 91%,
    var(--brass) 91%);
}
.center .weft { margin-left: auto; margin-right: auto; }

/* Header */
.site-header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap;
  gap: 10px 32px; padding: 30px var(--gut) 0;
}
.wordmark {
  font: 500 1.5rem/1 var(--serif); letter-spacing: .05em;
}
.site-nav { display: flex; gap: clamp(18px, 3vw, 40px); }
.site-nav a {
  position: relative; padding: 6px 0;
  font: 500 .7rem/1 var(--sans); letter-spacing: .24em; text-transform: uppercase;
  color: var(--soft); transition: color .25s;
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px;
  background: var(--brass-2); transition: right .35s cubic-bezier(.2, .7, .2, 1);
}
.site-nav a:hover, .site-nav a[aria-current] { color: var(--ivory); }
.site-nav a:hover::after, .site-nav a[aria-current]::after { right: 0; }

/* Buttons and links */
.btn {
  display: inline-flex; align-items: center; gap: .9em;
  padding: 1.15em 1.7em; border: 1px solid var(--brass);
  font: 500 .7rem/1 var(--sans); letter-spacing: .24em; text-transform: uppercase;
  transition: background .3s, color .3s;
}
.btn:hover { background: var(--brass); color: var(--ink); }
.more {
  display: inline-flex; align-items: center; gap: .8em;
  font: 500 .7rem/1 var(--sans); letter-spacing: .24em; text-transform: uppercase;
  color: var(--brass-2); padding-bottom: 6px; border-bottom: 1px solid var(--rule);
  transition: border-color .3s, color .3s;
}
.more:hover { color: var(--ivory); border-color: var(--brass-2); }
.light .more { color: var(--madder); border-color: var(--rule-d); }
.light .more:hover { color: var(--ink); border-color: var(--ink); }
.arrow { display: inline-block; transition: transform .3s; }
.btn:hover .arrow, .more:hover .arrow { transform: translateX(4px); }

/* Home hero */
.hero {
  position: relative; isolation: isolate;
  min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center; gap: clamp(28px, 5vw, 88px);
  max-width: 1480px; margin: 0 auto;
  padding: 130px var(--gut) 90px;
}
.hero::before {
  /* warp threads */
  content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: 0; width: 44%;
  background: repeating-linear-gradient(90deg, var(--rule) 0 1px, transparent 1px 28px);
  -webkit-mask-image: linear-gradient(180deg, transparent 4%, #000 34%, #000 62%, transparent 96%);
  mask-image: linear-gradient(180deg, transparent 4%, #000 34%, #000 62%, transparent 96%);
  opacity: .5;
}
.hero h1 {
  font: 500 clamp(2.7rem, 5.6vw, 5.1rem)/1.02 var(--serif);
  letter-spacing: -.012em; margin-top: 22px;
}
.hero h1 em { font-style: italic; color: var(--brass-2); }
.hero .lead { max-width: 30em; color: var(--soft); font-size: 1.04rem; }
.hero .btn { margin-top: 36px; }
.hero-figure { position: relative; isolation: isolate; }
.hero-figure::after {
  content: ""; position: absolute; z-index: -1;
  inset: 20px -20px -20px 20px; border: 1px solid var(--rule);
}
.hero-figure img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.hero-figure figcaption {
  position: absolute; left: 0; bottom: -46px;
  font: 500 .68rem/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--mute);
}
.hero-figure figcaption a:hover { color: var(--brass-2); }

/* Sections */
.section { padding: clamp(76px, 10vw, 150px) var(--gut); }
.light { background: var(--paper); color: var(--ink); }
.deep { background: var(--ink-2); }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap;
  gap: 20px 40px; margin-bottom: clamp(32px, 4.5vw, 60px);
}
.section-head h2, .h2 {
  font: 500 clamp(2.1rem, 4.2vw, 3.4rem)/1.05 var(--serif); letter-spacing: -.008em; margin-top: 14px;
}

/* Works mosaic (home) */
.mosaic { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(10px, 1.3vw, 20px); }
.mosaic .card:nth-child(1) { grid-column: span 2; grid-row: span 2; }
.mosaic .card:nth-child(n+6) { grid-column: span 2; }
.mosaic .card:nth-child(n+6) .card-img { aspect-ratio: 2 / 1; }
.card { position: relative; display: block; overflow: hidden; background: var(--ink-3); }
.card-img {
  width: 100%; height: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  transition: transform 1.1s cubic-bezier(.2, .7, .2, 1);
}
.card:hover .card-img { transform: scale(1.045); }
.card-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; gap: 5px;
  padding: 70px clamp(14px, 1.6vw, 24px) clamp(14px, 1.6vw, 22px);
  background: linear-gradient(180deg, rgba(12, 10, 9, 0), rgba(12, 10, 9, .86));
}
.card-title { font: 500 clamp(1.3rem, 1.9vw, 1.75rem)/1.1 var(--serif); }
.card:nth-child(1) .card-title { font-size: clamp(1.7rem, 3vw, 2.6rem); }
.card-type { font: 500 .64rem/1.4 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--brass-2); }

/* Statement */
.statement { text-align: center; }
.ornament { width: 26px; height: 26px; color: var(--madder); margin: 0 auto 30px; }
.statement p {
  font: 500 italic clamp(1.55rem, 3.1vw, 2.5rem)/1.32 var(--serif);
  max-width: 23em; margin: 0 auto;
}
.statement .more { margin-top: 44px; }

/* Three projects */
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 4vw, 60px); }
.trio article { border-top: 1px solid var(--rule); padding-top: 24px; }
.num { font: 500 .7rem/1 var(--sans); letter-spacing: .24em; color: var(--brass); }
.trio h3 { font: 500 clamp(1.6rem, 2.3vw, 2rem)/1.12 var(--serif); margin: 16px 0 14px; }
.trio p { color: var(--soft); }

/* Places */
.places-band { border-top: 1px solid var(--rule); padding-top: clamp(48px, 6vw, 80px); padding-bottom: clamp(48px, 6vw, 80px); }
.places { font: 500 clamp(1.35rem, 2.5vw, 2.05rem)/1.55 var(--serif); margin-top: 16px; }
.places span { color: var(--brass); padding: 0 .5em; }

/* Inner page head */
.page-head { padding: clamp(150px, 17vw, 210px) var(--gut) clamp(48px, 6vw, 80px); position: relative; isolation: isolate; }
.page-head::before {
  content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; right: 0; width: 38%;
  background: repeating-linear-gradient(90deg, var(--rule) 0 1px, transparent 1px 28px);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 50%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 50%, transparent);
  opacity: .4;
}
.page-head h1 { font: 500 clamp(2.8rem, 6.4vw, 5.4rem)/1 var(--serif); letter-spacing: -.012em; margin-top: 18px; }
.page-head .lead { max-width: 34em; color: var(--soft); font-size: 1.06rem; }

/* Works index */
.index-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(40px, 5vw, 80px) clamp(18px, 3vw, 48px);
}
.tile { display: block; }
.tile:first-child { grid-column: 1 / -1; }
.tile-frame { overflow: hidden; background: var(--ink-3); }
.tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 1.1s cubic-bezier(.2, .7, .2, 1); }
.tile:first-child img { aspect-ratio: 2 / 1; }
.tile:hover img { transform: scale(1.035); }
.tile-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-top: 20px; }
.tile h2 { font: 500 clamp(1.7rem, 2.8vw, 2.4rem)/1.1 var(--serif); }
.tile p { color: var(--mute); margin-top: 10px; max-width: 40em; }

/* Work page */
.work {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(28px, 5vw, 84px); align-items: start;
  max-width: 1480px; margin: 0 auto; padding: 130px var(--gut) clamp(72px, 9vw, 120px);
}
.work-media { display: grid; gap: clamp(10px, 1.3vw, 20px); }
.work-media img { width: 100%; background: var(--ink-3); }
.work-info { position: sticky; top: 36px; }
.crumb { font: 500 .68rem/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--mute); }
.crumb a:hover { color: var(--brass-2); }
.work h1 { font: 500 clamp(2.7rem, 5vw, 4.6rem)/1 var(--serif); letter-spacing: -.012em; margin: 22px 0 14px; }
.spec { margin: 34px 0 30px; border-top: 1px solid var(--rule); }
.spec div { display: grid; grid-template-columns: 7.5em 1fr; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--rule); }
.spec dt { font: 500 .66rem/1.9 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--mute); }
.spec dd { color: var(--ivory); font-size: .95rem; line-height: 1.6; }
.prose p { color: var(--soft); margin-bottom: 1.2em; }
.prose p:last-child { margin-bottom: 0; }

.pager { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--rule); }
.pager a { display: block; padding: clamp(34px, 5vw, 64px) var(--gut); transition: background .35s; }
.pager a + a { text-align: right; border-left: 1px solid var(--rule); }
.pager a:hover { background: var(--ink-2); }
.pager strong { display: block; font: 500 clamp(1.5rem, 3vw, 2.4rem)/1.1 var(--serif); margin-top: 12px; }

/* About */
.about { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(32px, 6vw, 100px); align-items: start; }
.about-side { position: sticky; top: 36px; }
.portrait { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 46% center; }
.about-side .name { font: 500 1.7rem/1.1 var(--serif); margin-top: 22px; }
.about-side .role { margin-top: 8px; }
.about-main p { margin-bottom: 1.25em; max-width: 40em; color: #3a332d; }
.about-main .intro { font: 500 clamp(1.45rem, 2.3vw, 1.95rem)/1.35 var(--serif); color: var(--ink); max-width: 28em; margin-bottom: 1.1em; }
.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 4vw, 60px); }
.pillars article { border-top: 1px solid var(--rule); padding-top: 24px; }
.pillars h3 { font: 500 clamp(1.5rem, 2.1vw, 1.85rem)/1.15 var(--serif); margin: 14px 0; }
.pillars p { color: var(--soft); }
.expertise { border-top: 1px solid var(--rule-d); max-width: 62em; }
.expertise div { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 12px 32px; padding: 20px 0; border-bottom: 1px solid var(--rule-d); }
.expertise dt { font: 500 1.4rem/1.2 var(--serif); }
.expertise dd { color: #3a332d; }

/* Projects page */
.project { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: clamp(20px, 5vw, 80px); padding: clamp(48px, 6vw, 84px) 0; border-top: 1px solid var(--rule); }
.project .big-num { font: 500 clamp(3.2rem, 7vw, 6rem)/.9 var(--serif); color: var(--brass); }
.project h2 { font: 500 clamp(2rem, 3.6vw, 3rem)/1.05 var(--serif); margin-bottom: 22px; }
.project p { color: var(--soft); max-width: 40em; margin-bottom: 1.2em; }
.facts { margin-top: 30px; border-top: 1px solid var(--rule); max-width: 46em; }
.facts div { display: grid; grid-template-columns: 11em 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.facts dt { font: 500 .66rem/1.9 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--mute); }
.facts dd { font-size: .95rem; }

/* Contact */
.contact { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.contact-img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 48% center; }
.mail {
  font: 500 clamp(1.5rem, 4.2vw, 3.1rem)/1.2 var(--serif);
  padding-bottom: 6px; border-bottom: 1px solid var(--rule); transition: border-color .3s, color .3s;
  overflow-wrap: anywhere;
}
.mail:hover { color: var(--brass-2); border-color: var(--brass-2); }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding: clamp(44px, 6vw, 72px) var(--gut) 36px; }
.foot { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 28px 48px; }
.foot .wordmark { font-size: 1.9rem; }
.foot .tag { color: var(--mute); margin-top: 10px; font-size: .92rem; }
.foot-nav { display: flex; gap: clamp(18px, 3vw, 40px); flex-wrap: wrap; }
.foot-nav a { font: 500 .7rem/1 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--soft); padding: 6px 0; }
.foot-nav a:hover { color: var(--brass-2); }
.legal { margin-top: 44px; font-size: .78rem; color: var(--mute-d); letter-spacing: .04em; }

/* Not found */
.notfound { min-height: 80vh; display: grid; place-content: center; text-align: center; padding: 160px var(--gut) 80px; }
.notfound h1 { font: 500 clamp(2.6rem, 6vw, 4.6rem)/1 var(--serif); margin: 18px 0 30px; }

/* Smaller screens */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 140px; padding-bottom: 110px; }
  .hero::before { width: 100%; }
  .hero-figure::after { inset: 12px -10px -12px 10px; }
  .mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mosaic .card:nth-child(1) { grid-row: auto; }
  .mosaic .card:nth-child(n+6) { grid-column: span 1; }
  .mosaic .card:nth-child(n+6) .card-img { aspect-ratio: 1 / 1; }
  .trio, .pillars { grid-template-columns: 1fr; }
  .work { grid-template-columns: 1fr; padding-top: 140px; }
  .work-info { display: contents; }
  .work-head { order: 1; }
  .work-media { order: 2; }
  .work-body { order: 3; }
  .about { grid-template-columns: 1fr; }
  .about-side { position: static; }
  .portrait, .contact-img { aspect-ratio: 3 / 2; }
  .contact { grid-template-columns: 1fr; }
  .project { grid-template-columns: 1fr; }
  .expertise div { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .site-header { padding-top: 22px; }
  .wordmark { font-size: 1.35rem; }
  .index-grid { grid-template-columns: 1fr; }
  .tile:first-child img { aspect-ratio: 4 / 3; }
  .pager strong { font-size: 1.3rem; }
  .facts div, .spec div { grid-template-columns: 1fr; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
