/* =============================================================
   Chimaera Todd: portfolio
   Plain document styling. One column, content first.
   ============================================================= */

:root {
  --bg:          #ffffff;
  --bg-soft:     #f8f9fa;
  --text:        #202122;
  --muted:       #54595d;
  --border:      #a2a9b1;
  --border-soft: #c8ccd1;
  --link:        #3366cc;
  --link-visit:  #6b4ba1;
  --link-hover:  #2a4b8d;

  --serif: Georgia, "Times New Roman", Times, serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono:  ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
}

img { max-width: 100%; height: auto; }

a { color: var(--link); text-decoration: none; }
a:visited { color: var(--link-visit); }
a:hover { color: var(--link-hover); text-decoration: underline; }

code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--bg-soft);
  border: 1px solid #eaecf0;
  border-radius: 2px;
  padding: .05em .35em;
}

:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: #fff; border: 1px solid var(--border); padding: .6rem 1rem;
}
.skip:focus { left: .5rem; top: .5rem; }

.small { font-size: .875em; color: var(--muted); }
.note  { font-size: .875em; color: var(--muted); font-style: italic; }

/* ------------------------------- layout -------------------------------- */

.content {
  max-width: 60rem;
  margin-inline: auto;
  padding: 2.5rem clamp(1rem, 5vw, 2.5rem) 4rem;
}

/* ------------------------------ headings ------------------------------- */

.title {
  font-family: var(--serif);
  font-size: 2.1rem;
  font-weight: 400;
  line-height: 1.2;
  margin: 0;
}

.subtitle {
  margin: .3rem 0 0;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: .9375rem;
}

h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.3;
  margin: 2.5rem 0 .6rem;
  padding-bottom: .2rem;
  border-bottom: 1px solid var(--border);
  clear: both;
  scroll-margin-top: 1rem;
}

h3 {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 2rem 0 .5rem;
  scroll-margin-top: 1rem;
}

p { margin: 0 0 .75rem; }

.lead { margin-top: 1.25rem; font-size: 1.02rem; }

.section-note { color: var(--muted); font-size: .9375rem; }

.hatnote {
  clear: both;
  margin: .5rem 0 1rem;
  padding: .55rem .8rem;
  background: var(--bg-soft);
  border-left: 3px solid var(--border-soft);
  font-size: .875rem;
  color: var(--muted);
}
.hatnote b { color: var(--text); }

article ul { margin: 0 0 .9rem; padding-left: 1.4rem; }
article ul li { margin-bottom: .55rem; }

/* -------------------------------- TOC ---------------------------------- */

.toc {
  display: table;
  margin: 1.5rem 0 2rem;
  padding: .7rem 1.4rem .8rem .7rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: .9375rem;
}

.toc__h { margin: 0 0 .4rem; font-weight: 700; text-align: center; font-size: .9375rem; }

.toc__list, .toc__list ol { margin: 0; padding-left: 1.5rem; }
.toc__list li { margin: .15rem 0; }
.toc__list ol { margin-top: .15rem; }

/* ------------------------------ infobox -------------------------------- */

.infobox {
  float: right;
  clear: right;
  width: 21rem;
  max-width: 100%;
  margin: 0 0 1rem 1.5rem;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  border-collapse: collapse;
  font-size: .8125rem;
  line-height: 1.5;
}

.infobox th, .infobox td {
  border-top: 1px solid var(--border-soft);
  padding: .4rem .6rem;
  text-align: left;
  vertical-align: top;
}
.infobox th { width: 34%; font-weight: 700; }
.infobox tr:first-child th, .infobox tr:first-child td { border-top: 0; }

/* ------------------------------- tables -------------------------------- */

.wikitable {
  border-collapse: collapse;
  border: 1px solid var(--border);
  background: var(--bg);
  margin: 1rem 0 1.25rem;
  font-size: .875rem;
  line-height: 1.55;
  width: 100%;
}

