/* ==========================================================================
   CINE TREASURE — project detail modal & homepage trigger
   Scoped to the CINE TREASURE project. Uses the existing site tokens only.
   ========================================================================== */

/* ---------- 1. Homepage card trigger ---------- */
.project-entry--cine {
  position: relative;
}

.project-entry--cine .project-entry-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  min-width: 0;
}

.project-entry--cine .project-entry-aside .project-entry-media {
  width: 100%;
}

.project-entry-hit {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.project-entry-hit:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}

.project-entry-view {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
  pointer-events: none;
  transition: color 0.3s var(--ease);
}

.project-entry-view span {
  color: var(--blue);
  font-size: 11px;
  line-height: 0.8;
  transition: color 0.3s var(--ease);
}

.project-entry--cine .project-entry-media img {
  transition: transform 0.7s var(--ease);
}

.project-entry--cine .project-entry-title {
  transition: color 0.3s var(--ease);
}

.project-entry--cine:focus-within .project-entry-title,
.project-entry--cine:focus-within .project-entry-view {
  color: var(--blue);
}

@media (hover: hover) and (pointer: fine) {
  .project-entry--cine:hover .project-entry-media img {
    transform: scale(1.035);
  }

  .project-entry--cine:hover .project-entry-title,
  .project-entry--cine:hover .project-entry-view {
    color: var(--blue);
  }
}

/* ---------- 2. Modal shell ---------- */
.cine-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: clamp(12px, 2.4vw, 28px);
}

.cine-modal[hidden] {
  display: none;
}

.cine-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 25, 29, 0.52);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.cine-modal__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(85vw, 1280px);
  height: 90vh;
  height: 90dvh;
  max-height: 980px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  box-shadow: 0 30px 90px rgba(23, 25, 29, 0.18);
  opacity: 0;
  transform: translateY(18px) scale(0.995);
  transition: opacity 0.32s var(--ease), transform 0.32s var(--ease);
}

.cine-modal__panel:focus {
  outline: none;
}

.cine-modal.is-open .cine-modal__backdrop {
  opacity: 1;
}

.cine-modal.is-open .cine-modal__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

body.cine-modal-open {
  overflow: hidden;
}

/* ---------- 3. Modal bar ---------- */
.cine-modal__bar {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 58px;
  padding: 0 clamp(18px, 3.4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.cine-modal__eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.4;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.cine-modal__eyebrow::before {
  content: "";
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  background: var(--blue);
}

.cine-modal__eyebrow span {
  color: var(--blue);
}

.cine-modal__close {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  padding: 8px 0 8px 18px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: color 0.25s var(--ease);
}

.cine-modal__close:hover {
  color: var(--blue);
}

.cine-modal__close-icon {
  position: relative;
  display: block;
  width: 13px;
  height: 13px;
}

.cine-modal__close-icon::before,
.cine-modal__close-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
}

.cine-modal__close-icon::before {
  transform: rotate(45deg);
}

.cine-modal__close-icon::after {
  transform: rotate(-45deg);
}

/* ---------- 4. Independent modal scroll ---------- */
.cine-modal__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  -webkit-overflow-scrolling: touch;
}

.cine-modal__scroll::-webkit-scrollbar {
  width: 8px;
}

.cine-modal__scroll::-webkit-scrollbar-track {
  background: transparent;
}

.cine-modal__scroll::-webkit-scrollbar-thumb {
  background: var(--line-strong);
}

.cine-modal__inner {
  width: 100%;
  max-width: 1040px;
  margin-inline: auto;
  padding: clamp(24px, 3.2vw, 44px) clamp(20px, 4vw, 56px) clamp(32px, 4vw, 52px);
}

/* ---------- 5. Image placeholders ---------- */
.cine-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 20px;
  border: 1px solid var(--line);
  background-color: var(--bg-soft);
  background-image: radial-gradient(rgba(23, 25, 29, 0.05) 0.5px, transparent 0.5px);
  background-size: 4px 4px;
  text-align: center;
}

.cine-placeholder__mark {
  display: block;
  width: 5px;
  height: 5px;
  background: var(--blue);
}

.cine-placeholder__label {
  max-width: 100%;
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.6;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.cine-placeholder--hero {
  aspect-ratio: 16 / 7;
}

.cine-media {
  min-width: 0;
}

/* Images keep their own ratio; width:100% + height:auto avoids cropping. */
.cine-media img,
.cine-hero__media img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}

.cine-media--portrait .cine-placeholder {
  aspect-ratio: 3 / 4;
}

.cine-media--phone .cine-placeholder {
  aspect-ratio: 9 / 16;
}

.cine-media--wide .cine-placeholder {
  aspect-ratio: 16 / 7;
}

/* ---------- 6. Hero ---------- */
.cine-hero {
  padding-bottom: 0;
}

.cine-hero__media {
  aspect-ratio: 16 / 7;
  margin: 0 0 clamp(22px, 3vw, 34px);
  overflow: hidden;
}

