/* ==========================================================================
   Case-study pages. Sacardo's own ink-and-gold system throughout, with one
   exception that is the point of the page: the project's name is set in the
   project's own typeface and color, as it appears on the site it names.
   Each page sets --accent on <body>.
   ========================================================================== */

.cs { --accent: var(--gold); }
.cs--ame { --accent: #E7A61C; }
.cs--ev  { --accent: #E1592A; }
.cs--sb  { --accent: #FF7A4D; }

/* ---- Opening ---------------------------------------------------------- */

.cs-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3rem, 7vw, 5.5rem) 0 0;
  background:
    radial-gradient(ellipse 55% 45% at 85% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    var(--ink);
}

.cs-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.6rem;
  font-size: 0.86rem;
}
.cs-crumbs a {
  color: var(--paper-dim);
  padding-block: 0.3rem;
  transition: color 0.2s ease;
}
.cs-crumbs a:hover { color: var(--paper); }

.cs-title {
  margin-top: clamp(1.4rem, 3vw, 2.2rem);
  font-size: clamp(3.2rem, 10.5vw, 9.5rem);
  line-height: 0.9;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.cs-title em { color: var(--accent); }
/* Longer page titles (service pages and guides) */
.cs-title--page { font-size: clamp(2.3rem, 6.2vw, 5rem); line-height: 1; letter-spacing: -0.025em; max-width: 18ch; }
.cs-hero--page { padding-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.cs-hero--page .cs-lede { max-width: 56ch; }

/* The project's own voice */
.cs--ame .cs-title { font-family: "Bebas Neue", var(--font-display); font-weight: 400; letter-spacing: 0.01em; line-height: 0.88; color: #F7F4EC; }
.cs--ame .cs-title em { font-style: normal; }
.cs--ev .cs-title  { font-family: "Fraunces", Georgia, serif; font-weight: 400; color: #F3EBDD; letter-spacing: -0.03em; }
.cs--ev .cs-title em { font-style: italic; }
.cs--sb .cs-title  { font-family: "Fraunces", Georgia, serif; font-weight: 400; color: #FBF7F2; letter-spacing: -0.045em; }
.cs--sb .cs-title em { font-style: italic; }

.cs-lede {
  margin-top: 1.6rem;
  max-width: 46ch;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--paper-dim);
}
.cs-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 1rem; }

.cs-hero .container > * { animation: fade-up 0.6s var(--ease-out) both; }
.cs-hero .container > *:nth-child(2) { animation-delay: 0.06s; }
.cs-hero .container > *:nth-child(3) { animation-delay: 0.12s; }
.cs-hero .container > *:nth-child(4) { animation-delay: 0.18s; }

/* ---- The site itself: desktop in a browser frame, phone overlapping ---- */

.cs-shots {
  position: relative;
  margin: clamp(2.8rem, 6vw, 4.5rem) 0 0;
  padding-bottom: clamp(3rem, 8vw, 6rem);
}
.cs-browser {
  border: 1px solid var(--line-strong);
  background: var(--ink-raised);
  box-shadow:
    0 50px 90px -40px rgba(0, 0, 0, 0.8),
    0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}
.cs-browser-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--paper-faint);
  white-space: nowrap;
  overflow: hidden;
}
.cs-browser-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); flex-shrink: 0; }
.cs-browser-bar span { margin-left: 0.9rem; overflow: hidden; text-overflow: ellipsis; }
.cs-browser img { width: 100%; height: auto; }

.cs-phone {
  position: absolute;
  right: clamp(0.5rem, 4vw, 3.5rem);
  bottom: 0;
  width: clamp(112px, 19%, 236px);
  border: clamp(4px, 0.6vw, 7px) solid #050806;
  border-radius: clamp(18px, 2.6vw, 30px);
  overflow: hidden;
  background: #050806;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.85), 0 0 0 1px var(--line-strong);
}
.cs-phone img { width: 100%; height: auto; }

.cs-shots figcaption {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--paper-faint);
  max-width: 60%;
}

/* ---- The story: facts on the left, the narrative on the right ---------- */

.cs-body { padding: var(--section-space) 0; background: var(--ink-raised); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cs-body-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 2fr);
  gap: 3rem clamp(3rem, 7vw, 6rem);
  align-items: start;
}

