/* ==========================================================================
   bactriana.org — splash page.
   Two doors, nothing else. The destination appears on hover or focus;
   on touch screens, where there is no hover, it is always visible.
   Palette and type follow jamespickett.info.
   ========================================================================== */

:root {
  --paper:   #f4efe4;
  --ink:     #2c2a22;
  --ink-soft:#8d8574;
  --turquoise-deep: #0e5f64;

  --display: "Spectral", Georgia, "Times New Roman", serif;
  --utility: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 300;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 3vh;
}

/* --- the wordmark: small, so the images carry the page, but present so a
       stranger (and a search engine) knows where they have landed --- */
.wordmark {
  flex: 0 0 auto;
  text-align: center;
  font-family: var(--utility);
  font-weight: 400;
  font-size: .72rem;
  letter-spacing: .42em;
  text-indent: .42em;           /* optical centering against the tracking */
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 0 1rem clamp(1.6rem, 4vh, 2.8rem);
}

/* --- the doors --- */
/* Each door keeps the image's own 3:2, so nothing is cropped away: the
   two sit as one continuous 3:1 band across the full width of the page. */
.doors {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.door { aspect-ratio: 3 / 2; }

.door {
  position: relative;
  display: block;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border-top: 1px solid rgba(44,42,34,.14);
  border-bottom: 1px solid rgba(44,42,34,.14);
}
.door + .door { border-left: 1px solid rgba(44,42,34,.14); }

.door img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(.94);
  transition: transform .8s cubic-bezier(.2,.6,.2,1), filter .4s ease;
}

/* a wash that deepens on hover so the label has something to sit on */
.veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(20,26,26,.10) 0%, rgba(20,26,26,.52) 100%);
  opacity: 0;
  transition: opacity .38s ease;
  pointer-events: none;
}

.label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 2rem 1.6rem 2.2rem;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .34s ease, transform .34s cubic-bezier(.2,.6,.2,1);
}

.name {
  display: block;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.25rem, 2.6vw, 1.85rem);
  line-height: 1.2;
  color: #f6f1e6;
  text-shadow: 0 1px 10px rgba(12,18,18,.5);
}

.addr {
  display: block;
  font-family: var(--utility);
  font-size: .66rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #cfe0dd;
  margin-top: .5rem;
  text-shadow: 0 1px 8px rgba(12,18,18,.55);
}

.door:hover img,
.door:focus-visible img { transform: scale(1.04); filter: saturate(1.04); }

.door:hover .veil,
.door:focus-visible .veil { opacity: 1; }

.door:hover .label,
.door:focus-visible .label { opacity: 1; transform: none; }

.door:focus-visible {
  outline: 3px solid var(--turquoise-deep);
  outline-offset: -3px;
}

/* ------------------------------------------------------------- responsive */
@media (max-width: 820px) {
  .doors { grid-template-columns: 1fr; }
  .door + .door { border-left: 0; border-top: 0; }
  .label { padding: 1.4rem 1.2rem 1.5rem; }
}

/* No hover on touch screens, so never hide the destination there. */
@media (hover: none) {
  .veil  { opacity: 1; }
  .label { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .door:hover img { transform: none; }
}
