:root {
  color-scheme: dark;
  --background: #05070b;
  --line: #252b35;
  --text: #a7adb7;
  --bright: #e4e0d7;
  --digital: #7ea8ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--background);
  color: var(--text);
  font-family: Inter, "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body { padding: 0; }

button,
kbd,
code {
  font: inherit;
}

button {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.project-shell {
  width: 100%;
  margin: 0 auto;
}

.project-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 18px;
}

.eyebrow,
h1,
.reading-guide h2,
.reading-guide h3,
.reading-guide p,
.section-intro h2,
.section-intro p,
.subtitle,
.project-intention,
.project-footer p {
  margin: 0;
}

.eyebrow {
  color: #69717d;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
}

h1 {
  margin-top: 5px;
  color: var(--bright);
  font-size: clamp(22px, 2.2vw, 34px);
  font-weight: 500;
  letter-spacing: 0.08em;
}

.subtitle {
  margin-top: 3px;
  font-size: 13px;
  letter-spacing: 0.035em;
}

.project-intention {
  max-width: 760px;
  margin-top: 10px;
  color: #828c9a;
  font-size: 13px;
  line-height: 1.55;
}

.reading-guide {
  padding: 12px 0 8px;
  border-top: 1px solid #171c24;
  border-bottom: 1px solid #171c24;
}

.reading-guide-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 0 0 6px;
}

.reading-guide-heading h2 {
  color: var(--bright);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.055em;
}

.reading-guide-heading p {
  color: #68717e;
  font-size: 11px;
}

.reading-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.reading-guide-item {
  min-width: 0;
  padding: 4px 24px 2px;
  border-left: 1px solid #171c24;
}

.reading-guide-item:first-child {
  padding-left: 0;
  border-left: 0;
}

.reading-guide-item:last-child {
  padding-right: 0;
}

.guide-visual {
  display: block;
  width: 100%;
  height: 76px;
  overflow: visible;
}

.guide-quiet-axis {
  stroke: #252d39;
  stroke-width: 1;
}

.guide-plan-line {
  fill: none;
  stroke: #b8b3a9;
  stroke-width: 2;
  stroke-dasharray: 10 10;
  opacity: 0.82;
}

.guide-plan-origin {
  fill: #05070b;
  stroke: #b8b3a9;
  stroke-width: 2;
}

