/* amritasinha.in, minimal academic, crimson and white
   Single column, 680px, serif. Harvard crimson #A51C30 as the only accent.
   Light only, by design, no dark mode. */

:root {
  --crimson:      #a51c30;
  --crimson-deep: #7f1526;
  --crimson-pale: #f5e6e8;

  --ink:        #1a1a1a;
  --ink-soft:   #4a4a4a;
  --ink-faint:  #777270;
  --paper:      #ffffff;
  --rule:       #e2dcda;
  --measure:    680px;
}

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

/* ---------- content protection (deterrent only) ----------
   Stops casual selection, drag and right-click. It cannot stop
   view-source, reader mode, screenshots or a JS-disabled browser,
   nothing client-side can. The copyright notice does the real work. */
html, body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  user-drag: none;
  pointer-events: none;
}

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

body {
  margin: 0;
  padding: 0 1.5rem;
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, "Iowan Old Style", "Times New Roman", Times, serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--measure); margin: 0 auto; }

/* ---------- masthead ---------- */

.masthead { padding: 3.5rem 0 0; }

.masthead h1,
.masthead .name {
  margin: 0;
  font-size: 1.5rem;
  font-weight: normal;
  letter-spacing: 0.02em;
  color: var(--crimson);
}

.masthead .name a { color: var(--crimson); text-decoration: none; }
.masthead .name a:hover { color: var(--crimson-deep); }

.masthead .standfirst {
  margin: 0.35rem 0 0;
  color: var(--ink-faint);
  font-size: 0.9375rem;
  font-style: italic;
}

/* the one heavy line on the page */
.masthead hr {
  border: 0;
  border-top: 2px solid var(--crimson);
  margin: 1.15rem 0 0;
}

/* ---------- navigation ---------- */

nav.site {
  padding: 0.85rem 0 0;
  font-size: 0.9375rem;
}

nav.site a {
  color: var(--ink-soft);
  text-decoration: none;
  margin-right: 1.75rem;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

nav.site a:hover { color: var(--crimson); }

nav.site a[aria-current="page"] {
  color: var(--crimson);
  border-bottom-color: var(--crimson);
}

/* ---------- body copy ---------- */

main { padding: 2.75rem 0 0; }

h2 {
  font-size: 1.1875rem;
  font-weight: normal;
  margin: 2.75rem 0 0.85rem;
  letter-spacing: 0.01em;
  color: var(--crimson);
}

h3 {
  font-size: 1.0625rem;
  font-weight: normal;
  font-style: italic;
  margin: 2rem 0 0.6rem;
  color: var(--ink);
}

p { margin: 0 0 1.15rem; }

a { color: var(--crimson); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--crimson-deep); }

blockquote {
  margin: 1.5rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--crimson);
  color: var(--ink-soft);
  font-style: italic;
}

blockquote.epigraph {
  margin: 1.9rem 0 2.1rem;
}

blockquote.epigraph p {
  margin: 0 0 0.5rem;
}

blockquote.epigraph cite {
  display: block;
  font-style: normal;
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  line-height: 1.5;
  color: var(--ink-faint);
}

hr.section {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 3rem 0;
}

/* ---------- writing list ---------- */

ul.writing {
  list-style: none;
  margin: 0;
  padding: 0;
}

ul.writing li {
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--rule);
}

ul.writing li:first-child { padding-top: 0; }

ul.writing .title {
  display: block;
  font-size: 1.0625rem;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid transparent;
}

ul.writing .title:hover {
  color: var(--crimson);
  border-bottom-color: var(--crimson);
}

ul.writing .meta {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.875rem;
  color: var(--ink-faint);
  font-style: italic;
}