.cs-facts {
  position: sticky;
  top: calc(var(--header-h, 4.4rem) + 1.5rem);
  display: grid;
  gap: 1.1rem;
  margin: 0;
  padding-top: 1.2rem;
  border-top: 2px solid var(--accent);
}
.cs-facts div { display: grid; gap: 0.2rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--line); }
.cs-facts dt {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-faint);
}
/* overflow-wrap: a long web address is one unbreakable word, and in the two-column
   facts grid on a 320px phone it was wider than its cell */
.cs-facts dd { margin: 0; font-size: 0.95rem; color: var(--paper); overflow-wrap: anywhere; }
.cs-facts dd a { color: var(--gold-bright); border-bottom: 1px solid transparent; transition: border-color 0.2s ease; }
.cs-facts dd a:hover { border-color: var(--gold-bright); }

.cs-story { display: flex; flex-direction: column; gap: clamp(2.6rem, 5vw, 3.6rem); }
.cs-block { padding: 0; }   /* they're <section>s; opt out of the site-wide section padding */
.cs-block h2 {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-bright);
}
.cs-block h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.cs-block > p {
  margin-top: 1.1rem;
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.6;
  max-width: 60ch;
}
.cs-block > p + p { margin-top: 1rem; }
.cs-block > p.cs-big {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  line-height: 1.3;
  max-width: 34ch;
}

.cs-list { margin-top: 1.3rem; display: grid; gap: 0; }
.cs-list li {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 2fr);
  gap: 0.4rem 2rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
}
.cs-list li:last-child { border-bottom: 1px solid var(--line); }
.cs-list strong { font-weight: 600; color: var(--paper); }
.cs-list span { color: var(--paper-dim); font-size: 0.96rem; }

.cs-result {
  margin-top: 1.2rem;
  padding: 1.4rem 1.6rem;
  border: 1px solid var(--line-strong);
  border-left: 2px solid var(--accent);
  background: var(--ink);
}
.cs-result p { font-size: 1.05rem; }
.cs-result p + p { margin-top: 0.7rem; font-size: 0.86rem; color: var(--paper-faint); }

/* ---- Next project ------------------------------------------------------ */

.cs-next { padding: clamp(4rem, 9vw, 7rem) 0; }
.cs-next-label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-faint);
}
.cs-next-link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25em;
  margin-top: 0.8rem;
  font-size: clamp(2.6rem, 8vw, 6.5rem);
  line-height: 0.95;
  color: var(--paper);
  transition: color 0.25s ease;
}
.cs-next-link:hover { color: var(--gold-bright); }
.cs-next-link .arrow { font-family: var(--font-body); font-size: 0.5em; transition: transform 0.3s var(--ease-out); }
.cs-next-link:hover .arrow { transform: translateX(0.2em); }
.cs-next-link.is-ame { font-family: "Bebas Neue", var(--font-display); letter-spacing: 0.01em; }
.cs-next-link.is-ev  { font-family: "Fraunces", Georgia, serif; letter-spacing: -0.03em; }
.cs-next-link.is-sb  { font-family: "Fraunces", Georgia, serif; font-style: italic; letter-spacing: -0.04em; }

.cs-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.6rem 2rem;
  margin-top: clamp(3rem, 6vw, 4.5rem);
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.cs-cta p { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.4rem, 2.6vw, 2rem); }
.cs-cta .hero-actions { margin-top: 0; opacity: 1; animation: none; }

/* ---- Small screens ----------------------------------------------------- */

@media (max-width: 860px) {
  .cs-body-grid { grid-template-columns: 1fr; }
  .cs-facts { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.4rem; }
  .cs-list li { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .cs-facts { gap: 0.9rem 1rem; }
  .cs-facts dd { font-size: 0.88rem; }
  .cs-phone { width: 34%; }
  .cs-shots { padding-bottom: 4.5rem; }
  .cs-shots figcaption { max-width: 56%; }
}

@media (prefers-reduced-motion: reduce) {
  .cs-hero .container > * { animation: none; }
}

@media print {
  .cs-phone, .cs-actions, .cs-next { display: none !important; }
  .cs-facts { position: static; }
}
