/* Cangrande — dark charcoal mat, grey ink, prints on paper. */
:root {
  --ground: #1c1c1c;   /* the mat */
  --ink:    #5c5c5c;   /* all type, one tone */
  --lit:    #9a9894;   /* hover / current */
  --paper:  #d5d4d3;   /* the print's paper */
  --gutter: clamp(1rem, 4.5vw, 4rem);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--ground); }
body {
  min-height: 100vh;
  background: var(--grain), var(--ground);   /* grain on the mat only, never on the photos */
  color: var(--ink);
  font-family: "EB Garamond", Garamond, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.4;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .04);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; -webkit-user-drag: none; user-select: none; }
a { color: inherit; text-decoration: none; transition: color .25s ease; }
a:hover, a[aria-current] { color: var(--lit); }
a:focus-visible { outline: 1px solid var(--lit); outline-offset: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* type */
.mark { font-style: italic; font-size: 1.25rem; letter-spacing: .02em; }
.nav { display: flex; gap: clamp(1.1rem, 3vw, 2.4rem); }
.nav a, .label, .title {
  font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 400;
}
.nav a { font-size: 1.05rem; letter-spacing: .14em; }


/* ---------- home: one print, matted, bottom-weighted like a framer's cut ---------- */
.home { height: 100vh; height: 100svh; display: grid; place-items: center; grid-template-columns: 100%;
  grid-template-rows: minmax(var(--gutter), 1fr) auto minmax(calc(var(--gutter) + 8rem), 1.3fr);
  padding: 0 var(--gutter); }
.plate { grid-row: 2; position: relative;
  width: min(1000px, 100%, max(16rem, (100svh - 17rem) * var(--ratio, 1.5)));
  container-type: inline-size; }
.window { display: block; position: relative;
  padding: 1.4cqi; background: var(--paper);
  border: .5cqi solid; border-color: #aeaba6 #cfccc7 #e1dfda #c2bfb9;
  box-shadow: inset 0 .3cqi .6cqi rgba(0,0,0,.28), 0 1.5rem 3rem -1.5rem rgba(0,0,0,.6);
  animation: fade 1.2s ease both .1s; }
.window img { width: 100%; }
.from { position: absolute; left: 0; right: 0; top: calc(100% + max(.6rem, 1.4cqi));
  text-align: center; font-style: italic; font-size: .95rem; animation: fade 1.2s ease both .4s; }
.from a { color: var(--lit); }
.from a:hover { color: #c4c2bd; }
.caption { position: absolute; left: 0; right: 0; top: calc(100% + max(2.8rem, 5.5cqi));
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  animation: fade 1.2s ease both .4s; }
/* instagram / youtube / email, at the foot of the home page */
.links { grid-row: 3; align-self: end; display: flex; gap: clamp(1.2rem, 3vw, 2.4rem);
  padding-bottom: clamp(1rem, 3vh, 1.8rem); animation: fade 1.2s ease both .7s; }
.links a { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; cursor: pointer; }
@keyframes fade { from { opacity: 0; } }

/* ---------- inner pages ---------- */
.top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: clamp(1.4rem, 3.5vw, 2.6rem) var(--gutter); }

/* photography index */
.index { display: grid; gap: clamp(2rem, 5vw, 4.5rem) clamp(1.2rem, 3vw, 3rem);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  padding: clamp(1rem, 4vw, 3rem) var(--gutter) 8rem; max-width: 1400px; margin: 0 auto; }
.card { display: block; }
.frame { display: block; aspect-ratio: 1; overflow: hidden; background: #161616; }
.frame img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.82);
  transition: filter .5s ease, transform 1.2s ease; }
.card:hover .frame img { filter: brightness(1); transform: scale(1.015); }
.card .label { display: block; margin-top: .9rem; }

