/* ============================================================
   SECTIONS — hero, case studies, footer
   (background system will be layered in Phase 2)
============================================================ */

/* ——— HERO ——— */

.section--hero {
  position: relative;
  /* Acts as a scroll spacer — content is fixed */
}

.hero__content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-m);
  padding: var(--space-l);
  pointer-events: auto;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity;
}

/* Fade out as soon as the background leaves dark-hero */
body:not([data-bg="dark-hero"]) .hero__content {
  opacity: 0;
  pointer-events: none;
}

.hero__name-logo {
  display: block;
  width: 705px;
  max-width: 100%;
  height: auto;
}

.hero__description {
  font-family: var(--font-body);
  font-size: var(--text-m);
  font-weight: 400;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.55);
  max-width: 520px;
}

/* Email CTA */
.cta-email {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 40px;
  padding: 8px 16px;
  font-family: var(--font-heading);
  font-size: var(--text-s);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.78);
  background: #7FE6D4;
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  transition: opacity var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}

.cta-email:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

/* Scroll cue — sits inside hero__content flex column */
.hero__scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.9);
  pointer-events: none;
}

.hero__scroll-label {
  font-family: var(--font-body);
  font-size: var(--text-m);
  font-weight: 400;
  letter-spacing: 0.04em;
  animation: scroll-hint-label 2s ease-in-out infinite;
}

.hero__scroll-chevron {
  display: block;
  animation: scroll-hint-chevron 2s ease-in-out infinite;
}

@keyframes scroll-hint-label {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(14px); }
}

@keyframes scroll-hint-chevron {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(8px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__scroll-label,
  .hero__scroll-chevron {
    animation: none;
  }
}


/* ——— CASE STUDIES ——— */

/* Text color adapts to the section's light/dark theme */
.section--case[data-theme^="light"] {
  color: var(--color-black);
}

.section--case[data-theme^="dark"] {
  color: var(--color-white);
}

/* Case-1 (SugarAI) enters from the dark hero — muted white so it reads
   softly on black, then switches to dark in sync with the bg transition */
#case-1 {
  color: rgba(255, 255, 255, 0.65);
  transition: color 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

body[data-bg="light-case-1"] #case-1 {
  color: var(--color-black);
}

/* ——— Case header layout ——— */

/* Title row: large title + right decorative line */
.case__title-row {
  display: flex;
  align-items: center;
  gap: 40px;
  padding-left: 72px;
  padding-right: 170px;
}

/* Case title — Outfit Bold, display size */
.case__title {
  font-family: 'Outfit', sans-serif;
  font-size: 132px;
  font-weight: 700;
  line-height: 166px;
  letter-spacing: -0.02em;
  margin: 0;
  white-space: nowrap; /* keep on one line */
  transform: translateX(-20px);
  transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Title slides to rest when its own case theme is the active background */
body[data-bg="light-case-1"] #case-1 .case__title,
body[data-bg="light-case-3"] #case-2 .case__title,
body[data-bg="dark-case-2"] #case-3 .case__title,
body[data-bg="light-case-4"] #case-4 .case__title {
  transform: translateX(0);
}

/* Right decorative line — fills remaining space after the title */
.case__line-right {
  flex: 1;
  height: 1px;
  background-color: currentColor;
  opacity: 0.2;
}

/* Description row: left decorative line + paragraph */
.case__desc-row {
  display: flex;
  align-items: center;
  gap: 44px;
  margin-top: 12px;
  padding-right: 205px;
}

/* Left decorative line — consistent width, vertically centered with paragraph */
.case__line-left {
  width: 255px;
  flex-shrink: 0;
  height: 1px;
  background-color: currentColor;
  opacity: 0.2;
}

/* Case summary — Rubik Regular 18/27 */
.case__summary {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 400;
  line-height: 27px;
  opacity: 0.85;
  transform: translateX(20px);
  transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

body[data-bg="light-case-1"] #case-1 .case__summary,
body[data-bg="light-case-3"] #case-2 .case__summary,
body[data-bg="dark-case-2"] #case-3 .case__summary,
body[data-bg="light-case-4"] #case-4 .case__summary {
  transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
  .case__title,
  .case__summary {
    transform: none;
    transition: none;
  }
}

/* Meta labels + values */
.meta__label {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.45;
}

.meta__value {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
}

/* ——— Sugar AI Hero Panel ——— */
.case__hero-panel {
  position: relative;
  width: 100%;
  border-radius: 20px;
  background: linear-gradient(rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.35) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow: rgba(0, 0, 0, 0.06) 0px 2px 10px;
  overflow: hidden;
}

.case__hero-panel__img {
  display: block;
  width: 100%;
  height: auto;
}

/* ——— Sugar AI Hero Caption ——— */
/* The caption block starts at the content's left edge and contains a
   vertical-centered line + 48px gap + text. Because .case__media spans
   the parent's content box, 50% equals half the content width, so
   width = 50% + textW/2 places the right edge at viewport-center + textW/2.
   That keeps the text horizontally centered in the viewport across widths,
   while the line stretches/shrinks to fill the remaining space. */
.case__hero-caption {
  --cap-text-w: 665px;
  display: flex;
  align-items: center;
  gap: 48px;
  width: calc(50% + var(--cap-text-w) / 2);
  margin: 96px 0;
}

