/* ==========================================================================
   Shima Mousavizadeh Markieh — portfolio
   Layout is a centred content column with a left sidebar pinned to the
   viewport, which is why the sidebar is positioned against the page rather
   than against the column. Measurements are taken at a 1600px viewport.
   ========================================================================== */

/* --- Fonts ---------------------------------------------------------------
   Jost is the UI face. Tinos is metric-compatible with Times New Roman and
   only loads where Times itself is unavailable.
   ------------------------------------------------------------------------- */

@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/assets/fonts/jost-300.woff2') format('woff2');
}

@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/jost-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Tinos';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/tinos-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Tinos';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/tinos-400i.woff2') format('woff2');
}

@font-face {
  font-family: 'Tinos';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/tinos-700.woff2') format('woff2');
}

:root {
  --font-sans: 'Jost', sans-serif;
  --font-serif: 'Times New Roman', Times, 'Tinos', serif;

  --ink: #414141;
  --ink-soft: #636363;
  --page: #ffffff;
  --rule: #d6d6d4;
  --field-border: rgba(65, 65, 65, 0.75);

  /* Centred content column, and the inset the page bodies sit at inside it. */
  --column: 934px;
  --inset: 289px;

  /* Sidebar is pinned to the viewport, not to the column. */
  --sidebar-x: 64px;
  --sidebar-top: 46px;
  --nav-top: 182px;
}

/* --- Reset ---------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- Shell ---------------------------------------------------------------- */

