/* =====================================================================
   CASE-PAGES.CSS — the six project pages only
   (unitedairlines, yelp, cura, scopemagazine, cinnamontoastpunk, bauhausai)
   Loaded after styles.css. Everything here starts with .cs-page (or
   .cs-graphic for the three graphic design pages).

   HOW THIS FILE IS ORGANISED
     1  Page layout, headings and text
     2  Image placeholders and the section links near the top
     3  Paper cards and story sections
     4  Galleries and process rows
     5  End of page: back link, next-project sticky note, Back to top
     6  Interactive Figma prototype (UX pages)
     7  Graphic design pages
     8  Tablet and phone layouts (@media blocks)
   ===================================================================== */

/* =====================================================================
   1 — PAGE LAYOUT, HEADINGS AND TEXT
   ===================================================================== */

.cs-page {
  width: min(90%, 1600px);
  margin-inline: auto;
  padding-block: clamp(28px, 4vw, 64px) clamp(40px, 4.5vw, 64px);
  text-align: left;
}

.cs-page * {
  box-sizing: border-box;
}

.cs-page h1,
.cs-page h2,
.cs-page h3 {
  color: var(--blue);
  font-family: salted, Gabarito, sans-serif;
  font-weight: 400;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.cs-page h1 {
  font-size: clamp(2.8rem, 5.3vw, 6rem);
  line-height: 1.1;
  margin: 16px 0;
}

.cs-page h2 {
  font-size: clamp(2rem, 3vw, 3.2rem);
  line-height: 1.2;
  margin: 0 0 18px;
}

.cs-page h3 {
  font-size: clamp(1.65rem, 2.2vw, 2.4rem);
  line-height: 1.2;
  margin: 0 0 16px;
}

.cs-page p {
  max-width: 70ch;
  line-height: 1.65;
  margin: 0 0 16px;
}

.cs-page a,
.cs-page summary {
  min-height: 44px;
}

.cs-page a:focus-visible,
.cs-page summary:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 5px;
}

.cs-page .cs-back {
  display: inline-flex;
  align-items: center;
  margin-bottom: 24px;
}

.cs-page .cs-heading {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 5vw, 80px);
  align-items: center;
  margin-bottom: clamp(28px, 4vw, 56px);
}

.cs-page .cs-kicker {
  color: var(--blue);
  font-size: .85rem;
  letter-spacing: .055em;
  margin-bottom: 16px;
}

.cs-page .cs-status {
  font-size: .9rem;
}

.cs-page .cs-intro {
  font-size: clamp(1.1rem, 1.45vw, 1.45rem);
}

.cs-page .cs-visual {
  margin: 0;
  min-width: 0;
  width: 100%;
}

/* =====================================================================
   2 — IMAGE PLACEHOLDERS AND SECTION LINKS
   The grey boxes shown until real images are added.
   ===================================================================== */

.cs-page .cs-placeholder {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  padding: clamp(16px, 3vw, 40px);
  border: 1px solid #c6c8c6;
  background: #e4e5e2;
  color: #49534e;
  text-align: center;
}

.cs-page .cs-placeholder span {
  max-width: 30ch;
  font-size: clamp(.95rem, 1.25vw, 1.25rem);
  line-height: 1.5;
}

.cs-page .cs-phone {
  max-width: 270px;
  justify-self: center;
}

.cs-page .cs-phone .cs-placeholder {
  aspect-ratio: 9 / 19.5;
}

.cs-page .cs-portrait .cs-placeholder {
  aspect-ratio: 3 / 4;
}

.cs-page .cs-spread .cs-placeholder {
  aspect-ratio: 2 / 1;
}

.cs-page figcaption {
  font-size: .8rem;
  color: #59645d;
  padding-top: 10px;
}

.cs-page .cs-index {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  padding-block: 22px;
  border-bottom: 1px solid #d9d0b8;
  margin-bottom: clamp(40px, 6vw, 88px);
}

.cs-page .cs-index a {
  display: flex;
  align-items: center;
}

/* =====================================================================
   3 — PAPER CARDS AND STORY SECTIONS
   ===================================================================== */

.cs-page .cs-paper {
  background: #fffdf5;
  border: 1px solid #ddd5bf;
  box-shadow: 4px 5px 0 rgba(188, 179, 152, .19);
  padding: clamp(24px, 3vw, 48px);
}