.cine-hero__media img {
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.cine-hero__title {
  max-width: 100%;
  font-size: clamp(2rem, 6.2vw, 4.6rem);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.cine-hero__title::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 14px;
  background: var(--blue);
  vertical-align: 0.14em;
}

.cine-hero__cn {
  margin-top: 10px;
  font-size: clamp(0.9rem, 1.25vw, 1.05rem);
  line-height: 1.6;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.cine-hero__intro {
  max-width: 680px;
  margin-top: clamp(16px, 2.2vw, 24px);
  font-size: clamp(14px, 1.1vw, 16px);
  line-height: 1.95;
  color: var(--ink);
}

/* ---------- 7. Sections ---------- */
.cine-section {
  margin-top: clamp(38px, 4.6vw, 56px);
  padding-top: clamp(30px, 3.6vw, 44px);
  border-top: 1px solid var(--line);
}

.cine-section__kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.5;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.cine-section__num {
  color: var(--blue);
}

.cine-section__en {
  color: var(--muted);
}

.cine-section__title {
  margin-top: 14px;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.cine-section__lead {
  max-width: 64ch;
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.95;
  color: var(--ink);
}

.cine-section__lead--follow {
  margin-top: 8px;
}

/* ---------- 8. Facts ---------- */
.cine-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 40px);
  margin-top: clamp(24px, 3vw, 32px);
}

.cine-fact {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.cine-fact__label {
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.5;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.cine-fact__value {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}

/* ---------- 9. Platforms ---------- */
.cine-platforms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 36px);
  margin-top: clamp(24px, 3vw, 32px);
}

.cine-platform {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.cine-platform__name {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.16em;
  color: var(--ink);
}

.cine-platform__desc {
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--muted);
}

/* ---------- 10. Galleries ---------- */
.cine-gallery {
  display: grid;
  gap: clamp(14px, 2vw, 24px);
  margin-top: clamp(24px, 3vw, 34px);
}

.cine-gallery--single {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  width: 100%;
  max-width: 100%;
}

.cine-gallery--single .cine-media {
  width: 100%;
  max-width: 460px;
}

.cine-gallery--single-phone .cine-media {
  max-width: 340px;
}

.cine-gallery--double {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
}

.cine-gallery--double .cine-media {
  width: 100%;
}

/* ---------- 11. AI cases ---------- */
.cine-cases {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(22px, 3vw, 40px);
  margin-top: clamp(26px, 3.4vw, 40px);
}

.cine-case {
  min-width: 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.cine-case__kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.5;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cine-case__num {
  color: var(--blue);
}

.cine-case__en {
  color: var(--muted);
}

.cine-case__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 12px;
}

.cine-case__list li {
  position: relative;
  padding-left: 10px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink);
}

.cine-case__list li::before {
  content: "";
  position: absolute;
  top: 0.82em;
  left: 0;
  width: 3px;
  height: 3px;
  background: var(--blue);
}

.cine-case__media {
  width: 100%;
  max-width: 280px;
  margin-top: 18px;
}

.cine-case__notes {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.cine-case__notes-title {
  font-family: var(--font-mono);
  font-size: 7.5px;
  line-height: 1.6;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.cine-case__notes ul {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.cine-case__notes li {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- 12. Archive + bottom navigation ---------- */
.cine-archive {
  width: 100%;
  margin-top: clamp(24px, 3vw, 36px);
}

.cine-pagination {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  margin-top: clamp(52px, 6vw, 80px);
  padding-top: clamp(18px, 2.4vw, 26px);
  border-top: 1px solid var(--line);
}

.cine-pagination__item {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.cine-pagination__item--next {
  align-items: flex-end;
  text-align: right;
}

.cine-pagination__label {
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: 0.14em;
  color: var(--ink);
}

.cine-pagination__arrow {
  margin-left: 4px;
  color: var(--blue);
}

.cine-pagination__meta {
  font-family: var(--font-mono);
  font-size: 7.5px;
  line-height: 1.5;
  letter-spacing: 0.16em;
  color: var(--muted);
}

/* ---------- 13. Responsive ---------- */
@media (max-width: 900px) {
  .cine-modal__panel {
    width: 90vw;
    height: 92vh;
    height: 92dvh;
  }

  .cine-cases {
    grid-template-columns: minmax(0, 1fr);
  }

  .cine-case__media {
    max-width: 280px;
  }
}

@media (max-width: 800px) {
  .cine-platforms {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .cine-modal {
    padding: 10px;
  }

  .cine-modal__panel {
    width: 100%;
    height: calc(100vh - 20px);
    height: calc(100dvh - 20px);
    max-height: none;
    box-shadow: none;
  }

  .cine-modal__bar {
    min-height: 54px;
    padding: 0 16px;
  }

  .cine-modal__close {
    gap: 9px;
    padding-left: 12px;
  }

  .cine-modal__inner {
    padding: 24px 18px 40px;
  }

  .cine-hero__title {
    font-size: clamp(1.9rem, 9vw, 3rem);
  }

  .cine-hero__intro {
    font-size: 14px;
  }

  .cine-section__lead {
    font-size: 14.5px;
  }

  .cine-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .cine-gallery--single .cine-media {
    max-width: 420px;
  }

  .cine-gallery--single-phone .cine-media {
    max-width: 300px;
  }

  .cine-gallery--double {
    grid-template-columns: minmax(0, 1fr);
    max-width: 100%;
    justify-items: center;
  }

  .cine-gallery--double .cine-media {
    max-width: 300px;
  }

  .cine-media--phone .cine-placeholder {
    max-width: 300px;
  }

  .cine-case__media {
    max-width: 300px;
  }
}

@media (max-width: 420px) {
  .cine-modal__inner {
    padding: 22px 16px 36px;
  }

  .cine-modal__eyebrow {
    font-size: 8px;
    letter-spacing: 0.14em;
  }

  .cine-section__lead {
    font-size: 14px;
  }
}
