:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #7a7a7a;
  --line: #ececec;
  --gap: clamp(14px, 2vw, 28px);
  --pad: clamp(16px, 4vw, 56px);
  --max: 1680px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Jost", "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* Header */
.site-header {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(20px, 3vw, 40px) var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-link {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.nav-link:hover, .nav-link:focus-visible { color: var(--ink); border-bottom-color: var(--ink); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  width: 56px;
  height: 56px;
  
  display: block;
}

.brand-name {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Grid: 3 columns, then 2, then 1.
   Each tile takes the exact proportion of its video (set by the width and
   height attributes), so the full frame always shows and text is never cropped.
   main.js places tiles into the shortest column so mixed proportions stay tidy;
   without JS it falls back to a plain grid. */
.grid {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad) clamp(48px, 7vw, 110px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  align-items: start;
}

.grid.is-masonry {
  display: flex;
  align-items: flex-start;
}

.grid .col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.tile {
  margin: 0;
  background: #f4f4f4;
  overflow: hidden;
}

.tile video {
  display: block;
  width: 100%;
  height: auto;            /* keeps the native proportion */
  object-fit: contain;     /* never crop, even if a box is off by a pixel */
  background: #f4f4f4;
}

@media (max-width: 1023px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 639px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(36px, 5vw, 64px) var(--pad) 28px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-brand img {
  width: 44px;
  height: 44px;
  
}

.footer-brand p {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.footer-contact {
  font-style: normal;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 15px;
}

.footer-contact a {
  width: fit-content;
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}

.footer-contact a:hover,
.footer-contact a:focus-visible {
  border-bottom-color: var(--ink);
}

.legal {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px var(--pad) 32px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

@media (max-width: 639px) {
  .footer-inner { flex-direction: column; }
}

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

/* Client login */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.login {
  max-width: 420px;
  margin: 0 auto;
  padding: clamp(48px, 10vw, 140px) var(--pad) clamp(64px, 10vw, 160px);
  text-align: center;
}
.login h1 { font-size: 22px; font-weight: 400; letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 12px; }
.login p { color: var(--muted); margin: 0 0 28px; font-size: 15px; }
.login form { display: flex; gap: 10px; }
.login input {
  flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 12px 14px;
  border: 1px solid #d8d8d8; border-radius: 0; background: #fff; color: var(--ink);
}
.login input:focus { outline: none; border-color: var(--ink); }
.login button {
  font: inherit; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 12px 20px; border: 1px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.login button:hover:not(:disabled) { background: #fff; color: var(--ink); }
.login button:disabled { opacity: .5; cursor: default; }
.login .login-msg { margin: 18px 0 0; min-height: 1.5em; font-size: 14px; }

.private-tile .tile-box { width: 100%; background: #f4f4f4; }
.private-tile video { display: block; width: 100%; height: 100%; object-fit: contain; }
.private-tile figcaption { padding-top: 8px; font-size: 13px; letter-spacing: 0.04em; color: var(--muted); }
.private-tile { background: none; overflow: visible; }

@media (max-width: 479px) { .login form { flex-direction: column; } }

/* Click-through to a single private piece */
.private-link { display: block; color: inherit; text-decoration: none; cursor: pointer; }
.private-link:hover figcaption, .private-link:focus-visible figcaption { color: var(--ink); }
.private-link .tile-box { transition: opacity .2s ease; }
.private-link:hover .tile-box { opacity: .92; }

.viewer { max-width: 1200px; margin: 0 auto; padding: 0 var(--pad) clamp(40px, 6vw, 90px); }
.viewer-box { background: #f4f4f4; }
.viewer-box video { display: block; width: 100%; height: auto; max-height: 78vh; object-fit: contain; margin: 0 auto; background: #f4f4f4; }
.viewer-title { margin: 14px 0 0; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.viewer-note { text-align: center; color: var(--muted); padding: 60px var(--pad); font-size: 15px; }
