/* Reusable pieces: buttons, hero bits, cards, videos, steps, FAQ, brief, contact */

/* ---------- Buttons ---------- */

/* Chunky buttons with a pressed-down bottom edge, like Roblox's old UI */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.4rem;
  border: 0;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  box-shadow: 0 4px 0 var(--shadow-edge), inset 0 0 0 1px var(--line-2);
  font-family: var(--display);
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--shadow-edge), inset 0 0 0 1px var(--line-2);
}

.btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--shadow-edge), inset 0 0 0 1px var(--line-2);
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: 0 4px 0 var(--accent-dark);
}

.btn--primary:hover {
  box-shadow: 0 6px 0 var(--accent-dark);
}

.btn--primary:active {
  box-shadow: 0 1px 0 var(--accent-dark);
}

.btn--small {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

/* Theme toggle: shows the sun in dark mode, the moon in light mode */
.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, transform 0.3s;
}

.icon-btn:hover {
  color: var(--text);
  transform: rotate(20deg);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:root[data-theme="dark"] .icon-moon,
:root[data-theme="light"] .icon-sun {
  display: none;
}

/* ---------- Scroll progress ---------- */

/* Floating rail on the left that fills as you scroll. --p (0 to 1) is set in main.js */
.progress {
  --p: 0;
  position: fixed;
  top: 50%;
  left: 18px;
  z-index: 50;
  width: 4px;
  height: 40vh;
  border-radius: 99px;
  background: var(--line);
  transform: translateY(-50%);
}

.progress__fill {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(var(--accent-dark), var(--accent));
  box-shadow: 0 0 12px var(--accent);
  transform: scaleY(var(--p));
  transform-origin: top;
}

/* Glowing knob at the end of the fill */
.progress::after {
  content: "";
  position: absolute;
  top: calc(var(--p) * 100%);
  left: 50%;
  width: 12px;
  height: 12px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 14px var(--accent);
  transform: translate(-50%, -50%);
}

@media (max-width: 860px) {
  .progress {
    left: 6px;
    width: 3px;
  }

  .progress::after {
    width: 9px;
    height: 9px;
  }
}

/* ---------- Hero bits ---------- */

.status {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.4rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line-2);
  border-radius: 99px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.88rem;
}

.status[hidden] {
  display: none;
}

.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3ecf6e;
  box-shadow: 0 0 10px #3ecf6e;
  animation: pulse 2.2s ease-in-out infinite;
}

.status__time {
  padding-left: 0.5rem;
  border-left: 1px solid var(--line-2);
}

@keyframes pulse {
  50% {
    opacity: 0.4;
  }
}

/* Italic accent words in headings */
h1 em,
h2 em {
  font-style: italic;
  font-weight: 900;
  color: var(--accent);
}

/* At-a-glance card */

.facts {
  padding: 1.4rem 1.5rem 0.6rem;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--accent-soft);
}

.facts__title {
  margin-bottom: 0.4rem;
  font-family: var(--display);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.facts div {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 1rem;
  padding-block: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.facts div:last-child {
  border-bottom: 0;
}

.facts dt {
  color: var(--muted);
  font-size: 0.9rem;
}

.facts dd {
  font-size: 0.97rem;
}

/* ---------- Ticker band ---------- */

.ticker {
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: var(--surface);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.ticker__track {
  display: flex;
  width: max-content;
  animation: ticker 40s linear infinite;
}

.ticker__track span {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding: 1.1rem 1.25rem;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ticker__track span::after {
  content: "✦";
  color: var(--accent);
  font-size: 0.8rem;
}

@keyframes ticker {
  to {
    transform: translateX(-50%);
  }
}

/* ---------- Cards ---------- */

/* Spotlight: a soft glow that follows the cursor (position set in main.js) */
.spotlight {
  position: relative;
  isolation: isolate;
}

.spotlight::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.spotlight:hover::after {
  opacity: 1;
}

.card {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
  border-color: var(--line-2);
}

.card h3 {
  margin-bottom: 0.6rem;
}

.card p {
  color: var(--muted);
  font-size: 0.95rem;
}

.card__big {
  display: block;
  margin-bottom: 0.9rem;
  font-family: var(--display);
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--accent);
}

/* Tags */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.88rem;
}

/* Skill card: description first, tags underneath */
.card .card__text {
  margin-bottom: 1rem;
}

/* ---------- Videos ---------- */

.videos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

/* Thumbnail: click anywhere on it to open the viewer */
.clip {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.clip__frame {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: #000;
  transition: border-color 0.2s, transform 0.2s;
}

.clip__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s, opacity 0.2s;
}

.clip__play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 4px 0 var(--accent-dark), 0 8px 24px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -50%);
  transition: transform 0.15s;
}

