/* The two films share one scroll transition. The portrait version adds a phone frame. */
#home-reel.film-sequence,
#ritiki-film.film-sequence {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 100%;
  padding: clamp(72px, 12vh, 120px) var(--base-padding-x, 5%) clamp(72px, 10vh, 110px);
}

#home-reel.film-sequence {
  --film-aspect: 9 / 16;
  --film-end-width: min(100%, 454px, calc((100svh - 176px) * .5625));
}

#ritiki-film.film-sequence {
  --film-aspect: 16 / 9;
  --film-end-width: min(100%, 1260px, calc((100svh - 214px) * 1.7778));
  z-index: 2;
  background: #080e0c;
  color: #eaf7ef;
  padding-bottom: clamp(110px, 16vh, 160px);
}

.film-sequence-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 6vw, 100px);
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
}

.film-sequence-start,
.film-sequence-end,
.film-sequence-screen {
  aspect-ratio: var(--film-aspect);
}

.film-sequence-start { justify-self: center; }
.film-sequence--portrait .film-sequence-start { width: clamp(180px, 20vw, 264px); }
.film-sequence--landscape .film-sequence-start { width: 100%; max-width: 560px; }

.film-sequence-end {
  width: var(--film-end-width);
  margin: clamp(74px, 14vh, 130px) auto min(20svh, 176px);
}

.film-sequence-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  opacity: var(--film-copy-opacity, 1);
}

.film-sequence-copy:focus-within { opacity: 1; }

#home-reel #home-reel-title {
  font-size: clamp(38px, 5.1vw, 80px) !important;
  margin: 0 0 clamp(18px, 3vw, 36px) !important;
}

#home-reel #home-reel-content { max-width: 560px; }
#home-reel #home-reel-cta { float: none; margin-bottom: 0 !important; opacity: 1; }

.film-sequence-player {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: var(--film-player-width, var(--film-end-width));
  pointer-events: none;
  transform-origin: top left;
  visibility: hidden;
}

.film-sequence.is-measured .film-sequence-player { visibility: visible; }

.film-sequence-screen {
  position: relative;
  z-index: 1;
  width: 100%;
  overflow: hidden;
  border-radius: var(--film-screen-radius, 16px);
  background: #030705;
}

#home-reel-video-container.film-sequence-screen {
  aspect-ratio: 9 / 16;
  margin: 0 !important;
}

.film-sequence-screen > img,
#home-reel-inline-video,
.inline-film-media {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
}

.film-sequence--portrait .film-sequence-poster,
#home-reel-inline-video { filter: grayscale(var(--film-grayscale, .86)); }

.film-phone-frame {
  position: absolute;
  z-index: 0;
  inset: -11px;
  border: 1px solid #afb9b4b3;
  border-radius: 43px;
  background: linear-gradient(151deg, #879390 0%, #34413f 18%, #151c1a 61%, #697572 100%);
  box-shadow: inset 0 0 0 2px #172320, inset 0 0 0 5px #070d0c, 0 15px 44px #0009;
  opacity: var(--phone-opacity, 1);
}

.film-phone-frame::before,
.film-phone-frame::after {
  content: "";
  position: absolute;
  width: 3px;
  border-radius: 2px;
  background: #65716e;
}

.film-phone-frame::before { top: 19%; left: -4px; height: 12%; }
.film-phone-frame::after { top: 25%; right: -4px; height: 9%; }

.film-phone-camera {
  position: absolute;
  z-index: 2;
  top: 13px;
  left: 50%;
  width: 20%;
  height: 17px;
  transform: translateX(-50%);
  border-radius: 18px;
  background: #09100f;
  opacity: var(--phone-opacity, 1);
}

#home-reel-inline-video {
  z-index: 2;
  background: #030705;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

#home-reel .is-inline-playing #home-reel-inline-video {
  opacity: 1;
}

#home-reel .is-inline-playing #home-reel-inline-video[controls] { pointer-events: auto; }

