/* ==================================================================
   Janhvi Ratrey: Exposure
   The page is sensitised paper. Prints wait underneath (z 0),
   the paper canvas covers them (z 1), and the words lie on top (z 2).
   ================================================================== */

:root {
  --paper: #ece6d4;
  --ink: #0c2559;
  --ink-2: rgba(12, 37, 89, 0.64);
  --ink-3: rgba(12, 37, 89, 0.38);
  --rule: rgba(12, 37, 89, 0.18);
  --blue: #1a428c;
  --ember: #d0452f;

  --display: "Melodrama", "Didot", serif;
  --text: "Ranade", system-ui, sans-serif;

  --gutter: clamp(16px, 3.4vw, 56px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { background: var(--blue); }
body {
  background: var(--blue);
  color: var(--ink);
  font-family: var(--text);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
@media (hover: hover) and (pointer: fine) { body { cursor: none; } a, button { cursor: none; } }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; }
img { display: block; max-width: 100%; }
::selection { background: var(--ink); color: var(--paper); }
em { font-style: normal; font-weight: 400; }
b { font-weight: 500; }

/* ---------- layers ---------- */

#paper {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}
.under {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(1.12) saturate(1.05);
}
[data-shadow], .bar, .plate-head, .spec-label { position: relative; z-index: 2; }

/* no WebGL: show the paper as plain paper */
.no-gl body, .no-gl html { background: var(--paper); }
.no-gl .under { opacity: 0; }
.no-gl .window .under { opacity: 1; }

/* ---------- sun (cursor) ---------- */

.sun {
  position: fixed;
  left: 0; top: 0;
  z-index: 50;
  pointer-events: none;
  width: 0; height: 0;
}
.sun::before, .sun i {
  content: "";
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.sun::before {
  width: 9px; height: 9px;
  background: var(--ember);
  box-shadow: 0 0 18px 4px rgba(208, 69, 47, 0.45);
}
.sun i {
  width: 46px; height: 46px;
  border: 1px solid rgba(208, 69, 47, 0.5);
  transition: width 0.6s var(--ease), height 0.6s var(--ease), border-color 0.4s;
}
.sun.is-link i { width: 70px; height: 70px; border-color: var(--ember); }
@media (hover: none), (pointer: coarse) { .sun { display: none; } }

/* ---------- top bar ---------- */

.bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 24px;
  padding: 22px var(--gutter);
  font-size: 15px;
}
.bar-name { font-family: var(--display); font-size: 26px; font-weight: 400; line-height: 1; letter-spacing: -0.01em; justify-self: start; }
.bar-nav { justify-self: end; display: flex; gap: 26px; }
.bar-nav a { position: relative; }
.bar-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.6s var(--ease);
}
.bar-nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.bar-name { white-space: nowrap; }
@media (max-width: 560px) { .bar { gap: 12px; } .bar-nav { gap: 13px; font-size: 13px; } .bar-name { font-size: 20px; } }

/* ---------- shared plate type ---------- */

.plate { position: relative; padding: 0 var(--gutter); }
.plate-no { font-size: 13px; letter-spacing: 0.04em; color: var(--ink-2); width: fit-content; }
.plate-head { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 32px; align-items: end; padding-bottom: clamp(56px, 9vh, 110px); }
.plate-title {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(36px, 4vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  width: fit-content;
}
.plate-aside { color: var(--ink-2); font-size: 15px; max-width: 30ch; justify-self: end; width: fit-content; }
@media (max-width: 900px) {
  .plate-head { grid-template-columns: 1fr; gap: 16px; }
  .plate-aside { justify-self: start; }
}

/* ---------- I. hero: a blank herbarium sheet ---------- */

.hero {
  height: 100svh;
  min-height: 620px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding-top: 100px;
  padding-bottom: clamp(24px, 5vh, 48px);
}

/* the print waiting under the paper */
.hero-print { overflow: hidden; background: var(--blue); }
.hero-print img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* the original hero print: cosmos at full strength */
.hp-bg { object-position: 70% 40%; }

/* the specimen label, the only thing printed on the sheet */
.label {
  width: min(380px, 100%);
  padding: 20px 22px 18px;
  border: 1px solid var(--ink);
  font-size: 14px;
  order: 2;
}
.label-top { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.label-name { font-family: var(--display); font-weight: 400; font-size: 40px; line-height: 1; letter-spacing: -0.015em; margin: 16px 0 8px; }
.label-what { color: var(--ink); line-height: 1.45; }
.label-rows { display: grid; grid-template-columns: 78px 1fr; gap: 3px 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule); }
.label-rows dt { color: var(--ink-3); font-style: italic; }
.label-rows dd { color: var(--ink-2); }

.hint { display: flex; gap: 12px; align-items: center; font-size: 14px; color: var(--ink-2); width: fit-content; max-width: 34ch; }
.hint-sun { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 0 5px rgba(208, 69, 47, 0.15); animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 9px rgba(208, 69, 47, 0.06); } }

.for-touch { display: none; }
@media (hover: none), (pointer: coarse) { .for-fine { display: none; } .for-touch { display: inline; } }
@media (max-width: 760px) {
  .hero { flex-direction: column; align-items: stretch; justify-content: flex-end; }
  .label { order: 0; }
}

/* ---------- II. selected work ---------- */

.specimens { padding-top: clamp(140px, 22vh, 240px); }
.spec-table {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2.4vw, 40px);
  row-gap: clamp(90px, 14vh, 160px);
}
.spec { position: relative; }
.spec:nth-child(1) { grid-column: 1 / span 6; }
.spec:nth-child(2) { grid-column: 8 / span 4; margin-top: 26vh; }
.spec:nth-child(3) { grid-column: 2 / span 4; }
.spec:nth-child(4) { grid-column: 7 / span 6; margin-top: 14vh; }
.spec:nth-child(5) { grid-column: 1 / span 5; margin-top: -6vh; }
.spec:nth-child(6) { grid-column: 7 / span 5; margin-top: 10vh; }
@media (max-width: 860px) {
  .spec:nth-child(n) { grid-column: 1 / -1; margin-top: 0; }
}

