/*
   APHROFLUFF PORTFOLIO

   Start with section 01 for colors, overall width, and your background image.
   Find individual page sections by their numbered headings below.
   Desktop styles come first; tablet and phone adjustments are at the end.
   If a change does not appear on a smaller screen, check sections 12 and 13.
*/

/* ==========================================================================
   01. EDITABLE SETTINGS - colors, page width, and background
   ========================================================================== */

:root {
  color-scheme: dark;
  --ink: #111821;
  --text: #f3eee6;
  --muted: #aaaeb8;
  --blue: #8fb6ff;
  --line: #ffffff20;
  /* Shared maximum width of all page sections. */
  --content-width: 920px;
  --grain: url("assets/grain.png");
  /* ADD YOUR BACKGROUND IMAGE HERE.
     Replace none with url('assets/your-background.jpg').
     The image repeats and moves from top left to bottom right.
     Adjust tile size, speed, tint, and blur below. No image is set yet. */
  --background-image: none;
  --background-tile-size: 640px;
  --background-speed: 70s;
  /* Overlay opacity: 0 = no tint, 1 = completely dark. */
  --background-tint: 0.82;
  --background-blur: 2px;
}

/* ==========================================================================
   02. BASE STYLES - browser defaults, text, and keyboard focus
   ========================================================================== */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 32px;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

button {
  font: inherit;
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 6px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

::selection {
  background: #456bc0;
  color: white;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 20;
  padding: 14px;
  background: var(--ink);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: none;
}

/* ==========================================================================
   03. BACKGROUND - image, dark overlay, grain, and movement
   ========================================================================== */

.background {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 15% 5%, #203c6359, transparent 55%),
    radial-gradient(ellipse at 95% 85%, #79502938, transparent 60%), var(--ink);
}

.background-image {
  position: absolute;
  inset: calc(-1 * var(--background-tile-size) - 30px);
  background-image: var(--background-image);
  background-repeat: repeat;
  background-size: var(--background-tile-size) var(--background-tile-size);
  filter: blur(var(--background-blur));
  animation: drift var(--background-speed) linear infinite;
}

.background-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  opacity: var(--background-tint);
}

.background::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grain);
  opacity: 0.5;
}

@keyframes drift {
  to {
    transform: translate(
      var(--background-tile-size),
      var(--background-tile-size)
    );
  }

}
body.motion-paused .background-image {
  animation-play-state: paused;
}

/* ==========================================================================
   04. PAGE WIDTH AND INTRODUCTION
   ========================================================================== */

main,
footer {
  width: min(100% - 80px, var(--content-width));
  margin-inline: auto;
}

/* Leave a glimpse of Creators at the bottom of the first screen. */
.hero {
  margin: 0 auto;
  padding-top: 200px;
  min-height: calc(100svh - 160px);
}

h1 {
  font-size: clamp(32px, 4.4vw, 54px);
  font-weight: 550;
  letter-spacing: -1.7px;
  line-height: 1.2;
  text-align: center;
  margin-bottom: 32px;
}

h1 span {
  color: var(--blue);
}

/* ==========================================================================
   05. VIDEO PLAYERS - frames, thumbnails, and play buttons
   ========================================================================== */

.video-frame {
  position: relative;
  /* Keep the playable area at 16:9, excluding the decorative border. */
  box-sizing: content-box;
  aspect-ratio: 16 / 9;
  border: 1px solid #ffffff30;
  border-radius: 10px;
  background: #080e16;
  overflow: hidden;
  box-shadow:
    0 8px 24px #0004,
    0 1px 0 #ffffff0a;
}

.hero-video {
  border: 6px solid #252e3d;
  outline: 1px solid #8799b342;
  box-shadow:
    0 18px 65px #0007,
    0 0 55px #4677c617;
  border-radius: 20px;
}

/* Round the video itself as well as its outer frame, including playback. */
.hero-video > .video-poster,
.hero-video > iframe {
  border-radius: 14px;
  clip-path: inset(0 round 14px);
}

.video-poster {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
}

.video-poster > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.25s;
}

.video-poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 45%, #080e1640);
  pointer-events: none;
}

.play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  padding-left: 4px;
  width: 58px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid #ffffff70;
  background: linear-gradient(#345b9eee, #1e3d70ee);
  box-shadow:
    inset 0 1px #ffffff2b,
    0 4px 18px #0007;
  font-size: 20px;
  color: white;
  transition:
    background 0.2s,
    box-shadow 0.2s;
}

.video-poster:hover > img {
  filter: brightness(1.08);
}

.video-poster:hover .play,
.video-poster:focus-visible .play {
  background: #3a67b3;
  box-shadow:
    0 0 0 5px #8fb6ff22,
    0 5px 20px #0007;
}

.video-caption {
  display: flex;
  justify-content: space-between;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
  padding: 28px 20px 16px;
  background: linear-gradient(transparent, #080e16dd);
  font-size: 13px;
  font-weight: 600;
}

.video-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ==========================================================================
   06. SHARED SECTIONS - vertical spacing and headings
   ========================================================================== */

/* Default gap between sections. Creators has its own gap below. */
.section {
  margin-top: 112px;
}

.section-heading {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
}

h2 {
  font-size: 28px;
  font-weight: 550;
  letter-spacing: -0.8px;
}

.heading-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, #b7916755, #b7916710);
}

