:root {
  color-scheme: light;
  --paper: #faf9f7;
  --surface: #ffffff;
  --ink: #191917;
  --ink-soft: #4f4e49;
  --ink-faint: #6d6c66;
  --rule: #191917;
  --rule-soft: #e6e4de;
  --accent: #d96500;
  --veil: rgba(250, 249, 247, 0.94);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #111113;
    --surface: #1a1a1d;
    --ink: #ececea;
    --ink-soft: #c4c3bd;
    --ink-faint: #97968f;
    --rule: #ececea;
    --rule-soft: #2b2b2f;
    --accent: #ff8f40;
    --veil: rgba(17, 17, 19, 0.94);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111113;
  --surface: #1a1a1d;
  --ink: #ececea;
  --ink-soft: #c4c3bd;
  --ink-faint: #97968f;
  --rule: #ececea;
  --rule-soft: #2b2b2f;
  --accent: #ff8f40;
  --veil: rgba(17, 17, 19, 0.94);
}

:root[data-theme="light"] {
  color-scheme: light;
  --paper: #faf9f7;
  --surface: #ffffff;
  --ink: #191917;
  --ink-soft: #4f4e49;
  --ink-faint: #6d6c66;
  --rule: #191917;
  --rule-soft: #e6e4de;
  --accent: #d96500;
  --veil: rgba(250, 249, 247, 0.94);
}

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 2.5rem;
}

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

header {
  text-align: center;
  padding: 1.6rem 0 0;
}

.ear {
  font-size: 0.78rem;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2.4rem, 7vw, 4.3rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.055em;
  margin: 0.4rem 0 0.7rem;
}

.dateline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
  padding: 0.35rem 0.2rem;
  font-size: 0.8rem;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

/* --------------------------------------------------- body */

main {
  flex: 1;
  display: flex;
  gap: 2.5rem;
  padding: 2rem 0;
  align-items: flex-start;
  flex-wrap: wrap;
}

#stage {
  position: relative;
  flex: 0 1 470px;
  max-width: 100%;
}

#poster {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--rule-soft);
  background: #000;
}

#stage figcaption {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--ink-faint);
  line-height: 1.5;
}
#stage figcaption span { display: block; }

#veil {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--veil);
  color: var(--ink-soft);
  font-style: italic;
  letter-spacing: 0.08em;
  transition: opacity 0.6s ease;
}
#veil.hidden { opacity: 0; pointer-events: none; }

#panel {
  flex: 1 1 300px;
  max-width: 440px;
  min-width: 0;
  border-left: 1px solid var(--rule-soft);
  padding-left: 2.5rem;
}

/* ----------------------------------------------- controls */

.controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  border: 1px solid var(--rule-soft);
  margin-bottom: 1.8rem;
}

select, button {
  font-family: inherit;
  font-size: 0.75rem;
  background: var(--surface);
  color: var(--ink);
  border: none;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

select {
  min-width: 0;
}

button { border-right: 1px solid var(--rule-soft); }
.controls > :last-child { border-right: none; }

button.primary {
  background: var(--accent);
  color: #fff;
}

button:hover { color: var(--accent); }
button.primary:hover { filter: brightness(0.9); color: #fff; }
button:disabled { opacity: 0.4; cursor: wait; }

/* ------------------------------------------------- column */

#meta h2 {
  font-size: 0.8rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin: 1.6rem 0 0.7rem;
  padding-bottom: 0.35rem;
  border-bottom: 3px double var(--rule);
}

dl {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  row-gap: 0.35rem;
  font-size: 0.88rem;
}
dt { color: var(--ink-faint); font-style: italic; }
dd { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#meta select {
  border: 1px solid var(--rule-soft);
  padding: 0.25rem 0.5rem;
  font-size: 0.82rem;
  text-transform: none;
  letter-spacing: normal;
}
#meta select:hover { border-color: var(--ink); }
#m-blend-used {
  margin-left: 0.5rem;
  font-style: italic;
  color: var(--ink-faint);
}

#m-sources {
  list-style: none;
  font-size: 0.88rem;
  line-height: 1.55;
}
#m-sources li {
  margin-bottom: 0.55rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px dotted var(--rule-soft);
}
#m-sources li:last-child { border-bottom: none; }
#m-sources mark {
  background: transparent;
  color: var(--accent);
  font-style: italic;
  font-weight: bold;
}

/* embedded in the portfolio page: no masthead, tighter frame */
.is-embed header { display: none; }
.is-embed body { padding-top: 0.5rem; }
.is-embed main { padding-top: 0.75rem; }

@media (max-width: 760px) {
  body { padding: 0 1.1rem; }
  main { gap: 1.5rem; }
  #stage,
  #panel {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  #panel { border-left: none; padding-left: 0; }
  .dateline { flex-direction: column; gap: 0.1rem; text-align: center; }
  .controls button { min-width: 0; padding-inline: 0.45rem; }
}
