/* ratsakatika.com — hand-written stylesheet. No build step. */

:root {
  --paper: #F4EFE4;
  --ink: #1E2A22;
  --ink-soft: #3A4740;
  --muted: #5B6660;
  --rule: #D8D0BF;
  --accent: #2E5E3E;
  --footer-bg: #1E2A22;
  --footer-text: #E3E8E1;
  --footer-muted: #B3BFB4;
  --footer-small: #8C9A8E;
  --footer-rule: #33443A;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --gutter: 72px;
  --max: 1280px;
}

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

html {
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

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

.skip {
  position: absolute; left: 16px; top: -60px;
  background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 4px; z-index: 100;
}
.skip:focus { top: 12px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.site-header__inner {
  height: 72px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.wordmark {
  font-family: var(--serif);
  font-size: 27px; font-weight: 500; color: var(--ink);
  white-space: nowrap;
}
.wordmark:hover { text-decoration: none; }
.nav { display: flex; gap: 32px; align-items: center; font-size: 16px; font-weight: 500; }
.nav a { color: var(--ink); }
.nav__contact {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

/* Shared type */
.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--muted);
}
.eyebrow--accent { color: var(--accent); font-size: 13px; letter-spacing: 1.4px; }
.eyebrow--light { color: #D9E4D6; font-size: 13px; letter-spacing: 1.6px; }
h2 { font-family: var(--serif); font-weight: 400; font-size: 36px; line-height: 1.15; }
.h2--small { font-size: 30px; }
.section { padding-top: 52px; padding-bottom: 56px; }
.section--rule { border-top: 1px solid var(--rule); }
.section__head { display: flex; align-items: baseline; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.section__sub { font-size: 16px; color: var(--muted); }

/* Hero */
/* The hero photo's sizes attribute in index.html is worked out from these heights (620px, 500px on phones) */
.hero {
  position: relative; height: 620px; overflow: hidden; background: var(--ink); color: #fff;
}
.hero__photo {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 40%;
}
.hero__shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(14,26,20,0.08) 0%, rgba(14,26,20,0.40) 45%, rgba(14,26,20,0.86) 100%);
}
/* right: 19px matches the visible gap above the letters (16px plus the line spacing above them) */
.hero__caption {
  position: absolute; right: 19px; top: 16px;
  font-size: 12px; color: rgba(255,255,255,0.8);
}
.hero__content {
  position: absolute; left: 0; right: 0; bottom: 52px;
  display: flex; flex-direction: column; gap: 22px;
}
.hero__title {
  font-family: var(--serif); font-weight: 400;
  font-size: 44px; line-height: 1.16; max-width: 960px; color: #fff;
}
.pills { display: flex; gap: 10px; flex-wrap: wrap; }
.pills a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border: 1px solid rgba(255,255,255,0.55); border-radius: 999px;
  color: #fff; font-size: 15px; font-weight: 500;
}
.pills a:hover { background: rgba(255,255,255,0.12); text-decoration: none; }

/* Latest cards */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.card {
  display: flex; flex-direction: column; gap: 14px;
  border-top: 2px solid var(--ink); padding-top: 18px;
}
.card__figure img { width: 100%; height: 330px; object-fit: cover; border-radius: 4px; }
.card__figure--map img { object-fit: contain; }
.card__figure figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); }
.card__title { font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1.25; }
.card > p { font-size: 16px; line-height: 1.55; color: var(--ink-soft); }
.links { display: flex; gap: 22px; flex-wrap: wrap; font-size: 16px; font-weight: 600; }
.link {
  color: var(--ink); padding-bottom: 2px;
  border-bottom: 2px solid var(--rule);
}
.link--primary { color: var(--accent); border-bottom-color: var(--accent); }
.link:hover { text-decoration: none; border-bottom-color: var(--accent); }

/* Experience */
.intro { display: grid; grid-template-columns: 150px 1fr; gap: 32px; align-items: center; margin-bottom: 28px; }
.intro__portrait { width: 150px; height: 168px; object-fit: cover; border-radius: 4px; }
.intro h2 { margin-bottom: 12px; }
.intro__text { max-width: 820px; font-size: 17px; line-height: 1.5; color: var(--ink-soft); }