.window { position: relative; overflow: hidden; }
.window::after {
  /* hairline frame drawn above the paper */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 1px solid var(--rule);
  pointer-events: none;
  transition: border-color 0.6s;
}
.spec .window { aspect-ratio: 4 / 5; }
.spec:nth-child(1) .window, .spec:nth-child(4) .window { aspect-ratio: 5 / 4; }
.spec .window .under { transform: scale(1.06); transition: transform 2.4s var(--ease); }
.spec.is-lit .window .under { transform: scale(1); }
.spec.is-lit .window::after { border-color: transparent; }

/* number, title, one line; the outcome surfaces only when the print is lit */
.spec-label {
  display: grid;
  grid-template-columns: 36px auto;
  align-items: baseline;
  row-gap: 6px;
  width: fit-content;
  margin-top: 20px;
  font-size: 14px;
}
.spec-no { color: var(--ink-3); font-size: 13px; letter-spacing: 0.04em; }
.spec-title {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(34px, 3.2vw, 54px);
  line-height: 1;
  letter-spacing: -0.02em;
}
.spec-what, .spec-yield { grid-column: 2; color: var(--ink-2); }
.spec-yield {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.8s var(--ease), opacity 0.6s, transform 0.8s var(--ease);
  transform: translateY(-4px);
}
.spec-yield b { font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1; color: var(--blue); margin-right: 6px; }
.spec.is-lit .spec-yield { max-height: 40px; opacity: 1; transform: none; }
@media (hover: none), (pointer: coarse) { .spec-yield { max-height: 40px; opacity: 1; transform: none; } }

.work-head { grid-template-columns: 1fr auto; padding-bottom: clamp(40px, 7vh, 80px); }
.work-head .plate-title { font-size: clamp(44px, 5vw, 84px); }

/* ---------- III. about ---------- */

.notes { padding-top: clamp(160px, 26vh, 300px); }
.notes-grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 110px); align-items: start; }
.notes-portrait { position: sticky; top: 110px; }
.notes-portrait .window { aspect-ratio: 4 / 5; }
.notes-portrait figcaption { margin-top: 14px; font-size: 13px; color: var(--ink-2); width: fit-content; }
.notes-lead {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(32px, 3.3vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 28px 0 24px;
}
.notes-body { color: var(--ink-2); max-width: 56ch; }

/* where I've worked: one line each, years / place / role */
.roles { list-style: none; margin-top: 48px; border-top: 1px solid var(--rule); }
.roles li {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 16px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  transition: padding 0.7s var(--ease);
}
.roles li:hover { padding-left: 10px; }
.roles span { font-size: 13px; color: var(--ink-3); }
.roles b { font-family: var(--display); font-weight: 400; font-size: clamp(22px, 1.9vw, 28px); line-height: 1.1; }
.roles i { font-style: normal; font-size: 14px; color: var(--ink-2); text-align: right; }
.edu { margin-top: 22px; font-size: 13px; color: var(--ink-3); width: fit-content; }
@media (max-width: 860px) {
  .notes-grid { grid-template-columns: 1fr; }
  .notes-portrait { position: relative; top: 0; max-width: 420px; }
}
@media (max-width: 560px) {
  .roles li { grid-template-columns: 64px 1fr; row-gap: 2px; }
  .roles i { grid-column: 2; text-align: left; }
}

/* ---------- V. keepsake + contact ---------- */

.keep { padding-top: clamp(160px, 26vh, 300px); padding-bottom: 48px; min-height: 100svh; }
.keep-under { top: 30%; height: 70%; object-position: 50% 80%; }
.keep-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 110px); align-items: start; }
.keepsake { margin-top: 20px; padding: 14px; background: var(--paper); box-shadow: 0 1px 0 var(--rule), 0 30px 60px -30px rgba(12, 37, 89, 0.35); }
.keepsake canvas { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; }
.keep-stats { margin-top: 18px; font-size: 14px; color: var(--ink-2); width: fit-content; }
.keep-btn {
  margin-top: 18px;
  padding: 14px 22px;
  border: 1px solid var(--ink);
  font-size: 15px;
  font-weight: 400;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}