/* an album: the photo in the viewer, a strip of its neighbours below */
.album-page { height: 100vh; height: 100svh; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.album { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 0 var(--gutter) clamp(1.2rem, 3.5vh, 2.4rem); }
.title { text-align: center; margin: 0 0 clamp(.8rem, 2.5vh, 1.6rem); color: var(--lit); }
.viewer { min-height: 0; position: relative; }
.viewer img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; cursor: zoom-in;
  transition: opacity .45s ease; }
.viewer img.out { opacity: 0; }
.strip { display: flex; justify-content: center; gap: clamp(.5rem, 1.4vw, 1rem);
  margin-top: clamp(1rem, 3vh, 2rem); }
.cell { width: clamp(3.2rem, 7vh, 5rem); aspect-ratio: 1; padding: 0; border: 0; background: #161616;
  cursor: pointer; opacity: .4; transition: opacity .25s ease; }
.cell:hover, .cell:focus-visible { opacity: .85; }
.cell:focus-visible { outline: 1px solid var(--lit); outline-offset: 3px; }
.cell.now { opacity: 1; outline: 1px solid var(--lit); outline-offset: 3px; cursor: default; }
.cell img { width: 100%; height: 100%; object-fit: cover; }
/* zoom: the photo alone, full screen; a second click looks closer */
.zoom { position: fixed; inset: 0; z-index: 60; background: rgba(22,22,22,.985);
  display: grid; place-items: center; overflow: hidden; animation: fade .3s ease; }
.zoom[hidden] { display: none; }
.zoom img { max-width: 100vw; max-height: 100vh; max-height: 100svh; width: auto; height: auto;
  cursor: zoom-in; touch-action: none; transform-origin: center; transition: transform .45s cubic-bezier(.2,.7,.2,1); }
.zoom.in img { cursor: zoom-out; transition: transform .12s linear; }
.zoom-close { position: absolute; top: 1.2rem; right: var(--gutter); z-index: 1; background: none; border: 0;
  color: var(--ink); font: inherit; font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; cursor: pointer;
  text-shadow: 0 0 6px rgba(0,0,0,.8); }
.zoom-close:hover { color: var(--lit); }
.lost { text-align: center; font-style: italic; padding: 20vh var(--gutter); }
.lost a { color: var(--lit); }
.fallback { display: flex; flex-direction: column; gap: 4rem; align-items: center; }

/* film */
.films { display: flex; flex-direction: column; align-items: center; gap: 7rem;
  padding: clamp(2rem, 8vh, 5rem) var(--gutter) 8rem; }
.film { width: min(1100px, 100%); }
.player { aspect-ratio: 16 / 9; background: #151515; }
.player iframe { width: 100%; height: 100%; border: 0; display: block; }
.facade { position: relative; display: block; width: 100%; padding: 0; border: 0; cursor: pointer; overflow: hidden; }
.facade img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.8); transition: filter .5s ease; }
.facade:hover img, .facade:focus-visible img { filter: brightness(.95); }
.facade:focus-visible { outline: 1px solid var(--lit); outline-offset: 4px; }
/* a thin ring with a small triangle, in the paper's white */
.play { position: absolute; left: clamp(1rem, 2.5%, 1.8rem); bottom: clamp(1rem, 3.5%, 1.8rem); width: 3rem; height: 3rem;
  border: 1px solid rgba(213,212,211,.7); border-radius: 50%; opacity: .75; transition: opacity .3s ease; }
.play::after { content: ""; position: absolute; left: 54%; top: 50%; translate: -50% -50%;
  border-style: solid; border-width: .5rem 0 .5rem .85rem; border-color: transparent transparent transparent rgba(213,212,211,.85); }
.facade:hover .play { opacity: 1; }
.player.empty { display: grid; place-items: center; font-style: italic; }
.film .label { margin-top: 1rem; color: var(--lit); }
.film .desc { margin-top: .35rem; font-style: italic; max-width: 40rem; }

@media (max-width: 34rem) {
  body { font-size: 16px; }
  .nav a, .label, .title { font-size: .7rem; letter-spacing: .12em; }
  .nav a { font-size: .9rem; }
  .mark { font-size: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
