/* ===== Fonts =====
   Masonic Lodge: local() uses the copy installed on your computer.
   For visitors, add a web version at fonts/MasonicLodge.woff2 (check the font's licence covers web use). */
@font-face {
  font-family: "Masonic Lodge";
  src: local("Masonic Lodge"), local("MasonicLodge"),
       url("../fonts/MasonicLodge.woff2") format("woff2");
  font-display: swap;
}

:root {
  --bg: #f9f8f5;
  --ink: #1f1f1f;
  --muted: #8f8f8f;
  --label: #1e3a3a;
  --field: #353535;
  --pill-border: #aab0e6;
  --display: "Masonic Lodge", "IM Fell English SC", Georgia, serif;
  --body: "Oswald", "Arial Narrow", sans-serif;
  --page-pad: clamp(1rem, 4vw, 4rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  text-transform: uppercase;
}
img { display: block; max-width: 100%; height: auto; }
main { padding: 0 var(--page-pad) 6rem; }

/* ===== Header ===== */
.site-header {
  position: relative;
  padding: 3.5rem var(--page-pad) 3rem;
  text-align: center;
}
.site-nav {
  position: absolute;
  left: var(--page-pad);
  top: 3.6rem;
  display: grid;
  grid-template-columns: auto auto;
  column-gap: 1rem;
  text-align: left;
  font-size: 1.05rem;
  line-height: 1.3;
}
.site-nav a { color: var(--ink); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 3px; }
.site-title {
  font-family: var(--display);
  font-size: clamp(2.2rem, 5.5vw, 4.6rem);
  color: var(--ink);
  text-decoration: none;
  text-transform: none;
  font-variant: small-caps;
  letter-spacing: 0.02em;
}

/* ===== Intro text blocks ===== */
.intro {
  max-width: 44rem;
  margin: 1rem auto 3rem;
  text-align: center;
}
.intro h1 { font-weight: 500; font-size: 2rem; margin: 0 0 1rem; }
.intro p { color: var(--muted); font-size: 1.15rem; line-height: 1.55; margin: 0 0 1.4em; }
.project-link { color: var(--ink); }

/* ===== Decorative art ===== */
.divider { margin: 2rem auto; width: min(100%, 60rem); }
.feature-art { margin: 4rem auto 3rem; width: min(80%, 32rem); }
.feature-art--small { width: min(60%, 20rem); }

/* ===== Pill buttons ===== */
.pill-links { display: flex; flex-direction: column; align-items: center; gap: 2rem; margin-bottom: 2rem; }
.pill {
  font-family: var(--display);
  text-transform: none;
  font-variant: small-caps;
  font-size: 1.6rem;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  padding: 0.4rem 2.2rem;
  transition: background-color .2s;
}
.pill:hover { background: #fff; }

/* ===== Project grids ===== */
.grid { display: flex; flex-wrap: wrap; justify-content: center; }
.grid--designs { gap: 6px; }
.grid--designs .tile { width: calc(50% - 3px); }
.grid--animations { gap: 2.2rem; }
.grid--animations .tile { width: calc((100% - 4.4rem) / 3); }

.tile {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e2e0da;
}
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile-name {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  text-align: center;
  background: rgba(20, 20, 20, 0.55);
  color: #fff;
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  font-weight: 500;
  opacity: 0;
  transition: opacity .25s;
}
.tile:hover .tile-name, .tile:focus-visible .tile-name { opacity: 1; }
.tile:focus-visible { outline: 3px solid var(--pill-border); outline-offset: 3px; }

/* Touch screens can't hover, so show the name as a bar instead */
@media (hover: none) {
  .tile-name { opacity: 1; inset: auto 0 0 0; padding: .5rem; font-size: 1rem; }
}

/* ===== Project page ===== */
.media { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; margin-bottom: 5rem; }
.media img { width: 100%; }

/* Videos: one fills the width, more go two across, an odd number leads with a full-width first video */
.media-videos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.media-videos[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
.media-videos[data-lead] > .video:first-child { grid-column: 1 / -1; }

/* Images: one fills the width, more flow into two columns without cropping */
.media-images { columns: 2; column-gap: 6px; }
.media-images[data-count="1"] { columns: 1; }
.media-images img { margin-bottom: 6px; break-inside: avoid; }
.video { position: relative; aspect-ratio: 16 / 9; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.more h2 { font-weight: 500; font-size: 1.5rem; margin: 0 0 1.5rem; }

/* ===== Contact form ===== */
.contact-form { max-width: 44rem; margin: 4rem auto; display: flex; flex-direction: column; }
.contact-form label {
  font-family: var(--display);
  text-transform: none;
  font-variant: small-caps;
  color: var(--label);
  font-size: 1.3rem;
  margin: 1.4rem 0 .6rem;
}
.contact-form input, .contact-form textarea {
  font: inherit;
  text-transform: none;
  font-size: 1rem;
  color: #fff;
  background: var(--field);
  border: 0;
  border-radius: 3px;
  padding: .85rem 1rem;
}
.contact-form ::placeholder { color: #9a9a9a; text-transform: uppercase; }
.contact-form button {
  align-self: flex-start;
  margin-top: 2rem;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 500;
  text-transform: uppercase;
  background: #b3b3b3;
  border: 0;
  border-radius: 999px;
  padding: .6rem 1.8rem;
  cursor: pointer;
}
.contact-form button:hover { background: #a2a2a2; }
:focus-visible { outline: 2px solid var(--pill-border); outline-offset: 2px; }

/* ===== Back to top ===== */
.to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(210, 210, 210, .85);
  color: #777;
}

/* ===== Smaller screens ===== */
@media (max-width: 900px) {
  .site-nav { position: static; justify-content: center; margin-bottom: 1.5rem; }
  .grid--animations { gap: 1rem; }
  .grid--animations .tile { width: calc(50% - .5rem); }
}
@media (max-width: 600px) {
  .media-videos { grid-template-columns: minmax(0, 1fr); }
  .media-images { columns: 1; }
  .grid--designs .tile, .grid--animations .tile { width: 100%; }
  .to-top { width: 3rem; height: 3rem; }
}

/* ===== Loaded-content states ===== */
.status { text-align: center; color: var(--muted); width: 100%; padding: 2rem 0; }
.page-body p { margin: 0 0 1.4em; }
.form-status { margin-top: 1rem; color: var(--label); text-transform: none; }
