
    iO                       d Z ddlmZ ddlZddlZddlZddlmZ ddlZddl	m
Z
  ed      Zedz  Zedz  Zed	z  Z ej                         d
z  Zej#                  dd       ej$                  j'                  dd       ddlZdZdZdZdZdZdZd%dZd&dZd'dZd(dZedk(  r ej
                         Z  e!d        e!d        e!de         e!d        e       Z" ee"      Z# ee#e        ej
                         e z
  Z$ e!dejJ                   de$dd       ejM                         r4 e!d ejO                         jP                  d!z  d"d#        e!d$e        yyy))u-  Venus A-5 CTA slide — Meta Carousel Slide (밝은 CTA 슬라이드).

Hybrid: Gemini background (brightest dawn/light scene) +
        Playwright HTML overlay (Korean text, gold CTA button, trust anchors).
Output: /home/jay/workspace/output/meta-ads/a-group-venus/venus-A5-cta.png

Design:
- Background: Brightest in the carousel — warm light streaming through doorway/window
- Headline: "전략을 바꿀 준비가 됐다면, 지금 딱 한 번 물어보세요." (딱 한 번 gold accent)
- Subheadline: "서울대보험쌤 팀장이 직접 답합니다. 조건 없는 상담, 당신 상황에 맞는 방향 제시."
- CTA Button: "무료 상담 신청하기" — dark text #1A0E00 on gold background (WCAG AAA)
- Trust anchors: "조건 없음 · 무료 상담 · 팀장 직접 응대"
- Page indicator: 5/5
    )annotationsN)Path)sync_playwrightz1/home/jay/workspace/output/meta-ads/a-group-venusz_bg_venus_a5_cta.jpgz_venus_a5_cta_template.htmlzvenus-A5-cta.pngz.local/share/fonts/PretendardTparentsexist_okz&/home/jay/workspace/tools/ai-image-genz0https://generativelanguage.googleapis.com/v1betazgemini-3-pro-image-previewzgemini-3.1-flash-image-previewzgemini-2.5-flash-preview-04-17z3https://www.googleapis.com/auth/generative-languageu  
Photorealistic warm sunrise/dawn light pouring through a wide open doorway or large floor-to-ceiling window.
Brilliant golden morning sunlight streams dramatically inward, creating beautiful volumetric god-rays
and warm bokeh particles floating in the air. The scene radiates hope, new beginnings, and forward momentum.

COMPOSITION: 1:1 square, 1080x1080px. Full bleed. No text, no people, no faces, no logos.

VISUAL CONCEPT:
A threshold moment — standing at the edge of a bright new beginning. Warm golden light floods in
from a large open door or expansive window, suggesting the final step into a new chapter.
The light is brilliant, warm, and enveloping — not harsh, but luminous and welcoming.
Soft lens flare and golden dust motes drift in the air, catching the dawn light.
This is the BRIGHTEST image in a 5-slide carousel series — maximum warmth and luminosity.

