/* Parham Pourdavood — Homepage
   Only index.html loads this. The art collection page uses style.css
   and art-collection.css instead. */

:root {
  --bg: #f7f5f1;
  --fg: #171615;
  --fg-2: #46433f;
  --mut: #77726c;
  --line: rgba(23, 22, 21, 0.1);
  --line-2: rgba(23, 22, 21, 0.2);
  --card: #fffefc;
  --acc: #c45d3e;
  --live: #3f9f6b;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Geist', system-ui, -apple-system, sans-serif;
  --mono: 'Geist Mono', ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #121110;
  --fg: #ece9e4;
  --fg-2: #c2bdb6;
  --mut: #8e8983;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.2);
  --card: #1a1918;
  --acc: #e8775a;
  --live: #5fbf8a;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.4s ease, color 0.4s ease;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
.mono { font-family: var(--mono); font-size: 12px; color: var(--mut); letter-spacing: 0; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }

/* ---------- Top bar ---------- */
.top { display: flex; justify-content: space-between; align-items: center; padding: 26px 0; }
.mark { font-family: var(--serif); font-size: 26px; line-height: 1; text-decoration: none; }
.nav { display: flex; align-items: center; gap: 24px; }
.nav a { text-decoration: none; transition: color 0.2s; }
.nav a:hover { color: var(--fg); }
.theme-toggle {
  width: 32px; height: 32px; border-radius: 100px;
  border: 1px solid var(--line); background: transparent; color: var(--fg);
  display: grid; place-items: center; cursor: pointer;
  transition: border-color 0.2s, transform 0.4s var(--ease);
}
.theme-toggle:hover { border-color: var(--line-2); }
[data-theme="dark"] .theme-toggle { transform: rotate(180deg); }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 40px;
  align-items: end;
  padding: clamp(28px, 5vw, 64px) 0 clamp(28px, 4vw, 48px);
}
.role { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }
.role .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--live); flex: none; }
.name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(46px, 7vw, 84px);
  line-height: 0.95;
  letter-spacing: -0.015em;
  margin-bottom: 18px;
}
.lede {
  font-size: clamp(17px, 1.9vw, 20px);
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--mut);
  max-width: 36em;
}
/* height: auto overrides the img's height="136" attribute, which would otherwise win over aspect-ratio
   and stretch the photo into a tall rectangle wherever the width drops below 136px */
.portrait {
  width: clamp(96px, 12vw, 136px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 24px;
  object-fit: cover;
}

/* ---------- Highlight cards: the products row, then Latest essay and album ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: clamp(64px, 10vw, 120px);
}
.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px 22px 22px;
  text-decoration: none;
  transition: transform 0.35s var(--ease), border-color 0.35s;
}
a.card:hover { transform: translateY(-2px); border-color: var(--line-2); }
.card-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }

.arrow { transition: color 0.2s; }
.is-live { color: var(--live); }

/* Products: the shipped Firstness products, one card each. The heading reads like a Work group name;
   "Firstness" in it links to the studio, underlined like the bio's links. */
.products { margin-bottom: 12px; }
.products-label {
  padding-bottom: 12px;
  font-family: var(--sans); font-size: 16px; font-weight: 500; letter-spacing: -0.01em; color: var(--fg);
}
.products-label a { text-decoration-color: var(--line-2); text-underline-offset: 3px; transition: color 0.2s; }
.products-label a:hover { color: var(--acc); }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.product-name {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-size: clamp(26px, 2.8vw, 32px); line-height: 1;
  transition: color 0.2s;
}
.product-name .arrow { font-size: 12px; align-self: flex-start; }
a.card:hover .product-name, a.card:hover .product-name .arrow { color: var(--acc); }
/* The marks keep their own colours on hover */
.product-mark { flex: none; color: var(--fg); }
.product-desc { font-size: 14px; line-height: 1.5; color: var(--mut); margin-top: 12px; }
.product-desc strong { font-weight: 400; color: var(--fg); }

.latest-title { font-family: var(--serif); font-size: clamp(24px, 2.6vw, 30px); line-height: 1.1; }
a.card:hover .latest-title { color: var(--acc); }

/* The essay and album cards share a row and its height; content sits top and bottom */
.latest, .album-card { display: flex; flex-direction: column; justify-content: space-between; }

.album { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; align-items: center; }
.album-cover { width: 64px; aspect-ratio: 1; border-radius: 10px; object-fit: cover; background: var(--line); }
.album-title { font-family: var(--serif); font-size: clamp(20px, 2.1vw, 24px); line-height: 1.15; transition: color 0.2s; }
.album-sub { font-size: 13px; color: var(--mut); margin-top: 3px; }
a.card:hover .album-title { color: var(--acc); }

/* ---------- Section headings ---------- */
.section-title { font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 4.5vw, 48px); line-height: 1; letter-spacing: -0.01em; }

