:root {
  --bg: #ececec;
  --text: #0d0d0d;
  --line: #111;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body:not(.page-ready) {
  overflow: hidden;
}

.origami-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0) 55%),
    radial-gradient(circle at 85% 84%, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0) 62%),
    #ececec;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.origami-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-scene {
  position: relative;
  width: min(72vw, 420px);
  aspect-ratio: 1.35;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-glow {
  position: absolute;
  width: 58%;
  height: 18%;
  bottom: 14%;
  border-radius: 50%;
  background: rgba(16, 16, 16, 0.18);
  filter: blur(14px);
  animation: glowPulse 2.3s ease-in-out infinite;
}

.loader-crane {
  width: min(72vw, 340px);
  overflow: visible;
  display: block;
  margin-inline: auto;
  animation: craneFloat 2.3s ease-in-out infinite;
}

.paper-outline path {
  fill: none;
  stroke: #111;
  stroke-width: 3.2;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-dasharray: 390;
  stroke-dashoffset: 390;
  animation: lineReveal 1.6s ease forwards;
}

.paper-fill polygon {
  fill: #f7f7f7;
  stroke: #151515;
  stroke-width: 1.7;
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
}

.paper-fill polygon:nth-child(1) {
  animation: foldA 2.3s ease-in-out infinite;
}

.paper-fill polygon:nth-child(2) {
  animation: foldB 2.3s ease-in-out infinite;
}

.paper-fill polygon:nth-child(3) {
  animation: foldC 2.3s ease-in-out infinite;
}

.loader-spark {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid #1b1b1b;
  transform: rotate(45deg);
  opacity: 0;
  animation: sparkMove 2.3s ease-in-out infinite;
}

.spark-1 {
  top: 16%;
  right: 22%;
  animation-delay: 0.1s;
}

.spark-2 {
  top: 34%;
  left: 16%;
  animation-delay: 0.5s;
}

.spark-3 {
  bottom: 20%;
  right: 14%;
  animation-delay: 0.9s;
}

.loader-text {
  margin: 0;
  width: 100%;
  font-size: clamp(20px, 3.1vw, 34px);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  animation: textRise 2.3s ease-in-out infinite;
}

