/* Layout and components. The colors, fonts, and sizes are in tokens.css. */

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

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

body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--line-height-body);
  -webkit-font-smoothing: antialiased;
}

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

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

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

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 2px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: var(--line-height-heading);
  letter-spacing: -0.01em;
  margin: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -100px;
  padding: var(--space-2) var(--space-3);
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  border-radius: var(--radius);
  z-index: 10;
}

.skip-link:focus {
  top: var(--space-3);
}

.container {
  width: min(100% - 2 * var(--space-4), var(--width-page));
  margin-inline: auto;
}

.container--wide {
  width: min(100% - 2 * var(--space-4), var(--width-wide));
}

/* Header */

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

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: var(--space-4);
}

.site-header__name {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  color: var(--color-text);
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--color-text);
  text-decoration: underline;
}

/* Home */

.hero {
  padding-block: var(--space-7) var(--space-6);
}

.hero__role {
  margin: 0 0 var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero__headline {
  max-width: 18ch;
  font-size: var(--text-hero);
}

.hero__intro {
  max-width: 40rem;
  margin: var(--space-4) 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-lg);
}

.work {
  padding-bottom: var(--space-7);
}

.section-heading {
  margin-bottom: var(--space-5);
  font-size: var(--text-xl);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr));
  gap: var(--space-6) var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-card__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.project-card__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--color-surface);
  transition: transform 0.3s ease;
}

.project-card__link:hover .project-card__image {
  transform: scale(1.015);
}

.project-card__title {
  margin-top: var(--space-4);
  font-size: var(--text-xl);
}

.project-card__link:hover .project-card__title {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.project-card__summary {
  margin: var(--space-2) 0 0;
  color: var(--color-text-muted);
}

.empty-state {
  color: var(--color-text-muted);
}

.draft-badge {
  display: inline-block;
  margin: var(--space-3) 0 0;
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  background: #fff3c4;
  color: #5c4300;
  font-size: var(--text-sm);
}

/* Case study */

.case-study__header {
  max-width: var(--width-text);
  padding-block: var(--space-6) var(--space-5);
}

.back-link {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
}

.back-link:hover {
  color: var(--color-text);
}

.case-study__title {
  margin-top: var(--space-4);
  font-size: var(--text-2xl);
}

.case-study__summary {
  margin: var(--space-4) 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-lg);
}

.case-study__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: var(--space-4);
  margin: var(--space-5) 0 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.case-study__meta dt {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.case-study__meta dd {
  margin: 0;
}

.case-study__cover {
  margin-block: 0 var(--space-6);
}

.case-study__cover img {
  width: 100%;
  border-radius: var(--radius);
}

.case-study__pager {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: var(--space-4);
  max-width: var(--width-text);
  margin-block: var(--space-6) var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
}

.case-study__pager-link {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  color: var(--color-text);
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  text-decoration: none;
}

.case-study__pager-link span {
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: var(--text-sm);
}

.case-study__pager-link--next {
  text-align: right;
  grid-column: -2;
}

/* Long text from Pages CMS */

.prose {
  max-width: var(--width-text);
}

.prose > * + * {
  margin-top: var(--space-4);
}

.prose h2 {
  margin-top: var(--space-6);
  font-size: var(--text-xl);
}

.prose h3 {
  margin-top: var(--space-5);
  font-size: var(--text-lg);
}

.prose p,
.prose ul,
.prose ol {
  margin-bottom: 0;
}

.prose img {
  margin-block: var(--space-5);
  border-radius: var(--radius);
}

.prose blockquote {
  margin-inline: 0;
  padding-left: var(--space-4);
  border-left: 3px solid var(--color-accent);
  color: var(--color-text-muted);
  font-family: var(--font-heading);
  font-size: var(--text-lg);
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin-block: var(--space-6);
}

.prose iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--radius);
}

/* About */

.about {
  padding-block: var(--space-6) var(--space-7);
}

.about__title {
  margin-bottom: var(--space-5);
  font-size: var(--text-2xl);
}

.about__grid--with-photo {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 60rem) {
  .about__grid--with-photo {
    grid-template-columns: 22.5rem 1fr;
    align-items: start;
  }
}

.about__photo {
  width: 100%;
  border-radius: var(--radius);
}

.about__links {
  padding-left: 1.2em;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: var(--space-5);
}

.site-footer__copy {
  margin: 0;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer__links a {
  color: inherit;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