.page {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.column {
  width: var(--column);
  margin: 0 auto;
}

.main {
  flex: 1 0 auto;
}

/* --- Sidebar -------------------------------------------------------------- */

.sidebar {
  position: absolute;
  top: 0;
  left: var(--sidebar-x);
  width: 141px;
  z-index: 2;
}

.sidebar__name {
  position: absolute;
  top: var(--sidebar-top);
  left: 0;
  width: 258px;
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1.1;
  color: var(--ink);
}

.nav {
  position: absolute;
  top: var(--nav-top);
  left: 0;
  width: 141px;
}

.nav__link {
  display: block;
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 35px;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}

.nav__link:hover,
.nav__link:focus-visible,
.nav__link[aria-current='page'] {
  color: var(--ink);
}

/* Menu button only exists in the mobile layout. */
.nav-toggle {
  display: none;
}

/* --- Footer --------------------------------------------------------------- */

.footer {
  flex-shrink: 0;
  padding: 54px 0 32px;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}

.footer__copy {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 14px;
  color: var(--ink-soft);
}

.social {
  display: flex;
  align-items: center;
  gap: 8px;
}

.social__link {
  display: block;
  width: 18px;
  height: 18px;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.social__link:hover {
  opacity: 0.6;
}

.social__link svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: #000;
}

/* --- Home ----------------------------------------------------------------- */

.home__hero {
  width: 933px;
  height: 934px;
  object-fit: cover;
}

.home__title {
  margin: 22px 0 0;
  font-family: var(--font-serif);
  font-size: 29px;
  font-weight: 400;
  line-height: 1.1;
  text-align: center;
  color: var(--ink);
}

.home__tagline {
  width: 715px;
  margin: 8px auto 0;
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1.35;
  text-align: center;
  color: var(--ink-soft);
}

/* --- Body column ---------------------------------------------------------
   Inner pages sit at a fixed inset inside the centred column. Content widths
   differ slightly per page.
   ------------------------------------------------------------------------- */

.body-col {
  margin-left: var(--inset);
}

/* --- Portfolio index ------------------------------------------------------ */

.collection-grid {
  display: grid;
  grid-template-columns: 295px 294px;
  gap: 40px;
  padding-top: 169px;
}

.collection-card {
  position: relative;
  display: block;
  overflow: hidden;
}

.collection-card__image {
  width: 100%;
  height: 294px;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.collection-card:hover .collection-card__image {
  transform: scale(1.03);
}

.collection-card__title {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 180px;
  transform: translate(-50%, -50%);
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 24px;
  line-height: 32px;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.28);
}

/* --- Collection page ------------------------------------------------------ */

.collection-head {
  padding-top: 181px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 16px;
  color: var(--ink);
}

.back-link svg {
  width: 13px;
  height: 13px;
  flex: none;
}

.back-link:hover span {
  text-decoration: underline;
}

.collection-title {
  width: 628px;
  margin: 72px 0 0;
  font-family: var(--font-serif);
  font-size: 29px;
  font-weight: 400;
  line-height: 40.6px;
  color: var(--ink);
}

.project-grid {
  display: grid;
  grid-template-columns: 303px 302px;
  gap: 22px 23px;
  padding-top: 80px;
}

.project-card {
  display: block;
  overflow: hidden;
}

.project-card__image {
  width: 100%;
  height: 303px;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.project-card:hover .project-card__image {
  transform: scale(1.03);
}

/* --- Project page --------------------------------------------------------- */

.project {
  width: 588px;
  padding-top: 189px;
}

.project__title {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 21px;
  color: var(--ink);
}

.project__meta {
  display: grid;
  grid-template-columns: 300px auto;
  column-gap: 44px;
  margin-top: 51px;
  row-gap: 51px;
}

.project__meta-item {
  min-width: 0;
}

.project__meta-item--full {
  grid-column: 1 / -1;
}

.project__meta-label {
  display: block;
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 28px;
  color: var(--ink);
}

.project__meta-value {
  margin: 5px 0 0;
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 22.4px;
  color: var(--ink);
}

.project__description {
  margin: 44px 0 0;
  font-family: var(--font-serif);
  font-size: 26px;
  line-height: 33.8px;
  color: var(--ink);
  white-space: pre-line;
}

.project__gallery {
  display: flex;
  flex-direction: column;
  gap: 23px;
  margin-top: 102px;
}

.project__image {
  width: 588px;
  height: auto;
}

.project__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 52px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 16px;
  color: var(--ink-soft);
}

.project__nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.project__nav svg {
  width: 13px;
  height: 13px;
}

.project__nav a:hover {
  color: var(--ink);
}

.project__nav span {
  visibility: hidden;
}

/* --- Contact -------------------------------------------------------------- */

.contact {
  width: 650px;
  padding-top: 184px;
}

.contact__eyebrow {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 20px;
  color: var(--ink-soft);
}

.contact__lede {
  margin: 30px 0 0;
  font-family: var(--font-serif);
  font-size: 29px;
  font-weight: 400;
  line-height: 34.8px;
  color: var(--ink);
}

.contact__columns {
  display: grid;
  grid-template-columns: 288px 300px;
  gap: 0 33px;
  margin-top: 31px;
}

.contact__columns p {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 22.4px;
  color: var(--ink);
}

.contact__rule {
  height: 1px;
  margin: var(--rule-gap, 249px) 0 0;
  border: 0;
  background: var(--rule);
}

.contact__section {
  margin-top: var(--section-gap, 54px);
}

.contact__section-title,
.contact__subsection-title {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 20px;
  color: var(--ink);
}

.contact__subsection-title {
  margin-top: var(--subsection-gap, 43px);
}

.timeline {
  margin: 49px 0 0;
  padding: 0;
  list-style: none;
}

/* Rows under a subsection heading sit closer than under a section heading. */
.contact__subsection-title + .timeline {
  margin-top: 28px;
}

.timeline__row {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 0 32px;
  margin-bottom: 17px;
}

.timeline__row:last-child {
  margin-bottom: 0;
}

.timeline__year {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 16px;
  line-height: 20px;
  color: var(--ink);
  white-space: nowrap;
}

.timeline__detail {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 20px;
  color: var(--ink);
}

/* Education rows use a wider year column ("2020 - 2024"). */
.timeline--wide .timeline__row {
  grid-template-columns: 88px 1fr;
}

.contact__details {
  display: flex;
  align-items: center;
  margin-top: 48px;
}

.contact__detail {
  display: flex;
  align-items: center;
  gap: 30px;
  margin: 0;
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--ink);
}

.contact__detail + .contact__detail {
  margin-left: 77px;
  gap: 21px;
}

.contact__detail svg {
  flex: none;
  width: 18px;
  height: 18px;
  stroke: var(--ink);
  fill: none;
  stroke-width: 1.2;
}

.contact__detail + .contact__detail svg {
  width: 16px;
  height: 16px;
}

.contact__detail a:hover {
  text-decoration: underline;
}

/* --- Form ----------------------------------------------------------------- */

.form {
  width: 628px;
  margin: 67px 0 0 -6px;
}

.form__field {
  margin-bottom: 24px;
}

.form__label {
  display: block;
  margin-bottom: 10px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 16px;
  line-height: 20px;
  color: var(--ink-soft);
}

