/* Tate Summers — portfolio styles */
:root {
  --bg: #111111;
  --panel: #1a1a1a;
  --text: #ffffff;
  --body: #b5b5b5;
  --muted: #8a8a8a;
  --line: #2a2a2a;
  --accent: #e8703a;
  --max: 1200px;
  --gap: 12px;
  --head: "Oswald", "Arial Narrow", Arial, sans-serif;
  --sans: "Barlow", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--text); color: var(--bg); padding: 8px 12px; z-index: 100;
}
.skip:focus { left: 8px; top: 8px; }

/* ---------- header ---------- */
.site-header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px 24px 20px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}
.nav { display: flex; gap: 22px; }
.nav a {
  font-family: var(--head);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 17px;
  color: var(--muted);
  text-decoration: none;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.logo {
  font-family: var(--head);
  font-weight: 500;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  text-align: center;
  font-size: 60px;
  line-height: 1;
  letter-spacing: 0;
  display: inline-block;
}
.logo span { display: block; white-space: nowrap; }
.logo span + span { margin-top: 2px; }

/* ---------- main ---------- */
main { max-width: var(--max); margin: 0 auto; padding: 28px 24px 40px; }

.page-title {
  font-family: var(--head);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text);
  text-align: center;
  font-size: 28px;
  margin: 24px 0 40px;
}

/* ---------- home grid ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}
.tile {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--panel);
  text-decoration: none;
}
.tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s ease, opacity .3s ease;
}
.tile .label {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center;
  background: rgba(0, 0, 0, .55);
  opacity: 0;
  transition: opacity .3s ease;
  padding: 16px;
}
.tile .label strong {
  font-family: var(--head);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text);
  font-size: 26px;
  line-height: 1.15;
}
.tile .label small { color: var(--body); font-size: 15px; margin-top: 4px; }
.tile:hover img, .tile:focus-visible img { transform: scale(1.04); }
.tile:hover .label, .tile:focus-visible .label { opacity: 1; }
@media (hover: none) {
  .tile .label {
    opacity: 1; top: auto; justify-content: flex-end; align-items: flex-start; text-align: left;
    background: linear-gradient(transparent, rgba(0, 0, 0, .75));
  }
  .tile .label strong { font-size: 20px; }
}

/* ---------- project page ---------- */
.section { margin: 0 auto 56px; }
.section h2 {
  font-family: var(--head);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text);
  text-align: center;
  font-size: 24px;
  margin: 0 0 16px;
}
.section p {
  max-width: 820px;
  margin: 0 auto 28px;
  text-align: center;
  color: var(--body);
}
.gallery { display: grid; gap: var(--gap); }
.gallery button {
  all: unset;
  cursor: zoom-in;
  display: block;
  background: var(--panel);
  overflow: hidden;
}
.gallery button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gallery img { width: 100%; transition: opacity .3s ease; }
.gallery button:hover img { opacity: .88; }

.layout-stack { grid-template-columns: 1fr; }
.layout-stack.narrow { max-width: 640px; margin: 0 auto; }

.layout-grid { grid-template-columns: repeat(3, 1fr); }
.layout-grid.count-2, .layout-grid.count-4 { grid-template-columns: repeat(2, 1fr); }
.layout-grid button { aspect-ratio: 1 / 1; }
.layout-grid img { height: 100%; object-fit: cover; }

.layout-grid.count-8, .layout-grid.count-12, .layout-grid.count-16 { grid-template-columns: repeat(4, 1fr); }
.layout-grid.count-5 { grid-template-columns: repeat(5, 1fr); }

.layout-pair { grid-template-columns: repeat(2, 1fr); }
.layout-pair button { aspect-ratio: 1 / 1; }
.layout-pair img { height: 100%; object-fit: cover; }

/* masonry: photos keep their natural shape, in columns */
.gallery.layout-masonry { display: block; columns: 3; column-gap: var(--gap); }
.layout-masonry button { width: 100%; margin: 0 0 var(--gap); break-inside: avoid; }

/* more work */
.more { border-top: 1px solid var(--line); padding-top: 32px; margin-top: 24px; }
.more h3 {
  font-family: var(--head); font-weight: 400; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); text-align: center; font-size: 18px; margin: 0 0 20px;
}
.more .work-grid { grid-template-columns: repeat(3, 1fr); }
.more .tile .label strong { font-size: 18px; }

/* ---------- contact ---------- */
.contact {
  text-align: center;
  font-size: 22px;
  color: var(--text);
}
.contact a { text-decoration: none; border-bottom: 1px solid var(--muted); }
.contact a:hover { border-color: var(--accent); }
.contact .sep { color: var(--muted); margin: 0 12px; }
.contact .button {
  display: inline-block;
  margin-top: 32px;
  padding: 12px 28px;
  border: 1px solid var(--text);
  font-family: var(--head);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 16px;
}
.contact .button:hover { background: var(--text); color: var(--bg); }

/* ---------- footer ---------- */
.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 24px 24px 48px;
}
.to-top {
  position: fixed; right: 20px; bottom: 20px;
  width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: #2b2b2b; color: var(--text);
  font-size: 20px; cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity .3s ease;
}
.to-top.show { opacity: .85; pointer-events: auto; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, .94);
  display: none; align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 86vh; width: auto; height: auto; }
.lightbox button {
  position: absolute;
  background: none; border: 0; color: var(--text);
  font-size: 34px; line-height: 1; cursor: pointer; padding: 14px;
  opacity: .8;
}
.lightbox button:hover { opacity: 1; }
.lb-close { top: 8px; right: 12px; }
.lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 800px) {
  .logo { font-size: 48px; }
  .layout-grid, .layout-grid.count-5, .layout-grid.count-8, .layout-grid.count-12, .layout-grid.count-16, .more .work-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery.layout-masonry { columns: 2; }
}
@media (max-width: 600px) {
  body { font-size: 17px; }
  .site-header { grid-template-columns: 1fr; justify-items: center; padding: 22px 16px 0; }
  .site-header .nav { order: 2; }
  .site-header .spacer { display: none; }
  .logo { font-size: 44px; }
  main { padding: 16px 16px 32px; }
  .work-grid { grid-template-columns: 1fr; }
  .layout-pair { grid-template-columns: 1fr; }
  .layout-pair button { aspect-ratio: auto; }
  .section p { text-align: left; }
  .contact { font-size: 19px; }
  .contact .sep { display: block; height: 6px; overflow: hidden; color: transparent; }
  .lb-prev, .lb-next { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
