/* ---------------------------------------------------------------
   davehamara.com — styles
   Layout idea: a white gallery wall. One small typeface, one size,
   and photographs hung in a lot of empty space.
   The few values you might want to change live right here.
   --------------------------------------------------------------- */
:root {
  --wall: #ffffff;         /* the background everywhere */
  --text: #111111;         /* all text */
  --quiet: #8c8c8c;        /* captions, counters, labels */
  --line: #e6e6e6;         /* the faint line under the index heading */
  --slide-seconds: 0;      /* seconds per photo on the homepage; 0 = only changes when clicked */
  --size: 12px;            /* the one text size used across the site */
  --gutter: clamp(16px, 2.6vw, 36px);
  --air: clamp(72px, 11vh, 120px);   /* empty space above and below the photo */
  --sans: 'Archivo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color-scheme: light;
}

@font-face { font-family: 'Archivo'; src: url('fonts/archivo.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--wall); }
body {
  margin: 0; background: var(--wall); color: var(--text);
  font-family: var(--sans); font-size: var(--size); font-weight: 400;
  line-height: 1.5; letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- header (shared) ---------- */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) var(--gutter) 14px;
  background: var(--wall);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.name { font-weight: 400; padding-block: 8px; }
.nav { display: flex; gap: clamp(20px, 2.6vw, 36px); }
.nav a, .nav button { padding-block: 8px; color: var(--quiet); transition: color 0.2s; }
.nav a:hover, .nav button:hover, .nav [aria-current], .nav [aria-pressed='true'] { color: var(--text); }

/* ---------- homepage: one photo on the wall ---------- */
.home { height: 100svh; overflow: hidden; }

.stage { position: fixed; inset: 0; cursor: e-resize; touch-action: pan-y; }
.stage.is-left { cursor: w-resize; }
.slide {
  position: absolute;
  top: var(--air); bottom: var(--air); left: var(--gutter); right: var(--gutter);
  width: calc(100% - 2 * var(--gutter)); height: calc(100% - 2 * var(--air));
  max-width: none;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.9s ease;
  user-select: none; -webkit-user-drag: none;
}
.slide.is-on { opacity: 1; }
.js .home:not(.ready) .slide.is-on { opacity: 0; }

.hud {
  position: fixed; inset: auto 0 0 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 14px var(--gutter) calc(14px + env(safe-area-inset-bottom, 0px));
  text-transform: uppercase; letter-spacing: 0.06em;
  pointer-events: none;
}
.hud > * { pointer-events: auto; }
.controls { display: flex; align-items: center; gap: 4px; margin-right: -10px; }
.controls button { min-height: 44px; padding-inline: 10px; color: var(--quiet); transition: color 0.2s; }
.controls button:hover { color: var(--text); }
.caption { margin: 0; color: var(--quiet); font-variant-numeric: tabular-nums; }
.count { min-width: 56px; text-align: center; font-variant-numeric: tabular-nums; }
.count span { color: var(--quiet); }

.progress { position: fixed; inset: auto 0 0 0; height: 1px; z-index: 11; }
.progress i { display: block; height: 100%; width: 0; background: var(--text); opacity: 0.25; }
.progress.run i { animation: fill calc(var(--slide-seconds) * 1s) linear forwards; }
.progress.off { display: none; }
@keyframes fill { to { width: 100%; } }

/* everything except the photo arrives a beat later */
.home .top, .home .hud { transition: opacity 1.2s ease 0.5s; }
.js .home:not(.ready) .top, .js .home:not(.ready) .hud { opacity: 0; }

/* ---------- homepage: the index ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 15;
  background: var(--wall);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 96px var(--gutter) 72px;
  opacity: 0; visibility: hidden;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}
.sheet.open { opacity: 1; visibility: visible; transition: opacity 0.35s ease; }
.sheet-head {
  display: flex; justify-content: space-between; gap: 16px;
  color: var(--quiet); margin-bottom: 40px;
}
.sheet-head--next { margin-top: clamp(96px, 14vw, 180px); }
.grid {
  list-style: none; margin: 0 auto; padding: 0; max-width: 1400px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(44%, 200px), 1fr));
  gap: clamp(28px, 4vw, 64px) clamp(16px, 3vw, 48px);
}
.frame { display: flex; flex-direction: column; gap: 10px; }
.frame img {
  width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: contain; object-position: 50% 100%;
  transition: opacity 0.25s ease;
}
.frame:hover img { opacity: 0.82; }
.frame-label { color: var(--text); font-variant-numeric: tabular-nums; text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }

/* without JavaScript the index is simply shown */
.no-js .sheet { opacity: 1; visibility: visible; position: static; min-height: 100svh; }
.no-js .stage, .no-js .hud, .no-js .progress, .no-js #toggle-index { display: none; }
.no-js .home { height: auto; overflow: auto; }

/* ---------- info page ---------- */
.info .top { position: absolute; }
.page {
  max-width: 1100px; margin: 0 auto;
  padding: 160px var(--gutter) 64px;
  display: flex; flex-direction: column; gap: clamp(56px, 8vw, 96px);
}
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 16px 32px; }
.row h2 { margin: 0; font-size: inherit; font-weight: 400; color: var(--quiet); text-transform: uppercase; letter-spacing: 0.06em; }
.row-body { max-width: 56ch; }
.row-body p { margin: 0 0 1.2em; }
.row-body p:last-child { margin-bottom: 0; }
.row > .tagline { grid-column: 2; }
.clients { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 24px; }
.clients h3 { margin: 0 0 10px; font-size: inherit; font-weight: 400; color: var(--quiet); text-transform: uppercase; letter-spacing: 0.06em; }
.clients ul { list-style: none; margin: 0; padding: 0; line-height: 1.8; }
.email { border-bottom: 1px solid currentColor; }
.email:hover { color: var(--quiet); }
.quiet { color: var(--quiet); }
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--quiet); text-transform: uppercase; letter-spacing: 0.06em; }

@media (max-width: 900px) {
  .clients { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  :root { --air: 92px; }
  .slide { left: 0; right: 0; width: 100%; }
  .row { grid-template-columns: minmax(0, 1fr); }
  .row > .tagline { grid-column: 1; }
  .page { padding-top: 112px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01s !important; animation: none !important; }
}
