/* CREMA 1968 — espresso atelier direction: velvet espresso-to-wine backdrop,
   cream display type, micro print, editorial asymmetry. */

@font-face {
  font-family: "Manrope";
  src: url("../../../open-runtime/3ae11c49db0455a3cc33e37d380f20fdb8c7f8b41dc07625c177e3d87a9d6ae6/Manrope.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --espresso: #241310;
  --wine: #6e1f2a;
  --cream: #f2e7d5;
  --cream-dim: #cdbfa7;
  --brass: #c89a5a;
  --line: rgba(242, 231, 213, 0.22);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--espresso);
  color: var(--cream);
  font-family: "Manrope", system-ui, sans-serif;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#stage:active { cursor: grabbing; }

.frame {
  position: fixed;
  inset: 0;
  padding: clamp(14px, 2.4vw, 34px);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "masthead masthead"
    "lede    legend"
    "foot    foot";
  pointer-events: none;
}

/* ---------- masthead ---------- */
.masthead {
  grid-area: masthead;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.mark { display: flex; align-items: center; gap: 10px; }
.mark-ring {
  width: 11px; height: 11px;
  border: 1.5px solid var(--brass);
  border-radius: 50%;
  display: inline-block;
}
.micro {
  font-size: 10px;
  letter-spacing: 0.32em;
  font-weight: 600;
  color: var(--cream-dim);
}
.micro.dim { color: rgba(205, 191, 167, 0.5); }

.langs { display: flex; gap: 6px; pointer-events: auto; }
.lang-btn {
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.14em;
  padding: 6px 13px;
  background: transparent;
  color: var(--cream-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.lang-btn[aria-pressed="true"] {
  color: var(--espresso);
  background: var(--cream);
  border-color: var(--cream);
}
.lang-btn:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

/* ---------- lede ---------- */
.lede {
  grid-area: lede;
  align-self: center;
  max-width: 340px;
  margin-top: -2vh;
}
.kicker {
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--brass);
  font-weight: 700;
  margin-bottom: 10px;
}
.display {
  font-size: clamp(44px, 6.2vw, 88px);
  line-height: 0.94;
  font-weight: 250;
  letter-spacing: 0.015em;
  color: var(--cream);
}
.display .year {
  font-weight: 800;
  color: var(--brass);
}
.sub {
  margin-top: 12px;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--cream-dim);
}
.body {
  margin-top: 14px;
  font-size: 13.5px;
  line-height: 1.75;
  max-width: 30em;
  color: rgba(242, 231, 213, 0.86);
}
.specs {
  list-style: none;
  margin-top: 20px;
  border-top: 1px solid var(--line);
}
.specs li {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  letter-spacing: 0.05em;
}
.specs li span:first-child { color: var(--brass); font-weight: 600; }
.specs li span:last-child { color: var(--cream-dim); }

/* ---------- legend ---------- */
.legend {
  grid-area: legend;
  align-self: center;
  width: 236px;
  pointer-events: auto;
  padding-left: 18px;
  border-left: 1px solid var(--line);
  transition: opacity .35s, transform .35s;
}
.legend-title { margin-bottom: 10px; }
#legend-list { list-style: none; }
#legend-list li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  padding: 6px 0;
  font-size: 12px;
  line-height: 1.45;
}
#legend-list .idx {
  color: var(--brass);
  font-weight: 800;
  font-size: 11px;
  padding-top: 1px;
}
#legend-list .name { color: var(--cream); font-weight: 600; letter-spacing: 0.03em; }
#legend-list .desc {
  grid-column: 2;
  color: var(--cream-dim);
  font-size: 10.5px;
  line-height: 1.5;
}
/* exploded state: collapse the long copy so the structure owns the stage.
   The camera reframes into the freed band (see cameraGoalFor in app.js). */
body.exploded .lede .sub,
body.exploded .lede .body,
body.exploded .lede .specs { display: none; }
body.exploded .lede { margin-top: 0; }
body.exploded .display { font-size: clamp(26px, 3.2vw, 44px); }
body.exploded .kicker { margin-bottom: 6px; }
body.exploded .legend { opacity: 1; }

/* ---------- controls ---------- */
.controls {
  grid-area: foot;
  justify-self: start;
  align-self: end;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  pointer-events: auto;
  margin-bottom: 4vh;
}
.btn {
  font: inherit;
  font-size: 12.5px;
  letter-spacing: 0.1em;
  font-weight: 700;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(36, 19, 16, 0.55);
  color: var(--cream);
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background .25s, border-color .25s, color .25s, transform .15s;
}
.btn:hover { border-color: var(--brass); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--wine);
  border-color: #8d2c39;
}
.btn-primary[aria-pressed="true"] {
  background: var(--brass);
  border-color: var(--brass);
  color: var(--espresso);
}

.colophon {
  grid-area: foot;
  justify-self: end;
  align-self: end;
  text-align: right;
  margin-bottom: 4vh;
  pointer-events: none;
}
.colophon .micro + .micro { margin-top: 5px; }

@media (prefers-reduced-motion: reduce) {
  .legend, .lede { transition: none; }
}

/* ---------- narrow desktop / tablet ---------- */
@media (max-width: 1180px) {
  .lede { max-width: 280px; }
  .display { font-size: clamp(34px, 4.6vw, 60px); }
  .body { font-size: 12.5px; }
  .legend { width: 192px; padding-left: 14px; }
  #legend-list li { font-size: 11px; padding: 5px 0; }
  #legend-list .desc { display: none; }
}

/* ---------- mobile ---------- */
@media (max-width: 720px) {
  .frame {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas: "masthead" "lede" "foot";
    padding: 14px;
  }
  .lede { align-self: start; margin-top: 1.5vh; max-width: 320px; }
  .display { font-size: 40px; }
  .body { font-size: 12px; max-width: 26em; line-height: 1.6; }
  .specs { display: none; }
  body.exploded .lede { margin-top: 0.5vh; }
  body.exploded .display { font-size: 30px; }
  body.exploded .lede .body,
  body.exploded .lede .sub { display: none; }
  .legend {
    position: fixed;
    left: 14px; right: 14px;
    bottom: 96px;
    width: auto;
    border-left: none;
    border-top: 1px solid var(--line);
    padding: 8px 0 0 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    background: rgba(36, 19, 16, 0.72);
    backdrop-filter: blur(6px);
    border-radius: 10px;
    transition: max-height .4s, opacity .4s, padding .4s;
  }
  body.exploded .legend { max-height: 200px; opacity: 1; padding: 10px 14px 12px; }
  #legend-list li { padding: 4px 0; }
  #legend-list .desc { display: none; }
  .controls { margin-bottom: 0; }
  .colophon { display: none; }
  .controls .btn { padding: 10px 16px; font-size: 11.5px; }
}