.case__hero-caption--trainerize {
  margin-top: 128px;
}

.case__hero-caption__line {
  flex: 1 1 auto;
  min-width: 0;
  height: 1px;
  background: currentColor;
  opacity: 0.4;
}

.case__hero-caption__text {
  flex: 0 0 var(--cap-text-w);
  margin: 0;
  font-family: 'Outfit', sans-serif;
  font-weight: 400;
  font-size: 32px;
  line-height: 1.2;
  text-align: left;
}

/* On narrower viewports, let the text shrink so the block still fits */
@media (max-width: 1024px) {
  .case__hero-caption {
    --cap-text-w: 520px;
    gap: 32px;
    margin: 64px 0;
  }
  .case__hero-caption__text {
    font-size: 26px;
  }
}

@media (max-width: 640px) {
  .case__hero-caption {
    width: 100%;
    gap: 24px;
    margin: 48px 0;
  }
  .case__hero-caption__text {
    flex: 1 1 auto;
    font-size: 20px;
  }
}

/* Detail panels row — two fixed-size panels side by side */
.case__detail-panels {
  display: flex;
  flex-direction: column;
  gap: 48px;
  margin-bottom: 48px;
}

.case__detail-panel {
  width: 100%;
  height: 624px;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.5) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow: rgba(0, 0, 0, 0.06) 0px 2px 10px;
}

.case__detail-panel__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
}

/* Media placeholder — removed in production when real media is added */
.media__placeholder {
  width: 100%;
  height: 100%;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.2;
  border: 1px solid currentColor;
  border-radius: 4px;
}


/* ——— FOOTER ——— */

.section--footer {
  color: var(--color-white);
  min-height: auto;
  padding: var(--space-xxl) 0;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.footer__tagline {
  margin-top: 4px;
}

.footer__ctas {
  margin-top: 40px;
}

.footer__name {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.footer__tagline {
  font-family: var(--font-body);
  font-size: var(--text-m);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.01em;
}

.footer__ctas {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.cta-linkedin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 40px;
  padding: 8px 16px;
  font-family: var(--font-heading);
  font-size: var(--text-s);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04));
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}

.cta-linkedin:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.footer__email {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 300;
  color: rgba(255, 255, 255, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 2px;
  transition: color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}

.footer__email:hover {
  color: var(--color-white);
  border-color: rgba(255, 255, 255, 0.6);
}

.footer__copy {
  font-family: var(--font-heading);
  font-size: var(--text-s);
  font-weight: 400;
  letter-spacing: 0.06em;
  opacity: 0.6;
  margin-top: var(--space-m);
}


/* ——— Pattern note row (sits below carousel) ——— */
.case__pattern-row {
  display: flex;
  align-items: stretch;
  gap: 48px;
  margin-top: 48px;
}

.pattern-note {
  flex: 0 0 360px;
  width: 360px;
  height: 388px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 20px;
  background: linear-gradient(rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.5) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 10px;
  box-sizing: border-box;
}

.pattern-note__title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 16px 0;
  color: var(--color-black);
}

.pattern-note__body {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  margin: 0;
  color: #1a1a1a;
  opacity: 0.85;
}

/* ——— Pattern decision matrix ——— */
.pattern-matrix {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pattern-matrix__title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  color: #1a1a1a;
}

.pattern-matrix__table {
  height: 388px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: rgba(0, 0, 0, 0.04) 0px 1px 6px;
  overflow: hidden;
}

.pattern-matrix__row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.4fr;
  align-items: center;
  gap: 24px;
  padding: 8px 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.pattern-matrix__row:first-child {
  border-top: none;
}

.pattern-matrix__row--head {
  padding-top: 12px;
  padding-bottom: 12px;
  /*background: #64748b;*/
}

.pattern-matrix__cell {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  color: #1a1a1a;
}

.pattern-matrix__cell--head {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  /*color: rgba(255, 255, 255, 0.85);*/
  color: #aaaaaa;
}

.pattern-matrix__cell--strong {
  font-weight: 700;
}

.pattern-matrix__cell--muted {
  color: #1a1a1a;
}

/* ——— Dark theme variants for pattern row ——— */
[data-theme^="dark"] .pattern-note {
  background: linear-gradient(rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: rgba(0, 0, 0, 0.35) 0px 2px 14px;
}

[data-theme^="dark"] .pattern-note__title {
  color: #ffffff;
}

[data-theme^="dark"] .pattern-note__body {
  color: rgba(255, 255, 255, 0.78);
  opacity: 1;
}

[data-theme^="dark"] .pattern-matrix__title {
  color: #ffffff;
}

[data-theme^="dark"] .pattern-matrix__table {
  background: linear-gradient(rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: rgba(0, 0, 0, 0.35) 0px 1px 6px;
}

[data-theme^="dark"] .pattern-matrix__row {
  border-top-color: rgba(255, 255, 255, 0.08);
}

[data-theme^="dark"] .pattern-matrix__cell {
  color: rgba(255, 255, 255, 0.78);
}

[data-theme^="dark"] .pattern-matrix__cell--head {
  color: rgba(255, 255, 255, 0.45);
}

[data-theme^="dark"] .pattern-matrix__cell--muted {
  color: rgba(255, 255, 255, 0.78);
}
