/* Sofi Blair — portfolio. Black & white, type-led, work in color. */
:root {
  --black: #0a0a0a;
  --white: #ffffff;
  --paper: #f6f6f4;
  --grey-1: #e6e6e3;
  --grey-2: #9a9a96;
  --grey-3: #5c5c59;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1320px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--white);
  color: var(--black);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
:root { color-scheme: light; }
a { color: inherit; text-decoration: none; }

.wrap {
  max-width: var(--max); margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

/* ---------- type ---------- */
.eyebrow {
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--grey-3);
}
.display {
  font-family: var(--serif);
  font-weight: 400;
  line-height: .95;
  letter-spacing: -.02em;
}
.display em { font-style: italic; }
h2.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1;
  letter-spacing: -.01em;
}
.lede { font-size: clamp(18px, 1.6vw, 22px); line-height: 1.5; color: var(--black); }
p + p { margin-top: 1em; }
.muted { color: var(--grey-3); }

/* ---------- header ---------- */
body::before {
  content: ""; position: fixed; inset: 0 0 auto; z-index: 60;
  height: env(safe-area-inset-top, 0px); background: var(--white);
}
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--grey-1);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo { font-family: var(--serif); font-size: 24px; line-height: 1; }
.nav { display: flex; gap: clamp(16px, 3vw, 36px); font-size: 13px; letter-spacing: .04em; }
.nav a { position: relative; padding: 4px 0; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform .3s ease;
}
.nav a:hover::after, .nav a[aria-current]::after { transform: scaleX(1); }

/* ---------- home hero ---------- */
/* the landing screen is just the intro: Selected work starts below the fold */
.hero { padding-block: clamp(48px, 7vw, 104px) clamp(48px, 8vw, 96px); min-height: calc(100vh - 65px); min-height: calc(100svh - 65px); box-sizing: border-box; }
.hero .display { font-size: clamp(52px, 9.5vw, 148px); }
.hero-sub {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
  margin-top: clamp(32px, 5vw, 64px);
  padding-top: 24px; border-top: 1px solid var(--black);
}
.hero-sub .roles { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.hero-sub .roles .row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.pill {
  font-size: 12px; letter-spacing: .04em;
  border: 1px solid var(--black); border-radius: 999px;
  padding: 6px 14px; white-space: nowrap;
}
.pill.solid { background: var(--black); color: var(--white); }

/* ---------- work index ---------- */
.section { padding-block: clamp(64px, 9vw, 128px); }
.section-head {
  display: flex; justify-content: space-between; align-items: end; gap: 24px;
  margin-bottom: clamp(32px, 5vw, 56px);
}
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(32px, 4vw, 56px) clamp(20px, 3vw, 40px); }
.work-card.feature { grid-column: 1 / -1; }
.work-card .thumb {
  overflow: hidden; background: var(--paper);
  aspect-ratio: 16 / 10;
  border: 1px solid var(--grey-1);
}
.work-card.feature .thumb { aspect-ratio: 21 / 9; }
.work-card .thumb img {
  width: 100%; height: 100%; object-fit: cover; object-position: top;
  transition: transform .8s cubic-bezier(.2,.7,.2,1);
}
.work-card:hover .thumb img { transform: scale(1.03); }
.work-card .meta {
  display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: baseline;
  padding-top: 16px;
}
.work-card .num { font-size: 12px; color: var(--grey-2); font-variant-numeric: tabular-nums; }
.work-card h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 2.6vw, 34px); line-height: 1.1; }
.work-card .kind { font-size: 13px; color: var(--grey-3); text-align: right; }
.work-card .arrow { display: inline-block; transition: transform .3s ease; }
.work-card:hover .arrow { transform: translateX(6px); }

/* ---------- capabilities ---------- */
.dark { background: var(--black); color: var(--white); }
.dark .eyebrow, .dark .muted { color: var(--grey-2); }
.caps { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid #2a2a2a; }
.cap { padding: 32px 24px 8px 0; border-right: 1px solid #2a2a2a; padding-left: 24px; }
.cap:first-child { padding-left: 0; }
.cap:last-child { border-right: 0; }
.cap .n { font-size: 12px; color: var(--grey-2); }
.cap h3 { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.1; margin: 12px 0; }
.cap ul { list-style: none; font-size: 14px; color: #c8c8c4; }
.cap li { padding: 4px 0; }

/* ---------- about / contact ---------- */
.about-grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 96px); }
.facts { margin-top: 40px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; border-top: 1px solid var(--grey-1); padding-top: 24px; }
.facts h4 { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--grey-3); font-weight: 500; margin-bottom: 8px; }
.facts p, .facts li { font-size: 14px; list-style: none; }