/* ---------- Work list ---------- */
.work-group { margin-top: 44px; }
.group-label { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 12px; }
/* The group's name reads as a subheading; its count stays a small mono label */
.group-label > span:first-child { font-family: var(--sans); font-size: 16px; font-weight: 500; letter-spacing: -0.01em; color: var(--fg); }
/* A group's own link (the Substack beside Research and writing) sits right after its name; the count stays at the far right */
.group-link { margin: 0 auto 0 14px; text-decoration: none; color: var(--mut); transition: color 0.2s; }
.group-link:hover, .group-link:hover .arrow { color: var(--acc); }
.work { list-style: none; }
.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 48px;
  grid-template-areas: "title kind year";
  gap: 24px;
  align-items: baseline;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
}
.row-text { grid-area: title; }
.row-title, .row-sub { display: block; }
.row-title { font-family: var(--serif); font-size: clamp(20px, 2.1vw, 23px); line-height: 1.2; transition: color 0.2s; }
.row-sub { font-size: 13px; color: var(--mut); margin-top: 3px; }
.row-kind { grid-area: kind; }
.row-year { grid-area: year; text-align: right; }
a.row:hover .row-title { color: var(--acc); }
.work.is-collapsed li.extra { display: none; }
.show-all {
  margin-top: 4px; padding: 16px 0; width: 100%;
  background: none; border: 0; border-top: 1px solid var(--line);
  text-align: left; cursor: pointer;
  font-family: var(--mono); font-size: 12px; color: var(--mut);
  transition: color 0.2s;
}
.show-all:hover { color: var(--fg); }
.show-all[hidden] { display: none; }

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 40px;
  padding-top: clamp(64px, 10vw, 120px);
}
.bio { font-size: 17px; line-height: 1.65; color: var(--fg-2); max-width: 38em; }
.bio a { text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.bio a:hover { color: var(--acc); }
.interests { margin-top: 28px; }
.interests ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.interests li { font-size: 13px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 100px; color: var(--fg-2); }

/* ---------- Footer ---------- */
.footer {
  margin-top: clamp(64px, 10vw, 120px);
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
}
.footer-mail { font-family: var(--serif); font-size: clamp(24px, 3vw, 32px); text-decoration: none; }
.footer-mail:hover { color: var(--acc); }
.socials { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.socials a {
  width: 34px; height: 34px; border-radius: 100px;
  display: grid; place-items: center;
  color: var(--mut); text-decoration: none; font-size: 15px;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.socials a:hover { color: var(--fg); background: var(--line); }
/* Quiet grey pill, like the Art Collection link beside the icons on the live homepage */
.socials a.footer-pill {
  width: auto; height: auto;
  display: inline-flex; align-items: center; gap: 7px;
  margin-left: 8px; padding: 6px 13px;
  border: 1px solid var(--line); border-radius: 100px;
  font-size: 13px; white-space: nowrap;
}
.socials a.footer-pill:hover { background: transparent; border-color: var(--line-2); }
.footer-pill i { font-size: 12px; }
.colophon { width: 100%; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Entrance motion ---------- */
.rise { animation: rise 0.9s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .rise { animation: none; }
  .card, .theme-toggle { transition: none; }
}

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  .cards, .product-grid { grid-template-columns: minmax(0, 1fr); }
  .about { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}
@media (max-width: 640px) {
  .nav { gap: 16px; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .portrait { order: -1; width: 84px; border-radius: 20px; }
  .row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title year" "kind kind";
    gap: 6px 16px;
  }
  /* The name, a group's link and its count don't fit on one line, so the link goes under the name */
  .group-label { flex-wrap: wrap; }
  .group-link { order: 3; flex-basis: 100%; margin: 4px 0 0; }
  /* The icons and the Art Collection pill don't fit on one line, so the pill gets its own */
  .socials { row-gap: 0; }
  .socials::after { content: ""; flex-basis: 100%; order: 1; }
  .socials a.footer-pill { order: 2; margin: 4px 0 0; }
}
