/* Tamara de Lempicka — Geometria Déco
 *
 * The site cannot show a single painting: the work is in copyright until 2050.
 * So the period is carried entirely by graphic means — stepped rules, the
 * sunburst, hard symmetry, letterspaced capitals and a lacquer/brass palette.
 * Every ornament here is CSS geometry; the site ships no images at all.
 */

/* ------------------------------------------------------------------ font -- */

@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ----------------------------------------------------------------- token -- */

:root {
  --lacca: #14110f;
  --lacca-tenue: #3a332d;
  --avorio: #f3ede2;
  --avorio-caldo: #e8dfd0;
  /* 4.99:1 on the ivory ground — the lighter brass this started as measured
   * 3.44:1 and failed AA for the catalogue numbers, the h3s and the nav. */
  --ottone: #7d6128;
  /* Kept for the frontispiece rules, which are decoration, not text. */
  --ottone-lucido: #9c7a33;
  --giada: #1d6a58;
  --corallo: #a83d2b;

  --fondo: var(--avorio);
  --inchiostro: var(--lacca);
  --inchiostro-tenue: var(--lacca-tenue);
  --filo: rgba(20, 17, 15, 0.22);
  --oro: var(--ottone);

  --display: "Fraunces", "Didot", "Bodoni MT", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --misura: 64ch;
  --gutter: 1.5rem;
  --colonna: calc(64ch + 3rem);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fondo: var(--lacca);
    --inchiostro: var(--avorio);
    --inchiostro-tenue: #b8ad9c;
    --filo: rgba(243, 237, 226, 0.24);
    --oro: #c9a44c;
    --giada: #4aa88f;
    --corallo: #d4715c;
  }
}

:root[data-theme="dark"] {
  --fondo: var(--lacca);
  --inchiostro: var(--avorio);
  --inchiostro-tenue: #b8ad9c;
  --filo: rgba(243, 237, 226, 0.24);
  --oro: #c9a44c;
  --giada: #4aa88f;
  --corallo: #d4715c;
}

/* ------------------------------------------------------------------ base -- */

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

