/* Shared responsive and input-accessibility rules for every public page. */

:root {
  --gold: #815e18;
}

@media (prefers-color-scheme: dark) {
  :root {
    --gold: #d2ad62;
  }
}

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

body {
  overflow-wrap: break-word;
}

h1,
#page-title {
  font-size: clamp(2.35rem, calc(1.47vw + 1.82rem), 3rem);
}

.site {
  padding-top: max(28px, env(safe-area-inset-top));
  padding-right: max(20px, env(safe-area-inset-right));
  padding-bottom: max(96px, calc(64px + env(safe-area-inset-bottom)));
  padding-left: max(20px, env(safe-area-inset-left));
  width: 100%;
}

.brand,
.nav a,
.button {
  min-height: 44px;
}

.brand,
.nav a,
.button,
.site-controls-btn,
.site-controls-close,
.site-controls-option {
  touch-action: manipulation;
  -webkit-tap-highlight-color: color-mix(in oklab, var(--green) 24%, transparent);
}

.nav a[aria-current="page"] {
  border-color: var(--green);
  color: var(--green);
}

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

h1,
h2,
h3,
p,
li {
  overflow-wrap: break-word;
}

.tag,
.pill,
.keyword-list li {
  max-width: 100%;
}

.project-card > div > h3 {
  font-size: 1.2rem;
  letter-spacing: 0;
  line-height: 1.2;
  margin: 0;
  text-transform: none;
}

:root.site-controls-high-contrast .button.primary {
  color: #0a140f;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--green) !important;
  outline-offset: 3px !important;
}

main[tabindex="-1"]:focus {
  outline: none;
}

@media (hover: none) {
  .nav a:not([aria-current="page"]):hover {
    border-color: var(--line);
    color: var(--muted);
  }

  .nav a:active {
    border-color: var(--green);
    color: var(--green);
  }

  .button:hover {
    border-color: var(--line);
    color: var(--text);
  }

  .button.primary:hover {
    border-color: var(--green);
    color: #ffffff;
  }
}

@media (hover: none) and (prefers-color-scheme: dark) {
  .button.primary:hover {
    color: #101412;
  }
}

@media (min-width: 901px) {
  .masthead {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
  }
}

@media (max-width: 880px) {
  .visual img {
    aspect-ratio: auto;
    max-height: none;
    object-fit: contain;
  }
}

@media (max-width: 900px) {
  .masthead {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 32px;
  }

  .nav {
    justify-content: flex-start;
    width: 100%;
  }
}

@media (max-width: 600px) {
  .site {
    padding-top: max(22px, env(safe-area-inset-top));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(96px, calc(64px + env(safe-area-inset-bottom)));
    padding-left: max(16px, env(safe-area-inset-left));
  }

  .masthead {
    gap: 16px;
    margin-bottom: 28px;
  }

  .nav {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav a {
    min-width: 0;
    padding: 8px;
    text-align: center;
    width: 100%;
  }

  .nav a:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  h1 {
    font-size: clamp(2rem, 8.4vw, 2.35rem);
    line-height: 1.08;
  }

  .lede {
    font-size: 1rem;
  }

  .card,
  .project-card {
    padding: clamp(16px, 4vw, 20px);
  }

  .actions,
  .card-actions,
  .closing-links {
    gap: 10px;
  }

  .actions .button,
  .card-actions .button,
  .closing-links .button,
  .closing .button {
    justify-content: center;
    width: 100%;
  }
}

@media (min-width: 781px) and (max-height: 500px) and (orientation: landscape) {
  .masthead {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    margin-bottom: 30px;
  }

  .nav {
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