.keep-btn:hover { background: var(--ink); color: var(--paper); }
.keep-title {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(36px, 4.2vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-top: 40px;
}
.keep-mail {
  display: inline-block;
  margin-top: 44px;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(26px, 3vw, 48px);
  line-height: 1.1;
  border-bottom: 1px solid var(--ink);
  overflow-wrap: anywhere;
  transition: color 0.4s, border-color 0.4s;
}
.keep-mail:hover { color: var(--blue); border-color: var(--blue); }
.keep-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; font-size: 15px; width: fit-content; }
.keep-links a, .keep-links button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  transition: color 0.4s, border-color 0.4s, transform 0.6s var(--ease);
}
.keep-links svg { width: 20px; height: 20px; flex: none; }
.keep-links a:hover, .keep-links button:hover { color: var(--blue); border-color: var(--blue); transform: translateY(-2px); }
.colophon { margin-top: clamp(80px, 16vh, 180px); font-size: 13px; color: var(--ink-3); width: fit-content; }
@media (max-width: 860px) { .keep-grid { grid-template-columns: 1fr; } .keep-print { max-width: 420px; } }

/* ---------- entrance: ink settles into the paper ---------- */

/* opacity makes a stacking context, so settling elements must sit above the paper themselves */
.settle { position: relative; z-index: 2; opacity: 0; transition: opacity 1.6s var(--ease); }
.bar.settle { position: fixed; z-index: 20; }
.settle.is-in { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .settle { opacity: 1; transition: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* a spec with a case study is a link */
a.spec { display: block; }
.spec-open {
  grid-column: 2;
  font-size: 14px;
  color: var(--ink);
  width: fit-content;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.4s, color 0.4s;
}
a.spec:hover .spec-open { color: var(--blue); border-color: var(--blue); }
.spec-soon {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-3);
  width: fit-content;
}
.spec-soon::before { content: ""; width: 6px; height: 6px; border-radius: 50%; border: 1px solid currentColor; }

/* a real screen in place of a print: inked onto the paper, developed into colour by the light */
.spec-ui .window, .spec-ui:nth-child(1) .window { aspect-ratio: 1440 / 842; }
.spec-ui .window .under { object-position: top left; filter: none; }
.spec-duo {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: var(--ink);
  isolation: isolate;
  transition: opacity 1.4s var(--ease);
}
.spec-duo img { width: 100%; height: 100%; object-fit: cover; object-position: top left; filter: grayscale(1) contrast(1.15) brightness(1.08); mix-blend-mode: screen; opacity: 0.92; }
.spec-duo::after { content: ""; position: absolute; inset: 0; background: var(--paper); mix-blend-mode: multiply; }
.spec-ui.is-lit .spec-duo { opacity: 0; }

/* hero tags, printed beneath the paper */
.hp-tags { list-style: none; position: absolute; inset: 0; }
.hp-tags li {
  position: absolute;
  left: var(--x);
  top: var(--y);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 14px;
  white-space: nowrap;
  color: var(--paper);
  border: 1px solid rgba(236, 230, 212, 0.75);
  background: rgba(12, 37, 89, 0.35);
  backdrop-filter: blur(2px);
}
.hp-tags li.ai { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.hp-tags li.ai::before { content: "✦"; margin-right: 7px; color: var(--blue); font-size: 11px; }
@media (max-width: 760px) {
  .hp-tags li { left: var(--mx, -999px); top: var(--my, -999px); font-size: 13px; padding: 6px 12px; }
}
