/*
  Styles for the starter template.
  To change the look, start with the colors below. After changing a color,
  check that text is still easy to read (a contrast of at least 4.5 to 1).
*/

:root {
  color-scheme: light;
  --background: #fffaf3;
  --surface: #ffffff;
  --text: #2b1d14;
  --accent: #8f3710;
  --accent-soft: #fbead2;
  --border: #e0c7a8;
  --focus: #1546b8;
  --radius: 1rem;
}

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

/* Text grows gently on large screens. */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: clamp(100%, 0.55rem + 0.5vw, 150%);
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.2;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 8vw, 3.25rem);
}

h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 5vw, 2rem);
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

/* A clear outline shows keyboard users where they are. Please keep it. */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

main:focus {
  outline: none;
}

/* The page uses the full width of the screen, with side margins that scale. */
.wrap {
  width: 100%;
  padding-inline: clamp(1rem, 4vw, 6rem);
}

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  background: var(--text);
  transform: translateY(-200%);
}

.skip-link,
.skip-link:hover {
  color: var(--surface);
}

.skip-link:focus {
  transform: none;
}

.site-header {
  padding-block: clamp(2rem, 7vw, 4rem) 1rem;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--border);
}

h1,
h2,
section p {
  overflow-wrap: anywhere;
}

.intro {
  max-width: 60ch;
  font-size: 1.2rem;
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

nav a {
  display: inline-block;
  padding-block: 0.35rem;
  font-weight: 600;
}

main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  padding-block: 1.5rem;
}

section {
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  scroll-margin-top: 1rem;
}

section p {
  max-width: 65ch;
}

section p:last-child {
  margin-bottom: 0;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

figure {
  margin: 0;
}

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

.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border-radius: 0.75rem;
  background: var(--accent-soft);
}

figcaption {
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

.site-footer {
  padding-block: 1rem;
  border-top: 1px solid var(--border);
}

/* On wide screens: the text on the left, the gallery filling the rest. */
@media (min-width: 70rem) {
  main {
    grid-template-columns: minmax(20rem, 1fr) minmax(0, 2fr);
    grid-template-rows: auto 1fr;
  }

  #gallery {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  #researcher {
    grid-column: 1;
    grid-row: 2;
  }
}

/* Motion only for people who have not asked to reduce it. */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .skip-link {
    transition: transform 0.18s ease;
  }
}