.timeline { display: flex; flex-direction: column; }
.entry {
  display: grid; grid-template-columns: 120px 24px 1fr; column-gap: 20px; align-items: start;
}
.entry__date {
  font-family: var(--serif); font-size: 22px; line-height: 1.3; padding-bottom: 6px;
}
.entry--now .entry__date { color: var(--accent); }
.entry__spine { position: relative; align-self: stretch; }
.entry__spine::before {
  content: ""; position: absolute; left: 5px; top: 12px; bottom: 0; width: 2px; background: var(--rule);
}
.entry--last .entry__spine::before { display: none; }
.entry__spine::after {
  content: ""; position: absolute; left: 0; top: 8px; width: 12px; height: 12px; border-radius: 999px; background: var(--ink);
}
.entry--now .entry__spine::after { background: var(--accent); }
.entry__body {
  display: grid; grid-template-columns: 1fr 220px; column-gap: 28px; align-items: start;
  padding-bottom: 28px; margin-bottom: 28px; border-bottom: 1px solid var(--rule);
}
.entry--last .entry__body { border-bottom: 0; margin-bottom: 0; padding-bottom: 8px; }
.entry__text { display: flex; flex-direction: column; gap: 6px; }
.entry__text h3 { font-size: 18px; font-weight: 600; line-height: 1.3; }
.entry__text p { font-size: 15px; line-height: 1.5; color: var(--ink-soft); }
.entry__photo { width: 220px; height: 140px; object-fit: cover; border-radius: 4px; }
/* Which part of a photo to keep when the crop is shallower than the image */
.entry__photo--top { object-position: 50% 0%; }
.entry__photo--bottom { object-position: 50% 100%; }
.note { margin-top: 20px; font-size: 14px; color: var(--muted); }

/* Talks and teaching */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.two-col h2 { margin-bottom: 14px; }
.list { border-top: 2px solid var(--ink); }
.list li { border-bottom: 1px solid var(--rule); }
.list li:last-child { border-bottom: 0; }
.list__item { display: flex; flex-direction: column; gap: 3px; padding: 12px 0; color: var(--ink); }
a.list__item:hover { text-decoration: none; }
a.list__item:hover .list__title { text-decoration: underline; }
.list__title { font-size: 16px; line-height: 1.4; }
.list__watch { font-weight: 600; color: var(--accent); }

