/* Name:  Samuel Rangai
  Assignment:  COM19999
  Date:  November 22 2026 */
  
/* Site theme color settings */
:root {
  color-scheme: dark;
  --bg: #101311;
  --panel: #191e1a;
  --ink: #fff;
  --muted: #b5bcb3;
  --lime: #d3f58a;
  --line: #343c33;
  /* Soft green lighting for the welcome screen. */
  --welcome-background-glow: radial-gradient(ellipse at 50% 12%, #3c4b2a66, transparent 67%);
  --radius: 1.4rem
}

/* Base styles. */
* {
  box-sizing: border-box
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1rem/1.65 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif
}
a {
  color: inherit;
  text-underline-offset: 4px
}
button,a {
  touch-action: manipulation
}
button {
  font: inherit
}
::selection {
  background: var(--lime);
  color: var(--bg)
}

/* Shared content width used by most sections */
.content-width {
  width: min(1160px,calc(100% - 3rem));
  margin: auto
}

/* Reading progress bar. JavaScript updates its width as the reader scrolls. */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--lime);
  z-index: 12
}

/* Sticky navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #101311f0;
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line)
}
.nav .content-width {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 750;
  letter-spacing: .07em;
  white-space: nowrap
}
.navlinks {
  display: flex;
  gap: 1.5rem;
  align-items: center
}
.navlinks a {
  font-size: .9rem;
  text-decoration: none;
  color: var(--muted)
}
.navlinks a:hover {
  color: var(--lime)
}

/* Section labels and intro typography. */
.section-label {
  font-size: .875rem;
  font-weight: 650;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--lime);
  margin: 0 0 1.3rem
}
.page-intro {
  padding: 6rem 0 3rem
}
.intro-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 4rem;
  align-items: center
}
h1,h2,h3,p {
  margin-top: 0
}
h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -.04em;
  font-weight: 600;
  margin-bottom: 1.8rem
}
.research-question {
  color: #fff;
}
em {
  font-family: Georgia,serif;
  font-weight: 400
}
h2 em {
  color: var(--lime)
}

/* Reusable links styled as buttons, .primary gives the main action a lime fill. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 50px;
  padding: .75rem 1.35rem;
  font-size: .9rem;
  transition: background .2s,color .2s,transform .2s
}
.button:hover {
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-2px)
}
.button.primary {
  background: var(--lime);
  color: var(--bg);
  border-color: var(--lime)
}
.button.primary:hover {
  background: #e5ffb8
}
/* Small down arrow styling */
.scroll-down-link {
  position: fixed;
  bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
  left: 50%;
  z-index: 9;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: var(--lime);
  transform: translateX(-50%);
  animation: scroll-arrow-appear .35s ease both;
}

.scroll-down-link:hover {
  border-color: var(--lime);
}

.scroll-down-arrow {
  width: .65rem;
  height: .65rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  animation: scroll-arrow-bounce 1.2s ease-in-out 3;
}

@keyframes scroll-arrow-appear {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scroll-arrow-bounce {
  50% { transform: translateY(3px) rotate(45deg); }
}

/* Align both clips with the transparent opening in the TV image. */
.retro-tv {
  --tv-image-position: center;
  position: relative;
  align-self: center;
  justify-self: center;
  width: min(100%, 28rem);
}

.retro-tv--monkey { --tv-image-position: center 42%; }
.retro-tv--bean { --tv-image-position: 55% center; }

.tv-frame {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
}

.tv-clip {
  position: absolute;
  inset: 21% auto auto 13%;
  width: 58.25%;
  height: 57.5%;
  object-fit: cover;
  object-position: var(--tv-image-position);
}

/* Source citation text. */
.cite {
  font-size: .875rem;
  font-weight: 400
}

/* Shared research section spacing, headings, columns, and quotations. */
.section {
  padding: 5rem 0;
  border-bottom: 1px solid var(--line)
}
h2 {
  font-size: clamp(2.2rem,4vw,3.8rem);
  line-height: 1.1;
  letter-spacing: -.045em;
  font-weight: 550;
  margin-bottom: 1.5rem;
  max-width: 850px
}
h3 {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -.02em
}
.section-intro {
  font-size: 1.25rem;
  max-width: 760px
}
/* Research paragraphs use a larger reading size. */
.research-copy {
  font-size: 1.1875rem;
}
.two-column-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  margin-top: 2.5rem
}

.research-layout {
  grid-template-areas:
    "heading visual"
    "copy    visual";
  grid-template-rows: auto 1fr;
  row-gap: 1.5rem;
  margin-top: 0;
}
.research-layout > h2 {
  grid-area: heading;
  margin-bottom: 0;
}
.research-layout > .research-copy {
  grid-area: copy;
}
.research-layout > .music-demo,
.research-layout > .film-panel {
  grid-area: visual;
}

