/* Proof Vermilion (#FF331F) Dry-Crayon Hand-Drawn Notes & High Renaissance Interactive Portrait Eyes */
:root {
  --wax-red: #FF331F;
  --wax-red-bright: #FF3B26;
  --wax-red-glow: rgba(255, 51, 31, 0.34);
}

.notes-overlay,
.notes-hud-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
  opacity: 1;
  transition: opacity .26s cubic-bezier(0.42, 0, 0.58, 1);
}
html[data-notes="off"] :is(.notes-overlay, .notes-hud-overlay),
body:has(dialog.cover-reveal[open]) :is(.notes-overlay, .notes-hud-overlay) {
  opacity: 0;
}

/* Fade plain bottom-left scroll prompt while "scroll to discover" wax note is active */
.footer .instruction {
  transition: opacity .22s cubic-bezier(0.42, 0, 0.58, 1);
}
html[data-notes="on"] .screen:has(.director-note[data-note="opening"][data-active="true"]) .footer .instruction {
  opacity: 0;
  pointer-events: none;
}

.director-note {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate3d(-50%, -50%, 0);
  padding: 6px;
  background: transparent;
  border: 0;
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.90));
  transition: opacity .24s cubic-bezier(0.42, 0, 0.58, 1);
}
html[data-notes="on"] .director-note[data-active="true"] {
  pointer-events: auto;
  cursor: pointer;
}
html[data-notes="on"] .director-note[data-active="true"]:hover svg {
  filter: url(#wax-pencil) brightness(1.16) drop-shadow(0 0 12px var(--wax-red-glow));
}

.director-note svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: url(#wax-pencil);
  transform-origin: center;
  will-change: transform;
  transition: filter .22s cubic-bezier(0.42, 0, 0.58, 1);
}

/* Thinner, delicate Proof Vermilion arrows, underlines & dry-crayon handwriting (zero <text>) */
:is(.director-note, .modal-wax-note) path.wax-halo,
:is(.director-note, .modal-wax-note) path.wax-core {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: stroke-dashoffset .78s cubic-bezier(0.42, 0, 0.58, 1);
}
:is(.director-note, .modal-wax-note) path.wax-halo {
  stroke: rgba(255, 51, 31, 0.22);
  stroke-width: 3.1;
}
:is(.director-note, .modal-wax-note) path.wax-core {
  stroke: var(--wax-red);
  stroke-width: 1.85;
}
:is(.director-note, .modal-wax-note) .wax-ink-halo {
  fill: none;
  stroke: rgba(255, 51, 31, 0.16);
  stroke-width: 0.75px;
  stroke-linecap: round;
  stroke-linejoin: round;
}
:is(.director-note, .modal-wax-note) .wax-ink-fill {
  fill: var(--wax-red-bright);
  fill-rule: evenodd;
  stroke: none;
  stroke-width: 0;
}

.director-note .wax-reveal-rect {
  transform: scaleX(0);
  transform-origin: -40px 0;
  transition: transform .82s cubic-bezier(0.22, 1, 0.36, 1);
}
.director-note[data-drawn="true"] .wax-reveal-rect {
  transform: scaleX(1);
}

/* Contact default vs copied hand-drawn state crossfade */
.director-note .wax-handwriting {
  transition: opacity .22s cubic-bezier(0.42, 0, 0.58, 1);
}
.director-note .wax-copied {
  opacity: 0;
}
.director-note[data-copied="true"] .wax-default {
  opacity: 0;
}
.director-note[data-copied="true"] .wax-copied {
  opacity: 1;
}

/* HUD-anchored notes live in .screen so they never shift vs UI controls on browser resize */
.director-note[data-note="opening"] {
  left: var(--hud-pad);
  top: auto;
  bottom: clamp(18px, 3.2svh, 34px);
  width: clamp(170px, 13.5vw, 225px);
  transform: none;
}
.director-note[data-note="contact"] {
  width: clamp(155px, 12.2vw, 195px);
  transform: translate3d(-88%, 0, 0);
}

/* 3D-object notes live in 16:9 .camera-frame space with edge-safe clamp translate offsets */
.director-note[data-note="collection"] {
  width: 14.5%;
  transform: translate3d(-100%, -48%, 0);
  margin-left: -0.5%;
  margin-top: -0.4%;
}
.director-note[data-note="practice"] {
  width: 13.0%;
  transform: translate3d(-50%, -96%, 0);
  margin-left: -8.0%;
  margin-top: -0.6%;
}
.director-note[data-note="about"] {
  width: 12.8%;
  margin-left: 3.0%;
  margin-top: 1.5%;
}

/* Header Notes Toggle Pill */
.header-actions {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}
.notes-toggle {
  display: inline-flex;
  align-items: center;
  gap: .48em;
  min-height: 36px;
  padding: .48em .92em;
  border-radius: 2px;
  background: var(--room-surface, rgba(14, 12, 10, 0.92));
  border: 1px solid var(--room-border, rgba(242, 236, 225, 0.24));
  font-family: var(--font-mono, "IBM Plex Mono", ui-monospace, monospace);
  font-size: clamp(10.5px, .8cqw, 12px);
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--room-muted, #c8bfb1);
  transition: border-color .2s cubic-bezier(0.42, 0, 0.58, 1), background-color .2s cubic-bezier(0.42, 0, 0.58, 1), color .2s cubic-bezier(0.42, 0, 0.58, 1);
}
.notes-toggle:hover {
  border-color: var(--wax-red);
  color: var(--room-ivory, #f2ece1);
}
.notes-toggle[aria-pressed="true"] {
  border-color: rgba(255, 51, 31, 0.58);
  color: var(--room-ivory, #f4efe6);
  box-shadow: 0 0 14px rgba(255, 51, 31, 0.14);
}
.notes-toggle svg {
  width: 12px;
  height: 12px;
  flex: none;
  color: var(--wax-red);
}

/* Practice Display Monitor Live Video Layer (#practice) */
.practice-screen-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.practice-screen-card {
  position: absolute;
  left: 0;
  top: 0;
  width: 384px;
  height: 216px;
  transform-origin: 0 0;
  will-change: transform;
  overflow: hidden;
  background: #0d0b0a;
}
.practice-screen-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(24, 22, 24, 0.92), inset 0 1px 5px rgba(0, 0, 0, 0.68);
  background: linear-gradient(125deg, rgba(255, 240, 218, 0.05) 0%, transparent 42%, rgba(10, 8, 7, 0.14) 100%);
}
.practice-screen-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Interactive High Renaissance Portrait Eye Layer (#about) */
.portrait-eyes-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  will-change: opacity;
}
body:has(dialog.cover-reveal[open]) .portrait-eyes-layer {
  opacity: 0 !important;
}
.portrait-eye {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.portrait-eye-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  user-select: none;
}
.portrait-eye-sclera {
  z-index: 1;
}
.portrait-eye-iris-wrap {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  clip-path: inset(14% 12% 14% 12%);
}
.portrait-eye-iris {
  will-change: transform;
}
.portrait-eye-eyelid {
  z-index: 3;
}
.portrait-eye-blink {
  z-index: 4;
  opacity: 0;
  transform-origin: 50% 20%;
  transform: scaleY(0.2);
  transition: opacity 80ms ease, transform 85ms cubic-bezier(0.42, 0, 0.58, 1);
}
.portrait-eye.is-blinking .portrait-eye-blink {
  opacity: 1;
  transform: scaleY(1);
}

/* Hand-Drawn Wax Annotation inside Cover-Reveal Showcase Modal */
.modal-wax-note {
  position: relative;
  width: clamp(135px, 10.5vw, 170px);
  margin-top: 0.45rem;
  margin-left: 1.0rem;
  pointer-events: none;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.88));
  transition: opacity .24s cubic-bezier(0.42, 0, 0.58, 1);
}
.modal-wax-note svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: url(#wax-pencil);
  transform-origin: center;
  will-change: transform;
}
html[data-notes="off"] .modal-wax-note,
dialog.cover-reveal .modal-wax-note {
  display: none !important;
}

@media (max-width: 680px) {
  .notes-toggle span { display: none }
  .notes-toggle { min-width: 44px; min-height: 44px; justify-content: center; padding: 0 }
  .director-note[data-note="opening"] { width: 175px; min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .director-note[data-note="collection"],
  .director-note[data-note="practice"],
  .director-note[data-note="about"],
  .director-note[data-note="contact"] { display: none }
}

@media (prefers-reduced-motion: reduce) {
  .notes-overlay,
  .notes-hud-overlay,
  .footer .instruction,
  .director-note,
  .director-note path,
  .director-note .wax-reveal-rect,
  .director-note .wax-handwriting,
  .portrait-eye-blink {
    transition: none !important;
  }
}
