/* ---- Reset & base ---------------------------------------------------- */

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

:root {
  --color-bg: #ffffff;
  --color-text: #111111;
  --color-muted: #444444;
  --color-border: #111111;
  --color-focus: #0050c8;
  --font-sans: -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --max-width: 60rem;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

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

a {
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

/* Default convention across the site: links are underlined at rest and
   lose the underline on hover/focus. The two exceptions are the site
   logo (.site-title) and the project-entry CTA buttons (.project__cta a),
   which set their own text-decoration and are left alone. */
a:hover,
a:focus-visible {
  text-decoration: none;
}

/* Strong, visible focus outline everywhere -- never suppressed. */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

/* ---- Skip link --------------------------------------------------------- */

.skip-link {
  position: absolute;
  left: 0;
  top: 0;
  transform: translateY(-100%);
  background: var(--color-bg);
  color: var(--color-text);
  border: 2px solid var(--color-border);
  padding: 0.75rem 1rem;
  z-index: 10;
}

.skip-link:focus {
  transform: translateY(0);
}

/* ---- Layout -------------------------------------------------------------- */

.site-header {
  border-bottom: 2px solid var(--color-border);
}

.site-header__inner,
main,
.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.25rem;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-title {
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
}

main {
  min-height: 60vh;
  padding-top: 2rem;
  padding-bottom: 3rem;
}

/* ---- Navigation ---------------------------------------------------------- */

.nav-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font: inherit;
  font-size: 1rem;
  background: var(--color-bg);
  color: var(--color-text);
  border: 2px solid var(--color-border);
  padding: 0.4rem 0.75rem;
  cursor: pointer;
}

.nav-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  width: 100%;
}

/* Only styled as a flex row when actually shown -- an unconditional
   `display: flex` here would out-specificity the browser's native
   `[hidden] { display: none }` rule and defeat the JS-driven collapse. */
.nav-list:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-list a {
  font-weight: 600;
}

@media (min-width: 40em) {
  .nav-toggle {
    display: none !important;
  }

  /* On wide viewports the full nav is always shown as a row, no matter
     what JS did with the [hidden] attribute on narrower viewports. */
  .nav-list,
  .nav-list[hidden] {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    width: auto;
    margin: 0;
  }
}

/* ---- Headings & text ------------------------------------------------- */

h1,
h2,
h3 {
  line-height: 1.25;
}

h1 {
  font-size: 2rem;
  margin-top: 0;
}

h2 {
  font-size: 1.35rem;
}

/* ---- Homepage featured image -------------------------------------------- */

.featured__link {
  display: block;
  color: inherit;
}

.featured__image {
  width: 100%;
  border: 1px solid var(--color-border);
}

.featured__caption {
  margin-top: 1rem;
  font-size: 1.5rem;
}

/* ---- Project listing --------------------------------------------------- */

.project-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.project-list a {
  display: inline-block;
  font-size: 1.35rem;
  font-weight: 600;
}

/* ---- Project description & CTA ---------------------------------------- */

.project__links {
  padding-left: 1.25rem;
}

.project__cta a {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--color-border);
  text-decoration: none;
  font-weight: 700;
}

.project__cta a:hover,
.project__cta a:focus-visible {
  background: var(--color-text);
  color: var(--color-bg);
}

/* ---- Slides -------------------------------------------------------------- */

.slide__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.slide__meta h1 {
  margin: 0;
}

.slide__count {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.95rem;
  white-space: nowrap;
}

.slide__image {
  max-height: 55vh;
  width: auto;
  max-width: 100%;
  display: block;
  border: 1px solid var(--color-border);
  margin: 1rem auto;
}

.slide__video {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 1rem 0;
  border: 1px solid var(--color-border);
}

.slide__video iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.slide__caption {
  font-size: 1rem;
}

.slide__credit {
  color: var(--color-muted);
  font-size: 0.9rem;
}

.slide__nav ul {
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0;
  margin-top: 2rem;
  border-top: 2px solid var(--color-border);
  padding-top: 1rem;
}

.slide__nav a {
  font-weight: 600;
}

/* ---- Portraits ------------------------------------------------------------ */

.portrait-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 1.5rem;
}

.portrait-grid a {
  display: block;
}

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

.portrait {
  padding-top: 2rem;
}

.portrait__image {
  height: 55vh;
  width: auto;
  max-width: 100%;
  display: block;
  margin: 2rem auto 0;
  border: 1px solid var(--color-border);
}

/* ---- About page layout (all text left, photo right) --------------------- */

.about-layout {
  display: grid;
  grid-template-columns: 7fr 3fr;
  gap: 2rem;
  align-items: start;
}

.about-layout__text {
  min-width: 0;
}

.about-layout__photo {
  max-width: 14.5rem;
}

.about-layout__photo img {
  width: 100%;
  border: 1px solid var(--color-border);
}

.about-layout__photo p {
  font-size: 0.85rem;
  color: var(--color-muted);
}

@media (max-width: 39.98em) {
  .about-layout {
    grid-template-columns: 1fr;
  }

  .about-layout__photo {
    max-width: 14.5rem;
  }
}