BACKGROUND ELEMENTS:
- Dominant warm cream/ivory base (#F5F0E8, #FFF8EC) — luminous and bright
- Brilliant warm golden sunrise light (#E8C870 / #C9A84C tones) streaming from center-top or upper portion
- Beautiful volumetric light rays (god rays) piercing through the opening
- Soft golden bokeh circles and light particles floating in the air
- A subtle architectural element: door frame or window frame barely visible as a silhouette
- The lower 40% of the image is slightly darker warm cream — space for text overlay
- Overall: airy, premium, "threshold of hope and success" feeling

MOOD / ATMOSPHERE:
- Hope. New beginning. Clarity. The courage to take one step.
- "Just one question away from change" — lowest possible barrier perception
- Premium Korean financial advisory — warm and welcoming
- Action-ready energy: the dawn of a new strategy

COLOR PALETTE:
- Primary: Warm cream (#FFF8EC), golden ivory (#F5EDD8), soft off-white (#FFFDF7)
- Golden accent glow: #E8C870 to #C9A84C — rich, warm, visible but gentle
- No dark tones whatsoever — this is the brightest, most hopeful slide
- No cool tones — only warm cream/gold/ivory family
- Maximum warmth: the payoff moment after a dark-to-light journey

PHOTOGRAPHIC QUALITY:
- Shot on Hasselblad H6D-100c, 35mm lens, f/2.0 aperture
- Shallow depth of field with beautiful bokeh background
- Soft natural vignette at edges — bright center convergence
- Cinematic warmth — Christopher Nolan / Terrence Malick golden hour aesthetic

STYLE REQUIREMENTS:
- NO people, faces, hands, or figures
- NO text, numbers, labels, or UI elements
- NO dark zones — entire image must be bright and luminous
- Photorealistic commercial photography quality
- Premium advertising background — supportive of overlaid dark text
- The content overlay will use dark text (#1A0E00) so background MUST remain bright throughout
- Ensure the center and bottom areas have sufficient brightness and warmth
c            
        t         j                         rt        dt                 t         S t        d       t        j                  t
              d%fd} t        j                         }t        t        t        fD ]  }t        d|        	  | |      }|j                  dv rt        d|j                   d       C	 |j                          |j#                         }|j%                  dg       }|st        dt'        |      d d         |d   j%                  di       j%                  dg       }t)        d |D        d       }|7|D 	cg c]  }	d|	v s|	j%                  dd       }
}	t        d|
d d         |d   j%                  dd      }|d   d   }d|v rdnd}t         j+                  |      }|j-                  t/        j0                  |             t        d|j2                   d|j5                         j6                  d d!t        j                         |z
  d"d#       |c S  t9        d$      # t        $ r}t        d|        Y d }~d }~ww xY w# t        j                  $ rG}t        d	|j                  j                   d
|j                  j                   d d         Y d }~:d }~ww xY wc c}	w )&Nu(   [BG] 기존 배경 이미지 재사용: u1   [BG] Gemini API로 배경 이미지 생성 중...c                    t          d|  d}d dd}ddt        igigdd	gd
dd}t        j                  |||d      S )Nz/models/z:generateContentzBearer zapplication/json)AuthorizationzContent-TypepartstextIMAGETEXTg      ?)responseModalitiestemperature)contentsgenerationConfig,  )headersjsontimeout)GEMINI_API_BASE	BG_PROMPTrequestspost)model_idurlr   payloadtokens       \/home/jay/workspace/.worktrees/task-2116-dev1/tools/ai-image-gen/_backup/gen_venus_a5_cta.py_callz"generate_background.<locals>._callm   sn     !(3CD&ug..

 "VY$7#89:'.&7"!
 }}S'MM    u     -> 모델 시도: u     [WARN] 요청 실패: )i  i  i  z  [WARN] HTTP u    — 다음 모델 시도z  [ERROR] HTTP z: r   
