/*
 * The two internal sites from the Apple case study, rebuilt from the
 * originals: the Media Content Interns team site and Task Tally.
 * Both are laid out for a 1512 px wide MacBook Air screen; the case study
 * shows them in a laptop frame (see .cs-laptop in case-study.css).
 * They always render light, like the real pages.
 */

@font-face {
  font-family: "MCI Condensed";
  font-weight: 700;
  src: local("HelveticaNeue-CondensedBold"), local("Helvetica Neue Condensed Bold"), local("Arial Narrow Bold"), local("ArialNarrow-Bold");
}

:root {
  --text: #191919;
  --link: #485eaf;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --condensed: "MCI Condensed", "Arial Narrow", var(--sans);
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 1100px;
  background: #fff;
  color: var(--text);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img,
video {
  display: block;
  max-width: 100%;
}

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

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

/* ---------- motion: blocks rise in as they scroll into the screen ---------- */

.motion [data-rise] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--delay, 0s);
}

.motion [data-rise].in {
  opacity: 1;
  transform: none;
}

/* =========================================================
   Media Content Interns
   ========================================================= */

.mci-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 30px;
  height: 201px;
  padding: 18px 0 0 193px;
  background: #fff;
}

.mci-menu-button {
  display: grid;
  gap: 10px;
  width: 40px;
  padding: 6px 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.mci-menu-button span {
  height: 2px;
  background: #000;
  transition: transform 0.3s ease, opacity 0.2s ease;
}

.mci-menu-open .mci-menu-button span:nth-child(1) { transform: translateY(12px) rotate(45deg); }
.mci-menu-open .mci-menu-button span:nth-child(2) { opacity: 0; }
.mci-menu-open .mci-menu-button span:nth-child(3) { transform: translateY(-12px) rotate(-45deg); }

.mci-wordmark {
  font-family: var(--condensed);
  font-size: 39px;
  font-weight: 700;
  font-stretch: condensed;
  line-height: 1;
  letter-spacing: -0.005em;
  color: #000;
}

/* the hamburger drops a menu over the portraits */
.mci-menu {
  position: absolute;
  top: 201px;
  left: 0;
  right: 0;
  z-index: 1;
  display: flex;
  gap: 56px;
  padding: 36px 193px 44px;
  background: #fff;
  box-shadow: 0 24px 40px -24px rgba(0, 0, 0, 0.25);
  transform: translateY(-12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.mci-menu-open .mci-menu {
  transform: none;
  opacity: 1;
  visibility: visible;
}

.mci-menu a {
  font-family: var(--display);
  font-size: 32px;
  letter-spacing: -0.01em;
}

.mci-menu a:hover,
.mci-menu a[aria-current] {
  color: var(--link);
}

.mci-portraits {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.mci-portraits img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.mci-label {
  font-family: var(--condensed);
  font-size: 23px;
  font-weight: 700;
  font-stretch: condensed;
  line-height: 1.2;
  color: #000;
}

.mci-heading {
  margin-top: 22px;
  font-family: var(--display);
  font-size: 48px;
  font-weight: 400;
  line-height: 62px;
  letter-spacing: -0.01em;
  color: #000;
}

.mci-body {
  margin-top: 6px;
  font-size: 18px;
  line-height: 27px;
  letter-spacing: 0.005em;
}

.mci-about {
  width: 740px;
  margin: 30px auto 0;
}

.mci-grid {
  display: grid;
  gap: 0 31px;
  width: 1130px;
  margin: 119px auto 0;
}

.mci-grid-wide-left { grid-template-columns: 739px 1fr; }
.mci-grid-wide-right { grid-template-columns: 355px 1fr; margin-top: 135px; }
.mci-grid-thirds { grid-template-columns: repeat(3, 1fr); margin-top: 151px; }

.mci-card .mci-media {
  overflow: hidden;
  background: #f2f2f2;
}

.mci-card .mci-media img,
.mci-card .mci-media video {
  width: 100%;
  transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.mci-card .mci-label {
  margin-top: 37px;
}

.mci-card .mci-body {
  max-width: 740px;
  margin-top: 8px;
}

.mci-step .mci-body {
  max-width: 330px;
}

.mci-coffee .mci-body {
  max-width: 330px;
}

.mci-thirds-card .mci-label {
  margin-top: 20px;
}

/* the one card that goes somewhere: Task Tally */
a.mci-card {
  display: block;
  cursor: pointer;
}

a.mci-card:hover .mci-media video {
  transform: scale(1.03);
}

a.mci-card:hover .mci-heading {
  color: var(--link);
}

.mci-heading .mci-arrow {
  display: inline-block;
  margin-left: 0.25em;
  opacity: 0;
  transform: translateX(-0.3em);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

a.mci-card:hover .mci-arrow {
  opacity: 1;
  transform: none;
}

.mci-footer {
  margin-top: 120px;
  padding: 72px 0 120px;
  background: #000;
  color: #fff;
  text-align: center;
}

.mci-footer p {
  margin-top: 22px;
  font-size: 18px;
  letter-spacing: 0.02em;
}

.mci-footer .mci-wordmark {
  margin-top: 0;
  font-size: 39px;
  letter-spacing: -0.005em;
  color: #fff;
}

.mci-footer nav {
  display: flex;
  justify-content: center;
  gap: 74px;
  margin-top: 96px;
}

.mci-footer nav a {
  font-family: var(--condensed);
  font-size: 23px;
  font-weight: 700;
  font-stretch: condensed;
  transition: color 0.3s ease;
}

.mci-footer nav a[href]:hover {
  color: #f7a552;
}

/* =========================================================
   Task Tally
   ========================================================= */

.tt-page {
  background: #fefefe;
}

.tt-hero {
  background: #f7a552;
}

.tt-hero video {
  width: 100%;
  aspect-ratio: 1920 / 700;
}

.tt-section {
  padding: 150px 0 40px;
}

.tt-section + .tt-section {
  padding-top: 170px;
}

.tt-section:last-of-type {
  padding-bottom: 220px;
}

.tt-title {
  font-family: var(--display);
  font-size: 37px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-align: center;
}

/* illustration on the left half, checklist from the centre line */
.tt-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  margin-top: 150px;
}

/* each badge keeps the size and spot it had on the original page */
.tt-art {
  justify-self: start;
  width: var(--art, 560px);
  margin: 0 0 0 var(--art-x, 100px);
}

.tt-art img {
  width: 100%;
  height: auto;
}

/* finishing a section gives its badge a little bounce */
.tt-section.done .tt-art img {
  animation: tt-earned 0.9s cubic-bezier(0.3, 1.6, 0.5, 1);
}

@keyframes tt-earned {
  0% { transform: scale(1) rotate(0); }
  35% { transform: scale(1.08) rotate(-3deg); }
  70% { transform: scale(0.98) rotate(1deg); }
  100% { transform: none; }
}

.tt-list {
  max-width: 440px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 17px;
  line-height: 26px;
  letter-spacing: 0.005em;
}

.tt-list li + li {
  margin-top: 15px;
}

.tt-list label {
  display: grid;
  grid-template-columns: 19px 1fr;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

/* the real checkbox stays for keyboard and screen readers; the box is drawn */
.tt-list input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tt-box {
  position: relative;
  width: 19px;
  height: 19px;
  border: 1px solid #b7b7b7;
  border-radius: 3px;
  background: #ececec;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.15s ease;
}

.tt-box svg {
  position: absolute;
  inset: 2px;
  width: 13px;
  height: 13px;
  fill: none;
  stroke: #45b545;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
  transition: stroke-dashoffset 0.3s ease 0.05s;
}

.tt-list label:hover .tt-box {
  border-color: #8f8f8f;
}

.tt-list label:active .tt-box {
  transform: scale(0.88);
}

.tt-list input:focus-visible + .tt-box {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.tt-list input:checked + .tt-box {
  border-color: #64d564;
  background: #dafdda;
}

.tt-list input:checked + .tt-box svg {
  stroke-dashoffset: 0;
}

.tt-link {
  color: var(--link);
}

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

  .motion [data-rise] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .tt-section.done .tt-art img {
    animation: none;
  }
}