#home-reel #home-reel-video-watch-btn,
.inline-film-play {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: max-content;
  height: auto;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid #e0fff5aa;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background: #ecfff5;
  color: #101a16;
  font: 550 12px/1.4 Pretendard, sans-serif;
  cursor: pointer;
  visibility: hidden;
  pointer-events: none;
}

#home-reel #home-reel-video-watch-btn {
  width: 52px !important;
  height: 48px !important;
  padding: 0;
  transform: translate(-50%, -50%) scale(var(--reel-control-scale, 1));
}

#home-reel #home-reel-video-watch-btn svg,
.inline-film-play svg { width: 19px; height: 19px; fill: currentColor; }

#home-reel .is-reel-visible #home-reel-video-watch-btn,
.film-sequence.is-expanded .inline-film-play { visibility: visible; pointer-events: auto; }

#home-reel .is-inline-playing #home-reel-video-watch-btn {
  inset: auto 12px 12px auto;
  width: 44px !important;
  height: 44px !important;
  min-height: 0;
  border-color: #b3f8e387;
  background: #0a1a17d9;
  color: #e6fff6;
  transform: scale(var(--reel-control-scale, 1));
  transform-origin: right bottom;
}

#home-reel #home-reel-video-watch-btn:focus-visible { outline: 2px solid #a2f7dd; outline-offset: 3px; }
#home-reel-video-watch-btn .reel-pause,
#home-reel-video-watch-btn[data-playing="true"] .reel-play,
#home-reel.is-expanded .is-inline-playing #home-reel-video-watch-btn:not(:focus-visible),
.inline-film-frame.is-playing .inline-film-play { display: none; }
#home-reel-video-watch-btn[data-playing="true"] .reel-pause { display: block; }

#home-featured > .brand-brochures a {
  gap: 15px;
  min-height: 45px;
  padding: 10px 16px;
  border-color: #90eace86;
  background: linear-gradient(155deg, #214039, #142821 80%);
  box-shadow: inset 0 1px 0 #ceffed1f, 0 0 18px #a2f7dd16;
  color: #e7fff5;
  font: 620 clamp(12px, 1vw, 14px)/1.3 Pretendard, sans-serif;
  transition: background .22s ease, box-shadow .22s ease, color .22s ease;
}

#home-featured > .brand-brochures a svg { color: #a2f7dd; }
#home-featured > .brand-brochures a:is(:hover, :focus-visible) {
  background: #a2f7dd;
  color: #102923;
  box-shadow: 0 0 24px #a2f7dd45;
}
#home-featured > .brand-brochures a:is(:hover, :focus-visible) svg { color: inherit; }

.inline-film-heading p {
  margin: 0 0 19px;
  color: #93c7b0;
  font: 500 10px/1.5 Pretendard, sans-serif;
  letter-spacing: .14em;
}

.inline-film-heading h2 {
  margin: 0;
  font: 460 clamp(31px, 3.5vw, 54px)/1.22 Pretendard, sans-serif;
  letter-spacing: -.045em;
  word-break: keep-all;
}

.inline-film-heading > span {
  display: block;
  margin-top: 22px;
  color: #a6c2b3;
  font: 400 11px/1.75 Pretendard, sans-serif;
}

.inline-film-media { pointer-events: none; }

.inline-film-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px auto 0;
  visibility: hidden;
}

.is-expanded .inline-film-actions { visibility: visible; pointer-events: auto; }

.inline-film-actions button {
  padding: 9px 15px;
  border: 1px solid #bdffe237;
  border-radius: 25px;
  background: #10231b;
  color: #c6f7dc;
  font: 400 11px/1.5 Pretendard, sans-serif;
  white-space: nowrap;
  cursor: pointer;
}

.inline-film-actions button:disabled { opacity: .35; cursor: default; }

.inline-film-actions p {
  margin: 0 0 0 auto;
  color: #9cb9ab;
  font: 400 10px/1.5 Pretendard, sans-serif;
}

.inline-film-actions a {
  display: block;
  width: max-content;
  margin-left: auto;
  color: #c6f7dc;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.inline-film-timeline {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 12px;
  min-width: 100px;
  margin-left: 8px;
}