candidatesu     [WARN] candidates 없음:    r   contentr   c              3  *   K   | ]  }d |v s|  yw)
inlineDataN ).0ps     r    	<genexpr>z&generate_background.<locals>.<genexpr>   s     ?q\Q->?s   	r    u&     [WARN] 이미지 없음. 텍스트:    r'   mimeTypez
image/jpegdatajpegz.jpgz.pngu   [BG] 완료:  (,z bytes, .1fu   초)u    [BG] 모든 모델 시도 실패)r   strreturnzrequests.Response)BG_PATHexistsprintgcloud_authget_service_account_tokenSCOPEtimeMODEL_PRIMARYMODEL_FALLBACKMODEL_FALLBACK2	Exceptionstatus_coderaise_for_statusr   	HTTPErrorresponser   r   getr4   nextwith_suffixwrite_bytesbase64	b64decodenamestatst_sizeRuntimeError)r!   t0r   resper/   r#   r   img_partr*   textsmimeb64extfpathr   s                  @r    generate_backgroundrX   e   s   ~~8	BC	
=>11%8EN 
B"NOD %$XJ/0	?D
 .N4#3#3"44MNO	!!#
 yy{XXlB/
0T4C0ABC1!!)R044WbA?E?F05E11QUU62&EEE:5!9+FG&**:|D&v. D.f##C(&**3/0ejj\EJJL,@,@+C8DIIKXZN[^K__cdeK%N 9
::G  	,QC01	 !! 	OAJJ$:$:#;2ajjoods>S=TUV	 Fs<   H=I"	J?J?=	III"J<5<J77J<c                v    d| j                          }t        t              }d| d| d| d| d| d| d| d	S )
Nfile://z<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<style>
  @font-face {
    font-family: 'Pretendard';
    src: url('file://z/PretendardVariable.ttf') format('truetype');
    font-weight: 100 900;
  }
  @font-face {
    font-family: 'Pretendard';
    src: url('file://z/Pretendard-Black.otf') format('opentype');
    font-weight: 900;
  }
  @font-face {
    font-family: 'Pretendard';
    src: url('file://z/Pretendard-ExtraBold.otf') format('opentype');
    font-weight: 800;
  }
  @font-face {
    font-family: 'Pretendard';
    src: url('file://z/Pretendard-Bold.otf') format('opentype');
    font-weight: 700;
  }
  @font-face {
    font-family: 'Pretendard';
    src: url('file://z/Pretendard-Medium.otf') format('opentype');
    font-weight: 500;
  }
  @font-face {
    font-family: 'Pretendard';
    src: url('file://u  /Pretendard-Regular.otf') format('opentype');
    font-weight: 400;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }

  html, body {
    width: 1080px;
    height: 1080px;
    overflow: hidden;
    background: #FFF8EC;
  }

  /* ── Canvas: background image ── */
  .canvas {
    width: 1080px;
    height: 1080px;
    position: relative;
    background-image: url('u!  ');
    background-size: cover;
    background-position: center center;
    font-family: 'Pretendard', 'Noto Sans KR', sans-serif;
    overflow: hidden;
  }

  /* ── Very light warm overlay — preserves bright background, adds bottom contrast ── */
  .overlay {
    position: absolute;
    inset: 0;
    background:
      radial-gradient(ellipse 80% 50% at 50% 30%, rgba(255, 252, 240, 0.25) 0%, transparent 70%),
      linear-gradient(
        180deg,
        rgba(255, 252, 245, 0.30) 0%,
        rgba(255, 250, 238, 0.15) 30%,
        rgba(245, 240, 228, 0.05) 55%,
        rgba(255, 248, 228, 0.45) 75%,
        rgba(255, 245, 215, 0.70) 100%
      );
    pointer-events: none;
  }

  /* All content above overlay */
  .content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 72px;
  }

  /* ── PAGE INDICATOR (bottom-right absolute) ── */
  .page-indicator {
    position: absolute;
    bottom: 52px;
    right: 58px;
    font-family: 'Pretendard', sans-serif;
    font-size: 34px;
    font-weight: 500;
    color: rgba(100, 75, 25, 0.55);
    letter-spacing: 0.06em;
    z-index: 10;
    font-variant-numeric: tabular-nums;
  }

  /* ── TOP SPACER ── */
  .top-spacer {
    height: 108px;
    flex-shrink: 0;
  }

  /* ── HEADLINE SECTION — center ── */
  .headline-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 8px;
  }

  /* Decorative top element — small gold ornament above headline */
  .top-ornament {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
  }

  .ornament-line {
    width: 60px;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, #C9A84C);
  }

  .ornament-line.right {
    background: linear-gradient(90deg, #C9A84C, transparent);
  }

  .ornament-diamond {
    width: 10px;
    height: 10px;
    background: #C9A84C;
    transform: rotate(45deg);
    box-shadow: 0 0 8px rgba(201, 168, 76, 0.60);
    flex-shrink: 0;
  }

  /* Headline */
  .headline {
    font-family: 'Pretendard', sans-serif;
    font-size: 70px;
    font-weight: 900;
    line-height: 1.24;
    letter-spacing: -0.030em;
    color: #1A0E00;
    word-break: keep-all;
    text-align: center;
    margin-bottom: 28px;
  }

  /* "딱 한 번" accent: gold color + underline + slightly larger */
  .headline .accent {
    color: #C9A84C;
    font-weight: 900;
    text-decoration: underline;
    text-decoration-color: rgba(201, 168, 76, 0.80);
    text-decoration-thickness: 4px;
    text-underline-offset: 8px;
    font-size: 78px;
  }

  /* Gold divider: line-dot-line */
  .divider {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    max-width: 500px;
    margin-bottom: 28px;
  }

  .divider-line {
    flex: 1;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.50), transparent);
  }

  .divider-dot {
    width: 8px;
    height: 8px;
    background: #C9A84C;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(201, 168, 76, 0.65);
  }

  /* Subheadline */
  .subcopy {
    font-family: 'Pretendard', sans-serif;
    font-size: 40px;
    font-weight: 500;
    line-height: 1.72;
    color: rgba(40, 28, 8, 0.78);
    text-align: center;
    word-break: keep-all;
    letter-spacing: -0.015em;
  }

  /* ── BOTTOM SECTION ── */
  .bottom-section {
    width: 100%;
    padding: 0 0 68px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    flex-shrink: 0;
  }

  /* ── CTA BUTTON ── */
  /* SUCCESS pattern #10: dark text on gold — WCAG AAA (#1A0E00 on gold = 8.5:1+) */
  .cta-btn {
    width: 100%;
    max-width: 880px;
    background: linear-gradient(
      135deg,
      #D4A84C 0%,
      #F0CA60 35%,
      #E8C255 55%,
      #C9A030 80%,
      #B88A20 100%
    );
    color: #1A0E00;
    font-family: 'Pretendard', sans-serif;
    font-size: 50px;
    font-weight: 900;
    letter-spacing: -0.020em;
    text-align: center;
    padding: 36px 48px;
    border-radius: 20px;
    word-break: keep-all;
    box-shadow:
      0 0 56px rgba(201, 168, 76, 0.45),
      0 10px 36px rgba(0, 0, 0, 0.18),
      inset 0 2px 0 rgba(255, 255, 255, 0.42),
      inset 0 -3px 0 rgba(0, 0, 0, 0.10);
    position: relative;
    overflow: hidden;
  }

  /* Subtle inner highlight */
  .cta-btn::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 45%;
    background: linear-gradient(180deg, rgba(255,255,255,0.20) 0%, transparent 100%);
    border-radius: 20px 20px 0 0;
  }

  /* ── TRUST ANCHOR ── */
  .trust-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
  }

  .trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Pretendard', sans-serif;
    font-size: 34px;
    font-weight: 600;
    color: rgba(60, 42, 10, 0.70);
    letter-spacing: -0.01em;
  }

  .trust-icon {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
  }

  .trust-sep {
    width: 5px;
    height: 5px;
    background: rgba(201, 168, 76, 0.60);
    border-radius: 50%;
    flex-shrink: 0;
  }