/* Play triangle */
.clip__play::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent var(--accent-text);
  transform: translate(-50%, -50%);
}

.clip__time {
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
}

.clip:hover .clip__frame,
.clip:focus-visible .clip__frame {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.clip:hover img {
  transform: scale(1.04);
}

.clip:hover .clip__play {
  transform: translate(-50%, -50%) scale(1.1);
}

.clip__label strong {
  display: block;
  font-family: var(--display);
  font-size: 0.98rem;
  font-weight: 700;
}

.clip__label span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Viewer: a big player in a window over a dimmed page */
.viewer {
  width: min(1100px, calc(100% - 2rem));
  max-width: none;
  max-height: calc(100% - 2rem);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7);
}

.viewer::backdrop {
  background: rgba(5, 6, 8, 0.82);
  backdrop-filter: blur(6px);
}

.viewer__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.9rem 0.7rem 1.25rem;
}

.viewer__count {
  color: var(--muted);
  font-size: 0.9rem;
}

.viewer__stage {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: 68vh;
  margin-inline: auto;
  background: #000;
}

.viewer__stage video,
.viewer__stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.viewer__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 1rem 1.25rem 1.25rem;
}

.viewer__foot strong {
  font-family: var(--display);
  font-size: 1.1rem;
}

.viewer__foot p {
  color: var(--muted);
  font-size: 0.93rem;
}

.viewer__nav {
  display: flex;
  gap: 0.6rem;
}

.empty {
  padding: 3rem 1.5rem;
  border: 1px dashed var(--line-2);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.empty a {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- FAQ ---------- */

.faq {
  max-width: 50rem;
  border-top: 1px solid var(--line);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.15rem;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.3rem;
  line-height: 1;
  transition: transform 0.2s;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details p {
  padding-bottom: 1.2rem;
  color: var(--muted);
}

/* ---------- Brief builder ---------- */

.contact {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  align-items: start;
  gap: 1.25rem;
}

.brief {
  display: grid;
  gap: 1.1rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.brief fieldset {
  border: 0;
}

.brief legend,
.brief label {
  color: var(--muted);
  font-size: 0.9rem;
}

.brief legend {
  margin-bottom: 0.6rem;
}

.brief label {
  display: grid;
  gap: 0.4rem;
}

.brief__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.brief input,
.brief select,
.brief textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.97rem;
}

.brief textarea {
  resize: vertical;
}

.brief input:focus,
.brief select:focus,
.brief textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pick {
  position: relative;
}

.pick input {
  position: absolute;
  opacity: 0;
}

.pick span {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line-2);
  border-radius: 99px;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.pick input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-text);
}

.pick input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.brief__preview {
  padding: 0.9rem 1rem;
  border: 1px dashed var(--line-2);
  border-radius: 10px;
}

.brief__preview span {
  color: var(--muted);
  font-size: 0.8rem;
}

.brief__preview pre {
  margin-top: 0.3rem;
  font-family: inherit;
  font-size: 0.93rem;
  white-space: pre-wrap;
}

.brief .btn {
  justify-self: start;
}

/* Discord card */

.contact__card {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  padding: 1.75rem;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--accent-soft), 0 30px 60px -30px rgba(0, 0, 0, 0.6);
}

.contact__card p {
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.contact__label {
  color: var(--muted);
  font-size: 0.85rem;
}

.contact__name {
  font-family: var(--display);
  font-size: 1.9rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

@media (max-width: 800px) {
  .contact,
  .brief__row {
    grid-template-columns: 1fr;
  }

  .contact__card {
    position: static;
  }
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  z-index: 60;
  max-width: calc(100% - 2rem);
  padding: 0.75rem 1.15rem;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.93rem;
  transform: translateX(-50%);
}

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s, transform 0.6s;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}