/* Footer */
.footer { background: var(--footer-bg); color: var(--footer-text); margin-top: auto; }
.footer__inner { padding-top: 44px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 20px; }
.footer__row { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; flex-wrap: wrap; }
.footer__id { display: flex; flex-direction: column; gap: 8px; }
.footer__name { font-family: var(--serif); font-size: 30px; color: #fff; line-height: 1.2; }
.footer__line { font-size: 15px; color: var(--footer-muted); }
.footer__note { font-size: 15px; max-width: 32em; }
.footer__email, .footer__links a { color: #fff; font-size: 15px; }
.footer__links { display: flex; gap: 28px; flex-wrap: wrap; padding-top: 8px; }
.footer__small { font-size: 13px; color: var(--footer-small); border-top: 1px solid var(--footer-rule); padding-top: 16px; }

/* Video lightbox */
/* Browsers without <dialog> would otherwise show it at the foot of the page */
.video:not([open]) { display: none; }
/* 16:9, as wide as the gutters allow, and short enough to leave 72px above for the close button (and the same below) */
.video {
  width: min(100vw - 2 * var(--gutter), (100vh - 144px) * 16 / 9, var(--max));
  width: min(100vw - 2 * var(--gutter), (100dvh - 144px) * 16 / 9, var(--max));
  max-width: none; max-height: none;
  padding: 0; border: 0; background: none; overflow: visible;
}
.video::backdrop { background: rgba(14,26,20,0.92); }
.video__frame { aspect-ratio: 16 / 9; background: #000; border-radius: 4px; overflow: hidden; }
.video__frame iframe { display: block; width: 100%; height: 100%; border: 0; }
/* Sits just above the video's top right corner, in the style of the hero pills.
   Filled, so the dimmed page text behind it cannot show through the label. */
.video__close {
  position: absolute; right: 0; bottom: calc(100% + 12px);
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 1px solid rgba(255,255,255,0.55); border-radius: 999px; background: var(--ink);
  color: #fff; font: inherit; font-size: 15px; font-weight: 500; cursor: pointer;
}
.video__close span { font-size: 22px; line-height: 1; }
.video__close:hover { background: var(--ink-soft); }
.video__close:focus-visible { outline-color: #fff; border-radius: 999px; }
/* Stops the page scrolling behind the video */
html:has(.video[open]) { overflow: hidden; }

/* Tablet */
@media (max-width: 900px) {
  :root { --gutter: 32px; }
  .cards { grid-template-columns: 1fr; gap: 32px; }
  .two-col { grid-template-columns: 1fr; gap: 32px; }
  .hero__title { font-size: 36px; }
  .entry__body { grid-template-columns: 1fr 180px; }
  .entry__photo { width: 180px; height: 120px; }
}

/* Phone */
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  html { scroll-padding-top: 70px; }
  .site-header__inner { height: 56px; }
  .wordmark { font-size: 22px; }
  .nav a:not(.nav__contact) { display: none; }
  .nav__contact { font-size: 14px; }

  .hero { height: 500px; }
  .hero__caption { display: none; }
  .hero__content { bottom: 20px; gap: 14px; }
  .hero__title { font-size: 27px; line-height: 1.2; }
  .eyebrow--light { font-size: 12px; letter-spacing: 1.4px; }
  .pills { gap: 8px; }
  .pills a { min-height: 40px; padding: 0 12px; font-size: 14px; }

  .section { padding-top: 28px; padding-bottom: 24px; }
  h2 { font-size: 28px; }
  .h2--small { font-size: 26px; }
  .section__head { gap: 8px; margin-bottom: 18px; }
  .section__sub { font-size: 15px; }
  .card__figure img { height: 220px; }
  .card__figure figcaption { font-size: 12px; }
  .card__title { font-size: 21px; }
  .card > p { font-size: 15px; }
  .links { gap: 18px; font-size: 15px; }
  .eyebrow--accent { font-size: 11px; letter-spacing: 1.2px; }

  .intro { grid-template-columns: 72px 1fr; gap: 14px; margin-bottom: 16px; align-items: start; }
  .intro__portrait { width: 72px; height: 80px; }
  .intro h2 { margin-bottom: 4px; }
  .intro__text { font-size: 14px; }

  .entry { grid-template-columns: 18px 1fr; column-gap: 12px; }
  .entry__spine { grid-column: 1; grid-row: 1 / span 2; }
  .entry__spine::before { left: 4px; top: 10px; }
  .entry__spine::after { width: 10px; height: 10px; top: 6px; }
  .entry__date { grid-column: 2; grid-row: 1; font-size: 18px; padding-bottom: 4px; }
  .entry__body { grid-column: 2; grid-row: 2; grid-template-columns: 1fr; padding-bottom: 18px; margin-bottom: 18px; }
  .entry__text { display: contents; }
  .entry__text h3 { order: 1; font-size: 16px; margin-bottom: 6px; }
  .entry__photo { order: 2; width: 100%; height: 150px; margin-bottom: 6px; }
  .entry__text p { order: 3; font-size: 14px; line-height: 1.45; }
  .note { font-size: 13px; }

  .list__title { font-size: 15px; }
  .footer__inner { padding-top: 28px; padding-bottom: 28px; gap: 14px; }
  .footer__name { font-size: 24px; }
  .footer__links { gap: 18px; padding-top: 0; }
  .footer__small { font-size: 12px; padding-top: 12px; }
}

.notfound { min-height: 60vh; }
.notfound__text { margin-top: 12px; max-width: 560px; color: var(--ink-soft); }

@media print {
  .site-header, .hero__shade, .skip { display: none; }
  .hero { height: auto; color: var(--ink); }
  .hero__photo { display: none; }
  .hero__content { position: static; }
  .hero__title { color: var(--ink); }
  .pills a { color: var(--ink); border-color: var(--rule); }
}
