:root {
  color-scheme: dark;
  --story-shell-gutter: clamp(16px, 4vw, 64px);
  --story-bg: #050a13;
  --story-line: rgba(148, 163, 184, 0.22);
  --story-text: #f8fafc;
  --story-muted: #a5b4c8;
  --story-accent: #ff6b22;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--story-bg);
}

body.story-home {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--story-text);
  background:
    radial-gradient(circle at 92% 4%, rgba(34, 211, 238, 0.14), transparent 32rem),
    radial-gradient(circle at 8% 88%, rgba(59, 130, 246, 0.13), transparent 34rem),
    linear-gradient(145deg, #030711, #071221 58%, #09172c);
  font-family: Inter, "Noto Sans CJK KR", Arial, sans-serif;
}

html[lang="en"] body.story-home {
  font-family: Inter, Arial, sans-serif;
}

html[lang="ja"] body.story-home {
  font-family: "Noto Sans CJK JP", "Yu Gothic", sans-serif;
}

html[lang="zh"] body.story-home {
  font-family: "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}

html[lang="es"] body.story-home {
  font-family: Inter, Arial, sans-serif;
}

body.story-home::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  content: "";
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent 88%);
}

body.story-home button,
body.story-home a {
  -webkit-tap-highlight-color: transparent;
}

.story-skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  color: #07101f !important;
  font-weight: 800;
  transform: translateY(-160%);
}

.story-skip-link:focus {
  transform: translateY(0);
}

.story-site-header {
  position: relative;
  z-index: 20;
  width: auto;
  margin-right: var(--story-shell-gutter);
  margin-left: var(--story-shell-gutter);
  padding: 28px 0 12px;
}

.story-site-header .nav {
  margin-bottom: 12px;
}

.story-language-nav {
  display: flex;
  width: max-content;
  margin-left: auto;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--story-line);
  border-radius: 999px;
  background: rgba(5, 10, 19, 0.72);
  backdrop-filter: blur(16px);
}

.story-language-nav a {
  min-width: 42px;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--story-muted) !important;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.story-language-nav a[aria-current="page"] {
  background: #e8f0fb;
  color: #0a1424 !important;
}

.story-main {
  width: min(100%, 1540px);
  margin: 0 auto;
  padding: 24px clamp(22px, 4vw, 64px) 92px;
  padding-right: clamp(252px, 22vw, 342px);
}

.story-content[hidden] {
  display: none;
}

.story-document {
  container-type: inline-size;
  display: grid;
  width: min(100%, 1080px);
  margin: 0 auto;
}

.story-slide-frame {
  position: relative;
  width: min(100%, 1080px);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #050a13;
}

.story-slide-frame > .slide {
  position: absolute;
  top: 0;
  left: 0;
  transform: scale(calc(100cqw / 1080px));
  transform-origin: top left;
}

.story-bottom-cta {
  width: min(100%, 1080px);
  margin: 58px auto 0;
  padding: 30px;
  border: 1px solid var(--story-line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(20, 34, 57, 0.96), rgba(8, 20, 36, 0.96));
}

.story-bottom-cta strong {
  display: block;
  font-size: 1.25rem;
}

.story-bottom-cta p {
  margin: 9px 0 22px;
  color: var(--story-muted);
  font-size: 1rem;
  line-height: 1.6;
}

.story-detail-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 48px;
  padding: 12px 17px;
  border: 1px solid var(--story-accent);
  border-radius: 10px;
  color: #fff !important;
  background: rgba(255, 107, 34, 0.13);
  font-weight: 850;
  text-decoration: none;
  transition: background 140ms ease, transform 140ms ease;
}

.story-detail-button:hover,
.story-detail-button:focus-visible {
  background: var(--story-accent);
  outline: none;
  transform: translateY(-2px);
}

.story-rail {
  position: fixed;
  top: 50%;
  right: clamp(18px, 3vw, 48px);
  z-index: 30;
  display: grid;
  width: clamp(210px, 17vw, 270px);
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--story-line);
  border-radius: 16px;
  background: rgba(5, 10, 19, 0.88);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
  transform: translateY(-50%);
}

[data-story-switcher] {
  display: grid;
  gap: 9px;
}

.story-type-button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  padding: 13px 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #c8d4e3;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.story-type-number {
  color: #72839a;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.09em;
}

.story-type-copy {
  min-width: 0;
}

.story-type-title,
.story-type-status {
  display: block;
}

.story-type-title {
  font-size: 0.88rem;
  font-weight: 850;
  line-height: 1.4;
}

.story-type-status {
  margin-top: 3px;
  color: #718198;
  font-size: 0.7rem;
}

.story-type-button[aria-current="true"] {
  border-color: rgba(255, 107, 34, 0.5);
  color: #fff;
  background: rgba(255, 107, 34, 0.13);
}

.story-type-button[aria-current="true"] .story-type-number,
.story-type-button[aria-current="true"] .story-type-status {
  color: #ffad7d;
}

.story-type-button:disabled {
  cursor: default;
  opacity: 0.62;
}

.story-rail .story-detail-button {
  width: 100%;
  margin-top: 5px;
}

.story-site-footer {
  width: auto;
  margin-right: var(--story-shell-gutter);
  margin-left: var(--story-shell-gutter);
  padding-bottom: 36px;
  text-align: left;
}

.story-site-footer footer {
  margin-top: 0;
}

.story-site-footer footer a {
  color: #7dd3fc;
}

@media (max-width: 1080px) {
  .story-main {
    padding-right: 242px;
  }

  .story-rail {
    right: 18px;
    width: 210px;
  }
}

@media (max-width: 900px) {
  body.story-home {
    padding-bottom: 98px;
  }

  .story-main {
    padding-right: clamp(18px, 4vw, 40px);
  }

  .story-rail {
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    display: flex;
    width: auto;
    max-width: none;
    overflow-x: auto;
    padding: 8px;
    transform: none;
  }

  [data-story-switcher] {
    display: flex;
    flex: 1 0 auto;
    gap: 8px;
  }

  .story-type-button {
    flex: 1 0 150px;
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 10px;
  }

  .story-rail .story-detail-button {
    flex: 0 0 auto;
    width: auto;
    min-width: 154px;
    margin: 0;
  }
}

@media (max-width: 620px) {
  .story-site-header {
    padding-top: 10px;
  }

  .story-language-nav a {
    min-width: 36px;
    padding: 6px 8px;
  }

  .story-main {
    padding: 12px 14px 70px;
  }

  .story-bottom-cta {
    margin-top: 42px;
    padding: 22px;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}
