/* Torira Research — institutional academic
   No webfonts, no JavaScript, no third-party requests. */

:root {
  --paper: #faf8f4;
  --paper-2: #f3efe6;
  --ink: #16243c;
  --ink-soft: #3d4d66;
  --muted: #5b6b83;
  --brass: #8a6d3b;
  --brass-deep: #6f5629;
  --rule: #d8d2c4;
  --rule-soft: #e2ddd0;

  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino,
    "Times New Roman", Times, serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas,
    "Liberation Mono", monospace;

  --container: 1080px;
  --measure: 68ch;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.72;
  text-underline-offset: 0.18em;
}

/* ---------- Skip link ---------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 0.7em 1.1em;
  z-index: 50;
  text-decoration: none;
}

.skip:focus {
  left: 0;
}

/* ---------- Focus ---------- */

a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

/* ---------- Shell ---------- */

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

.topbar {
  background: var(--ink);
  color: #c9d3e2;
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.topbar .container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em 1.6em;
  justify-content: space-between;
  padding-top: 0.6em;
  padding-bottom: 0.6em;
}

.masthead {
  border-bottom: 1px solid var(--rule);
}

.masthead .container {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1em 2em;
  align-items: flex-end;
  justify-content: space-between;
  padding-top: 1.5em;
  padding-bottom: 1.2em;
}

.wordmark {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.2;
}

.wordmark:hover {
  color: var(--brass-deep);
}

.masthead .tagline {
  margin: 0.45em 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  max-width: 40ch;
}

/* ---------- Navigation (wraps, no script) ---------- */

.nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35em 1.35em;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.8rem;
  letter-spacing: 0.045em;
}

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--rule);
}

.nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom: 1.5px solid var(--brass);
}

/* ---------- Sections ---------- */

.section {
  padding: 3em 0 2.7em;
  border-bottom: 1px solid var(--rule);
}

.section:last-of-type {
  border-bottom: 0;
}

.section--tint {
  background: var(--paper-2);
}

.eyebrow {
  margin: 0 0 1em;
  font-size: 0.7rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--brass);
}

h1,
h2,
h3,
h4 {
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.005em;
}

h1 {
  font-size: 2.35rem;
  line-height: 1.2;
  margin: 0 0 0.6em;
  max-width: 30ch;
}

h2 {
  font-size: 1.55rem;
  line-height: 1.3;
  margin: 0 0 0.7em;
  max-width: 34ch;
}

h3 {
  font-size: 1.12rem;
  line-height: 1.4;
  margin: 0 0 0.5em;
}

h4 {
  font-size: 0.95rem;
  margin: 0 0 0.4em;
}

p {
  margin: 0 0 1.1em;
}

.prose,
.lede {
  max-width: var(--measure);
}

.lede {
  font-size: 1.14rem;
  line-height: 1.68;
  color: var(--ink-soft);
}

.muted {
  color: var(--muted);
}

a {
  color: var(--ink);
  text-decoration-color: var(--rule);
}

a:hover {
  text-decoration-color: var(--brass);
}

.actions {
  margin-top: 1.7em;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6em 1.9em;
  font-size: 0.9rem;
}

.actions a {
  text-decoration: none;
  border-bottom: 1.5px solid var(--brass);
  padding-bottom: 2px;
}

.actions a.secondary {
  border-bottom-color: var(--rule);
  color: var(--muted);
}

/* ---------- Grids ---------- */

.grid {
  display: grid;
  gap: 2em;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1em;
}

.grid > * > :last-child {
  margin-bottom: 0;
}

/* ---------- Numbered items ---------- */

.numeral {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--brass);
  margin-bottom: 0.6em;
}

.item p {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--ink-soft);
  margin-bottom: 0;
}

.item h3 {
  font-size: 1.05rem;
}

/* ---------- Study entries ---------- */

.study {
  border-left: 2px solid var(--rule);
  padding-left: 1.2em;
  margin-bottom: 2.2em;
  max-width: var(--measure);
}

.study--active {
  border-left-color: var(--brass);
}

.study:last-child {
  margin-bottom: 0;
}

.status {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--brass-deep);
  margin-bottom: 0.5em;
}

.study h3 {
  font-size: 1.2rem;
  margin-bottom: 0.45em;
}

.study p {
  font-size: 0.94rem;
  color: var(--ink-soft);
}

.study dl {
  margin: 0.9em 0 0;
  font-size: 0.88rem;
}

.study dt {
  color: var(--brass-deep);
  letter-spacing: 0.05em;
  font-size: 0.76rem;
  text-transform: uppercase;
  margin-top: 0.8em;
}