/* ==========================================================================
   07. CREATORS - cards, images, names, and follower counts
   ========================================================================== */

/* Gap from the introduction to Creators. */
.creators {
  margin-inline: auto;
  margin-top: 0px;
}

.creator-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.creator {
  padding: 8px 8px 16px;
  border: 1px solid #b7916738;
  border-radius: 16px;
  text-align: center;
  background: var(--grain), linear-gradient(135deg, #393027, #252322);
  box-shadow:
    inset 0 1px #ffffff08,
    0 4px 12px #0002;
}

.creator > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 9px;
}

.creator > div {
  padding: 9px 0 0;
  overflow-wrap: anywhere;
}

/* Creator name size (desktop). */
.creator h3 {
  font-size: 27px;
  font-weight: 600;
  line-height: 1.2;
}

/* Follower count size and its distance from the name (desktop). */
.creator p {
  margin-top: 4px;
  font-size: 21px;
  line-height: 1.25;
  color: #c0b2a4;
}

/* ==========================================================================
   08. WORK - video grid
   ========================================================================== */

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* ==========================================================================
   09. MY VIDEO - player and channel information
   ========================================================================== */

.favorite {
  margin-inline: auto;
}

.favorite-card {
  border: 1px solid #b7916745;
  border-radius: 12px;
  overflow: hidden;
  background: var(--grain), linear-gradient(135deg, #393027, #262321);
  box-shadow: 0 12px 32px #0003;
}

.favorite-card .video-frame {
  border: 0;
  border-radius: 0;
}

.channel-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
}

.channel-avatar {
  border-radius: 50%;
}

.channel-bar h3 {
  font-size: 16px;
  font-weight: 600;
}

.channel-bar p {
  font-size: 12px;
  color: #c0b2a4;
  margin-top: 6px;
}

.channel-bar p span {
  padding-inline: 0;
}

/* ==========================================================================
   10. CONTACT
   ========================================================================== */

.contact {
  text-align: center;
  border-top: 1px solid var(--line);
  padding: 64px 0 76px;
}

.contact h2 {
  margin-bottom: 20px;
}

.email {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  color: var(--blue);
  font-size: clamp(17px, 2.8vw, 30px);
  letter-spacing: -0.5px;
  text-decoration: underline;
  text-decoration-color: #8fb6ff40;
  text-underline-offset: 9px;
  text-decoration-thickness: 1px;
}

.email:hover {
  text-decoration-color: var(--blue);
}

/* ==========================================================================
   11. FOOTER
   ========================================================================== */

footer a:hover {
  color: var(--blue);
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border-top: 1px solid var(--line);
  padding-block: 24px;
  font-size: 12px;
  color: var(--muted);
}

footer a,
.motion-toggle {
  padding-block: 10px;
}

.motion-toggle {
  color: var(--muted);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.motion-toggle:hover {
  color: var(--text);
}

/* ==========================================================================
   12. TABLETS AND SMALLER - overrides apply at 760px and below
   ========================================================================== */

@media (max-width: 760px) {
  main,
  footer {
    width: calc(100% - 40px);
  }

  .hero {
    padding-top: 54px;
    min-height: calc(100svh - 128px);
  }

  .creator > div {
    padding-top: 8px;
  }
  /* clamp(minimum, fluid size, maximum) scales text with screen width. */
  .creator h3 {
    font-size: clamp(13px, calc(6vw - 15px), 23px);
  }

  .creator p {
    font-size: clamp(9px, calc(6vw - 19px), 19px);
  }

  .section {
    margin-top: 80px;
  }

  .creators {
    margin-top: 40px;
  }

  .work-grid {
    gap: 16px;
  }

  .channel-bar h3 {
    font-size: 14px;
  }

}
/* ==========================================================================
   13. PHONES - overrides apply at 480px and below
   ========================================================================== */

@media (max-width: 480px) {
  h1 {
    letter-spacing: -1px;
    font-size: 32px;
    margin-bottom: 26px;
  }

  .desktop-break {
    display: none;
  }

  .hero-video {
    border-width: 4px;
  }

  h2 {
    font-size: 25px;
  }

  .section-heading {
    margin-bottom: 20px;
  }

  .creator-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .creator {
    padding: 6px 6px 13px;
    border-radius: 13px;
  }

  .creator > div {
    padding-top: 7px;
  }
  /* clamp(minimum, fluid size, maximum) scales text with screen width. */
  .creator h3 {
    font-size: clamp(13px, calc(8vw - 15px), 19px);
  }

  .creator p {
    font-size: clamp(9px, calc(8vw - 19px), 15px);
  }

  .work-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .channel-bar {
    padding: 14px;
    gap: 10px;
  }

  .channel-avatar {
    width: 34px;
    height: 34px;
  }

  .channel-bar p {
    font-size: 11px;
  }

  .contact {
    padding-block: 44px 52px;
  }

  .email {
    gap: 10px;
    letter-spacing: -0.4px;
  }

  footer {
    flex-wrap: wrap;
    gap: 4px 14px;
    font-size: 11px;
  }

  .motion-toggle {
    order: 3;
    width: 100%;
    text-align: left;
  }

}
/* ==========================================================================
   14. REDUCED MOTION - respect the visitor's device setting
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .motion-toggle {
    display: none;
  }

}