blockquote {
  margin: 1.8rem 0;
  padding: 0 0 0 1.2rem;
  border-left: 2px solid var(--lime)
}
/* Italicize quoted words in cards. */
blockquote p,
q {
  font-style: italic;
}

blockquote p {
  font-family: Georgia,serif;
  font-size: 1.35rem;
  line-height: 1.45;
  margin-bottom: .6rem
}

/* Keep quote credits and the notes directly below quotes muted*/
blockquote .cite,
blockquote + .note {
  color: var(--muted);
}

/* Music demo styling. */
.music-demo {
  --intro-width: calc(100% / 3);
  --clock-angle: 120deg;
  --intro-fill: #3b4933;
}

.music-demo,
.film-panel {
  align-self: start;
  min-width: 0;
  padding: clamp(1rem, 3vw, 1.8rem);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.music-demo .metric-row {
  margin-top: .5rem;
}

.music-demo .sample-legend {
  margin-bottom: 1rem;
}

.music-pause,
.film-replay {
  margin-top: 1rem;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: .45rem .85rem;
}

/* Supporting notes and quote cards. */
.note {
  font-size: .875rem;
  margin-bottom: 0
}
.quote-card {
  padding-top: 1.3rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--line)
}
.quote-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  margin-top: 1rem
}

/* Conclusion layout. */
.conclusion-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 3.5rem;
  margin-top: 1.5rem;
}

.conclusion-layout blockquote {
  margin-top: 0;
  margin-bottom: .75rem;
}

.takeaway {
  margin: 1.3rem 0 0;
  font-size: 1.375rem;
}

/* References list layout. */
.source-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0
}
.source-list li {
  padding: 1.4rem 0;
  border-top: 1px solid var(--line);
  font-size: 1.0625rem;
  scroll-margin-top: 7rem
}
.source-list li:target {
  background: #d3f58a0b
}
.source-list .source-label {
  color: var(--lime);
  display: block;
  font-size: .8125rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .6rem
}
.source-list p {
  margin-bottom: .6rem;
  max-width: 940px
}
.source-list a {
  overflow-wrap: anywhere
}
.source-list em {
  font-family: inherit;
  font-style: italic
}

/* Footer layout. */
footer {
  padding: 2rem 0 3rem;
  color: var(--muted);
  font-size: .875rem
}
footer .content-width {
  display: flex;
  justify-content: space-between;
  gap: 1rem
}

/* Scroll reveal */
.fade-in-on-scroll {
  transition: opacity .6s,transform .6s
}
.fade-in-on-scroll.waiting-to-fade-in {
  opacity: 0;
  transform: translateY(18px)
}

/* Small screens: stacks columns and allows for navigation links to scroll horizontally. */
@media(max-width:760px) {
  .content-width {
    width: calc(100% - 2rem)
  }
  .nav .content-width {
    display: block;
    padding: 1rem 0
  }
  .navlinks {
    gap: 1.15rem;
    overflow: auto;
    margin-top: .7rem;
    padding-bottom: .2rem
  }
  .navlinks a {
    font-size: .875rem;
    white-space: nowrap
  }
  .page-intro {
    padding-top: 3rem
  }
  .intro-layout,.two-column-grid,.quote-grid,.conclusion-layout {
    grid-template-columns: 1fr;
    gap: 2rem
  }
  .research-layout {
    grid-template-areas: "heading" "visual" "copy";
    grid-template-rows: auto;
    row-gap: 1.5rem;
  }
  .section {
    padding: 3.5rem 0
  }
  footer .content-width {
    display: block
  }
}

/* Welcome screen layout and styling */
[hidden] { display: none !important; }
body.welcome-open { overflow: hidden; }
.welcome {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: #fff;
  background: var(--welcome-background-glow), var(--bg);
  overflow: auto;
  transition: opacity .7s ease, transform .7s cubic-bezier(.22, 1, .36, 1);
}
.welcome::backdrop { background: transparent; }

.welcome-center {
  min-height: 100%;
  padding: 1.25rem;
  display: grid;
  grid-template-rows: minmax(4rem, 1fr) auto minmax(4rem, 1fr);
  justify-items: center;
  text-align: center;
}

.welcome-text {
  grid-row: 2;
  width: min(100%, 1120px);
  max-width: none;
  margin: 0;
  font-size: clamp(1.6rem, 5vw, 4rem);
  line-height: 1.2;
  text-wrap: balance;
  outline: none;
  transition: opacity .45s ease, transform .45s ease;
}

.welcome-text.is-changing {
  opacity: 0;
  transform: translateY(8px);
}

.welcome-action {
  grid-row: 3;
  align-self: start;
  padding-top: 1.25rem;
}