.wikitable th, .wikitable td {
  border: 1px solid var(--border-soft);
  padding: .45rem .6rem;
  text-align: left;
  vertical-align: top;
}

.wikitable tbody th[scope="row"] {
  background: var(--bg-soft);
  font-weight: 700;
  width: 10rem;
  white-space: nowrap;
}

/* project detail tables clear the floated figure above them */
.details { clear: right; }

/* ----------------------------- thumbnails ------------------------------ */

.thumb {
  margin: .3rem 0 1rem;
  padding: 3px;
  border: 1px solid var(--border-soft);
  background: var(--bg-soft);
  font-size: .8125rem;
  line-height: 1.5;
}

.thumb.tright {
  float: right;
  clear: right;
  width: 19rem;
  margin-left: 1.5rem;
}
.thumb--wide.tright { width: 24rem; }

.thumb img {
  display: block;
  width: 100%;
  background: #fff;
  border: 1px solid var(--border-soft);
}
.thumb a { display: block; }
.thumb a:hover img { outline: 2px solid var(--link); outline-offset: -1px; }

.thumb figcaption { padding: .4rem .25rem .15rem; color: var(--muted); }

/* ------------------------------- gallery ------------------------------- */

.gallery__intro { clear: both; margin-top: 1.25rem; font-weight: 700; font-size: .9375rem; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: .6rem;
  clear: both;
  margin: .5rem 0 1.25rem;
}

.gallery figure {
  margin: 0;
  padding: 3px;
  border: 1px solid var(--border-soft);
  background: var(--bg-soft);
  font-size: .75rem;
  line-height: 1.45;
}

.gallery img {
  display: block;
  width: 100%;
  background: #fff;
  border: 1px solid var(--border-soft);
}
.gallery a:hover img { outline: 2px solid var(--link); outline-offset: -1px; }

.gallery figcaption { padding: .35rem .2rem .1rem; color: var(--muted); }
.gallery figcaption b { display: block; color: var(--text); }

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

.foot {
  clear: both;
  margin-top: 2.5rem;
  padding-top: .9rem;
  border-top: 1px solid var(--border-soft);
  font-size: .8125rem;
  color: var(--muted);
}
.foot p { margin: 0 0 .25rem; }

/* ------------------------------ lightbox ------------------------------- */

.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 15, 15, .94);
  display: flex; flex-direction: column;
}
.lightbox[hidden] { display: none; }

.lightbox__bar {
  flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .6rem 1rem;
  background: #1b1b1b;
  border-bottom: 1px solid #333;
  color: #ddd;
  font-size: .8125rem;
}

.lightbox__cap { margin: 0; min-width: 0; }

.lightbox__tools { display: flex; align-items: center; gap: 1rem; flex: none; }
.lightbox__tools a { color: #8ab4f8; }

.lightbox__tools button {
  font: inherit; color: #ddd; background: none; border: 0; padding: 0 .3rem;
  font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.lightbox__tools button:hover { color: #fff; }

.lightbox__stage {
  flex: 1;
  display: grid; place-items: center;
  padding: 1rem;
  overflow: auto;
}
.lightbox__stage img { max-width: 100%; max-height: 100%; background: #fff; }

/* ----------------------------- responsive ------------------------------ */

@media (max-width: 700px) {
  .infobox { float: none; width: 100%; margin: 1.25rem 0; }
  .thumb.tright, .thumb--wide.tright { float: none; width: 100%; max-width: 25rem; margin: .5rem 0 1rem; }
}

@media (max-width: 560px) {
  body { font-size: 14.5px; }
  .title { font-size: 1.75rem; }
  h2 { font-size: 1.3rem; }
  .toc { display: block; }
  .wikitable tbody th[scope="row"] { width: auto; white-space: normal; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@media print {
  .lightbox, .toc { display: none; }
  body { font-size: 11pt; }
  a { color: inherit; text-decoration: none; }
}