.cs-page .cs-overview {
  display: grid;
  grid-template-columns: minmax(220px, .7fr) minmax(0, 1.5fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}

.cs-page .cs-glance h2 {
  font-size: 2rem;
}

.cs-page dl {
  margin: 0;
}

.cs-page dl > div + div {
  border-top: 1px solid #e3ddcb;
  padding-top: 16px;
  margin-top: 16px;
}

.cs-page dt {
  color: var(--blue);
  font-weight: 600;
  margin-bottom: 6px;
}

.cs-page dd {
  margin: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.cs-page .cs-context {
  display: grid;
  gap: 24px;
}

.cs-page .cs-contribution {
  border-left: 3px solid var(--blue);
  padding-left: 24px;
}

.cs-page .cs-section {
  margin-top: clamp(56px, 7vw, 112px);
  scroll-margin-top: 24px;
}

.cs-page #overview {
  scroll-margin-top: 24px;
}

.cs-page .cs-section-heading {
  border-top: 1px solid #d9d0b8;
  padding-top: 28px;
  margin-bottom: 32px;
}

.cs-page .cs-process-row {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  align-items: center;
  gap: clamp(28px, 5vw, 80px);
  padding-block: clamp(28px, 4vw, 56px);
  border-bottom: 1px solid #e0d9c8;
}

.cs-page .cs-missing {
  font-size: .95rem;
  color: #62604f;
  border-left: 2px solid #b8ad90;
  padding-left: 16px;
}

/* =====================================================================
   4 — GALLERIES AND PROCESS ROWS
   ===================================================================== */

.cs-page .cs-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: clamp(20px, 3vw, 48px);
}

.cs-page .cs-decisions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 32px;
}

.cs-page .cs-reflection {
  background: #f5ecd2;
}

.cs-page .cs-reflection > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.cs-page .cs-source {
  margin-top: 32px;
}

.cs-page summary {
  cursor: pointer;
  padding-block: 14px;
  color: var(--blue);
}

/* =====================================================================
   5 — END OF PAGE
   "Back to selected work", the next-project sticky note, and Back to top.
   Each note's colour comes from --note-bg, set in that page's HTML.
   ===================================================================== */

/* End of every project: back link + a taped sticky note for the next project
   (same paper, tape, tilt and lift as the homepage favorites), then Back to top.
   The note colour comes from the next project's --note-bg, set inline in the HTML. */
.cs-page .cs-next {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 40px 32px;
  margin-top: clamp(56px, 7vw, 104px);
}

.cs-page .cs-back-work,
.cs-page .cs-back-top {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--blue);
  text-decoration: none;
  font: 400 clamp(20px, 1.6vw, 26px)/1.2 salted, Gabarito, sans-serif;
}

.cs-page .cs-back-work img,
.cs-page .cs-back-top img,
.cs-page .cs-next-arrow {
  width: clamp(20px, 1.4vw, 26px);
  height: auto;
  image-rendering: pixelated;
  transition: transform .18s steps(3);
}

.cs-page .cs-back-work img {
  transform: rotate(90deg);
}

.cs-page .cs-back-work:hover img,
.cs-page .cs-back-work:focus-visible img {
  transform: rotate(90deg) translateY(6px);
}