.welcome-action .button {
  cursor: pointer;
  animation: welcome-arrive .6s backwards;
}

.welcome.is-leaving { opacity: 0; transform: scale(1.04); pointer-events: none; }
body.site-entering .intro-layout { animation: intro-appear 1s .1s both; }
@keyframes welcome-arrive { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes intro-appear { from { opacity: 0; transform: translateY(35px) scale(.98); } to { opacity: 1; transform: none; } }

.question-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  color: #fff;
}
.question-transition-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--welcome-background-glow), var(--bg);
  animation: question-overlay-fade var(--question-move-duration) ease-out both;
}
.question-transition-overlay .welcome-lettering {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
}
@keyframes question-overlay-fade {
  0%, 10% { opacity: 1; }
  100% { opacity: 0; }
}

/* Shared visual styles for the music and film charts. */
.metric-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.8rem 0; }
.chart-number { display: flex; align-items: baseline; font-size: clamp(4.5rem, 8vw, 7rem); line-height: 1; letter-spacing: -.07em; color: var(--lime); font-variant-numeric: tabular-nums; }
.chart-number > span:last-child { font-size: .5em; margin-left: .15em; }
.timer-dial { position: relative; width: 75px; height: 75px; border: 1px solid #59664d; border-radius: 50%; background: repeating-conic-gradient(from 0deg, #59664d 0deg 1deg, transparent 1deg 30deg); box-shadow: inset 0 0 0 10px var(--panel); }
.timer-dial span { position: absolute; width: 2px; height: 25px; background: var(--lime); left: calc(50% - 1px); top: 50%; transform-origin: 50% 100%; transform: translateY(-100%) rotate(var(--clock-angle)); }
.timer-dial::after { content: ""; position: absolute; width: 7px; height: 7px; top: calc(50% - 3.5px); left: calc(50% - 3.5px); border-radius: 50%; background: var(--lime); }
.film-sample-chart { margin: 2rem 0; }
.visual-labels { display: flex; justify-content: space-between; font-size: .75rem; letter-spacing: .1em; color: var(--muted); margin-bottom: .8rem; }
.hook-timeline,
.film-share {
  display: flex;
  height: 46px;
  border-radius: 7px;
  overflow: hidden;
}
.timeline-intro { flex: 0 0 var(--intro-width); background: var(--intro-fill); }
.timeline-hook { flex: 1; background: var(--lime); }

/* The non-recycled bar and its legend dot use the same color. */
.film-panel { --non-recycled-color: #687762; }
.film-share { background: var(--non-recycled-color); }
.film-share span {
  width: 33.1307%;
  background: var(--lime);
  transform-origin: left;
  transform: scaleX(var(--film-progress, 1));
}
.sample-legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .8rem; margin-top: 1rem; color: var(--muted); }
.sample-legend b { display: inline-block; width: 7px; height: 7px; margin-right: 6px; background: var(--lime); border-radius: 50%; }
.film-panel .sample-legend span:last-child b { background: var(--non-recycled-color); }
.music-demo .sample-legend span:first-child b { background: var(--intro-fill); }

/* Flat white handwriting. Each path is one pen stroke from handwriting.js. */
.welcome-lettering {
  display: block;
  width: 100%;
  height: auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.welcome-text .welcome-lettering {
  height: clamp(200px, 56dvh, 460px);
}

.welcome-text[data-step="0"] .welcome-lettering {
  width: min(88%, 880px);
  height: auto;
  margin-inline: auto;
}

/* Fill modes keep delayed paths hidden and finished paths visible. */
.pen-stroke {
  opacity: 0;
  stroke-dasharray: var(--pen-dash);
  animation: pen-write var(--pen-time) linear var(--pen-start) both;
}

@keyframes pen-write {
  from { opacity: 0; stroke-dashoffset: var(--pen-dash); }
  3% { opacity: 1; }
  to { opacity: 1; stroke-dashoffset: 0; }
}

.pen-dot {
  animation-name: pen-dot;
}

@keyframes pen-dot {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Print the research and show the full film chart even mid-animation. */
@media print {
  .nav, .reading-progress-bar, .scroll-down-link, .music-pause, .film-replay, .retro-tv {
    display: none;
  }
  .welcome, .question-transition-overlay {
    display: none !important;
  }
  body {
    background: white;
    color: black;
  }
  .section {
    padding: 1rem 0;
    break-inside: avoid;
  }
  h1, h2, h3, p, .cite, .section-intro {
    color: black !important;
  }
  .fade-in-on-scroll.waiting-to-fade-in {
    opacity: 1;
    transform: none;
  }
  .two-column-grid, .conclusion-layout {
    display: block;
  }
  .source-list li, a {
    color: black;
  }
  .film-share span {
    transform: none;
  }
}