.page {
  max-width: 1240px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 42px clamp(18px, 3.5vw, 48px) 56px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.brand-mark {
  display: inline-block;
  font-size: 50px;
  line-height: 0.86;
  letter-spacing: 0.08em;
  position: relative;
}

.brand-mark::after {
  content: "";
  position: absolute;
  top: 26px;
  left: -5px;
  width: 110px;
  border-top: 2px solid #121212;
  transform: rotate(-17deg);
}

.brand p {
  margin: 7px 0 0;
  font-size: 16px;
  letter-spacing: 0.01em;
}

.menu-button {
  border: 0;
  background: transparent;
  display: grid;
  gap: 8px;
  padding: 6px 0;
  cursor: default;
}

.menu-button span {
  display: block;
  width: 46px;
  border-top: 3px solid #131313;
}

.menu-button span:last-child {
  width: 28px;
  margin-left: auto;
}

.hero {
  text-align: center;
  padding-top: clamp(84px, 10vw, 140px);
}

.hero h1 {
  margin: 0;
  font-size: clamp(44px, 6vw, 72px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 16px 0 0;
  font-size: clamp(14px, 1.6vw, 19px);
  font-weight: 400;
}

.line-art {
  margin-top: clamp(42px, 6vw, 86px);
}

.line-art svg {
  width: 100%;
  height: auto;
}

.stroke-only path,
.stroke-only circle {
  fill: none;
  stroke: var(--line);
  stroke-width: 2.4;
}

.video-section {
  margin: clamp(62px, 8vw, 120px) auto 0;
  max-width: 920px;
}

.video-header h2 {
  margin: 0;
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 600;
  text-align: center;
}

.video-header p {
  margin: 12px 0 24px;
  text-align: center;
  font-size: 14px;
}

.video-header code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
}

.video-frame {
  border: 2px solid #161616;
  background: #f8f8f8;
  padding: 10px;
}

.video-frame video {
  width: 100%;
  display: block;
  background: #111;
}

.origami-steps {
  margin: clamp(44px, 7vw, 90px) auto 0;
  max-width: 980px;
}

.steps-header h2 {
  margin: 0;
  font-size: clamp(26px, 3.3vw, 40px);
  font-weight: 600;
  text-align: center;
}

.steps-header p {
  margin: 10px auto 0;
  max-width: 760px;
  font-size: 15px;
  text-align: center;
}

.steps-grid {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.step-card {
  border: 2px solid #161616;
  background: #f8f8f8;
  padding: 16px;
}

.step-card h3 {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 600;
}

.step-card p {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.55;
}

.step-figure {
  border: 2px dashed #1b1b1b;
  background: #f3f3f3;
  padding: 8px;
}

.step-figure svg {
  width: 100%;
  height: auto;
  display: block;
}

.step-figure path,
.step-figure rect {
  fill: none;
  stroke: #121212;
  stroke-width: 2.4;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.site-footer {
  margin: clamp(40px, 7vw, 84px) auto 0;
  max-width: 980px;
  border-top: 2px solid #161616;
  padding-top: 18px;
}

.site-footer h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 600;
}

.footer-text {
  margin: 8px 0 0;
  font-size: 15px;
}

.social-links {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.social-links li {
  margin: 0;
}

.social-links a {
  display: inline-block;
  text-decoration: none;
  color: #111;
  border: 2px solid #161616;
  background: #f8f8f8;
  padding: 8px 12px;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.social-links a:hover,
.social-links a:focus-visible {
  background: #e6e6e6;
}

@keyframes lineReveal {
  0% {
    stroke-dashoffset: 390;
  }
  40% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes foldA {
  0%,
  12% {
    opacity: 0;
    transform: rotateY(-80deg) scale(0.85);
  }
  28%,
  76% {
    opacity: 1;
    transform: rotateY(0deg) scale(1);
  }
  100% {
    opacity: 0.4;
    transform: rotateY(-16deg) scale(0.97);
  }
}

@keyframes foldB {
  0%,
  20% {
    opacity: 0;
    transform: rotateX(80deg) translateY(-8px);
  }
  36%,
  80% {
    opacity: 1;
    transform: rotateX(0deg) translateY(0);
  }
  100% {
    opacity: 0.45;
    transform: rotateX(22deg) translateY(-2px);
  }
}

@keyframes foldC {
  0%,
  18% {
    opacity: 0;
    transform: rotateY(80deg) scale(0.86);
  }
  34%,
  82% {
    opacity: 1;
    transform: rotateY(0deg) scale(1);
  }
  100% {
    opacity: 0.45;
    transform: rotateY(16deg) scale(0.97);
  }
}

@keyframes craneFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  40% {
    transform: translateY(-12px) rotate(1deg);
  }
  70% {
    transform: translateY(-8px) rotate(-1deg);
  }
}

@keyframes glowPulse {
  0%,
  100% {
    transform: scale(0.9);
    opacity: 0.32;
  }
  50% {
    transform: scale(1.12);
    opacity: 0.55;
  }
}

@keyframes sparkMove {
  0%,
  100% {
    opacity: 0;
    transform: translateY(0) rotate(45deg) scale(0.5);
  }
  28%,
  64% {
    opacity: 0.9;
    transform: translateY(-8px) rotate(45deg) scale(1);
  }
}

@keyframes textRise {
  0%,
  100% {
    opacity: 0.68;
    transform: translateY(0);
  }
  45% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

@media (max-width: 640px) {
  html,
  body {
    height: auto;
    overflow: auto;
  }

  .page {
    min-height: 100vh;
    padding: 16px 14px 14px;
  }

  .topbar {
    align-items: center;
  }

  .brand-mark {
    font-size: 34px;
  }

  .brand-mark::after {
    top: 17px;
    width: 74px;
  }

  .brand p {
    font-size: 12px;
    margin-top: 4px;
  }

  .menu-button {
    gap: 6px;
    padding-top: 0;
  }

  .menu-button span {
    width: 34px;
    border-top-width: 2px;
  }

  .menu-button span:last-child {
    width: 22px;
  }

  .hero {
    padding-top: 10px;
  }

  .hero h1 {
    font-size: clamp(30px, 10vw, 40px);
  }

  .subtitle {
    margin-top: 6px;
    font-size: 13px;
  }

  .line-art {
    display: none;
  }

  .video-section {
    margin: 14px auto 0;
    max-width: none;
    width: 100%;
  }

  .video-header h2 {
    font-size: clamp(20px, 7vw, 28px);
  }

  .video-header p {
    display: none;
  }

  .video-frame {
    padding: 6px;
  }

  .video-frame video {
    width: 100%;
    object-fit: contain;
  }

  .origami-steps {
    margin-top: 22px;
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .step-card {
    padding: 12px;
  }

  .step-card h3 {
    font-size: 18px;
  }

  .step-card p,
  .steps-header p {
    font-size: 13px;
  }

  .site-footer {
    margin-top: 26px;
    padding-top: 14px;
  }

  .site-footer h2 {
    font-size: 20px;
  }

  .footer-text {
    font-size: 13px;
  }

  .social-links {
    flex-direction: column;
  }

  .social-links a {
    width: 100%;
    font-size: 13px;
  }

  .loader-scene {
    width: min(84vw, 360px);
  }

  .loader-text {
    width: 90%;
    font-size: clamp(18px, 6vw, 26px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader-crane,
  .loader-glow,
  .loader-spark,
  .loader-text,
  .paper-outline path,
  .paper-fill polygon {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
