/*
 * 壹帧映迹 — Chapter scale and viewport rhythm
 * Keeps typography close to the Curveslink parent site while turning long
 * desktop pages into readable, viewport-sized cinematic chapters.
 */

:root {
  --section-space: clamp(72px, 8vw, 104px);
  --chapter-top: calc(var(--header-height) + 34px);
  --chapter-bottom: 42px;
}

body {
  font-size: 15px;
}

.section-heading {
  margin-bottom: clamp(36px, 4.5vw, 56px);
}

.section-heading h2 {
  font-size: clamp(38px, 4.6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.intro .section-heading h2 {
  font-size: clamp(40px, 4.9vw, 66px);
}

.section-lead {
  font-size: clamp(15px, 1.25vw, 17px);
  line-height: 1.82;
}

.hero {
  min-height: 760px;
  height: max(760px, 100svh);
}

.hero-inner {
  padding-top: calc(var(--header-height) + 74px);
  padding-bottom: 78px;
  grid-template-columns: minmax(0, 1fr);
}

.hero-copy {
  max-width: 860px;
}

.hero-copy::after {
  display: none;
}

.hero-copy h1 {
  max-width: 800px;
  margin-bottom: 22px;
  font-size: clamp(48px, 5.7vw, 82px);
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.hero-lead {
  max-width: 720px;
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.82;
}

.hero-actions {
  margin-top: 24px;
}

.hero-capabilities {
  max-width: 760px;
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid rgba(230, 195, 123, 0.34);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(3, 4, 5, 0.28);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.hero-capabilities article {
  min-width: 0;
  min-height: 74px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-capabilities article:last-child {
  border-right: 0;
}

.hero-capabilities .cinema-icon {
  width: 30px;
  height: 30px;
  grid-row: 1 / 3;
  align-self: center;
  color: var(--gold-bright);
  border-color: rgba(230, 195, 123, 0.28);
  font-size: 11px;
}

.hero-capabilities span {
  overflow: hidden;
  color: rgba(246, 242, 234, 0.44);
  font: 500 7px/1.2 var(--font-mono);
  letter-spacing: 0.12em;
  text-overflow: ellipsis;
}

.hero-capabilities strong {
  margin-top: 5px;
  color: var(--white);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.intro-statement p {
  font-size: 16px;
  line-height: 1.82;
}

.intro-statement p:first-child {
  font-size: 20px;
}

.capability-item h3 {
  font-size: 25px;
}

.matrix-cell h3 {
  font-size: clamp(20px, 1.75vw, 26px);
}

.track-card h3 {
  font-size: 36px;
}

.efficiency-intro h3 {
  font-size: clamp(30px, 3.2vw, 44px);
}

.metric strong {
  font-size: clamp(38px, 3.9vw, 54px);
}

.works-heading,
.works-grid {
  width: 100%;
  max-width: 1000px;
  margin-inline: auto;
}

.works-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.work-card,
.work-card:first-child {
  min-height: 0;
  max-height: none;
  grid-column: auto;
  aspect-ratio: 3 / 4;
}

.work-card {
  padding: 0;
  display: block;
  color: inherit;
  border: 0;
  border-radius: 0;
  appearance: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  isolation: isolate;
}

.work-card:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

.work-card:nth-child(4)::before { content: "FRAME 04"; }
.work-card:nth-child(5)::before { content: "FRAME 05"; }
.work-card:nth-child(6)::before { content: "FRAME 06"; }
.work-card:nth-child(7)::before { content: "FRAME 07"; }
.work-card:nth-child(8)::before { content: "FRAME 08"; }

.work-card__caption {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  padding: 58px 14px 14px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  color: var(--white);
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  background: linear-gradient(transparent, rgba(3, 4, 5, 0.96));
}

.work-card__caption > span {
  color: var(--gold-bright);
  font: 500 8px/1 var(--font-mono);
  letter-spacing: 0.08em;
}

.work-card__caption strong {
  font-size: 12px;
  font-weight: 500;
}

.work-card__play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--white);
  opacity: 0;
  transform: translate(-50%, -42%);
  transition: opacity 220ms ease, transform 220ms var(--ease-cinema);
  pointer-events: none;
}

.work-card__play .cinema-icon {
  width: 48px;
  height: 48px;
  color: var(--gold-bright);
  border-color: rgba(230, 195, 123, 0.55);
  background: rgba(3, 4, 5, 0.58);
  font-size: 17px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.work-card__play b {
  font: 500 8px/1 var(--font-mono);
  letter-spacing: 0.14em;
}

.work-card:hover .work-card__play,
.work-card:focus-visible .work-card__play {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.work-modal {
  width: min(920px, calc(100% - 40px));
  max-width: none;
  max-height: calc(100svh - 40px);
  margin: auto;
  padding: 0;
  overflow: auto;
  color: var(--white);
  border: 1px solid rgba(230, 195, 123, 0.34);
  border-radius: 0;
  background: #07090c;
  box-shadow: 0 42px 120px rgba(0, 0, 0, 0.76);
}

.work-modal::backdrop {
  background: rgba(2, 3, 4, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.work-modal[open] {
  animation: work-modal-in 260ms var(--ease-cinema) both;
}

.work-modal__panel {
  min-width: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(255, 255, 255, 0.018) 31px 32px),
    #090b0e;
}

.work-modal__bar {
  min-height: 58px;
  padding-left: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.work-modal__bar p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--text-faint);
  font: 500 8px/1 var(--font-mono);
  letter-spacing: 0.12em;
}

.work-modal__bar b {
  color: var(--gold-bright);
  font-weight: 500;
}

.work-modal__close {
  position: relative;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}

.work-modal__close i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 19px;
  height: 1px;
  background: var(--white);
}

.work-modal__close i:first-child { transform: translate(-50%, -50%) rotate(45deg); }
.work-modal__close i:last-child { transform: translate(-50%, -50%) rotate(-45deg); }

.work-modal__close:hover { background: rgba(255, 255, 255, 0.05); }
.work-modal__close:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: -4px; }

.work-modal__media {
  position: relative;
  background: #000;
}

.work-modal__media::before {
  content: "";
  position: absolute;
  inset: 12px;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.work-modal__media video {
  width: 100%;
  max-height: min(58svh, 520px);
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #000;
}

.work-modal__info {
  min-height: 92px;
  padding: 18px 22px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  border-top: 1px solid var(--line);
}

.work-modal__info p {
  margin: 0 0 8px;
  color: var(--cyan);
  font: 500 8px/1 var(--font-mono);
  letter-spacing: 0.12em;
}

.work-modal__info h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
}

.work-modal__info > span {
  color: var(--text-faint);
  font: 500 8px/1.5 var(--font-mono);
  letter-spacing: 0.08em;
  text-align: right;
}

body.modal-open {
  overflow: hidden;
}

.platform-stage {
  margin-top: clamp(24px, 3vw, 38px);
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, 0.55fr);
  align-items: stretch;
  gap: 18px;
}

.platform-stage .workflow-board,
.platform-stage .feature-system {
  height: 100%;
  margin-top: 0;
}

.platform-stage .workflow-board__body {
  min-height: 330px;
}

.platform-stage .workflow-nodes {
  min-height: 214px;
}

.platform-stage .workflow-node {
  min-height: 94px;
  padding: 14px;
}

.platform-stage .feature-system {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
}

.platform-stage .feature-system__head {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}

.platform-stage .feature-system__head .eyebrow {
  margin-bottom: 9px;
}

.platform-stage .feature-system__head h3 {
  font-size: clamp(24px, 2vw, 28px);
  line-height: 1.16;
}

.platform-stage .feature-tabs {
  width: 100%;
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
}

.platform-stage .feature-tabs button {
  min-width: 0;
  min-height: 44px;
  padding: 0 7px;
  font-size: 11px;
}

.platform-stage .feature-panels {
  flex: 1;
  display: flex;
}

.platform-stage .feature-panel {
  width: 100%;
  min-height: 100%;
  grid-template-columns: 1fr;
}

.platform-stage .feature-panel article {
  min-height: 0;
  padding: 18px 20px;
  border-right: 0;
  border-bottom: 1px solid var(--line);
}

.platform-stage .feature-panel article:last-child {
  border-bottom: 0;
}

.platform-stage .feature-panel h4 {
  margin: auto 0 8px;
  font-size: 18px;
  line-height: 1.35;
}

.platform-stage .feature-panel p {
  font-size: 12px;
  line-height: 1.62;
}

@keyframes work-modal-in {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.feature-system__head h3 {
  font-size: clamp(30px, 3.2vw, 44px);
}

.feature-panel h4 {
  font-size: 21px;
}

.service-lane h3 {
  font-size: clamp(32px, 3.2vw, 44px);
}

.world-board__advantages h3 {
  font-size: 23px;
}

.contact-copy h2 {
  font-size: clamp(44px, 5.2vw, 72px);
  line-height: 1.04;
}

@media (min-width: 961px) and (min-height: 680px) {
  html {
    scroll-snap-type: y mandatory;
    scroll-padding-top: var(--header-height);
  }

  body {
    overscroll-behavior-y: none;
  }

  .hero,
  .business,
  .production,
  .platform,
  .services,
  .global,
  .contact,
  .site-footer,
  .chapter-panel {
    scroll-snap-align: start;
  }

  .hero,
  .business,
  .services,
  .global,
  .contact,
  .chapter-panel {
    scroll-snap-stop: always;
  }

  .business,
  .services,
  .global {
    min-height: 100svh;
    padding: var(--chapter-top) 0 var(--chapter-bottom);
    display: flex;
    align-items: center;
  }

  .business > .shell,
  .services > .shell,
  .global > .shell {
    width: min(calc(100% - (var(--gutter) * 2)), 1240px);
  }

  .production,
  .platform {
    padding: 0;
  }

  .chapter-panel {
    min-height: 100svh;
    padding: var(--chapter-top) 0 var(--chapter-bottom);
    scroll-margin-top: var(--header-height);
  }

  .chapter-panel--works,
  .chapter-panel--platform-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .chapter-panel--efficiency {
    margin-top: 0;
    align-content: center;
  }

  .intro-grid {
    gap: clamp(50px, 7vw, 96px);
    margin-bottom: clamp(34px, 4.4vw, 54px);
  }

  .intro-statement {
    padding-block: 22px;
  }

  .capability-item {
    min-height: 248px;
    padding: 22px;
  }

  .capability-item .cinema-icon {
    width: 42px;
    height: 42px;
    margin-top: 22px;
    font-size: 16px;
  }

  .matrix-axis {
    min-height: 62px;
    padding: 14px 20px;
  }

  .matrix-label,
  .matrix-cell {
    min-height: 158px;
  }

  .matrix-label {
    padding: 20px;
  }

  .matrix-cell {
    padding: 25px 26px;
  }

  .matrix-cell p {
    top: 18px;
    left: 26px;
  }

  .track-card {
    min-height: 330px;
    padding: 24px;
  }

  .track-card__top span {
    font-size: 32px;
  }

  .track-card .cinema-icon {
    width: 44px;
    height: 44px;
    margin-top: 22px;
    font-size: 17px;
  }

  .track-card > p {
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.7;
  }

  .metric {
    min-height: 208px;
    padding: 24px 20px;
  }

  .comparison-table {
    margin-top: 22px;
  }

  .comparison-table > div {
    min-height: 56px;
  }

  .works-heading {
    margin-top: 0;
    padding-bottom: 18px;
  }

  .works-grid {
    margin-top: 18px;
  }

  .works-heading,
  .works-grid {
    max-width: min(1000px, calc(150svh - 330px));
  }

  .work-card,
  .work-card:first-child {
    max-height: none;
    aspect-ratio: 3 / 4;
  }

  .product-intro {
    grid-template-columns: 0.42fr 1.2fr;
    gap: clamp(48px, 7vw, 96px);
  }

  .workflow-board {
    margin-top: clamp(28px, 3.8vw, 46px);
  }

  .workflow-board__body {
    min-height: 390px;
  }

  .workflow-nodes {
    min-height: 258px;
  }

  .workflow-node {
    min-height: 108px;
    padding: 16px;
  }

  .architecture-layer {
    min-height: 104px;
    padding: 17px 24px;
  }

  .architecture-layer span {
    min-height: 46px;
  }

  .service-lane {
    min-height: 490px;
    padding: clamp(24px, 3vw, 38px);
  }

  .service-lane .cinema-icon {
    width: 46px;
    height: 46px;
    margin-top: 28px;
    font-size: 17px;
  }

  .service-lane h3 {
    margin-top: 22px;
  }

  .service-lane > p {
    margin-bottom: 22px;
  }

  .service-lane li {
    padding-block: 12px;
  }

  .world-board__markets {
    padding: 30px 36px;
  }

  .market-list article {
    min-height: 88px;
    padding: 16px 0;
  }

  .world-board__advantages article {
    min-height: 330px;
    padding: 25px 22px;
  }

  .global-route {
    margin-top: 18px;
    padding: 20px 24px;
  }

  .global-route > p {
    margin-bottom: 16px;
  }

  .global-route li {
    min-height: 66px;
  }

  .contact {
    min-height: 100svh;
    padding: var(--chapter-top) 0 var(--chapter-bottom);
  }

  .inquiry-form {
    padding: clamp(26px, 3vw, 38px);
  }

  .field {
    margin-bottom: 14px;
  }

  .field input,
  .field select {
    min-height: 46px;
  }

  .field textarea {
    min-height: 96px;
  }

  .site-footer {
    scroll-snap-stop: normal;
  }
}

@media (max-width: 960px) {
  .hero-copy h1 {
    font-size: clamp(46px, 10vw, 68px);
  }

  .section-heading h2,
  .intro .section-heading h2 {
    font-size: clamp(38px, 8vw, 54px);
  }

  .contact-copy h2 {
    font-size: clamp(42px, 9vw, 60px);
  }

  .hero-meta {
    display: none;
  }

  .works-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-card,
  .work-card:first-child {
    grid-column: auto;
    min-height: 0;
    aspect-ratio: 3 / 4;
  }

  .platform-stage {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .product-lockup {
    order: 0;
  }
}

@media (max-width: 700px) {
  :root {
    --section-space: 80px;
  }

  .hero {
    min-height: 850px;
    height: max(850px, 100svh);
  }

  .hero-inner {
    min-height: 850px;
    padding-top: calc(var(--header-height) + 78px);
    padding-bottom: 92px;
  }

  .hero-copy h1 {
    font-size: clamp(44px, 13.2vw, 58px);
    line-height: 0.98;
  }

  .hero-lead {
    font-size: 15px;
    line-height: 1.75;
  }

  .hero-capabilities {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-capabilities article {
    min-height: 66px;
    padding: 9px 10px;
  }

  .hero-capabilities article:nth-child(2) {
    border-right: 0;
  }

  .hero-capabilities article:nth-child(-n + 2) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .works-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-card__play {
    opacity: 1;
    transform: translate(-50%, -50%);
  }

  .work-card__play b {
    display: none;
  }

  .work-modal {
    width: calc(100% - 20px);
    max-height: calc(100svh - 20px);
  }

  .work-modal__bar {
    min-height: 52px;
    padding-left: 14px;
  }

  .work-modal__close {
    width: 52px;
    height: 52px;
  }

  .work-modal__info {
    min-height: 78px;
    padding: 14px 16px;
  }

  .work-modal__info h3 {
    font-size: 20px;
  }

  .work-modal__info > span {
    max-width: 140px;
  }

  .section-heading h2,
  .intro .section-heading h2 {
    font-size: clamp(36px, 10.5vw, 48px);
  }

  .intro-statement p:first-child {
    font-size: 18px;
  }

  .track-card h3 {
    font-size: 32px;
  }

  .feature-system__head h3 {
    font-size: 32px;
  }

  .service-lane h3 {
    font-size: clamp(32px, 9vw, 40px);
  }

  .contact-copy h2 {
    font-size: clamp(40px, 11vw, 54px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-snap-type: none;
  }

  .hero,
  .section,
  .contact,
  .chapter-panel,
  .site-footer {
    scroll-snap-align: none;
    scroll-snap-stop: normal;
  }
}