ul.writing .blurb {
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

/* ---------- single piece ---------- */

article header.essay {
  margin-bottom: 2.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

article header.essay h1 {
  font-size: 1.5rem;
  font-weight: normal;
  line-height: 1.3;
  margin: 0 0 0.5rem;
  color: var(--ink);
}

article header.essay .meta {
  margin: 0;
  font-size: 0.875rem;
  color: var(--crimson);
  font-style: italic;
}

/* ---------- subject category labels ---------- */

h3.cat {
  font-style: normal;
  font-weight: normal;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--crimson);
  margin: 2.75rem 0 0.7rem;
}

h3.cat:first-of-type { margin-top: 1.5rem; }

/* ---------- figures ---------- */

figure {
  margin: 2.5rem 0;
}

figure img {
  display: block;
  width: 100%;
  height: auto;
}

figure figcaption {
  margin-top: 0.7rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
  font-style: italic;
  text-align: center;
}

/* On a narrow screen an SVG scaled to 340px makes its own labels illegible.
   Give the figure a floor and let it scroll sideways instead of shrinking. */
@media (max-width: 34rem) {
  figure {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  figure img { min-width: 30rem; }
  figure figcaption { position: sticky; left: 0; }
}

/* ---------- portrait (About) ----------
   Scoped away from the essay-figure rules above: a portrait must not inherit
   the 30rem min-width or the sideways scroll those need for wide diagrams. */

figure.portrait {
  float: right;
  width: 13rem;
  margin: 0.35rem 0 1.5rem 2rem;
  overflow: visible;
}

figure.portrait img {
  width: 100%;
  min-width: 0;
  height: auto;
  display: block;
  border-bottom: 2px solid var(--crimson);
}

figure.portrait figcaption {
  margin-top: 0.6rem;
  text-align: left;
  font-size: 0.875rem;
}

@media (max-width: 34rem) {
  figure.portrait {
    float: none;
    width: 100%;
    max-width: 16rem;
    margin: 0 auto 2rem;
    overflow: visible;
  }
  figure.portrait img { min-width: 0; }
  figure.portrait figcaption { text-align: center; position: static; }
}

/* ---------- float containment ----------
   The About portrait floats right. Without these, later rules and headings
   slide up beside it instead of starting below, which throws the whole page
   out of alignment. */

main hr.section,
main h2 { clear: both; }

/* ---------- contact form ---------- */

.connect {
  clear: both;
  margin: 1.75rem 0 0;
  padding: 1.75rem 0 0;
  border-top: 1px solid var(--rule);
}

.connect .row {
  display: flex;
  gap: 1.25rem;
}

.connect .row > .field { flex: 1 1 0; min-width: 0; }

.connect .field {
  margin-bottom: 1.25rem;
}

.connect label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.connect label .opt {
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-faint);
  font-style: italic;
}

.connect input,
.connect textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: #fdfcfb;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.65rem 0.75rem;
  transition: border-color 0.15s, background 0.15s;
  -webkit-user-select: text;
  user-select: text;
  pointer-events: auto;
}

.connect textarea {
  min-height: 8rem;
  resize: vertical;
}

.connect input:focus,
.connect textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--crimson);
  box-shadow: 0 0 0 2px var(--crimson-pale);
}

.connect button {
  display: inline-block;
  font-family: inherit;
  font-size: 0.9375rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--crimson);
  border: 1px solid var(--crimson);
  border-radius: 2px;
  padding: 0.7rem 2.2rem;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.15s;
}

.connect button:hover { background: var(--crimson-deep); border-color: var(--crimson-deep); }

.connect .note {
  margin: 1rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-faint);
}

/* spam honeypot, invisible to humans, visible to bots.
   clip rather than off-screen positioning, which can force a scrollbar. */
.connect .hp {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 34rem) {
  .connect .row { display: block; }
}

article .footnotes {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--ink-soft);
}

article .footnotes ol { padding-left: 1.25rem; }
article .footnotes li { margin-bottom: 0.5rem; }

sup a { text-decoration: none; }

/* ---------- footer ---------- */

footer.site {
  margin: 4.5rem 0 3rem;
  padding-top: 1.25rem;
  border-top: 2px solid var(--crimson);
  font-size: 0.875rem;
  color: var(--ink-faint);
}

footer.site a { color: var(--ink-soft); }
footer.site a:hover { color: var(--crimson); }

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

@media (max-width: 34rem) {
  body { font-size: 1rem; padding: 0 1.15rem; }
  .masthead { padding-top: 2.25rem; }
  nav.site a { margin-right: 1.15rem; }
}


article nav.related {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}
article nav.related h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin: 0 0 0.6rem;
}
article nav.related ul { margin: 0; padding-left: 1.1rem; }
article nav.related li { margin-bottom: 0.35rem; }


article p.filed {
  margin-top: 2.5rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
h3.cat a { color: inherit; text-decoration: none; }
h3.cat a:hover { text-decoration: underline; }


.masthead .standfirst a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.masthead .standfirst a:hover {
  color: var(--crimson-deep);
  border-bottom-color: currentColor;
}


/* visually hidden, still read aloud */
.vh {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.hp-x { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }



/* ---------- latest ---------- */

.latest {
  margin: 2rem 0 1.9rem;
  padding: 1.1rem 0 0;
  border-top: 2px solid var(--crimson);
}

.latest h2 {
  margin: 0 0 0.6rem;
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--crimson);
  font-weight: 700;
}

.latest ul { list-style: none; margin: 0; padding: 0; }

.latest li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2.25rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--rule);
}

.latest li:last-child { border-bottom: 0; }

.latest a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.latest a:hover { border-bottom-color: var(--crimson); }

.latest .when {
  flex: 0 0 auto;
  font-size: 0.85rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 38rem) {
  .latest li { flex-direction: column; gap: 0.2rem; }
}


