/* ============================================
   Rushil Vislawath — portfolio
   One column, one serif, grey text.
   Size and weight carry the hierarchy.
   ============================================ */

:root {
  --bg: #ffffff;
  --bg-blur: rgba(255, 255, 255, 0.82);
  --head: #2f2f33;
  --text: #55555c;
  --muted: #85858e;
  --faint: #b4b4bc;
  --rule: #e6e6ea;
  --shot: #f2f2f4;
  --measure: 46rem;   /* text column */
  --rail: 20rem;      /* image column, floated right of the text */
  --page: 70rem;      /* text + rail + gutter */
  --bar: 3.75rem;
  --hero: linear-gradient(140deg,
    #d8e4f0 0%,
    #dfeaea 40%,
    #ece7dd 74%,
    #f4ede4 100%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111113;
    --bg-blur: rgba(17, 17, 19, 0.82);
    --head: #e4e4e8;
    --text: #a9a9b2;
    --muted: #83838d;
    --faint: #5c5c66;
    --rule: #2a2a2f;
    --shot: #1b1b1f;
    --hero: linear-gradient(140deg,
      #18222f 0%,
      #182428 40%,
      #241f1c 74%,
      #2b2521 100%);
  }
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'STIX Two Text', Georgia, 'Times New Roman', serif;
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- site bar ---------- */
.site {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-blur);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.site-inner {
  max-width: 92rem;
  margin: 0 auto;
  min-height: var(--bar);
  padding: 0.7rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}
@media (max-width: 640px) {
  .site-inner { flex-direction: column; align-items: flex-start; gap: 0.5rem; padding: 0.8rem 1.35rem; }
}

.logo {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--head);
  margin: 0;
}
.logo a { text-decoration: none; }
.logo a:hover { color: var(--head); }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.15rem;
}
.nav a {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.76rem;
  letter-spacing: 0.01em;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.nav a:hover { color: var(--head); }
.nav .b { color: var(--faint); transition: color 0.15s ease; }
.nav a:hover .b { color: var(--muted); }
@media (max-width: 640px) { .nav { gap: 0.85rem; } .nav a { font-size: 0.72rem; } }

/* ---------- hero ---------- */
.hero {
  background: var(--hero);
  border-bottom: 1px solid var(--rule);
}
.hero-inner {
  max-width: 60rem;
  margin: 0 auto;
  min-height: clamp(440px, 82vh, 820px);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

main {
  max-width: var(--page);
  margin: 0 auto;
  padding: 4.5rem 1.5rem 6rem;
}
/* text keeps a fixed measure; figures float out into the rail beside it */
main > *:not(figure) { max-width: var(--measure); }
@media (max-width: 640px) { main { padding: 3rem 1.35rem 4rem; } }

/* ---------- type scale ---------- */
h2 {
  color: var(--head);
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 3.4rem 0 1.1rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  scroll-margin-top: calc(var(--bar) + 1.5rem);
  clear: both;
}
main > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

h3 {
  color: var(--head);
  font-size: 1.02rem;
  font-weight: 600;
  margin: 2.3rem 0 0.15rem;
  scroll-margin-top: calc(var(--bar) + 1.5rem);
}

p { margin-bottom: 1.1rem; }
p:last-child { margin-bottom: 0; }

em { font-style: italic; }
strong { font-weight: 600; color: var(--head); }

/* small grey line under a heading: role, stack, dates */
.meta {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.005em;
  margin-bottom: 0.75rem;
}

.fine {
  color: var(--faint);
  font-size: 0.78rem;
}

/* ---------- links ---------- */
a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-underline-offset: 0.16em;
  text-decoration-thickness: 0.5px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
a:hover { color: var(--head); text-decoration-color: var(--head); }

/* ---------- picture slots ---------- */
/* floated right so body text runs down the left of them; each figure sits
   just above the paragraphs it belongs with in the markup */
figure {
  float: right;
  width: var(--rail);
  margin: 0.4rem 0 1.6rem 3rem;
  clear: right;
}
/* no room for a rail: collapse to one centred column and cap the image size
   so a stacked 3:2 placeholder doesn't swallow the screen */
@media (max-width: 1080px) {
  main { max-width: var(--measure); }
  figure { float: none; width: auto; max-width: 30rem; margin: 2rem 0 2.2rem; }
}

figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
}

/* placeholder block; delete once a real image is dropped in */
.shot {
  aspect-ratio: var(--ratio, 3 / 2);
  background: var(--shot);
  border: 1px solid var(--rule);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  color: var(--faint);
  font-size: 0.8rem;
  font-style: italic;
}

figcaption {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.79rem;
  font-style: italic;
}

/* ---------- foot ---------- */
footer {
  clear: both;
  margin-top: 3.4rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
}
