/* ==========================================================================
   Styles Shortridge - site styles
   Tokens -> base -> layout -> components -> pages -> responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
:root {
  --font-serif: 'Source Serif 4', Georgia, serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --text: #EEF3F7;
  --text-body: #CBD8E2;
  --text-muted: #9DAFBE;
  --text-dim: #8FA1B0;
  --text-faint: #7F91A1;

  --link: oklch(0.82 0.085 240);
  --link-hover: oklch(0.93 0.05 240);

  --surface: #000;
  --rule: rgba(255, 255, 255, 0.16);
  --rule-soft: rgba(255, 255, 255, 0.14);
  --rule-faint: rgba(255, 255, 255, 0.18);
  --rule-strong: rgba(255, 255, 255, 0.55);
  --border-img: rgba(255, 255, 255, 0.22);
  --border-tag: rgba(255, 255, 255, 0.24);
  --hover-bg: rgba(255, 255, 255, 0.05);

  --measure: 800px;
  --gutter: 40px;

  /* Vertical rhythm between the blocks of a page; pages override it. */
  --page-gap: 48px;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
html {
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0 28px 140px;
  background-color: #05080A;
  background-image: linear-gradient(
    180deg,
    #8FB4D2 0%,
    #6B8CA6 14%,
    #47637A 32%,
    #2A3C4B 52%,
    #16212B 72%,
    #080D12 88%,
    #000 100%
  );
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-attachment: scroll;
  color: var(--text);
  font-family: var(--font-serif);
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

img {
  max-width: 100%;
}

::selection {
  background: oklch(0.45 0.1 250);
}

/* --------------------------------------------------------------------------
   Layout - the header, page, and footer share one centred black column
   -------------------------------------------------------------------------- */
.column {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  background: var(--surface);
}

.site-header {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 72px var(--gutter) 0;
}

.site-header__brand {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
}

.site-header__nav-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.site-header__divider {
  height: 1px;
  background: var(--rule-strong);
}

.nav {
  display: flex;
  gap: 26px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav a {
  color: var(--text-muted);
}

.nav a[aria-current='page'] {
  color: var(--text);
}

.page {
  display: flex;
  flex-direction: column;
  gap: var(--page-gap);
  padding: 64px var(--gutter) 0;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  justify-content: space-between;
  padding: 58px var(--gutter) 40px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.site-footer__links {
  display: flex;
  gap: 20px;
}

.site-footer a {
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   Components
   -------------------------------------------------------------------------- */

/* Section - a stack, optionally led by a ruled label. */
.section {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.section--tight {
  gap: 14px;
}

.section--intro {
  gap: 22px;
}

.section--article-head {
  gap: 20px;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.section-head__rule {
  flex: 1;
  height: 1px;
  background: var(--rule-faint);
}

/* Small mono uppercase label, used for section heads and eyebrows. */
.label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.page-title {
  margin: 0;
  font-size: 40px;
  line-height: 1.15;
  font-weight: 400;
  letter-spacing: -0.012em;
  text-wrap: pretty;
}

.page-title--long {
  max-width: 24ch;
}

.page-title--article {
  font-size: 42px;
  line-height: 1.14;
}

.lede {
  margin: 0;
  font-size: 21px;
  line-height: 1.6;
  color: var(--text-body);
  max-width: 52ch;
  text-wrap: pretty;
}

/* Prose */
.prose p {
  margin: 0 0 20px;
  font-size: 20.5px;
  line-height: 1.62;
  color: var(--text-body);
  text-wrap: pretty;
}

.prose p:last-child {
  margin-bottom: 0;
}

/* Subhead inside prose. Extra space above separates it from the run of text. */
.prose h2 {
  margin: 40px 0 18px;
  font-size: 26px;
  line-height: 1.25;
  font-weight: 400;
  letter-spacing: -0.008em;
  color: var(--text);
  text-wrap: pretty;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose em,
.prose i {
  font-style: italic;
  color: var(--text);
}

.note {
  margin: 0;
  font-size: 20.5px;
  line-height: 1.62;
  color: var(--text-muted);
  max-width: 54ch;
  text-wrap: pretty;
}

/* Index rows - the linked project and article cards. */
.index-list {
  display: flex;
  flex-direction: column;
}

.card {
  display: grid;
  gap: 24px;
  align-items: start;
  padding: 26px 8px;
  border-top: 1px solid var(--rule);
  color: var(--text);
}

.index-list .card:last-child {
  border-bottom: 1px solid var(--rule);
}

.card:hover {
  background: var(--hover-bg);
  color: var(--text);
  text-decoration: none;
}

/* Project row: text left, thumbnail right. */
.card--project {
  grid-template-columns: 1fr 104px;
}

/* Article row: thumbnail left, text right. */
.card--article {
  grid-template-columns: 200px 1fr;
}

.card__body {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.card__title {
  font-size: 24px;
  line-height: 1.25;
  font-weight: 400;
  text-wrap: pretty;
}

.card--article .card__title {
  font-size: 26px;
}

.card__desc {
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 44ch;
  text-wrap: pretty;
}

.card__meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.card__thumb {
  width: 104px;
  height: 74px;
  object-fit: cover;
  border: 1px solid var(--border-img);
  display: block;
}

.card__thumb--offset {
  object-position: 18% 50%;
}

/* Article rows get the wider thumbnail their 200px column allows. */
.card--article .card__thumb {
  width: 200px;
  height: 140px;
}

/* Tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.tag {
  border: 1px solid var(--border-tag);
  padding: 5px 9px;
}

/* Figures */
.figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.figure img {
  width: 100%;
  border: 1px solid var(--border-img);
  display: block;
}

.figure img.on-white {
  background: #fff;
}

.figure figcaption {
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-dim);
  text-wrap: pretty;
}

/* Figure row - two or more figures sharing one line. */
.figure-row {
  display: grid;
  grid-template-columns: repeat(var(--figure-cols, 3), 1fr);
  gap: 16px;
  align-items: start;
}

.figure-row--2 { --figure-cols: 2; }
.figure-row--4 { --figure-cols: 4; }

/* Crop to a common shape when the sources have mismatched aspect ratios. */
.figure-row--even img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Portrait - floated beside the About prose. */
.portrait {
  margin: 0 36px 22px 0;
  float: left;
  width: 218px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.portrait img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: 50% 22%;
  border: 1px solid var(--border-tag);
  display: block;
}

.portrait figcaption {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

/* Course lists */
.course-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
}

.course {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 17px 0;
  border-top: 1px solid var(--rule-soft);
}

.course-list .course:last-child {
  border-bottom: 1px solid var(--rule-soft);
}

.course__name {
  font-size: 19px;
  line-height: 1.4;
  color: var(--text);
}

.course__desc {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 64ch;
  text-wrap: pretty;
}

/* Image placeholder - stands in until the artwork is dropped in. */
.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border-img);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-align: center;
}

.placeholder--hero {
  width: 100%;
  height: 380px;
}

.placeholder--thumb {
  width: 200px;
  height: 140px;
}

.placeholder--figure {
  width: 100%;
  height: 300px;
}

/* Back link at the foot of a page. */
.back {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
}

/* --------------------------------------------------------------------------
   Page-level rhythm overrides
   -------------------------------------------------------------------------- */
.page--home { --page-gap: 72px; }
.page--about { --page-gap: 56px; }
.page--courses { --page-gap: 52px; }
.page--index { --page-gap: 44px; }
.page--project { --page-gap: 24px; }
.page--article { --page-gap: 40px; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  :root {
    --gutter: 22px;
  }

  body {
    padding: 0 12px 80px;
  }

  .site-header {
    padding-top: 48px;
  }

  .nav {
    flex-wrap: wrap;
    gap: 16px;
  }

  .page-title,
  .page-title--article {
    font-size: 30px;
  }

  .lede {
    font-size: 18px;
  }

  .prose p,
  .note {
    font-size: 18px;
  }

  .card--project,
  .card--article {
    grid-template-columns: 1fr;
  }

  .figure-row {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .figure-row--even img {
    aspect-ratio: auto;
    object-fit: fill;
  }

  .card--article .card__body {
    order: -1;
  }

  .portrait {
    float: none;
    margin: 0 0 22px;
    width: 100%;
    max-width: 218px;
  }

  .placeholder--hero {
    height: 220px;
  }

  .placeholder--figure {
    height: 190px;
  }

  .placeholder--thumb {
    width: 100%;
  }
}