.cs-page .cs-next-note {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 6px 24px;
  width: min(100%, 460px);
  padding: clamp(28px, 3vw, 40px) clamp(24px, 3vw, 40px) clamp(24px, 2.5vw, 32px);
  background: var(--note-bg, #f5ebd2);
  color: var(--ink);
  text-decoration: none;
  transform: rotate(-1deg);
  filter: drop-shadow(0 0 0 transparent);
  transition: transform .18s steps(3), filter .18s steps(3);
}

.cs-page .cs-next-note:hover,
.cs-page .cs-next-note:focus-visible {
  transform: translateY(-8px) rotate(-1deg);
  filter: drop-shadow(6px 9px 0 #8f877466);
}

.cs-page .cs-next-note:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 6px;
}

.cs-page .cs-tape {
  position: absolute;
  top: -12px;
  left: calc(50% - 38px);
  width: 76px;
  height: 24px;
  background: #d0b87a99;
  transform: rotate(-4deg);
  clip-path: polygon(0 0, 100% 0, 100% 30%, 97% 30%, 97% 60%, 100% 60%, 100% 100%, 0 100%, 0 65%, 3% 65%, 3% 35%, 0 35%);
}

.cs-page .cs-next-label {
  grid-column: 1 / -1;
  color: var(--blue);
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.cs-page .cs-next-note strong {
  color: var(--blue);
  font: 400 clamp(1.9rem, 2.8vw, 2.8rem)/1.1 salted, Gabarito, sans-serif;
  overflow-wrap: anywhere;
}

.cs-page .cs-next-arrow {
  transform: rotate(-90deg);
  margin-bottom: 6px;
}

.cs-page .cs-next-note:hover .cs-next-arrow,
.cs-page .cs-next-note:focus-visible .cs-next-arrow {
  transform: rotate(-90deg) translateY(6px);
}

/* Back to top: arrow lifts on hover; the words are never underlined. */
.cs-page .cs-back-top-wrap {
  display: flex;
  justify-content: center;
  padding-top: clamp(56px, 7vw, 104px);
}

.cs-page .cs-back-top {
  flex-direction: column;
  gap: 6px;
  padding: 6px 12px;
}

.cs-page .cs-back-top img {
  transform: rotate(180deg);
}

.cs-page .cs-back-top:hover img,
.cs-page .cs-back-top:focus-visible img {
  transform: rotate(180deg) translateY(6px);
}

/* =====================================================================
   6 — INTERACTIVE FIGMA PROTOTYPE
   To add a prototype, follow the instructions in the HTML comment
   inside the "Try it yourself" section of each UX page.
   ===================================================================== */

/* Interactive Figma prototype (UX pages): copy beside a phone-shaped frame. */
.cs-page .cs-prototype {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 400px);
  gap: clamp(28px, 5vw, 80px);
  align-items: center;
  border-top: 1px solid #d9d0b8;
  padding-top: 28px;
}

.cs-page .cs-prototype-hint {
  font-size: .95rem;
  color: #59645d;
}

.cs-page .cs-prototype-frame {
  margin: 0;
  width: 100%;
  aspect-ratio: 9 / 18;
}

.cs-page .cs-prototype-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid #c6c8c6;
  background: #e4e5e2;
}

.cs-page .cs-prototype-frame .cs-placeholder {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border: 1px solid #c6c8c6;
  background: #e4e5e2;
}

/* =====================================================================
   7 — GRAPHIC DESIGN PAGES
   ===================================================================== */

.cs-graphic .cs-process-row {
  grid-template-columns: .8fr 1.4fr;
}

.cs-graphic .cs-gallery {
  grid-template-columns: .7fr 1.2fr;
}

.cs-graphic .cs-gallery > :last-child {
  grid-column: 2;
}

/* =====================================================================
   8 — TABLET AND PHONE LAYOUTS
   max-width: 900px = tablets; 600px = phones.
   ===================================================================== */

@media (max-width: 900px) {
  .cs-page .cs-heading {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .cs-page .cs-prototype {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .cs-page .cs-prototype .cs-copy {
    justify-self: stretch;
  }

  .cs-page .cs-prototype-frame {
    width: min(100%, 400px);
  }

  .cs-page .cs-overview {
    grid-template-columns: 1fr;
  }

  .cs-page dl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .cs-page dl > div + div {
    border: 0;
    padding: 0;
    margin: 0;
  }
}

@media (max-width: 600px) {
  .cs-page {
    width: calc(100% - 40px);
  }

  .cs-page .cs-process-row,
  .cs-graphic .cs-process-row,
  .cs-page .cs-gallery,
  .cs-graphic .cs-gallery,
  .cs-page .cs-decisions,
  .cs-page .cs-reflection > div {
    grid-template-columns: 1fr;
  }

  .cs-graphic .cs-gallery > :last-child {
    grid-column: auto;
  }

  .cs-page .cs-gallery {
    gap: 28px;
  }

  .cs-page dl {
    grid-template-columns: 1fr;
  }

  .cs-page .cs-index {
    gap: 8px 20px;
  }

  .cs-page .cs-next-note {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cs-page .cs-reveal {
    transform: none !important;
    opacity: 1 !important;
  }

  .cs-page .cs-next-note,
  .cs-page .cs-next-note:hover,
  .cs-page .cs-next-note:focus-visible {
    transform: rotate(-1deg);
  }

  .cs-page .cs-next img,
  .cs-page .cs-back-top img {
    transition: none;
  }
}