</style>
</head>
<body>
<div class="canvas">

  <!-- Warm overlay -->
  <div class="overlay"></div>

  <!-- Page indicator (absolute bottom-right) -->
  <div class="page-indicator">5/5</div>

  <!-- Content layer -->
  <div class="content">

    <!-- Top spacer -->
    <div class="top-spacer"></div>

    <!-- HEADLINE SECTION: center -->
    <div class="headline-section">

      <!-- Gold ornament above headline -->
      <div class="top-ornament">
        <div class="ornament-line"></div>
        <div class="ornament-diamond"></div>
        <div class="ornament-line right"></div>
      </div>

      <!-- Headline: "딱 한 번" accented in gold with underline + larger size -->
      <h1 class="headline">
        전략을 바꿀 준비가 됐다면,<br>
        지금 <span class="accent">딱 한 번</span> 물어보세요.
      </h1>

      <!-- Divider: line-dot-line -->
      <div class="divider">
        <div class="divider-line"></div>
        <div class="divider-dot"></div>
        <div class="divider-line"></div>
      </div>

      <!-- Subheadline -->
      <p class="subcopy">
        서울대보험쌤 팀장이 직접 답합니다.<br>
        조건 없는 상담, 당신 상황에 맞는 방향 제시.
      </p>

    </div>

    <!-- BOTTOM: CTA + Trust -->
    <div class="bottom-section">

      <!-- CTA Button: dark text #1A0E00 on gold (WCAG AAA, SUCCESS pattern #10) -->
      <div class="cta-btn">무료 상담 신청하기</div>

      <!-- Trust anchors: "조건 없음 · 무료 상담 · 팀장 직접 응대" -->
      <div class="trust-row">
        <div class="trust-item">
          <!-- Checkmark icon -->
          <svg class="trust-icon" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">
            <circle cx="13" cy="13" r="11" stroke="#C9A84C" stroke-width="2"/>
            <path d="M7.5 13L11 16.5L18.5 9" stroke="#C9A84C" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/>
          </svg>
          조건 없음
        </div>
        <div class="trust-sep"></div>
        <div class="trust-item">
          <!-- Gift/free icon -->
          <svg class="trust-icon" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">
            <rect x="4" y="11" width="18" height="12" rx="2" stroke="#C9A84C" stroke-width="2"/>
            <path d="M13 11V23" stroke="#C9A84C" stroke-width="2" stroke-linecap="round"/>
            <path d="M4 15H22" stroke="#C9A84C" stroke-width="2" stroke-linecap="round"/>
            <path d="M13 11C13 11 10 8 10 6C10 4.9 10.9 4 12 4C13 4 13 5.5 13 5.5C13 5.5 13 4 14 4C15.1 4 16 4.9 16 6C16 8 13 11 13 11Z" stroke="#C9A84C" stroke-width="1.8" stroke-linejoin="round"/>
          </svg>
          무료 상담
        </div>
        <div class="trust-sep"></div>
        <div class="trust-item">
          <!-- Person/direct icon -->
          <svg class="trust-icon" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">
            <circle cx="13" cy="9" r="4.5" stroke="#C9A84C" stroke-width="2"/>
            <path d="M4.5 23C4.5 18.9 8.4 15.5 13 15.5C17.6 15.5 21.5 18.9 21.5 23" stroke="#C9A84C" stroke-width="2" stroke-linecap="round"/>
          </svg>
          팀장 직접 응대
        </div>
      </div>

    </div>

  </div><!-- /content -->