/* ---------- Education Base ---------- */

.crumb {
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 0.9rem;
}
.crumb a { color: var(--crimson); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

.backlink { margin: 2.4rem 0 0; padding-top: 1rem; border-top: 1px solid var(--rule); }
.backlink a { color: var(--crimson); text-decoration: none; }
.backlink a:hover { text-decoration: underline; }

.hint { font-size: 0.9rem; color: var(--ink-faint); font-style: italic; margin: 0 0 1.1rem; }

dl.authority { margin: 0 0 1.9rem; }
dl.authority dt { margin: 1.05rem 0 0.2rem; font-weight: bold; line-height: 1.4; }
dl.authority dt:first-child { margin-top: 0.3rem; }
dl.authority dd {
  margin: 0 0 0 1.15rem;
  color: var(--ink-soft);
  border-left: 2px solid var(--rule);
  padding-left: 0.85rem;
}
dl.authority.cases dt a { color: var(--crimson); text-decoration: none;
  border-bottom: 1px solid transparent; }
dl.authority.cases dt a:hover { border-bottom-color: var(--crimson); }

ul.plain { list-style: none; margin: 0 0 1.4rem; padding: 0; }
ul.plain li { margin: 0 0 0.45rem; }
ul.plain a { color: var(--crimson); text-decoration: none; }
ul.plain a:hover { text-decoration: underline; }

ul.subjects { list-style: none; margin: 0 0 1.6rem; padding: 0; }
ul.subjects li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}
ul.subjects li:last-child { border-bottom: 0; }
ul.subjects a { color: var(--ink); text-decoration: none;
  border-bottom: 1px solid transparent; }
ul.subjects a:hover { border-bottom-color: var(--crimson); }
ul.subjects .n {
  flex: 0 0 auto;
  font-size: 0.8rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
ul.subjects li.soon span:first-child { color: var(--ink-faint); }

.edu {
  margin: 2rem 0 1.9rem;
  padding: 1.1rem 0 0;
  border-top: 2px solid var(--crimson);
}
.edu h2 {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--crimson);
  font-weight: 700;
}
.edu p.lede { margin: 0 0 0.7rem; color: var(--ink-soft); font-size: 0.95rem; }
.edu ul { list-style: none; margin: 0 0 0.6rem; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.3rem 1.5rem; }
.edu ul a { color: var(--ink); text-decoration: none;
  border-bottom: 1px solid transparent; }
.edu ul a:hover { border-bottom-color: var(--crimson); }
.edu .more { margin: 0; font-size: 0.9rem; }
.edu .more a { color: var(--crimson); text-decoration: none; }
.edu .more a:hover { text-decoration: underline; }

@media (max-width: 38rem) {
  .edu ul { grid-template-columns: 1fr; }
  ul.subjects li { flex-direction: column; gap: 0.15rem; }
}


/* ---------- home page: prose left, rail right ---------- */
/* Only the home page uses this. Essays keep the single column. */

.wrap-wide { max-width: 980px; }

.home-grid { display: grid; grid-template-columns: minmax(0, 1fr); }

.home-rail { min-width: 0; }
.home-rail .latest { margin-top: 0; }
.home-rail .latest,
.home-rail .edu { margin-bottom: 1.9rem; }

@media (min-width: 62rem) {
  .home-grid {
    grid-template-columns: minmax(0, 1fr) 250px;
    column-gap: 3.25rem;
    align-items: start;
  }
  .home-intro   { grid-column: 1; grid-row: 1; }
  .home-listing { grid-column: 1; grid-row: 2; }
  .home-rail    { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 2rem; }

  /* the rail is 250px, so the Latest row must stack rather than sit side by side */
  .home-rail .latest li {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    padding: 0.45rem 0;
  }
  .home-rail .latest a { font-size: 0.95rem; line-height: 1.35; }
  .home-rail .latest .when { font-size: 0.78rem; }
  .home-rail .edu ul { grid-template-columns: 1fr; gap: 0.32rem; }
  .home-rail .edu ul a { font-size: 0.95rem; line-height: 1.35; }
  .home-rail .edu p.lede { font-size: 0.86rem; line-height: 1.45; }
  .home-rail .edu .more { font-size: 0.86rem; }
}

/* the listing heading follows the epigraph (wide) or the rail (narrow),
   both of which already carry space, so it does not need the full h2 margin */
.home-listing > h2:first-child { margin-top: 1.4rem; }
@media (min-width: 62rem) { .home-rail .latest:last-child { margin-bottom: 0; } }

/* a dated marker on a postscript added after publication */
p.meta.upd { margin: -0.35rem 0 1.15rem; font-style: italic; }
