/* create.css — page 6, "Create your own Extensions" (js/sections/create.js). */

.create {
  padding: clamp(80px, 14vh, 180px) 0 clamp(80px, 14vh, 160px);
}

.create__head {
  position: relative;
}

.create__title {
  display: grid;
  font-size: clamp(48px, 7.4vw, 124px);
  line-height: 1.04;
}

.create__line {
  display: block;
  will-change: transform, opacity;
}

.create__ch--0 {
  color: var(--c-m);
}

.create__ch--1 {
  color: var(--c-r);
}

.create__ch--2 {
  color: var(--ink-y);
}

.create__ch--3 {
  color: var(--c-g);
}

.create__ch--4 {
  color: var(--ink-c);
}

.create__ch--5 {
  color: var(--ink-b);
}

.create__title .dl-title {
  padding-bottom: 0.2em;
}

.create__title .dl-lines {
  height: 0.16em;
}

.create__title .dl-row {
  height: 0.04em;
}

.create__title .dl-row--b {
  top: 0.1em;
}

.create__body {
  position: relative;
  z-index: 2;
  margin-top: clamp(60px, 12vh, 140px);
}

/* ── band: beams under the deck ── */

.create__band {
  position: relative;
}

.create__beams {
  position: absolute;
  left: calc(50% - 50vw);
  width: 100vw;
  top: 26%;
  height: 34%;
  pointer-events: none;
  overflow: hidden;
}

/* a faint permanent rail + the travelling trail (::after) */
.create__beam {
  --c: #fff;
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  top: calc(var(--row) * 20%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--c) 30%, transparent) 15%, color-mix(in srgb, var(--c) 30%, transparent) 85%, transparent);
  border-radius: 2px;
}

.create__beam::after {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  width: 42vw;
  height: 7px;
  border-radius: 4px;
  background: linear-gradient(90deg, transparent, var(--c) 70%, #fff 96%, transparent);
  filter: drop-shadow(0 0 6px var(--c)) drop-shadow(0 0 14px var(--c));
  transform: translateX(-45vw);
  /* ease-in: the trail accelerates as it crosses */
  animation: beam-shoot 5s cubic-bezier(0.55, 0, 0.9, 0.5) infinite;
  animation-delay: calc(var(--row) * -0.83s - 0.3s);
}

@keyframes beam-shoot {
  0% {
    transform: translateX(-45vw);
    opacity: 0;
  }

  8% {
    opacity: 1;
  }

  62% {
    transform: translateX(105vw);
    opacity: 1;
  }

  62.01%,
  100% {
    transform: translateX(105vw);
    opacity: 0;
  }
}

.create__beam--m {
  --c: #ec008c;
  --row: 0;
}

.create__beam--r {
  --c: #ed1c24;
  --row: 1;
  animation-delay: -2.1s;
}

.create__beam--y {
  --c: #fff200;
  --row: 2;
}

.create__beam--g {
  --c: #00a651;
  --row: 3;
}

.create__beam--c {
  --c: #00aeef;
  --row: 4;
}

.create__beam--b {
  --c: #2e3192;
  --row: 5;
}

/* stagger by a scrambled order, not row order, so they never fire as a wave */
.create__beam--r::after {
  animation-delay: -3.4s;
}

.create__beam--y::after {
  animation-delay: -1.1s;
}

.create__beam--g::after {
  animation-delay: -4.2s;
}

.create__beam--c::after {
  animation-delay: -2.3s;
}

.create__beam--b::after {
  animation-delay: -0.4s;
}

.create__beam--m::after {
  animation-delay: -2.9s;
}

/* ── cards ── */

.create__deck {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 5vw, 80px);
}

.create__card {
  position: relative;
  display: grid;
  gap: 22px;
  padding: 28px 28px 24px;
  border-radius: 34px;
  background-color: #0b0b0c;
  /* film-grain noise: an SVG turbulence filter, inline (img-src allows data:) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  border: 1px solid rgb(255 255 255 / 0.1);
  box-shadow:
    0 30px 60px rgb(0 0 0 / 0.5),
    inset 0 1px 0 rgb(255 255 255 / 0.06);
}

:root[data-theme='light'] .create__card {
  background-color: #1a1a1c;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) .create__card {
    background-color: #1a1a1c;
  }
}

.create__bezel {
  aspect-ratio: 1;
  border-radius: 22px;
  overflow: hidden;
  background-color: #444446;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  box-shadow: inset 0 2px 10px rgb(0 0 0 / 0.55);
  padding: 4%;
}

.create__screen {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.create__dpad {
  height: 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 6px;
}

.create__dpad::before {
  content: '';
  width: 26px;
  height: 26px;
  background:
    linear-gradient(#262628, #262628) center / 9px 26px no-repeat,
    linear-gradient(#262628, #262628) center / 26px 9px no-repeat;
}

.create__dpad::after {
  content: '';
  width: 40px;
  height: 18px;
  background:
    radial-gradient(circle, #262628 7px, transparent 7.5px) 0 50% / 18px 18px no-repeat,
    radial-gradient(circle, #262628 7px, transparent 7.5px) 100% 50% / 18px 18px no-repeat;
}

/* ── notes ── */

.create__notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 5vw, 80px);
  margin-top: clamp(40px, 7vh, 72px);
}

.create__note {
  padding-inline: 8px;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.9s var(--ease-brand);
}

.create__note.is-in {
  opacity: 1;
  transform: none;
}

.create__note h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
}

.create__note p {
  color: var(--fg-muted);
  font-size: 14.5px;
  line-height: 1.6;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.create__note--m h3 {
  color: var(--ink-m);
}

.create__note--y h3 {
  color: var(--ink-y);
}

.create__note--c h3 {
  color: var(--ink-c);
}

html:not(.js) .create__note {
  opacity: 1;
  transform: none;
}

@media (max-width: 760px) {
  .create__deck,
  .create__notes {
    grid-template-columns: 1fr;
  }

  .create__deck {
    max-width: 360px;
    margin-inline: auto;
  }

  .create__beams {
    top: 4%;
    height: 92%;
  }

}
