:root {
  --text: #272626;
  --accent: #3d7365;
  --hover: #9bc4ab;
  --panel: #f4f5f7;
  --gutter: 12px;
  --row: 420px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font: 400 16px/1.65 Arial, Helvetica, "Helvetica Neue", sans-serif;
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; padding: 40px 0 72px; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--hover); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { line-height: 1.2; }
ul { list-style: none; margin: 0; padding: 0; }

.wrap { width: 100%; max-width: 1232px; margin: 0 auto; padding: 0 16px; }
.wrap-wide { max-width: 1232px; }
.wrap-text { max-width: 792px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }

/* header */
.site-header { border-bottom: 1px solid var(--panel); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 12px; position: relative; }
.logo { display: block; width: 287px; max-width: 55vw; line-height: 0; }
.logo:hover { opacity: .85; }
.nav ul { display: flex; gap: 28px; }
.nav a { color: var(--text); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--hover); }
.nav a[aria-current="page"] { border-bottom-color: var(--accent); }
.nav-toggle { display: none; font: inherit; color: var(--text); background: none; border: 1px solid var(--text); border-radius: 3px; padding: 6px 14px; cursor: pointer; }

/* home */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.tile-img { display: block; line-height: 0; }
.tile-img img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: opacity .2s; }
.tile-img:hover img { opacity: .85; }
.tile-label { display: block; margin-top: 18px; text-align: center; font-size: 28px; line-height: 1.2; color: var(--text); text-decoration: none; }
.tile-label:hover { color: var(--hover); }
.tile-caption { margin: 4px 0 0; text-align: center; font-size: 14px; letter-spacing: .04em; }

/* about */
.about { display: grid; grid-template-columns: 1fr 340px; gap: 48px; align-items: start; max-width: 1000px; }
.about h1 { font-size: 24px; margin: 0 0 20px; }
.about p { margin: 0 0 1.1em; }
.about-img img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.pullquote { margin: 28px 0 0; padding: 18px 22px; background: var(--panel); border-left: 4px solid var(--accent); }
.pullquote p { margin: 0; }

/* gallery: justified rows via flex-grow proportional to aspect ratio */
.gallery { display: flex; flex-wrap: wrap; gap: var(--gutter); }
.gallery::after { content: ""; flex-grow: 1000; }
.gallery li { flex: calc(var(--r) * 100) 1 calc(var(--r) * var(--row)); min-width: 0; }
.gallery a { display: block; line-height: 0; background: var(--panel); cursor: zoom-in; }
.gallery img { width: 100%; height: auto; transition: opacity .2s; }
.gallery a:hover img { opacity: .88; }

/* legal */
.legal { overflow-wrap: anywhere; }
.legal p { margin: 0 0 1em; }
.legal ul { list-style: disc; padding-left: 1.5em; margin: 0 0 1em; }
.legal ul ul { margin: .4em 0; }
.legal table { width: 100%; border-collapse: collapse; margin: 0 0 1em; }
.legal td { border: 1px solid #ddd; padding: 12px 14px; vertical-align: top; }

/* footer */
.site-footer { background: var(--panel); font-size: 14px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 22px; padding-bottom: 22px; }
.footer-inner p { margin: 0; }
.footer-inner ul { display: flex; gap: 20px; }
.footer-inner a { color: var(--text); }
.footer-inner a:hover { color: var(--accent); }

/* lightbox caption */
.pswp__caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 20px; text-align: center; color: #fff; background: rgba(0,0,0,.45); font-size: 15px; z-index: 5; }

@media (max-width: 960px) {
  :root { --row: 260px; }
  .tiles { gap: 20px; }
  .tile-label { font-size: 22px; }
  .about { grid-template-columns: 1fr; gap: 28px; }
  .about-img { order: -1; max-width: 360px; }
}
@media (max-width: 720px) {
  .tiles { grid-template-columns: 1fr; gap: 40px; }
  .tile-label { font-size: 26px; }
  .gallery li { flex: 0 0 100%; }
  .gallery::after { display: none; }
  /* menu: toggle button only when JS is available, otherwise nav simply wraps */
  .header-inner { flex-wrap: wrap; }
  .nav { width: 100%; }
  .nav ul { flex-wrap: wrap; gap: 4px 20px; }
  .js .nav-toggle { display: inline-block; }
  .js .nav { display: none; }
  .js .nav.open { display: block; }
  .js .nav ul { flex-direction: column; gap: 0; padding: 8px 0; }
  .js .nav a { display: block; padding: 10px 0; }
}