.inline-film-timeline input { width: 100%; min-width: 40px; accent-color: #a0edc6; cursor: pointer; }
.inline-film-timeline output { color: #a8cbb9; font: 400 10px/1.3 Pretendard, sans-serif; white-space: nowrap; }

#home-reel-video-watch-btn:focus-visible,
.inline-film-play:focus-visible,
.inline-film-actions a:focus-visible,
.inline-film-actions button:focus-visible { outline: 2px solid #b1ffdc; outline-offset: 3px; }

.inline-film-shell:fullscreen {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: none;
  padding: 20px;
  transform: none !important;
  background: #020604;
  pointer-events: auto;
}

.inline-film-shell:fullscreen .inline-film-frame {
  width: 100%;
  height: min(calc(100dvh - 100px), calc(100dvw * .5625));
  aspect-ratio: auto;
}

.inline-film-shell:fullscreen .inline-film-actions { width: 100%; visibility: visible; }

#home-company { padding-top: 32px; }
#home-company > div:first-child { border-top: 0 !important; }
#home-company #home-about-clients { padding-bottom: 58px; }
#home-company #home-about-award { padding: 35px 0 50px; }
#home-company .brand-history-heading { font-size: clamp(24px, 3vw, 37px); }

#home-company .brand-history-year ol { gap: 7px; }
#home-company .brand-history-year li { padding-block: 0 !important; }

#page-container:has(#home) #end-section { overflow: clip; }
#page-container:has(#home) #end-bottom { display: none !important; }
#home-company-intro { position: relative; width: 100%; color: #f1f8f3; background: transparent; }
#home-company-intro #about-who { position: relative; width: 100%; }
#page-container:not(:has(#home)) #home-company-intro,
#page-container:not(:has(#home)) #ritiki-film { display: none; }
#home-featured .project-item[data-id=oryzo_ai] .service-preview-video { object-position: 50% 35%; }

#home-goal-texts {
  line-height: 1.58;
  word-break: keep-all;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

@media (max-width: 700px) {
  #home-reel.film-sequence,
  #ritiki-film.film-sequence { padding-inline: 19px; padding-top: 68px; }
  #home-reel.film-sequence { --film-end-width: min(91%, 360px, calc((100svh - 166px) * .5625)); padding-top: 60px; }
  #ritiki-film.film-sequence { --film-end-width: min(100%, calc((100svh - 160px) * 1.7778)); }
  .film-sequence-stage { display: flex; flex-direction: column; align-items: stretch; gap: 32px; }
  .film-sequence-start { order: 2; align-self: center; }
  .film-sequence--portrait .film-sequence-stage { gap: 28px; }
  .film-sequence--portrait .film-sequence-start { width: min(48%, 204px); }
  .film-sequence--landscape .film-sequence-start { width: 73%; }
  .film-sequence-end { margin-top: 80px; }
  #home-reel #home-reel-title { font-size: clamp(36px, 10vw, 56px) !important; }
  .inline-film-heading p { font-size: 9px; margin-bottom: 14px; }
  .inline-film-heading h2 { font-size: clamp(27px, 7.4vw, 40px); }
  .inline-film-heading > span { margin-top: 14px; }
  .inline-film-actions { flex-wrap: wrap; gap: 7px; }
  .inline-film-actions button { padding: 8px 10px; font-size: 10px; }
  .inline-film-timeline { order: 5; flex-basis: 100%; margin: 2px 0 0; }
  .inline-film-actions p { flex: 1; text-align: right; font-size: 8px; }
  #home-company { padding-top: 18px; }
  #home-company #home-about-clients { padding-bottom: 37px; }
  #home-company #home-about-award { padding: 28px 0 36px; }
  #home-goal #home-goal-title { font-size: clamp(30px, 9.3vw, 58px) !important; word-break: keep-all; }
}

@media (prefers-reduced-motion: reduce) {
  .film-sequence-stage { display: block; }
  .film-sequence-start { display: none; }
  .film-sequence-end { margin: 30px auto 0; }
}