</div><!-- /canvas -->
</body>
</html>)resolver4   FONT_DIR)bg_pathbg_urlfont_dirs      r    
build_htmlr`      s    w()*F8}H Z  
 Z  
 Z  
 Z  
 Z  
 Z  $ #8 I$e{ {r"   c                v    t        |       }t        j                  |d       t        dt                t        S )Nzutf-8)encodingu   [HTML] 오버레이 저장: )r`   	HTML_PATH
write_textr8   )r]   html_contents     r    
write_htmlrf   +  s5    g&L8	(
45r"   c           
     v   t        d       t               5 }|j                  j                  ddg      }	 |j	                  ddd      }|j                  d| j                          d	
       |j                  d       |j                  d       |j                  j                  dd       |j                  t        |      dddddd       |j                          	 d d d        |j                         j                  dz  }t        d| d|dd       y # |j                          w xY w# 1 sw Y   OxY w)Nu$   [RENDER] Playwright 캡처 시작...z--no-sandboxz--disable-dev-shm-usage)argsi8  )widthheight)viewportrZ   networkidle)
wait_untilz+async () => { await document.fonts.ready; }i  Tr   pngr   )xyri   rj   )pathtypeclip   u   [RENDER] 완료: r1   .0fz KB))r8   r   chromiumlaunchnew_pagegotor[   evaluatewait_for_timeoutparentmkdir
screenshotr4   closerL   rM   )	html_pathout_pathr*   browserpagesize_kbs         r    capturer   4  s&   	
01		 a**##.:S)T#U	##tt-L#MDII	 1 1 345-IPMMGH!!$'OO!!$!>OO]1ttD   MMO  mmo%%,G	hZr'#d
;< MMO s#   D/BDD/D,,D//D8__main__z<============================================================u;   Venus A-5 CTA — Meta 캐러셀 광고 (밝은 희망 톤)u   출력: u
   
[완료] z  (r3   u   초 총 소요)u          파일 크기: rt   ru   z KBu          경로: )r5   r   )r]   r   r5   r4   )r]   r   r5   r   )r   r   r   r   r5   None))__doc__
__future__r   rI   sysr<   pathlibr   r   playwright.sync_apir   
OUTPUT_DIRr6   rc   OUT_PATHhomer\   r}   rq   insertr9   r   r=   r>   r?   r;   r   rX   r`   rf   r   __name__t_startr8   bghtmlelapsedrK   r7   rL   rM   r(   r"   r    <module>r      s   #  
    / EF
0077	,,TYY[:: 
    - ; < D.22G2	n?;HD=0 zdiikG	(O	
GH	HXJ
 	(O		Bb>DD(diikG#G	Kc'#o
FG&x}}'>'>'Ec&J#NOz*+  r"   