/* Config & Variables */
:root {
  /* Palette */
  --bg: #080808;
  --text-muted: #444;
  --text-light: #e5e5e5;
  --accent: #d4c5a3;

  /* Timeline Scopes */
  timeline-scope: --s1, --s2, --s3, --s4, --s5, --s6;
}

/* Base / Reset */
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-light);
  font-family: "Manrope", sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Layout: Sticky Visuals (Right) */
.sticky-visual {
  position: fixed;
  top: 0;
  right: 0;
  width: 50%;
  height: 100vh;
  display: grid;
  place-items: center;
  z-index: 10;
  pointer-events: none;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.shape-container {
  position: absolute;
  width: 400px;
  height: 400px;
  display: grid;
  place-items: center;
  opacity: 0;

  /* Entry/Exit Animation */
  animation-name: shape-fade;
  animation-fill-mode: both;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Timeline Linkages */
.shape-1 {
  animation-timeline: --s1;
}
.shape-2 {
  animation-timeline: --s2;
}
.shape-3 {
  animation-timeline: --s3;
}
.shape-4 {
  animation-timeline: --s4;
}
.shape-5 {
  animation-timeline: --s5;
}
.shape-6 {
  animation-timeline: --s6;
}

/* Layout: Content (Left) */
.content {
  width: 50%;
  padding-bottom: 20vh;
  position: relative;
  z-index: 20;
}

header {
  height: 90vh;
  display: flex;
  align-items: center;
  padding-left: 10vw;
}

.scroll-section {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 10vw;
  padding-right: 2rem;

  /* View Timeline Source */
  view-timeline-axis: block;
  view-timeline-inset: 40% 40%;
}

/* Section IDs */
.s1 {
  view-timeline-name: --s1;
}
.s2 {
  view-timeline-name: --s2;
}
.s3 {
  view-timeline-name: --s3;
}
.s4 {
  view-timeline-name: --s4;
}
.s5 {
  view-timeline-name: --s5;
}
.s6 {
  view-timeline-name: --s6;
}

.closing-section {
  height: 60vh;
  display: flex;
  align-items: center;
  padding-left: 10vw;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 10vh;
}

/* Components: Typography */
h1 {
  font-size: 1.5rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 300;
  margin: 0;
  color: var(--accent);
  opacity: 0.8;
}

.title-large {
  display: block;
  font-size: 5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-light);
  margin-top: 1rem;
  line-height: 1;
}

.focus-text {
  font-size: 3.5rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--text-muted);
  margin: 0;
  max-width: 500px;
  letter-spacing: -0.02em;

  /* Magnify Effect */
  animation: content-focus linear both;
  animation-timeline: view();
  animation-range: cover 0% cover 100%;
}

.description {
  font-size: 1.1rem;
  color: #666;
  margin-top: 1.5rem;
  max-width: 420px;
  line-height: 1.7;
  font-weight: 300;
  border-left: 2px solid var(--accent);
  padding-left: 1.5rem;

  /* Sync with Header */
  animation: content-focus linear both;
  animation-timeline: view();
  animation-range: cover 0% cover 100%;
}

.closer {
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--text-muted);
}
.closer strong {
  display: block;
  font-size: 2rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

/* Components: Shapes (CSS Art) */
/* 1. Circle Outline */
.circle-outline {
  width: 300px;
  height: 300px;
  border: 2px solid var(--text-light);
  border-radius: 50%;
  box-shadow: 0 0 60px rgba(255, 255, 255, 0.05);
}

/* 2. Textured Stone */
.stone-block {
  width: 250px;
  height: 350px;
  background: linear-gradient(135deg, #333, #111);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.stone-block::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.4'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* 3. Grid */
.grid-lines {
  width: 300px;
  height: 300px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 20px;
}
.grid-box {
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.grid-box:nth-child(1) {
  border-top: 0;
  border-left: 0;
}
.grid-box:nth-child(4) {
  border-bottom: 0;
  border-right: 0;
}

/* 4. Balance */
.balance {
  width: 300px;
  height: 300px;
  position: relative;
}
.b-circle {
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  mix-blend-mode: exclusion;
}
.b-1 {
  background: #fff;
  top: 20%;
  left: 20%;
}
.b-2 {
  background: #666;
  bottom: 20%;
  right: 20%;
}

/* 5. Light Orb */
.light-orb {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 30% 30%,
    var(--accent),
    transparent 60%
  );
  filter: blur(40px);
  opacity: 0.6;
}

/* 6. End Line */
.end-line {
  width: 2px;
  height: 300px;
  background: var(--text-light);
  position: relative;
}
.end-line::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 1px;
  background: var(--text-light);
}

/* Components: Progress Indicators */

/* Desktop: Vertical Line on Border */
.desktop-progress {
  position: absolute;
  left: -1px;
  top: 0;
  width: 3px;
  height: 100%;
  background: var(--accent);
  transform-origin: top;
  transform: scaleY(0);
  animation: progress-grow linear;
  animation-timeline: scroll();
  z-index: 20;
}

/* Mobile: Circular Widget */
.mobile-progress {
  display: none;
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  z-index: 100;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 50%;
  padding: 5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}

.mobile-progress svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-circle {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: circle-grow linear;
  animation-timeline: scroll();
}

.track-circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 8;
}

/* Keyframes */
@keyframes shape-fade {
  entry 0% {
    opacity: 0;
    transform: translateY(40px) scale(0.9);
  }
  entry 100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  exit 0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  exit 100% {
    opacity: 0;
    transform: translateY(-40px) scale(1.1);
  }
}

@keyframes content-focus {
  0% {
    filter: blur(12px);
    opacity: 0;
    transform: scale(0.8) translateY(40px);
    border-color: transparent;
  }
  45%,
  55% {
    filter: blur(0);
    opacity: 1;
    transform: scale(1) translateY(0);
    color: var(--text-light);
    border-color: var(--accent);
  }
  100% {
    filter: blur(12px);
    opacity: 0;
    transform: scale(0.95) translateY(-40px);
    border-color: transparent;
  }
}

@keyframes progress-grow {
  to {
    transform: scaleY(1);
  }
}

@keyframes circle-grow {
  to {
    stroke-dashoffset: 0;
  }
}

/*  Responsive Design  */
@media (max-width: 768px) {
  .sticky-visual {
    opacity: 0.1;
    width: 100%;
    z-index: -1;
    border-left: none;
  }

  .content {
    width: 100%;
  }
  .scroll-section {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  header {
    padding-left: 1.5rem;
  }

  /* Adjust Typography */
  .focus-text {
    font-size: 2rem;
  }
  .title-large {
    font-size: 3.5rem;
  }

  /* Toggle Progress Indicators */
  .desktop-progress {
    display: none;
  }
  .mobile-progress {
    display: block;
  }
}