/* Centro de Controle — static layer of the landing island: hero Orbs, section,
   typed prompt and the window that holds the canvas (or its still image).
   Loaded by index.html; the canvas bundle adds island.css on demand.
   Light is the landing default; html[data-theme='dark'] mirrors it. */

/* ---------------------------------------------------------------- hero Orbs */
.cc-hero { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.cc-hero__links { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cc-hero__links path {
  fill: none; stroke: #7486ad; stroke-opacity: .5; stroke-width: 1.2; stroke-dasharray: 4 6;
  vector-effect: non-scaling-stroke; animation: cc-hero-dash 2.6s linear infinite;
}
.cc-hero__links circle { fill: #c15a68; opacity: .75; }
html[data-theme='dark'] .cc-hero__links path { stroke: #c5d2f8; stroke-opacity: .32; }
html[data-theme='dark'] .cc-hero__links circle { fill: #ff886f; }
.cc-hero__orb {
  position: absolute; display: flex; align-items: center; gap: 9px;
  padding: 5px 14px 5px 5px; border-radius: 999px;
  background: #ffffffcf; border: 1px solid #8da0c340; color: #17243e;
  box-shadow: 0 10px 26px #50658f1c, 0 1px 0 #fff inset;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  animation: cc-hero-bob 7s ease-in-out infinite;
  white-space: nowrap;
}
html[data-theme='dark'] .cc-hero__orb {
  background: #141a2dcf; border-color: #bacaff26; color: #f4f2ec;
  box-shadow: 0 14px 30px #0005, 0 1px 0 #ffffff0d inset;
}
.cc-hero__orb img { width: 32px; height: 32px; object-fit: contain; transform: scale(1.15); }
.cc-hero__orb > span { display: grid; line-height: 1.25; }
.cc-hero__orb b { font: 600 12px/1.25 Manrope, Inter, sans-serif; letter-spacing: -.02em; }
.cc-hero__orb small { display: flex; align-items: center; gap: 5px; font-size: 9.5px; color: #5b6782; }
html[data-theme='dark'] .cc-hero__orb small { color: #a7a9b9; }
.cc-hero__orb small i { width: 5px; height: 5px; border-radius: 50%; background: #8c9bc0; }
.cc-hero__orb small i.is-work { background: #d4664f; animation: cc-hero-pulse 1.8s ease-in-out infinite; }
.cc-hero__orb small i.is-wait { background: #c9962f; }
html[data-theme='dark'] .cc-hero__orb small i.is-work { background: #ff886f; }
html[data-theme='dark'] .cc-hero__orb small i.is-wait { background: #f6c27b; }
.cc-hero__orb--a { left: 1%; top: 5%; }
.cc-hero__orb--b { right: 3%; top: 3%; animation-delay: -2.4s; }
.cc-hero__orb--c { left: -2%; top: 74%; animation-delay: -4.6s; }

/* ---------------------------------------------------------------- section */
.cc-section { position: relative; padding-top: 40px; }
.cc-section .section-heading--row > p:last-child { max-width: 330px; }
.cc-prompt {
  display: flex; align-items: center; justify-content: space-between; gap: 22px;
  margin-top: 46px; padding: 14px 14px 14px 22px;
  border: 1px solid #bacaff1f; border-radius: 18px;
  background: linear-gradient(155deg, #242c426e, #14182bc9);
  box-shadow: 0 18px 50px #0003, 0 1px 0 #ffffff0a inset;
}
html:not([data-theme='dark']) .cc-prompt {
  background: linear-gradient(150deg, #ffffffde, #f7f9ffcf);
  border-color: #8da0c333;
  box-shadow: 0 14px 44px #50658f12, 0 1px 0 #fff inset;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.cc-prompt__line { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.cc-prompt__mark { flex-shrink: 0; color: var(--coral); font-size: 17px; transform: translateY(1px); }
html:not([data-theme='dark']) .cc-prompt__mark { color: #a9496a; }
.cc-typed {
  font: 500 clamp(17px, 1.75vw, 23px)/1.45 Manrope, Inter, sans-serif; letter-spacing: -.03em;
  color: #c9cddc; min-height: 1.45em;
}
html:not([data-theme='dark']) .cc-typed { color: #4b5873; }
.cc-slot {
  color: var(--ivory); white-space: pre-wrap;
  background: linear-gradient(90deg, #f45e91, #ff886f) 0 100% / 100% 1.5px no-repeat;
  padding-bottom: 1px;
}
html:not([data-theme='dark']) .cc-slot { color: #11162b; }
.cc-caret {
  display: inline-block; width: 1.5px; height: 1.05em; margin-left: 2px; vertical-align: -.14em;
  background: var(--coral); animation: cc-caret 1s steps(1) infinite;
}
html:not([data-theme='dark']) .cc-caret { background: #c15a68; }
.cc-typed[data-typing='on'] .cc-caret { animation: none; }
.cc-prompt .button { flex-shrink: 0; min-height: 46px; }
.cc-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* One window stays in view as the four chapters pass it. */
.cc-story { margin-top: 20px; overflow-anchor: none; }
html.cc-story-interaction { scroll-behavior: auto; }
.cc-story__steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.cc-story__step {
  padding: clamp(16px, 2vw, 28px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--ink) 75%, transparent);
}
.cc-story__step > span { color: var(--muted); font: 650 11px/1.3 Inter, sans-serif; }
.cc-story__step h3 { margin: 8px 0; color: var(--ivory); font: 650 clamp(16px, 1.8vw, 24px)/1.2 Manrope, Inter, sans-serif; letter-spacing: -.03em; }
.cc-story__step p { margin: 0; max-width: 34ch; color: var(--muted); font-size: 13px; line-height: 1.55; }
.cc-story__step[data-active] { border-color: color-mix(in srgb, var(--coral) 50%, var(--line)); }
html:not([data-theme='dark']) .cc-story__step { background: #ffffffbd; border-color: #8da0c333; }
html:not([data-theme='dark']) .cc-story__step h3 { color: #17243e; }
html:not([data-theme='dark']) .cc-story__step p,
html:not([data-theme='dark']) .cc-story__step > span { color: #56627b; }
html:not([data-theme='dark']) .cc-story__step[data-active] { border-color: #b9728a; box-shadow: 0 14px 36px #50658f12; }

.cc-window .window-bar strong { font-weight: 500; color: inherit; }
.cc-stage { position: relative; height: clamp(470px, 42vw, 560px); overflow: hidden; isolation: isolate; }
.cc-mobile-dock { display: none; }
.cc-mobile-dock:empty { display: none !important; }
.cc-fallback { position: absolute; inset: 0; display: block; transition: opacity .45s ease, visibility .45s; }
.cc-fallback img { width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 50%; }
.cc-fallback__dark { display: none !important; }
html[data-theme='dark'] .cc-fallback__light { display: none !important; }
html[data-theme='dark'] .cc-fallback__dark { display: block !important; }
.cc-root { position: absolute; inset: 0; opacity: 0; transition: opacity .45s ease; }
.cc-section[data-cc-state='live'] .cc-root { opacity: 1; }
.cc-section[data-cc-state='live'] .cc-fallback { opacity: 0; visibility: hidden; }
.cc-hint { display: inline-flex; align-items: center; white-space: nowrap; }
.cc-window .window-footer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1fr); gap: 10px; }
.cc-story-feedback { min-width: 0; overflow-wrap: anywhere; }
.cc-window .cc-hint { justify-self: end; }
.cc-legend { display: inline-flex; align-items: center; gap: 8px; }
.cc-legend i { width: 22px; height: 0; border-top: 1.5px dashed currentColor; opacity: .7; }
.cc-window:has([data-scene='memory']) .cc-hint { visibility: hidden; }

@media (min-width: 1050px) and (min-height: 720px) and (prefers-reduced-motion: no-preference) {
  .cc-section[data-cc-state='live'] { --cc-sticky-top: clamp(20px, calc((100svh - 700px) / 2), 86px); }
  .cc-section[data-cc-state='live'] .cc-story { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 23%); gap: clamp(20px, 3vw, 52px); align-items: start; }
  .cc-section[data-cc-state='live'] .cc-window { position: sticky; top: var(--cc-sticky-top); }
  .cc-section[data-cc-state='live'] .cc-stage { height: clamp(460px, calc(100svh - 165px), 600px); }
  .cc-section[data-cc-state='live'] .cc-story__steps { grid-template-columns: 1fr; gap: clamp(64px, 20vh, 190px); margin: 0; padding: 30vh 0 58vh; }
  .cc-story__step { transition: border-color .24s, background .24s, box-shadow .24s; }
}

@media (max-width: 1049px) {
  .cc-section[data-cc-state='live'] .cc-mobile-dock {
    display: block;
    max-width: 100%;
    padding: 8px 12px;
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--ink) 88%, transparent);
    overflow: hidden;
  }
  html:not([data-theme='dark']) .cc-section[data-cc-state='live'] .cc-mobile-dock {
    background: #f5f7ffde;
  }
}

@media (max-width: 1100px) {
  .cc-typed { min-height: 2.9em; }
}
@media (max-width: 900px) {
  .cc-hero__orb { padding: 4px 11px 4px 4px; gap: 7px; }
  .cc-hero__orb img { width: 26px; height: 26px; }
  .cc-hero__orb b { font-size: 11px; }
  .cc-hero__orb small { font-size: 8.5px; }
}
@media (max-width: 767px) {
  .cc-hero__orb--a { left: 3%; top: 3%; }
  .cc-hero__orb--b { right: 4%; top: 1%; }
  .cc-hero__orb--c { left: 3%; top: 76%; }
  .cc-section { padding-top: 30px; }
  .cc-prompt { flex-direction: column; align-items: stretch; gap: 14px; margin-top: 32px; padding: 18px 16px 16px; }
  .cc-prompt__line { gap: 10px; }
  .cc-typed { font-size: 17px; min-height: 4.35em; }
  .cc-prompt .button { width: 100%; justify-content: space-between; }
  .cc-stage { height: 460px; }
  .cc-section[data-cc-state='live'] .cc-stage { height: 526px; }
  .cc-story__steps { grid-template-columns: 1fr; }
  .cc-window .window-bar > span:nth-child(2) { font-size: 9px; }
  .cc-window .window-footer { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
  .cc-story-feedback:empty { display: none; }
  .cc-story-feedback .cc-toast { text-align: start; }
}
@media (max-width: 370px) {
  .cc-hero__orb small { display: none; }
}

@keyframes cc-hero-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes cc-hero-dash { to { stroke-dashoffset: -20; } }
@keyframes cc-hero-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes cc-caret { 50% { opacity: 0; } }
