/* Rodin Hooshiyar - personal site. Light only. */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --fg: #0a0a0a;
  --fg-2: #555555;
  --fg-3: #8c8c8c;
  --line: #ebebeb;
  --stroke: rgb(0 0 0 / 0.07);
  --surface: #f5f5f5;
  --wrap: 1040px;
  --gutter: 24px;
  --col: 300px;
  --gap: 40px;
  --radius: 10px;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--fg); color: var(--bg); }
a { color: inherit; }
img, video { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- header and footer ---------- */

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; min-height: 64px; }
.wordmark { font-weight: 500; letter-spacing: -0.01em; text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.nav a { color: var(--fg-3); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--fg); }

.site-footer { margin-top: 112px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 24px 40px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--fg-3); }

/* ---------- shared bits ---------- */

.muted { color: var(--fg-3); }
.ilink { text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: #c4c4c4; }
.ilink:hover { text-decoration-color: currentColor; }

.links { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 14px 0 0; padding: 0; list-style: none; font-size: 14px; }
.links a { padding-bottom: 1px; border-bottom: 1px solid var(--line); text-decoration: none; }
.links a:hover { border-bottom-color: currentColor; }
.links a[target="_blank"]::after { content: "↗"; margin-inline-start: 3px; font-size: 0.85em; color: var(--fg-3); }

figure { margin: 0; }
figure img, figure video { width: 100%; height: auto; border-radius: var(--radius); box-shadow: 0 0 0 1px var(--stroke); background: var(--surface); }
figure video { background: #000; }
figure img.fit { object-fit: contain; }
figcaption { margin-top: 10px; font-size: 13.5px; line-height: 1.5; color: var(--fg-3); }

/* ---------- home ---------- */

.intro { padding-block: 96px 72px; }
.intro h1 { margin: 0; font-size: clamp(2rem, 4.6vw, 2.75rem); font-weight: 500; line-height: 1.1; letter-spacing: -0.03em; }
.intro-sub { margin: 10px 0 0; font-size: 16px; color: var(--fg-3); }
.intro-text { margin: 22px 0 0; max-width: 40em; font-size: 17.5px; line-height: 1.6; color: var(--fg-2, var(--fg)); }
.intro-text + .intro-text { margin-top: 12px; }
.intro-links { margin-top: 26px; }

.projects { display: grid; gap: 64px; margin: 0; padding: 0; list-style: none; }
.project { display: grid; grid-template-columns: var(--col) 1fr; gap: 20px var(--gap); align-items: start; }
.project-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.project h3 { margin: 0; font-size: 17px; font-weight: 500; line-height: 1.35; letter-spacing: -0.015em; }
.project h3 a { text-decoration: none; }
.project h3 a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.year { flex: none; font-size: 13px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.desc { max-width: 36em; margin: 8px 0 0; color: var(--fg-2); }
.meta { margin: 10px 0 0; font-size: 13.5px; color: var(--fg-3); }

/* ---------- carousel ---------- */

.car-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; aspect-ratio: 16 / 10; border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1px var(--stroke); scrollbar-width: none; }
.car-track::-webkit-scrollbar { display: none; }
.car-track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: start; border-radius: 0; box-shadow: none; }
.car-track img.fit { object-fit: contain; padding: 12px; background: #fff; }
.car-nav { display: none; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 12.5px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.car.has-nav .car-nav { display: flex; }
.car-nav button { font: inherit; font-size: 17px; line-height: 1; color: var(--fg-3); background: none; border: 0; padding: 2px 6px; cursor: pointer; }
.car-nav button:hover { color: var(--fg); }

/* ---------- project page ---------- */

.page { padding-top: 48px; }
.back { margin: 0 0 40px; font-size: 14px; }
.back a { color: var(--fg-3); text-decoration: none; }
.back a:hover { color: var(--fg); }

.proj-head { max-width: 760px; }
.proj-head h1 { margin: 0; font-size: clamp(2rem, 4.4vw, 2.75rem); font-weight: 500; line-height: 1.1; letter-spacing: -0.03em; }
.proj-head .lede { margin: 16px 0 0; font-size: 19px; line-height: 1.5; color: var(--fg-2); text-wrap: pretty; }

.facts-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px 32px; margin: 36px 0 0; padding: 18px 0; border-block: 1px solid var(--line); }
.facts-row div { min-width: 0; }
.facts-row dt { font-size: 12.5px; color: var(--fg-3); margin-bottom: 4px; }
.facts-row dd { margin: 0; font-size: 14.5px; }
.facts-row .links { margin: 0; gap: 4px 16px; }

.hero { margin: 40px 0 0; }
.hero img, .hero video { aspect-ratio: 16 / 9; object-fit: cover; }
.hero img.fit { aspect-ratio: auto; object-fit: contain; padding: 24px; background: #fff; }
.hero img.wide { aspect-ratio: auto; }

.highlights { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); margin: 40px 0 0; padding: 0; list-style: none; border-block: 1px solid var(--line); }
.highlights li { padding: 20px 24px; border-left: 1px solid var(--line); font-size: 14px; line-height: 1.4; color: var(--fg-3); }
.highlights li:first-child { border-left: 0; padding-left: 0; }
.highlights b { display: block; color: var(--fg); font-size: 26px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 4px; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px 64px; align-items: start; margin-top: 96px; }
.split.flip > .split-text { order: 2; }
.split.text-only { grid-template-columns: minmax(0, 680px); }
.split-text { max-width: 34em; padding-top: 2px; }
.split-text h2 { margin: 0 0 12px; font-size: 22px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.25; }
.split-text p { margin: 0 0 14px; font-size: 16px; line-height: 1.7; color: #2b2b2b; text-wrap: pretty; }
.split-text p:last-child { margin-bottom: 0; }
.split-text a { text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: #c4c4c4; }
.split-media { display: grid; gap: 16px; }
.split-media.two { grid-template-columns: 1fr 1fr; }
.split-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.split-media img.fit { object-fit: contain; background: #fff; padding: 12px; }
.split-media.two img { aspect-ratio: 4 / 5; }
.split-media.two img.fit { aspect-ratio: 4 / 3; }

.gallery { margin-top: 96px; }
.gallery h2 { margin: 0 0 20px; font-size: 14px; font-weight: 500; color: var(--fg-3); }
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.gallery-grid img, .gallery-grid video { aspect-ratio: 4 / 3; object-fit: cover; }
.gallery-grid img.fit { object-fit: contain; padding: 10px; background: #fff; }

.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 96px; padding-top: 24px; border-top: 1px solid var(--line); }
.pn a { text-decoration: none; font-size: 16px; font-weight: 500; letter-spacing: -0.01em; }
.pn a span { display: block; font-size: 13px; font-weight: 400; color: var(--fg-3); margin-bottom: 4px; }
.pn a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.pn .next { text-align: right; }

/* ---------- about ---------- */

.about-head { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 48px; align-items: center; }
.portrait { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); box-shadow: 0 0 0 1px var(--stroke); }
.about-head h1 { margin: 0; font-size: clamp(2rem, 4.4vw, 2.75rem); font-weight: 500; line-height: 1.1; letter-spacing: -0.03em; }
.about-head .lede { margin: 16px 0 0; font-size: 19px; line-height: 1.55; color: var(--fg-2); max-width: 34em; }
.about-head .links { margin-top: 24px; }

.story-label { margin: 104px 0 0; font-size: 14px; font-weight: 500; color: var(--fg-3); }
.story-label + .split { margin-top: 24px; }

.photo-band { margin-top: 96px; }
.photo-band h2 { margin: 0 0 20px; font-size: 14px; font-weight: 500; color: var(--fg-3); }
.photo-band .car-track { aspect-ratio: 16 / 8; }

.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 56px; margin-top: 96px; }
.cols h2 { margin: 0 0 14px; font-size: 14px; font-weight: 500; color: var(--fg-3); }
.cols .wide { grid-column: 1 / -1; }
.facts { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.facts li { display: flex; justify-content: space-between; gap: 4px 24px; flex-wrap: wrap; padding: 11px 0; border-bottom: 1px solid var(--line); }
.facts li span:last-child { color: var(--fg-3); font-size: 13.5px; }

.interests { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 32px; margin: 0; padding: 0; list-style: none; }
.interests b { display: block; font-weight: 500; margin-bottom: 4px; }
.interests span { color: var(--fg-2); font-size: 14.5px; }

/* ---------- small screens ---------- */

@media (max-width: 820px) {
  .project { grid-template-columns: 1fr; gap: 16px; }
  .projects { gap: 52px; }
  .intro { padding-block: 64px 56px; }
  .split, .split.flip { grid-template-columns: 1fr; margin-top: 64px; }
  .split.flip > .split-text { order: 0; }
  .facts-row { grid-template-columns: 1fr; }
  .highlights li { padding: 14px 12px; font-size: 13px; }
  .highlights b { font-size: 21px; }
  .gallery-grid, .interests { grid-template-columns: 1fr 1fr; }
  .about-head { grid-template-columns: 1fr; gap: 28px; }
  .portrait { max-width: 240px; }
  .cols { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .interests { grid-template-columns: 1fr; }
  .gallery-grid { gap: 12px; }
  .split-media.two { gap: 10px; }
  .photo-band .car-track { aspect-ratio: 4 / 3; }
}

.cols .split-media.two { max-width: 560px; }

/* Rows of phone screenshots: shown at their natural shape, no box */
.phones-row { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 16px; }
.phones img { aspect-ratio: auto; object-fit: contain; border-radius: 0; box-shadow: none; background: #fff; }
.hero.phones .phones-row { max-width: 920px; margin: 0 auto; gap: 24px; }
.split-media.has-phones .phones-row { max-width: 440px; }
@media (max-width: 520px) {
  .phones-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
.phones[style*="--n:1"] .phones-row { max-width: 280px; }
.split.text-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 820px) { .split.text-pair { grid-template-columns: 1fr; } }
/* Diagrams and screenshots keep their own shape instead of sitting in a fixed box */
.split-media img.fit, .split-media.two img.fit { aspect-ratio: auto; }
.split-media img.fit { max-height: 440px; }
.split-media.two img.fit { aspect-ratio: 4 / 5; max-height: none; }
.phones[style*="--n:1"] .phones-row { max-width: 220px; }
.split-media img.wide, .gallery-grid img.wide { aspect-ratio: auto; }
