/* Pedro Ordonez — paintings
   One wall, one eye line. The paintings carry the color; everything else stays quiet. */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/bricolage-grotesque-opsz.woff2") format("woff2");
}

:root {
  --wall: #d5d9d0;       /* sage-grey plaster */
  --ink: #1e3a2f;        /* forest green, used for all text */
  --ink-soft: #3d5a4d;   /* secondary text */
  --accent: #a8105a;     /* magenta lifted from the paintings; links and focus only */
  --shadow: 30 58 47;    /* ink as rgb, for hanging shadows */

  --gutter: clamp(1rem, 4vw, 3rem);
  --hang: clamp(18rem, 58vh, 34rem);  /* height of a portrait on the wall */

  font-family: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-optical-sizing: auto;
  color: var(--ink);
  background: var(--wall);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--wall);
  color: var(--ink);
  font-size: 1.125rem;
  line-height: 1.5;
  padding-inline: var(--gutter);
}

a { color: inherit; text-decoration-thickness: 0.08em; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 0.5rem 0.9rem;
  background: var(--ink);
  color: var(--wall);
  z-index: 10;
}
.skip:focus { top: 0.75rem; color: var(--wall); }

/* Masthead: the name is the only large type on the page. */
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  padding-block: clamp(1.25rem, 3.5vw, 2.5rem) clamp(2.5rem, 7vw, 6rem);
}

.masthead h1 {
  margin: 0;
  font-size: clamp(3.4rem, 13.5vw, 11.5rem);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.mail {
  flex: none;
  margin-top: 0.6rem;
  padding: 0.5rem 0;
  font-weight: 500;
}

/* The wall. Paintings share one eye line within each row. */
.wall {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 4.5vw, 4rem);
  padding-bottom: clamp(4rem, 10vw, 8rem);
}

.work {
  display: block;
  line-height: 0;
  cursor: zoom-in;
}

.work img {
  display: block;
  height: var(--hang);
  width: auto;
  max-width: 100%;
  background: rgb(var(--shadow) / 0.08);
  box-shadow:
    0 0.15rem 0.3rem -0.1rem rgb(var(--shadow) / 0.35),
    0 1.4rem 1.6rem -1.1rem rgb(var(--shadow) / 0.5);
}

.work--wide img { height: calc(var(--hang) * 0.7); }

.work:hover { color: inherit; }

/* Phones: one painting per row, sized by width. */
@media (max-width: 44rem) {
  .masthead { flex-direction: column; gap: 0.75rem; }
  .mail { margin-top: 0; }
  .wall { flex-direction: column; }
  .work img,
  .work--wide img {
    height: auto;
    width: min(100%, 26rem);
  }
}

/* Footer */
.foot {
  border-top: 2px solid var(--ink);
  padding-block: 1.75rem 3rem;
  display: grid;
  gap: 0.75rem;
}
.foot p { margin: 0; max-width: 44ch; }
.ask { font-size: 1.25rem; line-height: 1.4; }
.fine { font-size: 0.95rem; color: var(--ink-soft); }
.foot a { font-weight: 600; }

/* Viewer */
dialog#viewer {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgb(23 44 35 / 0.97);
  color: var(--wall);
}
dialog#viewer[open] {
  display: grid;
  grid-template-rows: 1fr auto;
  animation: viewer-in 0.18s ease-out;
}
dialog#viewer::backdrop { background: rgb(23 44 35 / 0.97); }

.viewer-frame {
  margin: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 3vw, 2rem) clamp(0.75rem, 3vw, 2rem) 0;
}
.viewer-frame img {
  max-width: 100%;
  max-height: calc(100dvh - 9rem);
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 1.5rem 3rem -1rem rgb(0 0 0 / 0.55);
}

.viewer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 0.75rem clamp(0.75rem, 3vw, 2rem) calc(0.75rem + env(safe-area-inset-bottom));
}
.viewer-caption { margin: 0; font-size: 1rem; }
.viewer-actions { display: flex; gap: 0.25rem; }

.viewer-actions button {
  min-height: 2.75rem;
  min-width: 2.75rem;
  padding: 0 1rem;
  border: 0;
  background: transparent;
  color: var(--wall);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.25em;
}
.viewer-actions button:hover { color: #fff; }
.viewer-actions button:focus-visible { outline-color: var(--wall); }

@keyframes viewer-in { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  dialog#viewer[open] { animation: none; }
}

/* 404 */
.lost { padding-block: clamp(4rem, 14vw, 10rem); max-width: 40ch; }
.lost h1 { margin: 0 0 1rem; font-size: clamp(2.2rem, 7vw, 4rem); font-weight: 800; line-height: 1; letter-spacing: -0.035em; }
.lost p { margin: 0; }
