* { box-sizing: border-box; }
:root {
  --bg: #060810;
  --indigo: #1a2248;
  --indigo-deep: #0c1020;
  --silver: #b8c4e8;
  --silver-soft: #dce4ff;
  --moon: #e8eeff;
  --cream: #eef1fb;
  --muted: #8b96b8;
  --line: rgba(184, 196, 232, .24);
}
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  background:
    radial-gradient(ellipse 48% 38% at 14% 16%, rgba(214, 224, 255, .07), transparent 58%),
    radial-gradient(ellipse 42% 62% at 74% 44%, rgba(0,0,0,.55) 0, rgba(0,0,0,.18) 46%, transparent 74%),
    radial-gradient(circle at 70% 22%, #1a2248 0, #0a0d18 38%, #04060c 76%);
  color: var(--cream);
  font-family: Inter, "Noto Sans KR", sans-serif;
  overflow-x: clip;
  max-width: 100vw;
}
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 2;
  background:
    radial-gradient(circle at 18% 42%, rgba(200,210,255,.04), transparent 28%),
    linear-gradient(90deg, rgba(0,0,0,.42), transparent 22%, transparent 82%, rgba(0,0,0,.28));
}
.study-moon {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background:
    radial-gradient(circle at 11% 14%, rgba(232, 238, 255, .11), transparent 22%),
    radial-gradient(circle at 9% 12%, rgba(184, 196, 232, .05), transparent 14%);
}
.study-shelves {
  position: fixed; left: 0; top: 0; bottom: 0; width: min(16vw, 128px);
  pointer-events: none; z-index: 1; opacity: .42;
  background:
    linear-gradient(90deg, rgba(8, 10, 20, .92), transparent),
    repeating-linear-gradient(
      90deg,
      rgba(110, 120, 160, .07) 0 3px,
      rgba(70, 78, 110, .04) 3px 11px,
      transparent 11px 18px
    );
  box-shadow: inset -1px 0 0 rgba(184, 196, 232, .06);
}
#scene { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
.grain {
  position: fixed; inset: -50%; z-index: 30; pointer-events: none; opacity: .08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
  animation: grain .25s steps(2) infinite;
}
@keyframes grain { 0%{transform:translate(0,0)} 25%{transform:translate(2%,-1%)} 50%{transform:translate(-1%,2%)} 75%{transform:translate(1%,1%)} }
.cursor-light {
  --x: 22vw; --y: 58vh;
  position: fixed; left: var(--x); top: var(--y); z-index: 1; width: 360px; height: 360px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(184,196,232,.08), rgba(20,28,60,.02) 40%, transparent 72%);
  filter: blur(18px); pointer-events: none; mix-blend-mode: screen;
  opacity: .45;
}