body {
  margin: 0;
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: var(--display);
  font-weight: 380;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

.cornice {
  max-width: var(--colonna);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

a {
  color: inherit;
  text-decoration-color: var(--oro);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--oro);
}

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

.salta {
  position: absolute;
  left: -9999px;
}

.salta:focus {
  position: static;
  display: inline-block;
  padding: 0.6rem 1rem;
  font-family: var(--mono);
  font-size: 0.75rem;
}

/* -------------------------------------------------------------- masthead -- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 0 1.2rem;
  border-bottom: 1px solid var(--filo);
}

.masthead__sigla {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
}

/* A stepped ziggurat, the most compact Déco signature available in CSS. */
.sigla__mark {
  width: 14px;
  height: 14px;
  flex: none;
  background:
    linear-gradient(var(--oro), var(--oro)) left bottom / 100% 4px no-repeat,
    linear-gradient(var(--oro), var(--oro)) center 5px / 66% 3px no-repeat,
    linear-gradient(var(--oro), var(--oro)) center 1px / 33% 3px no-repeat;
}

.nav ul {
  display: flex;
  gap: 1.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.nav a {
  text-decoration: none;
  color: var(--inchiostro-tenue);
}

.nav a:hover {
  color: var(--oro);
}

.nav__current {
  color: var(--oro);
  border-bottom: 2px solid var(--oro);
  padding-bottom: 2px;
}

/* ---------------------------------------------------------- frontespizio -- */

.frontespizio {
  position: relative;
  text-align: center;
  padding: 4.5rem 0 3.2rem;
  overflow: hidden;
}

/* The Déco sunburst: a fan of brass rays, drawn, never photographed. */
.raggiera {
  position: absolute;
  top: -14%;
  left: 50%;
  width: min(760px, 132%);
  aspect-ratio: 1;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0.16;
  background: repeating-conic-gradient(
    from 0deg at 50% 50%,
    var(--oro) 0deg 1.6deg,
    transparent 1.6deg 7.2deg
  );
  -webkit-mask-image: radial-gradient(closest-side, #000 12%, transparent 74%);
  mask-image: radial-gradient(closest-side, #000 12%, transparent 74%);
}

.frontespizio > *:not(.raggiera) {
  position: relative;
}

.frontespizio__occhiello,
.frontespizio__stile {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--inchiostro-tenue);
  margin: 0;
}

.frontespizio__nome {
  margin: 1.5rem 0 1.1rem;
  font-weight: 300;
  font-variation-settings: "SOFT" 0, "WONK" 0, "opsz" 144;
  line-height: 0.94;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1em;
}

.nome__a,
.nome__b {
  font-size: clamp(2.4rem, 11vw, 5.4rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  /* The trailing letterspace pushes optical centre right; pull it back. */
  text-indent: 0.14em;
}

.nome__de {
  font-size: clamp(1rem, 3vw, 1.5rem);
  font-style: italic;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--oro);
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  justify-content: center;
  margin: 0.1em 0;
}

/* Hairlines flanking the "de", the classic Déco title device. */
.nome__de::before,
.nome__de::after {
  content: "";
  height: 1px;
  flex: 1 1 auto;
  max-width: 8rem;
  background: linear-gradient(to right, transparent, var(--oro));
}

.nome__de::after {
  background: linear-gradient(to left, transparent, var(--oro));
}

.frontespizio__date {
  margin: 0 0 0.8rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  color: var(--inchiostro-tenue);
}

.frontespizio__stile {
  color: var(--giada);
  letter-spacing: 0.42em;
}

/* --------------------------------------------------------------- testata -- */

.testata {
  padding: 3.4rem 0 1.6rem;
  text-align: center;
}

.testata__titolo {
  margin: 0;
  font-weight: 300;
  font-variation-settings: "opsz" 144;
  font-size: clamp(2rem, 7vw, 3.4rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-indent: 0.1em;
  line-height: 1.05;
}

.testata__occhiello {
  margin: 1rem 0 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--inchiostro-tenue);
}

/* --------------------------------------------------------------- regola -- */

/* Thick over thin: the Déco divider. Centre diamond breaks the span. */
.regola {
  position: relative;
  height: 7px;
  margin: 3.4rem 0 1.8rem;
  border-top: 3px solid var(--oro);
  border-bottom: 1px solid var(--oro);
}

.regola::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  background: var(--fondo);
  border: 1px solid var(--oro);
  transform: translate(-50%, -50%) rotate(45deg);
}

/* -------------------------------------------------------------- sezione -- */

.principale {
  padding-bottom: 1rem;
}

.sezione__titolo {
  margin: 0 0 1.6rem;
  font-weight: 400;
  font-variation-settings: "opsz" 72;
  font-size: clamp(1.15rem, 3.2vw, 1.5rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  text-indent: 0.2em;
  color: var(--inchiostro);
}

.prosa {
  max-width: var(--misura);
  margin: 0 auto;
}

.prosa > * + * {
  margin-top: 1.2em;
}

.prosa h3,
.prosa h4 {
  margin: 2.4em 0 0.9em;
  font-weight: 400;
  font-variation-settings: "opsz" 48;
  font-size: 1.02rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--oro);
}

/* First line of each biographical section, set as a Déco opening. */
.prosa h3 + p::first-letter,
.prosa h4 + p::first-letter {
  font-size: 2.9em;
  line-height: 0.82;
  float: left;
  margin: 0.06em 0.1em 0 0;
  font-weight: 300;
  color: var(--giada);
}

/* The exhibition's section names arrive as <strong><em> runs in the source;
 * promote them to visible Déco markers rather than restructuring the prose. */
.prosa strong em {
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.86em;
  color: var(--corallo);
}

.prosa em {
  font-style: italic;
}

.prosa strong {
  font-weight: 600;
}

/* ------------------------------------------------------------- catalogo -- */

.nota-diritti {
  max-width: var(--misura);
  margin: 0 auto 2rem;
  padding: 0.9rem 1.1rem;
  border-left: 3px solid var(--giada);
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 1.6;
  color: var(--inchiostro-tenue);
}

.catalogo {
  max-width: var(--misura);
  margin: 0 auto;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.opera {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0 1.1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--filo);
}

.opera:first-child {
  border-top: 1px solid var(--filo);
}

.opera__num {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--oro);
  letter-spacing: 0.08em;
}

.opera__titolo {
  font-size: 1.04rem;
  letter-spacing: 0.01em;
}

.opera__anno {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--giada);
}

/* --------------------------------------------------------------- pedata -- */

.pedata {
  padding-bottom: 3.5rem;
}

.pedata p {
  max-width: var(--misura);
  margin: 0 auto;
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.7;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--inchiostro-tenue);
}

/* ---------------------------------------------------------- breakpoints -- */

@media (max-width: 34rem) {
  .nome__de::before,
  .nome__de::after {
    max-width: 2.5rem;
  }

  .opera {
    grid-template-columns: 2.4rem minmax(0, 1fr);
  }

  .opera__anno {
    grid-column: 2;
  }
}

/* --------------------------------------------------------------- motion -- */

@media (prefers-reduced-motion: no-preference) {
  a,
  .nav a {
    transition: color 160ms ease;
  }
}

@media print {
  .raggiera,
  .nav {
    display: none;
  }
}
