*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #141413;
  color: #e6e2dc;
  font-family: "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.35;
}

a,
a:visited {
  color: inherit;
  text-decoration: none;
}

a:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 3px;
}

.site-header {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.55rem 1.5rem;
  background: #f4f1ec;
  color: #1C1C1A;
  border-bottom: 1px solid #ddd9d3;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  color: #1C1C1A;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}

.logo {
  display: block;
  height: 36px;
  width: auto;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 1.15rem;
  min-width: 0;
  margin-left: auto;
  color: #1C1C1A;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.2;
}

.site-nav a {
  color: #1C1C1A;
  font-weight: 400;
  text-decoration: none;
}

.site-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

.site-nav a:not([href]) {
  cursor: default;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.lang-fr {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.lang-fr img {
  display: block;
  height: 15px;
  width: auto;
}

.lang-sep {
  color: #1C1C1A;
}

.split {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  width: 100%;
  min-height: 0;
}

.door {
  position: relative;
  flex: 1 1 0;
  width: 50%;
  min-width: 0;
  overflow: hidden;
}

.door-work {
  background: #e6e2dc;
  color: #1C1C1A;
}

.door-tech {
  background: #1C1C1A;
  color: #e6e2dc;
}

.rail-slot {
  position: absolute;
  top: 1.35rem;
  right: 1.5rem;
  bottom: 4.85rem;
  left: 1.5rem;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(28, 28, 26, 0.35);
  background-image:
    linear-gradient(#1C1C1A, #1C1C1A),
    linear-gradient(#1C1C1A, #1C1C1A),
    linear-gradient(#1C1C1A, #1C1C1A),
    linear-gradient(#1C1C1A, #1C1C1A),
    linear-gradient(#1C1C1A, #1C1C1A),
    linear-gradient(#1C1C1A, #1C1C1A),
    linear-gradient(#1C1C1A, #1C1C1A),
    linear-gradient(#1C1C1A, #1C1C1A);
  background-size:
    1.35rem 1px,
    1px 1.35rem,
    1.35rem 1px,
    1px 1.35rem,
    1.35rem 1px,
    1px 1.35rem,
    1.35rem 1px,
    1px 1.35rem;
  background-position:
    left top,
    left top,
    right top,
    right top,
    left bottom,
    left bottom,
    right bottom,
    right bottom;
  background-repeat: no-repeat;
}

.rail-view {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
}

.rail-names {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  flex: 0 0 auto;
  margin: 0;
  padding: 0.3rem 0 0.1rem;
  list-style: none;
  font-size: 0.78rem;
  line-height: 1.2;
  text-align: center;
}

.rail-names li {
  min-width: 0;
}

.rail-names span {
  display: inline;
}

.rail-names span + span::before {
  content: "\00a0";
}

.door-work .rail-hero {
  top: 0.4rem;
  right: 0;
  bottom: 4.7rem;
  left: 0;
  border: 0;
  background-image: none;
}

.rail-hero .rail-names {
  grid-template-columns: 1fr;
  padding-right: 1.25rem;
  padding-left: 1.25rem;
}

.door-drag {
  user-select: none;
  touch-action: none;
  cursor: grab;
}

.door-drag .rail-names {
  position: relative;
  min-height: 1.45rem;
}

.door-drag .rail-names li {
  position: absolute;
  top: 0.3rem;
  left: 50%;
  width: max-content;
  transform: translateX(-50%);
}

.rotator-frame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #1C1C1A;
  overflow: hidden;
}

.drag-icons {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  pointer-events: none;
  transform: translateX(-50%);
  visibility: hidden;
}

.drag-icons.is-placed {
  visibility: visible;
}

.drag-icons img {
  display: block;
  height: 1.45rem;
  width: auto;
}

.split-hint {
  position: absolute;
  z-index: 5;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  pointer-events: none;
  transform: translateX(-50%);
}

.split-hint img {
  display: block;
  height: 4rem;
  width: auto;
}

.split-hint-turn {
  transform-origin: center;
  animation: split-hint-turn 4s ease-in-out infinite;
}

.split-hint-move {
  animation: split-hint-move 4s ease-in-out infinite;
}

.split-hint.is-gone {
  display: none;
}

@keyframes split-hint-turn {
  0%,
  100% {
    transform: scale(0.9);
  }
  50% {
    transform: scale(1.08);
  }
}

@keyframes split-hint-move {
  0%,
  100% {
    transform: translateX(-0.55rem);
  }
  50% {
    transform: translateX(0.55rem);
  }
}

.door-hint {
  position: absolute;
  z-index: 5;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  pointer-events: none;
  transform: translateX(-50%);
}

.door-hint img {
  display: block;
  height: 3.25rem;
  width: auto;
}

.door-hint-turn {
  transform-origin: center;
  animation: split-hint-turn 4s ease-in-out infinite;
}

.door-hint-move {
  animation: split-hint-move 4s ease-in-out infinite;
}

.door-hint.is-gone {
  display: none;
}

.rail-count {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  pointer-events: none;
  color: rgba(28, 28, 26, 0.78);
  transition: opacity 0.7s ease;
}

.rail-count-bar {
  display: block;
  width: 7.5rem;
  height: 0.42rem;
  border-radius: 999px;
  background: rgba(28, 28, 26, 0.1);
  overflow: hidden;
}

.rail-count-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #f4b2a8, #e15d56);
  transition: width 0.28s ease;
}

.rail-count-nums {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.rail-count-n {
  font-size: 0.82rem;
  font-weight: 600;
}

.rail-count-n::after {
  content: "·";
  margin-left: 0.2rem;
  font-weight: 400;
  color: rgba(28, 28, 26, 0.28);
}

.rail-count-total {
  font-size: 0.68rem;
  font-weight: 500;
  color: rgba(28, 28, 26, 0.38);
}

.rail-count.is-gone {
  opacity: 0;
}

.hint {
  position: absolute;
  right: 1.25rem;
  bottom: 1.1rem;
  left: 1.25rem;
  margin: 0;
}

.hint-work {
  text-align: left;
}

.hint-tech {
  z-index: 3;
  text-align: left;
  pointer-events: none;
}

.hint-tech a {
  pointer-events: auto;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

.hint-title,
.hint-action {
  display: block;
  overflow-wrap: break-word;
}

.hint-action {
  margin-top: 0.15rem;
  font-size: 0.92rem;
}

.door-work .hint-action {
  color: rgba(28, 28, 26, 0.7);
}

.door-tech .hint-action {
  color: rgba(230, 226, 220, 0.72);
}

.site-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.65rem 1.5rem;
  background: #141413;
  color: #e6e2dc;
  border-top: 1px solid rgba(230, 226, 220, 0.16);
  font-size: 0.92rem;
}

.site-footer p {
  margin: 0;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.footer-social a {
  display: inline-flex;
  color: inherit;
  line-height: 0;
}

.footer-social a:hover {
  opacity: 0.72;
}

.footer-social svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
}

@media (max-width: 720px) {
  .site-header,
  .site-footer {
    padding-right: 0.85rem;
    padding-left: 0.85rem;
  }

  .site-nav {
    gap: 0.7rem;
    font-size: 0.82rem;
  }

  .wordmark {
    font-size: 0.92rem;
  }

  .rail-slot {
    top: 0.85rem;
    right: 0.85rem;
    left: 0.85rem;
  }

  .rail-names {
    font-size: 0.68rem;
  }

  .rail-names span {
    display: block;
  }

  .rail-names span + span::before {
    content: none;
  }

  .hint {
    right: 0.75rem;
    bottom: 0.85rem;
    left: 0.75rem;
    font-size: 0.85rem;
  }

  .drag-icons img {
    height: 1.25rem;
  }
}

.studio {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  background: #e6e2dc;
  color: #1C1C1A;
}

.studio-stage {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  cursor: grab;
}

.studio-stage.is-turning {
  cursor: grabbing;
}

.studio-view {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
}

.studio-hint {
  top: 50%;
  transform: translate(-50%, -50%);
}

.studio-copy {
  flex: 0 0 auto;
  padding: 0.35rem 1.5rem 1.15rem;
}

.studio-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.35;
}

.studio-note {
  margin: 0.15rem 0 0;
  color: rgba(28, 28, 26, 0.7);
  font-size: 0.92rem;
  line-height: 1.35;
}

.studio-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  margin: 0.7rem 0 0;
  font-size: 0.92rem;
}

.studio-links a:hover {
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

@media (max-width: 720px) {
  .studio-copy {
    padding-right: 0.85rem;
    padding-left: 0.85rem;
  }
}