.intro-overlay {
  position: fixed; inset: 0; z-index: 50; display:grid; place-items:center; pointer-events:none;
  background: radial-gradient(circle at 50% 42%, rgba(26,34,72,.32), rgba(4,6,12,.93) 46%, rgba(0,0,0,1) 78%);
  transition: opacity 1.2s ease, visibility 1.2s ease;
}
body.intro-done .intro-overlay { opacity: 0; visibility: hidden; }
.intro-center { text-align:center; }
.intro-date { font-family:"Cormorant Garamond",serif; color:#dce4ff; letter-spacing:.34em; font-size:clamp(34px, 4vw, 58px); opacity:0; animation:introDate 3s ease forwards; }
.intro-title { color:#b8c4e8; letter-spacing:.42em; font-size:12px; margin-top:14px; opacity:0; animation:introTitle 3s ease forwards; }
.intro-line { width:min(360px, 32vw); height:1px; margin:22px auto 0; background:linear-gradient(90deg, transparent, rgba(184,196,232,.9), transparent); transform:scaleX(0); animation:introLine 3s ease forwards; }
@keyframes introDate { 0%{opacity:0;transform:translateY(18px) scale(.98);filter:blur(8px)} 18%{opacity:1;transform:translateY(0) scale(1);filter:blur(0)} 68%{opacity:1} 100%{opacity:0;transform:translateY(-12px)} }
@keyframes introTitle { 0%,12%{opacity:0;transform:translateY(8px)} 28%,68%{opacity:1;transform:translateY(0)} 100%{opacity:0;transform:translateY(-10px)} }
@keyframes introLine { 0%,10%{transform:scaleX(0);opacity:0} 30%,72%{transform:scaleX(1);opacity:1} 100%{transform:scaleX(.4);opacity:0} }

.reveal-ui { opacity: 0; transform: translateY(24px); transition: opacity .9s ease, transform 1.15s cubic-bezier(.16,.84,.18,1); }
.delay-2 { transition-delay: 2.2s; }
.delay-3 { transition-delay: 2.45s; }
.delay-4 { transition-delay: 2.7s; }
body.intro-done .reveal-ui { opacity: 1; transform: translateY(0); }
body.intro-done .constellation.reveal-ui { opacity: 0.42; }

.sound-btn,.primary-btn,.segment { -webkit-tap-highlight-color: transparent; }
.sound-btn {
  position: fixed; z-index: 40; top: 18px; right: 22px;
  border: 1px solid rgba(184,196,232,.35); color: #dce4ff; background: rgba(8,10,16,.45);
  padding: 6px 10px; font-size: 9px; letter-spacing: .18em; cursor: pointer;
}
.sound-btn:hover { background:rgba(184,196,232,.12); }

.hero {
  min-height: 100svh; position: relative; z-index: 5; padding: 72px 5.4vw 70px;
  display:flex; align-items:center;
}
.hero-copy {
  width: 30%; min-width: 360px; position: relative; z-index: 8; margin-top: 12vh;
  display: flex; flex-direction: column; gap: 36px;
}
.hero-actions {
  display:flex; flex-direction:column; gap:18px;
}
.eyebrow { font-family:"Cormorant Garamond",serif; font-size: 34px; letter-spacing:.11em; color:var(--silver-soft); margin-bottom: 14px; }
.eyebrow span { font-size:22px; }
h1,h2 { font-family:"Cormorant Garamond",serif; font-weight:600; margin:0; }
h1 { font-size: clamp(44px, 4.8vw, 84px); line-height:1.02; letter-spacing:-.03em; text-transform:uppercase; background:linear-gradient(180deg,#f4f7ff 0,#b8c4e8 62%,#5a6a9a 100%); -webkit-background-clip:text; color:transparent; text-shadow:0 0 40px rgba(184,196,232,.08); }
.micro-copy { margin: 18px 0 28px; color:#9aa6c8; font-size:15px; letter-spacing:.05em; text-transform:uppercase; }
.control-label { color:#9aa6c8; font-size:11px; letter-spacing:.22em; text-transform:uppercase; margin-bottom:10px; }
.segment { border:0; background:transparent; color:#9aa6c8; padding:10px 16px; cursor:pointer; font-size:12px; letter-spacing:.18em; text-transform:uppercase; }
.segment.is-active { background:rgba(184,196,232,.14); color:#eef1fb; box-shadow: inset 0 0 0 1px rgba(184,196,232,.28); }
.primary-btn {
  border: 1px solid #b8c4e8; color:#dce4ff; background:rgba(8,10,16,.45); border-radius:2px;
  letter-spacing:.15em; font-weight:600; cursor:pointer; transition:.25s ease;
  font-size: 11px; padding:10px 16px; width:188px; box-shadow:inset 0 0 24px rgba(184,196,232,.05),0 0 20px rgba(184,196,232,.08);
}
.primary-btn:hover,.segment:hover { background:rgba(184,196,232,.12); box-shadow:0 0 30px rgba(184,196,232,.2); transform:translateY(-1px); }
.primary-btn:disabled { opacity:.55; cursor:not-allowed; transform:none; box-shadow:none; }
.star-form { display:flex; flex-direction:column; gap:12px; width:100%; max-width:100%; }
.star-field { display:flex; flex-direction:column; gap:6px; }
.star-field-label {
  color:#9aa6c8; font-size:10px; letter-spacing:.2em; text-transform:uppercase;
}
.star-field-label em { font-style:normal; letter-spacing:.08em; opacity:.65; text-transform:none; }
.star-field input,
.star-field textarea {
  width:100%; border:1px solid rgba(184,196,232,.28); border-radius:2px;
  background:rgba(8, 10, 18, .72); color:var(--cream); padding:12px 14px;
  font-family:Inter,"Noto Sans KR",sans-serif; font-size:14px; line-height:1.45; outline:none;
}
.star-field textarea {
  min-height:4.5em; resize:vertical;
}
.star-field input::placeholder,
.star-field textarea::placeholder { color:#6f7a9a; }
.star-field input:focus,
.star-field textarea:focus { border-color:rgba(184,196,232,.55); box-shadow:0 0 0 1px rgba(184,196,232,.18); }
.counter-wrap { color:#9aa6c8; display:flex; gap:9px; align-items:baseline; font-size:14px; flex-wrap:wrap; }
.counter-wrap strong { color:var(--silver-soft); font-family:"Cormorant Garamond",serif; font-size:34px; font-weight:600; }
.counter-star { color:var(--silver); }
.star-hint { margin:0; color:#7f8aab; font-size:12px; letter-spacing:.04em; max-width:100%; line-height:1.45; }
.study-wish {
  margin:14px 0 0; padding:12px 14px 11px; max-width:100%;
  border:1px solid rgba(184,196,232,.22);
  border-top:2px solid rgba(196,206,236,.38);
  background:
    linear-gradient(180deg, rgba(12,14,24,.88), rgba(8,10,18,.94)),
    repeating-linear-gradient(0deg, transparent, transparent 23px, rgba(184,196,232,.04) 23px, rgba(184,196,232,.04) 24px);
  box-shadow:0 10px 28px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.03);
  opacity:0; transform:translateY(6px);
  transition:opacity .65s ease, transform .65s ease;
}
.study-wish:not([hidden]) { opacity:1; transform:translateY(0); }
.study-wish.is-fading { opacity:0; transform:translateY(4px); }
.study-wish-label {
  margin:0 0 8px; font-size:9px; letter-spacing:.18em; text-transform:uppercase;
  color:#8b96b8; font-family:Inter,"Noto Sans KR",sans-serif;
}
.study-wish-quote {
  margin:0; color:#e8eeff; font-family:"Cormorant Garamond","Noto Serif KR",serif;
  font-size:clamp(17px,2vw,21px); line-height:1.5; font-weight:500;
  word-break:break-word;
}
.study-wish-from {
  margin:10px 0 0; padding-top:8px; border-top:1px solid rgba(184,196,232,.14);
  font-size:10px; letter-spacing:.14em; text-transform:uppercase;
  color:#9aa8c8; font-family:Inter,"Noto Sans KR",sans-serif;
}
.study-wish-from:empty { display:none; }
.studio-link {
  color:#c8d4f8; font-size:12px; letter-spacing:.12em; text-transform:uppercase;
  text-decoration:none; border-bottom:1px solid rgba(184,196,232,.35); padding-bottom:2px; width:fit-content;
}
.studio-link:hover { color:#eef1fb; border-bottom-color:rgba(220,228,255,.7); }
.hint { display:flex; gap:12px; align-items:center; color:#8b96b8; font-size:13px; margin:22px 0 0; }

.wish-field { position:fixed; inset:0; z-index:12; pointer-events:none; overflow:visible; }
.wish-star {
  position:absolute; pointer-events:auto; width:18px; height:18px; margin:0; padding:0;
  border:0; background:transparent; cursor:pointer; transform:translate(-50%, -50%);
  color:#f0f4ff;
}
.wish-star::before {
  content:""; position:absolute; left:50%; top:50%; width:9px; height:9px; border-radius:50%;
  transform:translate(-50%, -50%);
  background:radial-gradient(circle, #ffffff 0%, #e8eeff 38%, rgba(184,196,232,.35) 72%, transparent 100%);
  box-shadow:0 0 10px rgba(232,238,255,.85), 0 0 18px rgba(184,196,232,.45);
  animation:wishTwinkle 3.6s ease-in-out infinite;
  pointer-events:none;
}
.wish-star.is-mine::before {
  width:10px; height:10px;
  background:radial-gradient(circle, #ffffff 0%, #ece8ff 36%, #e8eeff 52%, rgba(184,196,232,.35) 72%, transparent 100%);
  box-shadow:
    0 0 12px rgba(240,244,255,.95),
    0 0 26px rgba(200,210,255,.55),
    0 0 16px rgba(168,140,210,.22);
  animation-duration:2.4s;
}
.wish-star.is-mine::after {
  content:""; position:absolute; left:50%; top:50%; width:14px; height:14px;
  border-radius:50%; transform:translate(-50%, -50%);
  border:1px solid rgba(168,130,210,.32);
  pointer-events:none;
}
.wish-star.is-highlight::before {
  width:12px; height:12px;
  box-shadow:0 0 18px rgba(245,248,255,1), 0 0 32px rgba(200,210,255,.75);
  animation:wishHighlight 1.1s ease-in-out 4;
}
.wish-star .wish-tooltip {
  position:absolute; z-index:40; left:50%; bottom:calc(100% + 10px); top:auto;
  transform:translateX(-50%); min-width:132px; max-width:min(240px, calc(100vw - 24px));
  padding:10px 12px 11px; opacity:0; visibility:hidden; pointer-events:none;
  transition:opacity .2s ease, visibility .2s;
  background:
    linear-gradient(180deg, rgba(14,16,26,.97), rgba(10,12,20,.98));
  border:1px solid rgba(184,196,232,.28);
  border-top:2px solid rgba(200,210,240,.42);
  color:#eef1fb;
  font-size:13px; line-height:1.5; text-align:left;
  box-shadow:0 10px 28px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.04);
  white-space:normal; word-break:break-word;
}
.wish-star.is-tooltip-below .wish-tooltip {
  bottom:auto; top:calc(100% + 10px);
}
.wish-star .wish-tooltip.is-measuring {
  visibility:hidden !important; opacity:0 !important;
}
.wish-star .wish-tooltip-from {
  display:block; margin-bottom:7px; padding-bottom:7px;
  border-bottom:1px solid rgba(184,196,232,.14);
  color:#9aa8c8; font-family:Inter,"Noto Sans KR",sans-serif;
  font-weight:500; font-size:9px; letter-spacing:.16em; text-transform:uppercase;
}
.wish-star .wish-tooltip-quote {
  display:block; font-family:"Cormorant Garamond","Noto Serif KR",serif;
  font-size:15px; line-height:1.48; font-weight:500; color:#e8eeff;
}
.wish-star.is-open .wish-tooltip {
  opacity:1; visibility:visible; transition:none;
}
.wish-star.is-open::before {
  box-shadow:0 0 14px rgba(220,228,255,.95), 0 0 24px rgba(184,196,232,.45);
}
@keyframes wishTwinkle {
  0%,100% { opacity:.65; }
  50% { opacity:1; }
}
@keyframes wishHighlight {
  0%,100% { transform:translate(-50%, -50%) scale(1); }
  50% { transform:translate(-50%, -50%) scale(1.35); }
}

.portrait-wrap {
  position:absolute; z-index:4; left: max(380px, 36%); right: 0; top: 24vh; bottom: -4vh;
  width:auto; height:auto;
  display:flex; align-items:center; justify-content:center; perspective:1200px;
}
.portrait-loading {
  position:absolute; z-index:7; inset:0; display:flex; align-items:center; justify-content:center;
  font-family:"Cormorant Garamond",serif; font-size:clamp(18px,2.2vw,26px); letter-spacing:.18em;
  text-transform:uppercase; color:rgba(200,210,255,.72); pointer-events:none;
  animation:portraitPulse 1.8s ease-in-out infinite;
  transition:opacity .55s ease, visibility .55s ease;
}
.portrait-loading.is-ready,
.portrait-loading.is-error { opacity:0; visibility:hidden; pointer-events:none; animation:none; }
.portrait-loading.is-error { color:rgba(200,140,100,.85); }
@keyframes portraitPulse {
  0%,100% { opacity:.42; }
  50% { opacity:.88; }
}
.portrait-canvas {
  position:relative; z-index:5; width:100%; height:100%; object-fit:contain;
  filter:saturate(1.08) contrast(1.1) brightness(1.12);
  mask-image:linear-gradient(to bottom,#000 90%,transparent 100%);
  -webkit-mask-image:linear-gradient(to bottom,#000 90%,transparent 100%);
}
.portrait-fallback {
  position:relative; z-index:5; width:100%; height:100%; object-fit:contain;
  filter:saturate(.96) contrast(1.04) brightness(.95);
  mix-blend-mode:screen;
  mask-image:linear-gradient(to bottom,#000 90%,transparent 100%);
  -webkit-mask-image:linear-gradient(to bottom,#000 90%,transparent 100%);
}
.portrait-fallback { display:none; }
.portrait-glow {
  position:absolute; z-index:4; inset:-4% -2%;
  pointer-events:none;
  background:
    radial-gradient(ellipse 50% 56% at 54% 36%, rgba(210, 220, 245, .11), rgba(120, 140, 190, .04) 46%, transparent 72%),
    radial-gradient(ellipse 34% 40% at 56% 34%, rgba(228, 234, 250, .07), transparent 76%);
  filter:blur(32px);
  opacity:.55;
}
.portrait-veil { position:absolute; z-index:6; inset:0; background:radial-gradient(circle at 56% 34%, rgba(26,34,72,.08), rgba(4,6,12,.55) 34%, rgba(0,0,0,.98) 72%); pointer-events:none; opacity:1; transition:opacity 1.35s ease; }
body.intro-done .portrait-veil { opacity:0; pointer-events:none; }

.constellation { position:absolute; z-index:3; color:#c8d4f8; font-family:"Cormorant Garamond",serif; font-size:15px; text-align:center; opacity:.42; transition:.25s ease; cursor:default; pointer-events:none; letter-spacing:.04em; }
.constellation span { display:block; margin-top:6px; line-height:1.25; }
.constellation svg { overflow:visible; opacity:.72; }
.constellation path { stroke:#9aaed8; stroke-width:1; fill:none; opacity:.55; }
.constellation circle { fill:#e8eeff; filter:drop-shadow(0 0 3px rgba(200,210,255,.45)); }
/* Orbit negative space: avoid title block (left) and face core (right-center). */
.c1 { left: 42%; top: 7%; }          /* Mono. */
.c1 svg { width: 78px; }
.c2 { left: 28%; top: 58%; }          /* Indigo */
.c2 svg { width: 118px; }
.c3 { right: 2.5%; top: 9%; }        /* Still Life */
.c3 svg { width: 92px; }
.c4 { right: 4%; bottom: 7%; }       /* Wild Flower */
.c4 svg { width: 128px; }

.toast { position:fixed;z-index:80;left:50%;bottom:32px;transform:translate(-50%,20px);opacity:0;pointer-events:none;background:#10120e;border:1px solid rgba(184,196,232,.4);color:#e8eeff;padding:12px 18px;transition:.3s;box-shadow:0 10px 40px #000; }
.toast.show { opacity:1;transform:translate(-50%,0); }

@media (max-width: 900px) {
  .sound-btn { top: 14px; right: 16px; }
  .hero {
    flex-direction: column;
    align-items: stretch;
    min-height: auto;
    padding: 64px 24px 72px;
  }
  .hero-copy {
    display: contents;
    width: auto;
    min-width: 0;
    margin-top: 0;
  }
  .hero-title-block {
    order: 1;
    width: 100%;
    margin-top: 8px;
  }
  .eyebrow { font-size:28px; }
  h1 { font-size:clamp(38px,10.5vw,64px); line-height:1.06; }
  .micro-copy { font-size:12px; }
  .portrait-wrap {
    order: 2;
    position: relative;
    width: calc(100% + 48px);
    margin: 28px -24px 0;
    height: min(58vh, 520px);
    /* Clear desktop absolute offsets — leftover left:max(380px,…) caused ~2× page width. */
    inset: auto;
    opacity: 1;
  }
  .study-shelves { display: none; }
  .portrait-canvas, .portrait-fallback { height:100%; width:100%; }
  .hero-actions {
    order: 3;
    margin-top: 28px;
    width: 100%;
  }
  .star-form { max-width:100%; }
  .counter-wrap strong { font-size:28px; }
  .primary-btn { width:100%; max-width:188px; padding:10px 16px; font-size:11px; }
  .wish-star .wish-tooltip { max-width:min(160px, calc(100vw - 24px)); }
  .toast {
    left: 16px; right: 16px; bottom: 20px; width: auto;
    transform: translate(0, 20px); text-align: center;
  }
  .toast.show { transform: translate(0, 0); }
  .constellation { font-size: 13px; opacity: 0.3; }
  .c1, .c2 { display: none; }
  .c3 { right: 5%; top: 8%; }
  .c3 svg { width: 72px; }
  .c4 { right: 4%; bottom: 6%; }
  .c4 svg { width: 96px; }
}
@media (max-width: 480px) {
  .hero { padding: 56px 16px 64px; }
  .portrait-wrap {
    width: calc(100% + 32px);
    margin: 20px -16px 0;
    height: min(52vh, 420px);
  }
  .eyebrow { font-size: 24px; }
  h1 { font-size: clamp(34px, 11vw, 48px); }
  .c4 { display: none; }
  .intro-date { letter-spacing: .28em; font-size: clamp(28px, 9vw, 42px); }
  .intro-title { letter-spacing: .28em; font-size: 11px; }
  .intro-line { width: min(240px, 70vw); }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition:none!important; }
}
