/* ===== Research pages styled after Sottsass' Olivetti ELEA 9003 ===== */
/* ---- 1. Console (Publications): each year is a control-desk panel with a mosaic display,
   every entry has a round indicator light, links are round keys ---- */
body.style-console .year-plate {
  display: flex; align-items: center; gap: 0.9rem; padding: 0.55rem 0.9rem;
  background: #2b2e47; border-radius: 3px 3px 0 0;
}
.yp-bits { display: none; }
body.style-console .yp-bits { display: grid; grid-template-columns: repeat(11, 10px); grid-auto-rows: 10px; gap: 2px; flex: none; }
body.style-console .yp-bits i { display: block; width: 10px; height: 10px; background: #3d4160; }
body.style-console .yp-bits i.a { background: var(--a); }
body.style-console .yp-bits i.b { background: var(--b); }
/* colour pairs from the cabinet's palette, one per year */
body.style-console .year-plate:has(.combo-0) { --a: #e2c565; --b: #d9784f; }
body.style-console .year-plate:has(.combo-1) { --a: #6f9a66; --b: #e7a4a0; }
body.style-console .year-plate:has(.combo-2) { --a: #e7a4a0; --b: #e2c565; }
body.style-console .year-plate:has(.combo-3) { --a: #d9784f; --b: #6f9a66; }
body.style-console .year-plate:has(.combo-4) { --a: #8c9ad8; --b: #e2c565; }
body.style-console .year-plate:has(.combo-5) { --a: #e2c565; --b: #e7a4a0; }
body.style-console .yp-title { font-family: var(--bs-font-monospace, monospace); font-weight: 700; font-size: 1.35rem; color: var(--a, #e2c565); letter-spacing: .08em; }
body.style-console .yp-count { margin-left: auto; font-family: var(--bs-font-monospace, monospace); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: #c9c8cc; }
body.style-console .year-group {
  margin: 0 0 1.4rem; border: 3px solid #9a98a3; border-radius: 6px; background: #e9e6df; overflow: hidden;
}
body.style-console .year-group .publication-item, body.style-console .year-group .resource-item {
  grid-template-columns: 1.1rem minmax(0, 1fr) !important; column-gap: 0.8rem;
  padding: 0.7rem 1rem !important; margin: 0 !important; background: none !important;
  border-top: 1px solid #d3d0c8 !important;
}
body.style-console .year-group .publication-item:first-of-type, body.style-console .year-group .resource-item:first-of-type { border-top: 0 !important; }
/* the year cell becomes the indicator light */
body.style-console .idx-year {
  font-size: 0 !important; width: 12px; height: 12px; border-radius: 50%; margin-top: 0.3rem;
  background: #f0d98a; box-shadow: inset 0 0 0 2px rgba(43, 46, 71, .25); transition: background .25s, box-shadow .25s;
}
body.style-console .publication-item:hover .idx-year, body.style-console .resource-item:hover .idx-year {
  background: #ffe28a; box-shadow: inset 0 0 0 2px rgba(43, 46, 71, .15), 0 0 10px 3px rgba(255, 210, 58, .8);
}
body.style-console .idx-year.idx-same { display: block !important; visibility: visible; }
/* round keys */
body.style-console .publication-links, body.style-console .resource-links { gap: 0.45rem !important; padding-top: 0.5rem !important; }
body.style-console .publication-links a, body.style-console .resource-links a,
body.style-console .publication-links a:nth-of-type(n), body.style-console .resource-links a:nth-of-type(n),
body.style-console .publication-bibtex summary.publication-link {
  min-width: 2.7rem !important; height: 2.7rem !important; padding: 0 0.55rem !important; border-radius: 999px !important;
  align-items: center !important; justify-content: center !important;
  background: #f4f2ee !important; color: #2b2e47 !important; border: 2px solid #9a98a3 !important;
  box-shadow: 0 2px 0 #9a98a3 !important; font-family: var(--bs-font-monospace, monospace) !important;
  font-size: 0.62rem !important; font-weight: 700 !important; text-transform: uppercase; letter-spacing: .06em;
  transition: background .15s, transform .1s, box-shadow .1s; filter: none !important;
}
body.style-console .publication-links a::before, body.style-console .resource-links a::before,
body.style-console .publication-bibtex summary.publication-link::before { display: none !important; }
body.style-console .publication-links a:hover, body.style-console .resource-links a:hover,
body.style-console .publication-bibtex summary.publication-link:hover,
body.style-console .publication-bibtex[open] summary.publication-link {
  background: #ffe28a !important; color: #2b2e47 !important; transform: translateY(2px); box-shadow: 0 0 0 #9a98a3, 0 0 10px rgba(255, 210, 58, .7) !important;
}

/* ---- 2. Modular cabinets (Talks, Projects and Resources): each year / category is a low
   cabinet in an aluminium frame with a coloured label plate, set side by side like the ELEA hall ---- */
body.style-cabinets main.content:has(.year-groups) { max-width: 72rem; }
body.style-cabinets .year-groups {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 0.9rem 0.7rem; align-items: start;
}
body.style-cabinets .year-group {
  --plate: #4b5a9c;
  border: 3px solid #9a98a3; border-radius: 4px; background: #e9e6df;
  border-bottom: 10px solid var(--plate); position: relative; margin-bottom: 10px;
}
body.style-cabinets .year-group:nth-child(4n+2) { --plate: #d9784f; }
body.style-cabinets .year-group:nth-child(4n+3) { --plate: #6f9a66; }
body.style-cabinets .year-group:nth-child(4n) { --plate: #e2c565; }
/* little feet */
body.style-cabinets .year-group::after {
  content: ""; position: absolute; left: 10%; right: 10%; bottom: -21px; height: 8px;
  background: linear-gradient(90deg, #9a98a3 0 14px, transparent 14px calc(100% - 14px), #9a98a3 calc(100% - 14px));
}
body.style-cabinets .year-plate {
  display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem;
  margin: 0.6rem 0.6rem 0.2rem; padding: 0.35rem 0.6rem; background: var(--plate); color: #fffdf6; border-radius: 2px;
}
body.style-cabinets .year-group:nth-child(4n) .year-plate { color: #2b2e47; }
body.style-cabinets .yp-title { font-family: var(--bs-font-monospace, monospace); font-weight: 700; font-size: 1rem; letter-spacing: .05em; }
body.style-cabinets .yp-count { font-family: var(--bs-font-monospace, monospace); font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; opacity: .85; }
body.style-cabinets .year-group .publication-item, body.style-cabinets .year-group .resource-item {
  grid-template-columns: 2.6rem minmax(0, 1fr) !important; column-gap: 0.5rem;
  margin: 0 0.6rem !important; padding: 0.55rem 0.2rem !important; background: none !important;
  border-top: 1px solid #d3d0c8 !important;
}
body.style-cabinets .year-group .resource-item:first-of-type { border-top: 0 !important; }
body.style-cabinets .year-group .resource-item:last-child { padding-bottom: 0.8rem !important; }
/* inside a year cabinet the year is already on the plate; inside a category cabinet it is a small mono label */
body.style-cabinets .group-by-year .publication-item, body.style-cabinets .group-by-year .resource-item { grid-template-columns: minmax(0, 1fr) !important; }
body.style-cabinets .group-by-year .idx-year { display: none; }
body.style-cabinets .group-by-year .publication-row, body.style-cabinets .group-by-year .resource-row { grid-column: 1; }
body.style-cabinets .idx-year { font-family: var(--bs-font-monospace, monospace); font-style: normal; font-size: .75rem; font-weight: 700; color: #6b6a75; padding-top: .15rem; }
body.style-cabinets .resource-entry { font-size: .88rem !important; }
/* rectangular keys */
body.style-cabinets .resource-links a, body.style-cabinets .resource-links a:nth-of-type(n) {
  padding: 0.2rem 0.55rem !important; border-radius: 2px !important;
  background: #fffdf6 !important; color: #2b2e47 !important; border: 1.5px solid #9a98a3 !important; box-shadow: 0 2px 0 #9a98a3 !important;
  font-family: var(--bs-font-monospace, monospace) !important; font-size: 0.62rem !important; font-weight: 700 !important;
  text-transform: uppercase; letter-spacing: .06em; filter: none !important; transition: transform .1s, box-shadow .1s, background .15s;
}
body.style-cabinets .resource-links a::before { display: none !important; }
body.style-cabinets .resource-links a:hover { background: #ffe28a !important; transform: translateY(2px); box-shadow: 0 0 0 #9a98a3 !important; }

/* ---- 3. Log (Activities): a continuous-feed printout, like the BibTeX panel —
   green bars, tractor-feed holes on both edges, perforations, monospace ---- */
body.style-log main.content { max-width: 52rem; }
body.style-log .quarto-title h1.title, body.style-log h1 {
  font-family: var(--bs-font-monospace, monospace) !important; font-style: normal !important; font-weight: 700;
  text-transform: uppercase; letter-spacing: .3em; font-size: 1.5rem !important;
}
body.style-log .typed-sheet {
  position: relative; margin-top: 2.4rem;
  font-family: var(--bs-font-monospace, monospace); font-size: 0.82rem; line-height: 1.5rem; color: #23262f;
  padding: 1.5rem 3rem 1.5rem 3rem;
  background-color: #fbfcf6;
  background-image:
    radial-gradient(circle at 1rem 0.75rem, #e9e6df 0 0.3rem, transparent 0.32rem),
    radial-gradient(circle at calc(100% - 1rem) 0.75rem, #e9e6df 0 0.3rem, transparent 0.32rem),
    repeating-linear-gradient(180deg, transparent 0 calc(18rem - 1px), #c9c8cc calc(18rem - 1px) 18rem),
    repeating-linear-gradient(180deg, #eef4ea 0 3rem, transparent 3rem 6rem);
  background-size: 100% 1.5rem, 100% 1.5rem, calc(100% - 4rem) 100%, calc(100% - 4rem) 100%;
  background-position: 0 0, 0 0, 2rem 0, 2rem 0;
  background-repeat: repeat-y, repeat-y, no-repeat, no-repeat;
  box-shadow: inset 2rem 0 0 -1.95rem #c9c8cc, inset -2rem 0 0 -1.95rem #c9c8cc, 0 6px 18px rgba(43, 46, 71, .08);
}
/* print-head strip on top */
body.style-log .typed-sheet::before {
  content: "STAMPA \00B7 LOG \00B7 L. PANNITTO"; position: absolute; left: 0; right: 0; top: -2rem; height: 2rem;
  display: flex; align-items: center; padding: 0 1rem; border-radius: 3px 3px 0 0;
  background: #2b2e47; color: #c9c8cc; font-size: .68rem; font-weight: 700; letter-spacing: .14em;
}
body.style-log .typed-entry { display: grid; grid-template-columns: 10rem minmax(0, 1fr); column-gap: 1.2rem; margin-bottom: 1.5rem; }
body.style-log .typed-entry p { margin: 0; }
body.style-log .typed-date { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
body.style-log .typed-date::before { content: "> "; color: #8a8798; }
body.style-log .typed-date p { display: inline; }
body.style-log .typed-sheet a { color: #23262f; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
body.style-log .typed-sheet a:hover { background: #ffe28a; }
body.style-log .typed-sheet em { color: #6b6a75; }
@media (max-width: 600px) {
  body.style-log .typed-sheet { padding: 1.5rem 2.2rem; }
  body.style-log .typed-entry { grid-template-columns: 1fr; }
}

/* ---- 4. Frieze (Teaching): after Sottsass' 1958 drawing of the ELEA console and central unit —
   a row of grey cabinets between dark columns with coloured side strips, a purple duct along the top,
   two towers, black trapezoid feet, and handwritten labels with arrows underneath ---- */
body.style-frieze main.content:has(.year-groups) { max-width: 76rem; }
body.style-frieze .year-plate { display: none; }
body.style-frieze .year-group { display: contents; }
body.style-frieze .year-groups {
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 3.2rem 0; padding: 3.2rem 0 1rem;
  background: #fbf8f1; padding-left: 1rem; padding-right: 1rem;
}
body.style-frieze .year-groups::before {
  content: ""; flex: 0 0 170px; height: 150px; align-self: flex-end; margin-bottom: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='150' viewBox='0 0 170 150'%3E%3Crect x='2' y='92' width='62' height='5' fill='%23e2c565'/%3E%3Crect x='4' y='97' width='3' height='53' fill='%2323223a'/%3E%3Crect x='59' y='97' width='3' height='53' fill='%2323223a'/%3E%3Crect x='76' y='40' width='92' height='110' fill='%23fbf8f1' stroke='%2323223a' stroke-width='1'/%3E%3Ccircle cx='92' cy='58' r='9' fill='none' stroke='%2323223a'/%3E%3Ccircle cx='114' cy='58' r='9' fill='none' stroke='%2323223a'/%3E%3Crect x='124' y='96' width='44' height='4' fill='%23e2c565'/%3E%3Crect x='150' y='40' width='18' height='56' fill='%2323223a'/%3E%3Crect x='164' y='40' width='4' height='56' fill='%23e2c565'/%3E%3Cpath d='M96 82 q0 -8 6 -8 q6 0 6 8 v18 h22 v8 h-34 z' fill='%236b2e7e'/%3E%3Crect x='111' y='108' width='3' height='26' fill='%23999'/%3E%3Cpath d='M98 148 l14 -12 l14 12 M112 136 v12' stroke='%23999' fill='none'/%3E%3C/svg%3E") no-repeat bottom left;
}
body.style-frieze .year-groups .year-group .resource-item {
  flex: 1 1 16rem; max-width: 24rem; position: relative; display: block !important;
  margin: 0 !important; padding: 1rem 1rem 1.6rem 3.2rem !important; border: 0 !important;
  color: #23223a; --strip: #d9784f;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='12'%3E%3Cpath d='M0 0 H40 L32 12 H8 Z' fill='%2323223a'/%3E%3C/svg%3E") no-repeat left 0 bottom 0 / 40px 12px,
    repeating-linear-gradient(90deg, #8d8b98 0 1px, transparent 1px 5px) no-repeat left 40px bottom 0 / calc(100% - 40px) 9px,
    linear-gradient(90deg, var(--strip) 0 10px, #23223a 10px 34px, transparent 34px) no-repeat 0 0 / 100% calc(100% - 12px),
    radial-gradient(circle at 30% 40%, rgba(255,255,255,.1) 0 .6px, transparent 1px) 0 0 / 5px 5px,
    radial-gradient(circle at 70% 70%, rgba(35,34,58,.035) 0 .6px, transparent 1px) 0 0 / 7px 7px,
    linear-gradient(#dedde7, #dedde7) no-repeat 0 0 / 100% calc(100% - 12px) !important;
}
body.style-frieze .year-groups .resource-item.k-0 { --strip: #d9784f; }
body.style-frieze .year-groups .resource-item.k-1 { --strip: #4b5a9c; }
body.style-frieze .year-groups .resource-item.k-2 { --strip: #e2c565; }
body.style-frieze .year-groups .resource-item.k-3 { --strip: #6f9a66; }
body.style-frieze .year-groups .resource-item.k-4 { --strip: #e7a4a0; }
/* the purple duct along the top */
body.style-frieze .resource-item::after {
  content: ""; position: absolute; left: 0; right: 0; top: -1.7rem; height: 1.7rem; pointer-events: none;
  /* the cable duct, fed by the dark column rising from the cabinet */
  background:
    linear-gradient(#6b2e7e, #6b2e7e) 0 0 / 100% 10px no-repeat,
    linear-gradient(#23223a, #23223a) 10px 0 / 24px 100% no-repeat;
}
/* towers rising above some of the columns */
body.style-frieze .resource-item:nth-child(4n+1)::before {
  content: ""; position: absolute; left: 10px; width: 24px; top: -2.6rem; height: 2.6rem;
  background: linear-gradient(#e2c565 0 5px, #23223a 5px);
}
body.style-frieze .resource-row { display: block !important; }
body.style-frieze .resource-entry { font-size: .86rem !important; line-height: 1.4; }
body.style-frieze .resource-entry strong { display: block; font-size: .95rem; margin-bottom: .2rem; }
body.style-frieze .resource-entry a { color: #23223a; }
body.style-frieze .idx-year { display: none !important; }
body.style-frieze .t-sep { display: none; }
body.style-frieze .resource-links { padding-top: .5rem !important; }
body.style-frieze .resource-links a, body.style-frieze .resource-links a:nth-of-type(n) {
  padding: 0.2rem 0.55rem !important; border-radius: 2px !important;
  background: #fbf8f1 !important; color: #23223a !important; border: 1.5px solid #23223a !important; box-shadow: 0 2px 0 #23223a !important;
  font-family: var(--bs-font-monospace, monospace) !important; font-size: 0.62rem !important; font-weight: 700 !important;
  text-transform: uppercase; letter-spacing: .06em; filter: none !important;
}
body.style-frieze .resource-links a::before { display: none !important; }
body.style-frieze .resource-links a:hover { background: #e2c565 !important; transform: translateY(2px); box-shadow: 0 0 0 #23223a !important; }
@media (max-width: 700px) { body.style-frieze .year-groups::before { display: none; } body.style-frieze .resource-item { max-width: none; } }

/* BibTeX panel as a print-out on continuous-feed paper (green bars, tractor holes) */
body.style-console .publication-bibtex-panel { grid-column: 2; margin: 0.7rem 0 0.2rem !important; border: 0 !important; background: none !important; }
body.style-console .publication-bibtex-toolbar {
  display: flex; align-items: center; gap: 0.8rem; margin: 0 !important; padding: 0.4rem 0.7rem !important;
  background: #2b2e47 !important; border: 0 !important; border-radius: 3px 3px 0 0 !important;
}
body.style-console .publication-bibtex-toolbar::before {
  content: "STAMPA \00B7 BIBTEX"; font-family: var(--bs-font-monospace, monospace); font-size: .68rem; font-weight: 700;
  letter-spacing: .14em; color: #c9c8cc; margin-right: auto;
}
body.style-console .publication-copy-button {
  order: 2; min-width: 2.7rem; height: 2.1rem; padding: 0 .7rem !important; border-radius: 999px !important;
  background: #f4f2ee !important; color: #2b2e47 !important; border: 2px solid #9a98a3 !important; box-shadow: 0 2px 0 #9a98a3 !important;
  font-family: var(--bs-font-monospace, monospace) !important; font-size: .62rem !important; font-weight: 700 !important;
  text-transform: uppercase; letter-spacing: .08em; filter: none !important;
}
body.style-console .publication-copy-button:hover { background: #ffe28a !important; transform: translateY(2px); box-shadow: 0 0 10px rgba(255, 210, 58, .7) !important; }
body.style-console .publication-copy-status { order: 1; font-family: var(--bs-font-monospace, monospace); font-size: .7rem; color: #e2c565; text-transform: uppercase; letter-spacing: .1em; }
body.style-console .publication-bibtex-content {
  margin: 0 !important; border: 0 !important; border-radius: 0 0 3px 3px !important; color: #23262f !important;
  font-family: var(--bs-font-monospace, monospace) !important; font-size: .78rem !important; line-height: 1.5rem !important;
  padding: 0.75rem 2.2rem !important; white-space: pre-wrap; overflow-x: auto;
  background-color: #fbfcf6 !important;
  background-image:
    radial-gradient(circle at 0.75rem 0.75rem, #e9e6df 0 0.28rem, transparent 0.3rem),
    radial-gradient(circle at calc(100% - 0.75rem) 0.75rem, #e9e6df 0 0.28rem, transparent 0.3rem),
    repeating-linear-gradient(180deg, #eef4ea 0 3rem, transparent 3rem 6rem) !important;
  background-size: 100% 1.5rem, 100% 1.5rem, calc(100% - 3rem) 100% !important;
  background-position: 0 0, 0 0, 1.5rem 0.75rem !important;
  background-repeat: repeat-y, repeat-y, no-repeat !important;
  box-shadow: inset 1.5rem 0 0 -1.47rem #c9c8cc, inset -1.5rem 0 0 -1.47rem #c9c8cc;
}

/* ---- Night theme: the ELEA pieces stay physical objects (light metal, paper) in a dark room,
   slightly dimmed, with dark ink inside so the text keeps its contrast ---- */
body.quarto-dark.style-console .year-group,
body.quarto-dark.style-cabinets .year-group,
body.quarto-dark.style-frieze .year-groups,
body.quarto-dark.style-log .typed-sheet,
body.quarto-dark.style-console .publication-bibtex-content { filter: brightness(.9); }
body.quarto-dark.style-frieze .year-groups { background: #e6e2d8; }
body.quarto-dark.style-console .year-group, body.quarto-dark.style-cabinets .year-group,
body.quarto-dark.style-frieze .resource-item, body.quarto-dark.style-log .typed-sheet,
body.quarto-dark.style-console .publication-bibtex-content { color: #23262f; }
body.quarto-dark.style-console .year-group :is(p, span, div, strong, em, li),
body.quarto-dark.style-cabinets .year-group .resource-entry :is(p, span, strong, em),
body.quarto-dark.style-cabinets .year-group .resource-entry,
body.quarto-dark.style-frieze .resource-entry, body.quarto-dark.style-frieze .resource-entry :is(p, span, strong, em),
body.quarto-dark.style-log .typed-sheet :is(p, div, strong) { color: #23262f; }
body.quarto-dark.style-console .year-group .yp-title { color: var(--a, #e2c565); }
body.quarto-dark.style-console .year-group .yp-count { color: #c9c8cc; }
body.quarto-dark.style-cabinets .year-plate, body.quarto-dark.style-cabinets .year-plate * { color: #fffdf6; }
body.quarto-dark.style-cabinets .year-group:nth-child(4n) .year-plate, body.quarto-dark.style-cabinets .year-group:nth-child(4n) .year-plate * { color: #2b2e47; }
body.quarto-dark.style-console .year-group .publication-entry a:not(.publication-link),
body.quarto-dark.style-console .year-group .resource-entry a,
body.quarto-dark.style-cabinets .year-group .resource-entry a,
body.quarto-dark.style-frieze .resource-entry a,
body.quarto-dark.style-log .typed-sheet a { color: #2b3a8f; }
body.quarto-dark.style-console .year-group em, body.quarto-dark.style-log .typed-sheet em { color: #5d5c68; }
body.quarto-dark.style-cabinets .idx-year { color: #6b6a75; }

/* DOI / URL key with a small copy tab clipped to its side */
.ref-key { display: inline-flex; align-items: center; }
.ref-copy {
  margin-left: -0.35rem; padding: 0.18rem 0.4rem 0.18rem 0.55rem; border: 1.5px solid #9a98a3; border-left: 0;
  border-radius: 0 3px 3px 0; background: #e9e6df; color: #2b2e47; cursor: pointer;
  font-family: var(--bs-font-monospace, monospace); font-size: 0.52rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  transition: background .15s;
}
.ref-copy:hover { background: #ffe28a; }
.ref-copy.done { background: #6f9a66; color: #fffdf6; }
body.style-console .ref-key .publication-link { position: relative; z-index: 1; }

/* ---- Compact lists: publications, talks/resources, log ---- */
body.style-console .year-group { margin-bottom: 1rem; }
body.style-console .year-plate { padding: 0.4rem 0.8rem; }
body.style-console .yp-title { font-size: 1.15rem; }
body.style-console .year-group .publication-item, body.style-console .year-group .resource-item { padding: 0.5rem 0.9rem !important; }
body.style-console .publication-links, body.style-console .resource-links { gap: 0.35rem !important; padding-top: 0.35rem !important; }
body.style-console .publication-links a, body.style-console .resource-links a,
body.style-console .publication-links a:nth-of-type(n), body.style-console .resource-links a:nth-of-type(n),
body.style-console .publication-bibtex summary.publication-link {
  min-width: 2.1rem !important; height: 2.1rem !important; padding: 0 0.5rem !important; font-size: 0.58rem !important;
}
body.style-console .ref-copy { font-size: 0.5rem; padding: 0.14rem 0.35rem 0.14rem 0.5rem; }
body.style-console .idx-year { margin-top: 0.2rem; }

body.style-cabinets .year-group .publication-item, body.style-cabinets .year-group .resource-item { padding: 0.4rem 0.2rem !important; }
body.style-cabinets .year-plate { margin: 0.5rem 0.5rem 0.1rem; padding: 0.25rem 0.55rem; }
body.style-cabinets .resource-entry { font-size: 0.84rem !important; line-height: 1.3; }
body.style-cabinets .resource-links { padding-top: 0.25rem !important; }

body.style-log .typed-sheet { font-size: 0.78rem; line-height: 1.3rem; padding: 1.2rem 2.6rem;
  background-size: 100% 1.3rem, 100% 1.3rem, calc(100% - 4rem) 100%, calc(100% - 4rem) 100%;
  background-image:
    radial-gradient(circle at 1rem 0.65rem, #e9e6df 0 0.26rem, transparent 0.28rem),
    radial-gradient(circle at calc(100% - 1rem) 0.65rem, #e9e6df 0 0.26rem, transparent 0.28rem),
    repeating-linear-gradient(180deg, transparent 0 calc(15.6rem - 1px), #c9c8cc calc(15.6rem - 1px) 15.6rem),
    repeating-linear-gradient(180deg, #eef4ea 0 2.6rem, transparent 2.6rem 5.2rem); }
body.style-log .typed-entry { grid-template-columns: 8.5rem minmax(0, 1fr); column-gap: 1rem; margin-bottom: 0.9rem; }

/* ---- 5. About Language: quotes typed by an Olivetti Valentine, papers on a Carlton bookcase ---- */
body.style-valentine main.content { max-width: 58rem; }
body.style-valentine .valentine { display: flex; justify-content: center; margin: 0.5rem 0 -0.6rem; position: relative; z-index: 1; }
body.style-valentine .valentine img { width: 230px; height: auto; display: block; }
body.style-valentine main h3 {
  font-family: var(--bs-font-monospace, monospace); font-size: 0.9rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .18em; margin: 1.6rem 0 0.1rem;
}
body.style-valentine main h3 + p { font-size: 0.78rem; color: var(--muted); margin-bottom: 0.9rem; }
body.style-valentine .typed-quotes { columns: 2 16rem; column-gap: 1.4rem; padding: 0.4rem 0.4rem 0; }
body.style-valentine .quote-sheet {
  break-inside: avoid; display: inline-block; width: 100%; margin: 0 0 1.4rem; padding: 1.1rem 1.2rem 0.9rem 1.5rem;
  background: #fffdf6; color: #23262f; border: 1px solid #d3d0c8; box-shadow: 3px 4px 0 rgba(43, 46, 71, .12);
  font-family: var(--bs-font-monospace, monospace); font-size: 0.76rem; line-height: 1.45rem; position: relative;
  background-image: linear-gradient(90deg, transparent 0.9rem, #f0b9ae 0.9rem, #f0b9ae calc(0.9rem + 1px), transparent calc(0.9rem + 1px));
}
body.style-valentine .quote-sheet p { margin: 0 0 0.5rem; }
body.style-valentine .quote-sheet.tilt-0 { transform: rotate(-1deg); }
body.style-valentine .quote-sheet.tilt-1 { transform: rotate(0.8deg); }
body.style-valentine .quote-sheet.tilt-2 { transform: rotate(-0.4deg); }
body.style-valentine .quote-sheet.tilt-3 { transform: rotate(1.2deg); }
body.style-valentine .quote-by { font-size: 0.68rem; line-height: 1.2rem; color: #b8352a; text-align: right; }
body.style-valentine .quote-by p { margin: 0; }
body.style-valentine .quote-sheet a, body.style-valentine .quote-by a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

body.style-valentine .book-link {
  display: inline-block; padding: 0.12rem 0.45rem; margin-right: 0.3rem; border: 1.5px solid #2b2e47; border-radius: 2px;
  background: #fffdf6; color: #2b2e47 !important; box-shadow: 2px 2px 0 #2b2e47; text-decoration: none;
  font-family: var(--bs-font-monospace, monospace); font-size: 0.6rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
body.style-valentine .book-link:hover { background: #ffe28a; transform: translate(2px, 2px); box-shadow: none; }
/* a low bookcase: coloured top board, slanted coloured partitions between the compartments, laminate plinth, feet */
body.style-valentine .bookcase {
  position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  margin: 1rem 0.2rem 2.6rem; background: #fffdf6; color: #23262f;
  border: 2.5px solid #2b2e47; border-top: 12px solid #2b2e47; box-shadow: inset 0 3px 0 #e2c565;
}
body.style-valentine .bookcase::after { /* laminate plinth */
  content: ""; position: absolute; left: -2.5px; right: -2.5px; top: 100%; height: 30px;
  background:
    radial-gradient(circle at 20% 30%, #2b2e47 0 1.3px, transparent 1.8px) 0 0 / 13px 10px,
    radial-gradient(ellipse 3px 1.1px at 45% 70%, #2b2e47 0 100%, transparent 100%) 0 0 / 16px 9px,
    #fffdf6;
  background-clip: border-box; border: 2.5px solid #2b2e47; border-top: 0; height: 18px;
}
body.style-valentine .shelf-cell {
  --c: #d9784f; position: relative; padding: 0.9rem 1.1rem 0.9rem 1.4rem; font-size: 0.8rem; line-height: 1.35;
  border-bottom: 8px solid var(--c);
}
body.style-valentine .shelf-cell.sc-1 { --c: #4b5a9c; }
body.style-valentine .shelf-cell.sc-2 { --c: #6f9a66; }
body.style-valentine .shelf-cell.sc-3 { --c: #e7a4a0; }
body.style-valentine .shelf-cell + .shelf-cell::before { /* slanted partition */
  content: ""; position: absolute; left: -5px; top: 0; bottom: -8px; width: 10px; background: #2b2e47; transform: skewX(-9deg);
}
body.style-valentine .shelf-cell p { margin: 0 0 0.35rem; }
body.style-valentine .book-year { font-family: var(--bs-font-monospace, monospace); font-weight: 700; font-size: 0.72rem; color: var(--c); letter-spacing: .08em; }
body.style-valentine .book-year p { margin: 0 0 0.2rem; }
@media (max-width: 640px) { body.style-valentine .shelf-cell + .shelf-cell::before { display: none; } }
body.quarto-dark.style-valentine .quote-sheet, body.quarto-dark.style-valentine .bookcase { filter: brightness(.9); }

/* ---- 6. Dissemination: a board of small Olivetti posters ---- */
body.style-posters main.content { max-width: 64rem; }
body.style-posters main.content > p:first-of-type, body.style-posters #quarto-document-content > p:first-of-type { max-width: 40rem; }
body.style-posters .poster-board {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); grid-auto-flow: dense;
  gap: 1.6rem 1.3rem; margin: 1.4rem 0 1rem; padding: 0.4rem;
}
body.style-posters .poster {
  --bg: #e2c565; --a: #d9784f; --b: #2b2e47; --ink: #2b2e47;
  display: flex; flex-direction: column; background: #fffdf6; color: #23262f;
  border: 1.5px solid #2b2e47; box-shadow: 4px 4px 0 rgba(43, 46, 71, .18); position: relative;
}
body.style-posters .poster:nth-child(3n+1) { transform: rotate(-0.8deg); }
body.style-posters .poster:nth-child(3n+2) { transform: rotate(0.6deg); }
body.style-posters .poster:nth-child(4n) { transform: rotate(-0.3deg); }
body.style-posters .poster::before { /* a strip of tape */
  content: ""; position: absolute; top: -9px; left: calc(50% - 26px); width: 52px; height: 16px;
  background: rgba(233, 230, 223, .85); border: 1px solid rgba(43, 46, 71, .12); transform: rotate(-3deg); z-index: 2;
}
body.style-posters .poster-big { grid-column: 1 / -1; }
body.style-posters .poster-big ul { columns: 2 18rem; column-gap: 1.4rem; }
body.style-posters .poster-big li { break-inside: avoid; }
@media (max-width: 640px) { body.style-posters .poster-big { grid-column: auto; grid-row: auto; } }
body.style-posters .poster-art {
  position: relative; height: 7.5rem; overflow: hidden; background-color: var(--bg); border-bottom: 1.5px solid #2b2e47;
}
body.style-posters .poster-big .poster-art { height: 10rem; }
body.style-posters .poster-year {
  position: absolute; left: 0.7rem; bottom: 0.35rem; z-index: 1; color: var(--ink);
  font-family: "Archivo", sans-serif; font-weight: 800; font-size: 2.5rem; line-height: 1; letter-spacing: -0.02em;
}
body.style-posters .poster-big .poster-year { font-size: 3.6rem; }
body.style-posters .poster-year p { margin: 0; }
/* six geometric pictures, all from the cabinet's palette */
body.style-posters .pv-0 .poster-art { background:
  radial-gradient(circle at 74% 42%, var(--a) 0 2.4rem, transparent 2.45rem),
  linear-gradient(var(--b), var(--b)) 100% 0 / 1.2rem 100% no-repeat, var(--bg); }
body.style-posters .pv-1 { --bg: #4b5a9c; --a: #e2c565; --ink: #fffdf6; }
body.style-posters .pv-1 .poster-art { background:
  radial-gradient(circle at 78% 100%, var(--a) 0 3.2rem, transparent 3.25rem),
  repeating-linear-gradient(90deg, transparent 0 14px, rgba(255, 253, 246, .25) 14px 18px) 0 0 / 55% 100% no-repeat, var(--bg); }
body.style-posters .pv-2 { --bg: #6f9a66; --a: #e7a4a0; --b: #2b2e47; --ink: #fffdf6; }
body.style-posters .pv-2 .poster-art { background:
  conic-gradient(from 225deg at 88% 50%, var(--b) 0 90deg, transparent 90deg) 0 0 / 100% 100% no-repeat,
  radial-gradient(circle at 62% 38%, var(--a) 0 1.9rem, transparent 1.95rem), var(--bg); }
body.style-posters .pv-3 { --bg: #d9784f; --a: #fffdf6; --ink: #2b2e47; }
body.style-posters .pv-3 .poster-art { background:
  repeating-radial-gradient(circle at 100% 0, var(--a) 0 6px, transparent 6px 16px), var(--bg); }
body.style-posters .pv-4 { --bg: #e7a4a0; --a: #4b5a9c; --ink: #2b2e47; }
body.style-posters .pv-4 .poster-art { background:
  linear-gradient(90deg, transparent 0 55%, var(--bg) 55%) 0 0 / 100% 100%,
  conic-gradient(var(--a) 0 25%, transparent 0 50%, var(--a) 0 75%, transparent 0) 100% 0 / 1.4rem 1.4rem, var(--bg); }
body.style-posters .pv-4 .poster-art { background:
  conic-gradient(var(--a) 0 25%, transparent 0 50%, var(--a) 0 75%, transparent 0) right 0 top 0 / 1.4rem 1.4rem,
  var(--bg); -webkit-mask: none; }
body.style-posters .pv-4 .poster-art::after { content: ""; position: absolute; inset: 0 45% 0 0; background: var(--bg); }
body.style-posters .pv-5 { --bg: #2b2e47; --a: #e2c565; --ink: #fffdf6; }
body.style-posters .pv-5 .poster-art { background:
  repeating-linear-gradient(-45deg, var(--a) 0 8px, transparent 8px 22px) 100% 0 / 45% 100% no-repeat,
  radial-gradient(circle at 58% 30%, #d9784f 0 1rem, transparent 1.05rem), var(--bg); }
body.style-posters .poster-body { padding: 0.7rem 0.85rem 0.8rem; font-size: 0.8rem; line-height: 1.4; }
body.style-posters .poster-body p { margin: 0 0 0.5rem; }
body.style-posters .poster-title {
  font-family: "Archivo", sans-serif; font-weight: 800; font-size: 0.95rem; line-height: 1.2; text-transform: lowercase;
  letter-spacing: 0.02em; margin-bottom: 0.4rem;
}
body.style-posters .poster-body ul { padding-left: 0; list-style: none; margin: 0 0 0.6rem; }
body.style-posters .poster-body li { padding: 0.35rem 0 0.35rem; border-top: 1px dashed #c9c8cc; font-size: 0.76rem; }
body.style-posters .poster-body li strong { font-family: var(--bs-font-monospace, monospace); color: #d9784f; }
body.style-posters .poster-body a { color: #2b3a8f; }
body.style-posters .poster-link {
  display: inline-block; margin: 0.15rem 0.35rem 0 0; padding: 0.14rem 0.45rem; border: 1.5px solid #2b2e47; border-radius: 2px;
  background: #fffdf6; color: #2b2e47 !important; box-shadow: 2px 2px 0 #2b2e47; text-decoration: none;
  font-family: var(--bs-font-monospace, monospace); font-size: 0.6rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
body.style-posters .poster-link:hover { background: #ffe28a; transform: translate(2px, 2px); box-shadow: none; }
/* the letters to the class, as envelopes */
body.style-posters .envelopes { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.2rem 0 0.5rem; }
body.style-posters .envelope {
  position: relative; display: flex; align-items: flex-end; width: 4.6rem; height: 3.1rem; padding: 0 0 0.3rem 0.35rem;
  background: #fffdf6; border: 1.5px solid #2b2e47; text-decoration: none; color: #2b2e47 !important; overflow: hidden;
  box-shadow: 2px 2px 0 #2b2e47; transition: transform .1s;
}
body.style-posters .envelope::before { /* the flap */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 60%;
  background: linear-gradient(to bottom right, transparent calc(50% - 1px), #2b2e47 calc(50% - 1px) calc(50% + .5px), transparent calc(50% + .5px)) left / 50% 100% no-repeat,
              linear-gradient(to bottom left, transparent calc(50% - 1px), #2b2e47 calc(50% - 1px) calc(50% + .5px), transparent calc(50% + .5px)) right / 50% 100% no-repeat;
}
body.style-posters .env-stamp { position: absolute; top: 4px; right: 4px; width: 12px; height: 14px; background: #d9784f; outline: 2px dotted #fffdf6; outline-offset: -2px; }
body.style-posters .env-label { position: relative; font-family: var(--bs-font-monospace, monospace); font-size: 0.55rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
body.style-posters .envelope:hover { transform: translate(2px, 2px); box-shadow: none; background: #ffe28a; }
body.quarto-dark.style-posters .poster { filter: brightness(.92); }

/* the Valentine types: carriage with paper and platen that slides, keys that go down */
body.style-valentine .valentine {
  flex-direction: column; align-items: center; width: 320px; margin: 0.4rem auto 0.4rem; cursor: pointer; outline: none; position: relative;
}
body.style-valentine .valentine:focus-visible .v-body { filter: drop-shadow(0 0 4px #ffd23a); }
body.style-valentine .v-top { position: relative; width: 320px; height: 10.6rem; }
body.style-valentine .v-carriage {
  --col: 0; --pad: 0.9rem;
  position: absolute; bottom: 0; left: calc(50% - var(--pad));
  font-family: var(--bs-font-monospace, monospace); font-size: 0.66rem;
  transform: translateX(calc(var(--col) * -1ch)); transition: transform 40ms linear;
}
body.style-valentine .v-carriage.returning { transition: transform 380ms cubic-bezier(.25, .8, .3, 1); }
body.style-valentine .v-paper {
  position: relative; width: calc(26ch + 2 * var(--pad)); height: 9.6rem; margin-bottom: -5px; padding: 0 var(--pad) 0.45rem;
  box-sizing: border-box; background: #fffdf6; border: 1px solid #d3d0c8; border-bottom: 0; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  line-height: 1.05rem; color: #23262f; box-shadow: 0 -2px 6px rgba(43, 46, 71, .06);
}
body.style-valentine .v-line { white-space: pre; min-height: 1.05rem; }
body.style-valentine .v-line.v-sig { color: #b8352a; }
body.style-valentine .v-platen {
  position: relative; z-index: 1; height: 16px; margin: 0 -14px; border-radius: 8px; background: #2b2e47;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .08);
}
body.style-valentine .v-platen::before, body.style-valentine .v-platen::after {
  content: ""; position: absolute; top: -2px; width: 20px; height: 20px; border-radius: 50%; background: #2b2e47;
}
body.style-valentine .v-platen::before { left: -10px; }
body.style-valentine .v-platen::after { right: -10px; }
/* the printing point: a small red guide where the type hits the paper */
body.style-valentine .v-point { position: absolute; left: calc(50% - 4px); bottom: 15px; z-index: 2; width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 6px solid #cf3f2e; }
body.style-valentine .valentine.hit .v-point { transform: translateY(-2px); }
body.style-valentine .v-bell { position: absolute; right: 6px; bottom: 22px; font-family: var(--bs-font-monospace, monospace); font-size: 0.6rem;
  color: #b8352a; opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; pointer-events: none; }
body.style-valentine .v-bell.ring { opacity: 1; transform: none; }
body.style-valentine .v-body { position: relative; z-index: 1; width: 320px; height: auto; display: block; margin-top: -2px; }
body.style-valentine .vk { transition: transform 50ms; transform-box: fill-box; }
body.style-valentine .vk.down { transform: translateY(1.6px); }
body.style-valentine .vk.down .vk-cap { fill: #e2c565; }
body.style-valentine .valentine:hover .v-spool { fill: #f0d98a; }
body.style-valentine .v-hint { margin-top: 0.35rem; font-family: var(--bs-font-monospace, monospace); font-size: 0.6rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
body.style-valentine .quote-sheet { cursor: pointer; transition: box-shadow .2s, transform .2s; }
body.style-valentine .quote-sheet:hover { box-shadow: 4px 6px 0 rgba(43, 46, 71, .2); }
body.style-valentine .quote-sheet.on-roller { box-shadow: 0 0 0 2px #e2c565, 4px 5px 0 rgba(43, 46, 71, .18); }
@keyframes v-blink { 50% { opacity: 0; } }
@media (max-width: 400px) { body.style-valentine .valentine, body.style-valentine .v-body { width: 280px; } }

/* Why Language: the machine on the left (it stays in view), the sheets on the right */
body.style-valentine .why-language { display: grid; grid-template-columns: 22.5rem minmax(0, 1fr); gap: 1.2rem; align-items: start; }
body.style-valentine .v-desk { position: sticky; top: 1.2rem; padding-top: 0.4rem; z-index: 2; }
body.style-valentine .v-desk .valentine { margin-left: 0; }
body.style-valentine .why-language .typed-quotes { columns: 1; padding-top: 0.6rem; }
@media (max-width: 900px) {
  body.style-valentine .why-language { grid-template-columns: 1fr; }
  body.style-valentine .v-desk { position: static; }
}

/* ---- Wide screens: Publications and Log use the whole width, entries side by side ---- */
@media (min-width: 1400px) {
  body.style-console main.content, body.style-log main.content {
    grid-column: body-content-start / screen-end-inset !important; max-width: none !important; width: auto;
  }
  body.style-console .year-group {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 0; align-items: stretch;
  }
  body.style-console .year-group > .year-plate { grid-column: 1 / -1; }
  body.style-console .year-group .publication-item:nth-of-type(even) { border-left: 1px solid #d3d0c8 !important; }
  body.style-console .year-group .publication-item:nth-of-type(2) { border-top: 0 !important; }
  body.style-log .typed-sheet { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.6rem; }
  body.style-log .typed-sheet > .typed-entry { margin-bottom: 1.3rem; }
}
@media (min-width: 2200px) {
  body.style-console .year-group, body.style-log .typed-sheet { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.style-console .year-group .publication-item:nth-of-type(even) { border-left: 0 !important; }
  body.style-console .year-group .publication-item:not(:nth-of-type(3n+1)) { border-left: 1px solid #d3d0c8 !important; }
  body.style-console .year-group .publication-item:nth-of-type(3) { border-top: 0 !important; }
}

/* cabinets stand on the floor: in each row they line up at the bottom, on a common floor line */
body.style-cabinets .year-groups { align-items: end; row-gap: 2.6rem; }
body.style-cabinets .year-group::before {
  content: ""; position: absolute; left: -0.5rem; right: -0.5rem; bottom: -24px; height: 3px;
  background: #c9c8cc; border-radius: 2px;
}

/* Teaching as one long machine: the frieze runs horizontally and scrolls to the right;
   under each cabinet, a handwritten label with its year, as in the drawing */
body.style-frieze main.content:has(.year-groups) { max-width: none; }
body.style-frieze .year-groups {
  flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; gap: 0; padding: 3.2rem 1rem 3.4rem;
  scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: #8d8b98 transparent;
}
body.style-frieze .year-groups .year-group .resource-item { flex: 0 0 18.5rem; max-width: none; }
body.style-frieze .year-groups::after { /* a closing tower at the far end */
  content: ""; flex: 0 0 48px; align-self: stretch; margin-top: -2.6rem;
  background: linear-gradient(#e2c565 0 5px, #23223a 5px calc(100% - 12px), transparent calc(100% - 12px)) 6px 0 / 30px 100% no-repeat;
}
body.style-frieze .idx-year, body.style-frieze .idx-year.idx-same {
  display: block !important; visibility: visible !important; position: absolute; left: 3.2rem; bottom: -2.5rem;
  font-family: var(--bs-font-monospace, monospace); font-style: italic; font-size: 0.72rem !important; font-weight: 400;
  color: #23223a; padding-top: 0 !important; transform: rotate(-2deg);
}
body.style-frieze .idx-year::before { /* leader line up to the cabinet */
  content: ""; position: absolute; left: -0.6rem; bottom: 0.55rem; width: 1px; height: 1.6rem; background: #23223a;
  transform: rotate(18deg); transform-origin: bottom;
}
body.style-frieze .idx-year p { margin: 0; }
body.style-frieze .frieze-hint {
  font-family: var(--bs-font-monospace, monospace); font-size: 0.62rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); text-align: right; margin: 0.3rem 1rem 0;
}
/* the machine gets the whole width (no floor lamp on this page) and sits in the middle of the screen */
@media (min-width: 821px) {
  body.style-frieze main.content { grid-column: body-content-start / screen-end-inset !important; max-width: none !important; }
  body.style-frieze .year-groups { margin-top: max(2rem, calc(50vh - 22rem)); }
}
body.style-frieze .year-groups .year-group .resource-item { flex-basis: 21rem; }
body.style-frieze .resource-entry { font-size: 0.92rem !important; }
body.style-frieze .resource-entry strong { font-size: 1.02rem; }