.guide-plan-arrow {
  fill: none;
  stroke: #b8b3a9;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.guide-digital-glow,
.guide-digital-route {
  fill: none;
  stroke: #7ea8ff;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.guide-digital-glow {
  stroke-width: 12;
  opacity: 0.09;
}

.guide-digital-route {
  stroke-width: 2.5;
  opacity: 0.88;
}

.guide-action-dot {
  stroke: #05070b;
  stroke-width: 2;
}

.guide-action-symbol {
  fill: none;
  stroke: #05070b;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-loading { fill: #7890b8; }
.action-running { fill: #76a7ff; }
.action-flying { fill: #a58bff; }
.action-driving { fill: #61c8db; }
.action-combat { fill: #d997c5; }
.action-quest { fill: #e0d7f4; }
.action-story { fill: #8d9ed1; }

.guide-avatar-glow {
  fill: rgba(126, 168, 255, 0.2);
  filter: drop-shadow(0 0 7px rgba(126, 168, 255, 0.62));
}

.guide-avatar-kite {
  fill: #05070b;
  stroke: #e4e0d7;
  stroke-width: 2;
  stroke-linejoin: round;
}

.guide-avatar-tail {
  stroke: #7ea8ff;
  stroke-width: 1.5;
}

.guide-physical-core {
  fill: #e4e0d7;
  filter: drop-shadow(0 0 8px rgba(184, 156, 255, 0.7));
}

.guide-ripple-ring {
  fill: none;
  stroke: #b89cff;
  stroke-width: 2;
  opacity: 0.64;
  transform-box: fill-box;
  transform-origin: center;
  animation: guide-ripple 2.8s ease-out infinite;
}

.ripple-two {
  opacity: 0.44;
  animation-delay: -0.85s;
}

.ripple-three {
  opacity: 0.26;
  animation-delay: -1.7s;
}

.guide-kicker {
  color: #7f8996;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
}

.reading-guide-item h3 {
  margin-top: 3px;
  color: var(--bright);
  font-size: 16px;
  font-weight: 480;
  letter-spacing: 0.025em;
}

.reading-guide-item > p:last-child {
  max-width: 360px;
  margin-top: 3px;
  color: #737d8a;
  font-size: 11px;
  line-height: 1.48;
}

@keyframes guide-ripple {
  0% {
    opacity: 0.78;
    transform: scale(0.62);
  }
  70%,
  100% {
    opacity: 0.08;
    transform: scale(1.06);
  }
}

.section-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  padding: 18px 0 14px;
  border-top: 1px solid #171c24;
}

.session-overview > .section-intro {
  padding: 9px 0 8px;
  border-top: 0;
}

.session-overview > .reading-guide {
  margin-top: 0;
}

.section-intro h2 {
  color: var(--bright);
  font-size: clamp(20px, 1.8vw, 28px);
  font-weight: 450;
  letter-spacing: 0.035em;
}

.section-intro > p {
  max-width: 630px;
  color: #747e8b;
  font-size: 14px;
  line-height: 1.5;
  text-align: right;
}

.session-overview-frame {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1600 / 1015;
  border: 1px solid #1b2029;
  background: var(--background);
}

.quest-portrait-section {
  margin-top: 64px;
}

.frame-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

.frame-controls button {
  appearance: none;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 7px 12px;
  letter-spacing: 0.03em;
}

.frame-controls button:hover,
.frame-controls button:focus-visible,
.frame-controls button[aria-pressed="true"] {
  border-color: var(--bright);
  color: var(--bright);
  outline: none;
}

.frame-controls .primary-control,
.frame-controls .save-button {
  border-color: var(--digital);
  color: var(--digital);
}

.canvas-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid #1b2029;
  background: var(--background);
}

#canvas-holder {
  line-height: 0;
}

#canvas-holder canvas {
  display: block;
  width: 100% !important;
  height: auto !important;
}

#loading-message {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  color: #69717d;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.detail-window {
  position: absolute;
  z-index: 10;
  inset: 7% 5% auto;
  width: 90%;
  margin: 0;
  border: 1px solid #262d38;
  background: rgba(5, 7, 11, 0.975);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(126, 168, 255, 0.08);
  pointer-events: none;
}

.detail-window[hidden] {
  display: none;
}

.detail-canvas-stage {
  overflow: hidden;
  background: #05070b;
  line-height: 0;
}

#detail-canvas {
  display: block;
  width: 100%;
  height: auto;
}

.project-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-top: 12px;
  color: #626a76;
  font-size: 11px;
}

kbd,
code {
  color: #858e9b;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

@media (max-width: 820px) {
  body {
    padding: 14px;
  }

  .project-header,
  .project-footer,
  .reading-guide-heading,
  .section-intro {
    align-items: start;
    flex-direction: column;
  }

  .section-intro > p {
    text-align: left;
  }

  .reading-guide-grid {
    grid-template-columns: 1fr;
  }

  .reading-guide-item,
  .reading-guide-item:first-child,
  .reading-guide-item:last-child {
    padding: 14px 0 18px;
    border-top: 1px solid #171c24;
    border-left: 0;
  }

  .reading-guide-item:first-child {
    border-top: 0;
  }

  .guide-visual {
    height: 86px;
  }

  .session-overview-frame {
    min-height: 620px;
    aspect-ratio: auto;
  }

  .frame-controls {
    justify-content: start;
  }

  .detail-window {
    inset: 4% 2% auto;
    width: 96%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .guide-ripple-ring {
    animation: none;
  }
}