.contact { text-align: left; }
.contact .display { font-size: clamp(48px, 9vw, 136px); }
.contact-links { display: flex; flex-wrap: wrap; gap: 12px 40px; margin-top: 40px; font-size: 15px; }
.contact-links a { border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.contact-links a:hover { opacity: .6; }

.site-footer { border-top: 1px solid #2a2a2a; padding: 24px 0; font-size: 12px; color: var(--grey-2); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- project page ---------- */
.p-hero { padding-block: clamp(48px, 8vw, 112px) clamp(32px, 5vw, 64px); }
.p-hero .back { font-size: 13px; color: var(--grey-3); display: inline-block; margin-bottom: 40px; }
.p-hero .back:hover { color: var(--black); }
.p-hero .display { font-size: clamp(52px, 9vw, 132px); margin: 16px 0 24px; }
.p-hero .lede { max-width: 760px; }
.p-meta {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  margin-top: clamp(40px, 6vw, 72px); padding-top: 20px; border-top: 1px solid var(--black);
}
.p-meta h4 { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--grey-3); font-weight: 500; margin-bottom: 6px; }
.p-meta p { font-size: 14px; }
.p-meta a { border-bottom: 1px solid currentColor; }

.stage { background: var(--paper); padding: clamp(32px, 6vw, 88px) 0; }
.stage + .stage { padding-top: 0; }
.caption { font-size: 13px; color: var(--grey-3); margin-top: 14px; display: flex; justify-content: space-between; gap: 16px; }

/* browser frame showing a full-length homepage */
.browser {
  background: var(--white);
  border: 1px solid var(--grey-1);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.25);
}
.browser .bar {
  display: flex; align-items: center; gap: 12px;
  height: 38px; padding: 0 14px;
  border-bottom: 1px solid var(--grey-1);
  background: var(--white);
}
.browser .dots { display: flex; gap: 6px; }
.browser .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--grey-1); }
.browser .url {
  flex: 1; max-width: 360px; margin: 0 auto;
  font-size: 11px; color: var(--grey-3); text-align: center;
  background: var(--paper); border-radius: 6px; padding: 4px 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.browser .page { width: 100%; }

/* phone frame: the homepage scrolls by itself, pausing at top and bottom */
.screen { --h: 560px; height: var(--h); overflow: hidden; position: relative; }
.screen img { width: 100%; }
.screen.auto img { animation: autoscroll var(--d, 30s) ease-in-out infinite alternate; }
@keyframes autoscroll {
  0%, 6% { transform: translateY(0); }
  94%, 100% { transform: translateY(calc(-100% + var(--h))); }
}

/* phone frame */
.phone {
  width: 100%; max-width: 300px; margin: 0 auto;
  border: 10px solid var(--black); border-radius: 38px;
  overflow: hidden; background: var(--black);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.35);
}
.phone .screen { --h: 560px; border-radius: 28px; }

.showcase { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(24px, 4vw, 64px); align-items: start; }
.phone-col { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 96px); }

.story { display: grid; grid-template-columns: 4fr 8fr; gap: clamp(24px, 6vw, 96px); padding-block: clamp(56px, 8vw, 112px); }
.story + .story { padding-top: 0; }
.story h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3.4vw, 44px); line-height: 1.05; }
.story ul.list { list-style: none; margin-top: 8px; border-top: 1px solid var(--grey-1); }
.story ul.list li { padding: 14px 0; border-bottom: 1px solid var(--grey-1); display: grid; grid-template-columns: 180px 1fr; gap: 16px; }
.story ul.list li strong { font-weight: 500; }

.next {
  display: block; border-top: 1px solid var(--grey-1);
  padding-block: clamp(48px, 8vw, 112px);
}
.next .display { font-size: clamp(44px, 8vw, 112px); transition: opacity .3s ease; }
.next:hover .display { opacity: .55; }