.form__input,
.form__textarea {
  display: block;
  width: 100%;
  padding: 8px;
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 14px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--field-border);
  border-radius: 0;
  outline-offset: 2px;
}

.form__input {
  height: 38px;
}

.form__textarea {
  height: 92px;
  padding: 12px 8px;
  resize: vertical;
}

.form__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

.form__submit {
  width: 139px;
  height: 42px;
  padding: 11px 7px;
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 15px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--field-border);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.form__submit:hover {
  background: var(--ink);
  color: #fff;
}

.form__submit:disabled {
  opacity: 0.5;
  cursor: default;
}

.form__status {
  margin: 14px 0 0;
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 14px;
  color: var(--ink-soft);
  text-align: right;
}

.form__status:empty {
  margin: 0;
}

.form__status[data-state='error'] {
  color: #a4342b;
}


/* --- Simple prose pages (Teaching / About / CV) --------------------------- */

.prose {
  width: 588px;
  padding-top: 189px;
}

.prose__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 29px;
  font-weight: 400;
  line-height: 40.6px;
  color: var(--ink);
}

.prose p {
  margin: 24px 0 0;
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 24px;
  color: var(--ink-soft);
}

/* ==========================================================================
   Mobile — a single-column layout below 1024px.
   ========================================================================== */

@media (max-width: 1023px) {
  :root {
    --column: 100%;
    --inset: 0px;
  }

  .column {
    width: auto;
    padding: 0 24px;
  }

  .body-col {
    margin-left: 0;
  }

  /* Sidebar becomes a sticky top bar with a slide-down menu. */
  .sidebar {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--page);
    z-index: 10;
  }

  .sidebar__inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 26px 24px 18px;
  }

  .sidebar__name {
    position: static;
    width: auto;
    max-width: 60vw;
    font-size: 24px;
    line-height: 1.22;
  }

  .nav-toggle {
    display: block;
    flex: none;
    width: 34px;
    height: 26px;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
  }

  .nav-toggle__bar {
    display: block;
    height: 2px;
    margin-left: auto;
    background: var(--ink);
    transition: width 0.25s ease, transform 0.25s ease, opacity 0.25s ease;
  }

  .nav-toggle__bar:nth-child(1) {
    width: 100%;
  }

  .nav-toggle__bar:nth-child(2) {
    width: 72%;
    margin-top: 8px;
  }

  .nav-toggle__bar:nth-child(3) {
    width: 100%;
    margin-top: 8px;
  }

  .nav-toggle[aria-expanded='true'] .nav-toggle__bar:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
  }

  .nav-toggle[aria-expanded='true'] .nav-toggle__bar:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle[aria-expanded='true'] .nav-toggle__bar:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
  }

  .nav {
    position: static;
    width: 100%;
    max-height: 0;
    padding: 0 24px;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .nav[data-open='true'] {
    max-height: 320px;
  }

  .nav__link {
    font-size: 18px;
    line-height: 44px;
  }

  /* Home */
  .home__hero {
    width: 100%;
    height: auto;
  }

  .home__title {
    margin-top: 18px;
    font-size: 30px;
  }

  .home__tagline {
    width: auto;
    font-size: 22px;
    line-height: 1.4;
  }

  /* Portfolio + collections collapse to one column */
  .collection-grid,
  .project-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 24px;
  }

  .collection-card__image,
  .project-card__image {
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
  }

  .collection-head {
    padding-top: 24px;
  }

  .collection-title {
    width: auto;
    margin-top: 24px;
    font-size: 26px;
    line-height: 1.35;
  }

  /* Project */
  .project,
  .prose,
  .contact {
    width: auto;
    padding-top: 24px;
  }

  .project__meta {
    grid-template-columns: 1fr 1fr;
    row-gap: 32px;
    margin-top: 32px;
  }

  .project__description {
    margin-top: 34px;
    font-size: 21px;
    line-height: 1.35;
  }

  .project__gallery {
    gap: 16px;
    margin-top: 40px;
  }

  .project__image {
    width: 100%;
    height: auto;
  }

  /* Contact */
  .contact__lede {
    font-size: 24px;
    line-height: 1.35;
  }

  .contact__columns {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .contact__rule {
    margin-top: 48px;
  }

  .contact__details {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  /* Footer stacks and centres */
  .footer__inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