.study dd {
  margin: 0.2em 0 0;
  color: var(--ink-soft);
}

/* ---------- Callouts and notices ---------- */

.callout {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  padding: 1.4em 1.5em;
}

.section--tint .callout {
  background: var(--paper);
}

.callout > :last-child {
  margin-bottom: 0;
}

.callout h3 {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 0.8em;
}

.callout p {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

.notice {
  background: var(--paper-2);
  border-left: 3px solid var(--brass);
  padding: 0.95em 1.2em;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--ink-soft);
  max-width: var(--measure);
}

.section--tint .notice {
  background: var(--paper);
}

.caveat {
  font-style: italic;
  color: var(--muted);
  font-size: 0.94rem;
  max-width: var(--measure);
}

/* ---------- Field chips ---------- */

.chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8em;
  margin-top: 1.4em;
}

.chip {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 0.8em 0.9em;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.chip span {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 0.35em;
}

/* ---------- Method steps ---------- */

.steps {
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
}

.steps > li {
  counter-increment: step;
  border-top: 1px solid var(--rule);
  padding: 1.8em 0 1.5em;
  max-width: var(--measure);
}

.steps > li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--brass);
  margin-bottom: 0.6em;
}

.steps h3 {
  font-size: 1.22rem;
  margin-bottom: 0.55em;
}

.steps p,
.steps li {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.steps ul {
  padding-left: 1.2em;
  margin: 0 0 1.1em;
}

.steps ul li {
  margin-bottom: 0.5em;
}

.steps > li > :last-child {
  margin-bottom: 0;
}

/* ---------- Definition list, plain ---------- */

.facts {
  margin: 0;
  max-width: var(--measure);
}

.facts dt {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass);
  margin-top: 1.4em;
}

.facts dd {
  margin: 0.35em 0 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* ---------- Entries (publications, related work) ---------- */

.entry {
  border-top: 1px solid var(--rule);
  padding: 1.5em 0;
  max-width: var(--measure);
}

.entry:last-child {
  border-bottom: 1px solid var(--rule);
}

.entry .meta {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.45em;
}

.entry h3 {
  font-size: 1.15rem;
  margin-bottom: 0.45em;
}

.entry p {
  font-size: 0.93rem;
  color: var(--ink-soft);
  margin-bottom: 0;
}

.entry p + p {
  margin-top: 0.7em;
}

/* ---------- People ---------- */

.person {
  border-top: 1px solid var(--rule);
  padding: 1.5em 0;
}

.person:last-of-type {
  border-bottom: 1px solid var(--rule);
}

.person h3 {
  font-size: 1.1rem;
  margin-bottom: 0.3em;
}

.person .role {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 0.6em;
}

.person p {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-bottom: 0;
  max-width: var(--measure);
}

/* ---------- Code and field names ---------- */

code {
  font-family: var(--mono);
  font-size: 0.84em;
  background: var(--paper-2);
  border: 1px solid var(--rule-soft);
  padding: 0.08em 0.35em;
  border-radius: 2px;
  color: var(--brass-deep);
}

.section--tint code {
  background: var(--paper);
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  color: #aab7cb;
  font-size: 0.88rem;
  line-height: 1.75;
  margin-top: 0;
}

.site-footer .container {
  padding-top: 2.6em;
  padding-bottom: 2.6em;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1.2fr;
  gap: 2em;
}

.site-footer h2 {
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  color: #fff;
  margin-bottom: 0.7em;
  max-width: none;
}

.site-footer h3 {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #e4e9f1;
  margin-bottom: 0.6em;
}

.site-footer a {
  color: #d5dde9;
  text-decoration-color: #4a5b78;
}

.site-footer a:hover {
  color: #fff;
  text-decoration-color: #a9b8cf;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer p {
  margin-bottom: 0.7em;
}

.colophon {
  border-top: 1px solid #2c3e5c;
  margin-top: 2.2em;
  padding-top: 1.4em;
  font-size: 0.8rem;
  color: #8b9ab2;
  max-width: 80ch;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  body {
    font-size: 17px;
  }

  h1 {
    font-size: 1.95rem;
  }

  .grid-3,
  .grid-4,
  .chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .container {
    padding: 0 20px;
  }

  h1 {
    font-size: 1.68rem;
  }

  h2 {
    font-size: 1.32rem;
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .chips,
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .masthead .container {
    align-items: flex-start;
  }

  .section {
    padding: 2.2em 0 2em;
  }
}

/* ---------- Motion and print ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .topbar,
  .nav,
  .site-footer {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }
}