/* journal gallery */
.gallery { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(10px, 1.4vw, 20px); }
.gallery figure { overflow: hidden; background: var(--paper); }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery figcaption { font-size: 12px; color: var(--grey-3); padding-top: 8px; background: var(--white); }
.g-6 { grid-column: span 6; } .g-4 { grid-column: span 4; } .g-8 { grid-column: span 8; } .g-12 { grid-column: span 12; }
.ar-portrait { aspect-ratio: 4 / 5; } .ar-wide { aspect-ratio: 4 / 3; } .ar-tall { aspect-ratio: 3 / 5; }
.bw img { filter: grayscale(1); transition: filter .6s ease; }
.bw:hover img { filter: grayscale(0); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--black); }
.stats div { padding: 24px 24px 0 0; }
.stats .big { font-family: var(--serif); font-size: clamp(44px, 6vw, 80px); line-height: 1; }
.stats p { font-size: 14px; color: var(--grey-3); margin-top: 8px; }

/* ---------- reveal ---------- */
.reveal { transition: transform .9s cubic-bezier(.2,.7,.2,1); }
.js .reveal:not(.in) { transform: translateY(16px); }
.reveal.in { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .js .reveal:not(.in) { transform: none; transition: none; }
  .screen.auto { overflow-y: auto; }
  .screen.auto img { animation: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-sub, .about-grid, .story { grid-template-columns: 1fr; }
  .hero-sub .roles { align-items: flex-start; }
  .hero-sub .roles .row { justify-content: flex-start; }
  .caps { grid-template-columns: 1fr 1fr; }
  .cap { border-right: 0; padding-left: 0; border-bottom: 1px solid #2a2a2a; padding-bottom: 24px; }
  .p-meta { grid-template-columns: 1fr 1fr; }
  .showcase { grid-template-columns: 1fr; }
  .phone-col { position: static; }
}
@media (max-width: 640px) {
  .work-grid { grid-template-columns: 1fr; }
  .work-card.feature .thumb { aspect-ratio: 16 / 10; }
  .work-card .meta { grid-template-columns: auto 1fr; }
  .work-card .kind { grid-column: 2; text-align: left; }
  .caps, .stats, .facts { grid-template-columns: 1fr; }
  .nav { gap: 16px; font-size: 12px; }
  .story ul.list li { grid-template-columns: 1fr; gap: 2px; }
  .gallery .g-4, .gallery .g-6, .gallery .g-8 { grid-column: span 12; }
  .browser .url { display: none; }
}

/* About: the note on AI */
.on-ai { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--grey-1); display: grid; gap: 12px; max-width: 65ch; }
.on-ai p + p { margin-top: 0; }

/* whole, uncropped photos */
.photo img, .photo-row img { width: 100%; height: auto; }
.photo figcaption, .photo-row figcaption { font-size: 12px; color: var(--grey-3); padding-top: 8px; }
.photo-row { display: flex; gap: clamp(10px, 1.4vw, 20px); align-items: flex-start; }
.photo-row figure { min-width: 0; }
.work-card .thumb.photos { aspect-ratio: auto; background: none; border: 0; }
.work-card .thumb.photos img { height: auto; object-fit: initial; }
@media (max-width: 640px) {
  .photo-row:not(.keep) { flex-direction: column; }
  .photo-row:not(.keep) figure { flex: none !important; width: 100%; }
}

/* featured journal card: one whole photo beside the title */
.work-card.split { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: end; }
.work-card.split .thumb.photos img { height: clamp(360px, 42vw, 560px); width: auto; max-width: 100%; }
.split-text { display: grid; gap: 16px; padding-bottom: 8px; max-width: 46ch; }
.split-text .display { font-size: clamp(48px, 6vw, 88px); }
.split-text .kind { font-size: 13px; color: var(--grey-3); }
@media (max-width: 640px) {
  .work-card.split { grid-template-columns: 1fr; }
  .work-card.split .thumb.photos img { width: 100%; height: auto; }
}
.split-text .kind { text-align: left; }

/* ---------- social case study: Instagram feeds ---------- */
.ig-account + .ig-account { padding-top: 0; }
.ig-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.ig-phone {
  width: 100%; max-width: 340px; margin: 0 auto;
  border: 10px solid var(--black); border-radius: 40px;
  background: var(--white); overflow: hidden;
  padding: 22px 0 0;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.35);
}
.ig-head { display: flex; align-items: center; gap: 14px; padding: 0 16px; }
.ig-pic { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 1px solid var(--grey-1); }
.ig-handle { font-size: 15px; font-weight: 500; }
.ig-name { font-size: 13px; color: var(--grey-3); }
.ig-bio { font-size: 12px; padding: 10px 16px 0; color: var(--black); }
.ig-tabs { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 14px; border-bottom: 1px solid var(--grey-1); }
.ig-tabs span { height: 30px; position: relative; }
.ig-tabs span::after { content: ""; position: absolute; left: 50%; top: 8px; width: 14px; height: 14px; transform: translateX(-50%); border: 1.5px solid var(--grey-2); border-radius: 3px; }
.ig-tabs .on { border-bottom: 1.5px solid var(--black); }
.ig-tabs .on::after { border-color: var(--black); }
.ig-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.ig-grid img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; }
.ig-text { display: grid; gap: 16px; max-width: 560px; }
.ig-text h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 3.6vw, 48px); line-height: 1.05; text-wrap: balance; }
.ig-reel { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px; align-items: center; margin-top: 12px; padding-top: 20px; border-top: 1px solid var(--grey-1); }
.ig-reel-img { position: relative; display: block; border-radius: 12px; overflow: hidden; aspect-ratio: 9 / 16; background: var(--paper); }
.ig-reel-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.ig-reel:hover .ig-reel-img img { transform: scale(1.04); }
.ig-reel .play { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(10,10,10,.72); }
.ig-reel .play::after { content: ""; position: absolute; left: 19px; top: 14px; border-style: solid; border-width: 10px 0 10px 16px; border-color: transparent transparent transparent var(--white); }
.ig-reel-text { display: grid; gap: 8px; font-size: 15px; }
.ig-watch { font-size: 13px; border-bottom: 1px solid currentColor; justify-self: start; }
.ig-reel:hover .ig-watch { opacity: .6; }

/* homepage card: three feeds side by side */
.work-card .thumb.feeds { aspect-ratio: 21 / 9; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(10px, 2vw, 28px); padding: clamp(14px, 2.4vw, 32px); align-items: center; }
.mini-feed p { font-size: 11px; color: var(--grey-3); margin-bottom: 6px; }
.mini-feed div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.work-card .thumb.feeds .mini-feed img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; object-position: center; }

@media (max-width: 900px) {
  .ig-layout { grid-template-columns: 1fr; }
  .ig-text { max-width: none; }
}
@media (max-width: 640px) {
  .work-card .thumb.feeds { aspect-ratio: auto; grid-template-columns: 1fr; }
  .work-card .thumb.feeds .mini-feed:nth-child(n+2) { display: none; }
  .ig-reel { grid-template-columns: 110px minmax(0, 1fr); }
}
.ig-head > div { min-width: 0; }
.ig-handle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(12px, 3.6vw, 15px); }
.ig-handle.long { font-size: 12.5px; }

/* reels that play on the page */
.ig-reel { grid-template-columns: 220px minmax(0, 1fr); }
.ig-player { cursor: pointer; }
.ig-player video { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--black); }
.ig-player:focus-visible { outline: 2px solid var(--black); outline-offset: 3px; }
.ig-player:hover .play { transform: translate(-50%, -50%) scale(1.08); }
.ig-reel .play { transition: transform .2s ease; pointer-events: none; }
.ig-player.playing { cursor: auto; }
.ig-player.playing .play { display: none; }
.ig-player.playing video { object-fit: contain; }
.ig-hint { font-size: 13px; color: var(--grey-3); }
@media (max-width: 640px) { .ig-reel { grid-template-columns: 150px minmax(0, 1fr); } }

/* phones: keep the first three role tags on one line */
@media (max-width: 480px) {
  .hero-sub .roles .row { gap: 6px; }
  .pill { font-size: 11px; letter-spacing: .02em; padding: 6px 10px; }
}
