/* ===================================================================
   Wish Before It Flies · 한옥 소원 풍등
   a night sky you can write into — Danbi Lab, 2026
   =================================================================== */
:root{
  --night:#070d1c;
  --night-2:#0d1830;
  --ink:#f4ead6;
  --ink-2:#c9bda6;
  --ink-3:#8e8577;
  --gold:#f0b45c;
  --gold-2:#ffd79a;
  --ember:#ff9a3c;
  --glass:rgba(10,16,30,.55);
  --glass-2:rgba(16,24,44,.78);
  --stroke:rgba(255,232,200,.18);
  --stroke-2:rgba(255,232,200,.34);
  --hanji:#f6ecd8;
  --hanji-ink:#3a2d22;
  --serif:"Gowun Batang",Georgia,serif;
  --sans:"Plus Jakarta Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Malgun Gothic",sans-serif;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;background:var(--night);color:var(--ink);overflow:hidden;
  font:400 15px/1.6 var(--sans);-webkit-font-smoothing:antialiased;
  -webkit-tap-highlight-color:transparent;
}
body.pad-bottom{padding-bottom:0}
img{display:block;max-width:100%}
button{font-family:inherit}
h1,h2,p{margin:0}
h1{font:400 clamp(34px,5.4vw,62px)/1.12 var(--serif);letter-spacing:-.01em;text-shadow:0 6px 40px rgba(0,0,0,.45)}
h1 em{font-style:normal;color:var(--gold-2)}
h2{font:400 clamp(22px,3vw,30px)/1.2 var(--serif)}
.close{
  position:absolute;right:12px;top:12px;width:34px;height:34px;border:0;border-radius:50%;
  background:rgba(255,240,214,.1);color:var(--ink);font-size:20px;line-height:1;cursor:pointer;z-index:3;
}
.close:hover{background:rgba(255,240,214,.2)}
.close.light{background:rgba(58,45,34,.08);color:var(--hanji-ink)}
.close.light:hover{background:rgba(58,45,34,.16)}

#sky{position:fixed;inset:0;width:100%;height:100%;display:block;touch-action:none;cursor:grab}
#sky.is-dragging{cursor:grabbing}

/* ------------------------------------------------------------- header */
.top{
  position:fixed;left:0;right:0;top:0;z-index:20;
  display:flex;align-items:center;gap:12px;
  padding:calc(12px + env(safe-area-inset-top,0px)) clamp(12px,3vw,26px) 12px;
  pointer-events:none;
}
.top>*{pointer-events:auto}
.brand{display:flex;align-items:center;gap:10px;min-width:0}
.brand-lamp{
  width:20px;height:26px;flex:none;border-radius:50% 50% 46% 46%;
  background:radial-gradient(circle at 50% 62%,#fff2cf,#ffc06a 45%,#e8873a 78%,rgba(232,135,58,0) 100%);
  box-shadow:0 0 18px rgba(255,170,90,.55),0 0 44px rgba(255,150,70,.28);
  animation:lampPulse 4.6s ease-in-out infinite;
}
@keyframes lampPulse{0%,100%{opacity:.92;transform:scale(1)}50%{opacity:1;transform:scale(1.04)}}
.brand-text{display:flex;flex-direction:column;line-height:1.15;min-width:0}
.brand-text b{font:400 15px/1.2 var(--serif);letter-spacing:.01em;text-shadow:0 2px 12px rgba(0,0,0,.5)}
.brand-text small{font-size:9px;letter-spacing:.18em;text-transform:uppercase;color:rgba(244,234,214,.5)}
.top-actions{margin-left:auto;display:flex;align-items:center;gap:8px}
.icon-btn{
  width:36px;height:36px;border-radius:50%;border:1px solid var(--stroke);background:var(--glass);
  color:var(--ink);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;
  -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
}
.icon-btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.icon-btn svg path:first-child{fill:currentColor;stroke:none}
.icon-btn .slash{opacity:1}
.icon-btn[aria-pressed="true"]{border-color:rgba(255,208,138,.6);color:var(--gold-2)}
.icon-btn[aria-pressed="true"] .slash{opacity:0}
.lang{display:inline-flex;padding:3px;border-radius:999px;background:var(--glass);border:1px solid var(--stroke);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
.lang button{border:0;background:transparent;border-radius:999px;padding:6px 10px;font:600 10px/1 var(--sans);letter-spacing:.07em;color:rgba(244,234,214,.55);cursor:pointer}
.lang button[aria-pressed="true"]{background:rgba(255,232,200,.92);color:#2a221a}
@media (max-width:560px){.brand-text small{display:none}}

/* --------------------------------------------------------------- hero */
.hero{
  position:fixed;left:clamp(10px,4vw,52px);bottom:clamp(190px,26vh,260px);z-index:10;
  max-width:min(540px,calc(100% - 20px));
  padding:22px 26px 26px;
  border-radius:22px;
  background:radial-gradient(130% 120% at 10% 55%,rgba(4,8,18,.72),rgba(4,8,18,.42) 55%,rgba(4,8,18,0) 78%);
  transition:opacity .7s ease,transform .7s ease;
}
.hero.is-gone{opacity:0;transform:translateY(14px);pointer-events:none}
.eyebrow{font-size:10px;font-weight:600;letter-spacing:.24em;text-transform:uppercase;color:rgba(240,180,92,.9);margin-bottom:14px}
.hero .lede{font-size:clamp(13px,1.4vw,15px);line-height:1.75;color:rgba(244,234,214,.78);margin-top:16px;max-width:34em;text-shadow:0 2px 16px rgba(0,0,0,.55)}
.cta{
  margin-top:22px;display:inline-flex;align-items:center;gap:10px;
  padding:13px 20px 13px 16px;border:1px solid rgba(255,214,154,.5);border-radius:999px;
  background:linear-gradient(180deg,rgba(255,196,110,.98),rgba(240,154,70,.98));color:#2b1c0d;
  font:600 14px/1 var(--sans);cursor:pointer;
  box-shadow:0 18px 40px -20px rgba(255,150,70,.85),0 0 0 1px rgba(255,230,190,.2) inset;
  transition:transform .18s ease,box-shadow .18s ease;
}
.cta:hover{transform:translateY(-1px);box-shadow:0 22px 46px -18px rgba(255,150,70,.9)}
.cta .cta-ico{font-size:13px;opacity:.8}
.cta .cta-arrow{font-size:15px;opacity:.7}
.cta.small{padding:12px 18px;font-size:13px;margin-top:0}
.note{margin-top:14px;font-size:10.5px;color:rgba(244,234,214,.42);letter-spacing:.02em}
@media (max-width:760px){
  .hero{
    left:0;right:0;bottom:0;max-width:none;padding:40px 18px calc(168px + env(safe-area-inset-bottom,0px));
    border-radius:0;
    background:linear-gradient(to top,rgba(3,7,16,.95) 0%,rgba(3,7,16,.86) 38%,rgba(3,7,16,.34) 72%,rgba(3,7,16,0) 100%);
  }
  .hero .lede{font-size:12.5px;line-height:1.7}
  .hero .note{display:none}
  .hero h1{font-size:clamp(30px,8.4vw,40px)}
}

/* --------------------------------------------------------------- dock */
.dock{
  position:fixed;left:50%;bottom:calc(74px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);
  z-index:22;display:flex;align-items:center;gap:4px;padding:5px;border-radius:999px;
  background:var(--glass-2);border:1px solid var(--stroke);
  box-shadow:0 24px 50px -30px rgba(0,0,0,.9);
  -webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);
  width:max-content;max-width:calc(100% - 24px);
}
.dock-btn{
  position:relative;display:inline-flex;align-items:center;gap:7px;padding:10px 14px;border:0;border-radius:999px;
  background:transparent;color:rgba(244,234,214,.82);font:500 11.5px/1 var(--sans);cursor:pointer;white-space:nowrap;
}
.dock-btn:hover{background:rgba(255,232,200,.08);color:#fff}
.dock-btn.primary{background:rgba(255,196,110,.16);color:#ffd79a;border:1px solid rgba(255,208,138,.35)}
.dock-btn.primary:hover{background:rgba(255,196,110,.24)}
.db-ico{display:inline-flex;width:17px;height:17px}
.db-ico svg{width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.badge{
  font-style:normal;font-size:9px;min-width:16px;height:16px;padding:0 4px;border-radius:999px;
  background:rgba(255,196,110,.9);color:#2b1c0d;display:inline-flex;align-items:center;justify-content:center;
  font-weight:700;
}
@media (max-width:520px){
  .dock{gap:0;padding:4px}
  .dock-btn{padding:10px 9px;font-size:10px;gap:5px}
  .dock-btn .db-ico{width:15px;height:15px}
}
.hint-line{
  position:fixed;left:50%;bottom:calc(132px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);
  z-index:12;pointer-events:none;margin:0;font-size:10px;letter-spacing:.06em;color:rgba(244,234,214,.42);
  pointer-events:none;white-space:nowrap;transition:opacity .8s;
}
.hint-line.is-faint{opacity:0}
@media (max-width:520px){.hint-line{bottom:calc(142px + env(safe-area-inset-bottom,0px));font-size:9px}}

/* ------------------------------------------------------------- composer */
.sheet{
  position:fixed;inset:0;z-index:2147483300;display:flex;align-items:flex-end;justify-content:center;
  padding:0;background:rgba(3,7,16,.55);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);
}
.sheet[hidden]{display:none}
.sheet-card{
  position:relative;width:min(560px,100%);max-height:94vh;overflow:auto;
  background:linear-gradient(180deg,rgba(20,28,48,.98),rgba(10,15,28,.99));
  border:1px solid var(--stroke);border-bottom:0;
  border-radius:24px 24px 0 0;padding:24px clamp(16px,4vw,26px) calc(20px + env(safe-area-inset-bottom,0px));
  box-shadow:0 -30px 80px -30px rgba(0,0,0,.9);
  animation:rise .32s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes rise{from{transform:translateY(40px);opacity:.4}to{transform:none;opacity:1}}
@media (min-width:720px){
  .sheet{align-items:center;padding:24px}
  .sheet-card{border-radius:22px;border-bottom:1px solid var(--stroke)}
}
.sheet-card h2{margin-bottom:6px}
.sheet-sub{font-size:12px;color:rgba(244,234,214,.6);margin-bottom:16px}
.field{position:relative}
.field textarea{
  width:100%;resize:none;min-height:96px;padding:14px 15px 34px;
  font:400 17px/1.55 var(--serif);color:#fdf6e7;
  background:rgba(255,240,214,.06);border:1px solid var(--stroke);border-radius:14px;
}
.field textarea::placeholder{color:rgba(244,234,214,.35)}
.field textarea:focus{outline:none;border-color:rgba(255,208,138,.6);box-shadow:0 0 0 3px rgba(255,180,92,.12)}
.field-foot{position:absolute;left:10px;right:10px;bottom:8px;display:flex;align-items:center;justify-content:space-between;gap:10px}
.ghost-btn{
  display:inline-flex;align-items:center;gap:6px;padding:7px 11px;border-radius:999px;
  border:1px solid var(--stroke);background:transparent;color:rgba(244,234,214,.8);
  font:500 11px/1 var(--sans);cursor:pointer;
}
.ghost-btn:hover{border-color:rgba(255,208,138,.5);color:#ffd79a}
.ghost-btn.light{border-color:rgba(58,45,34,.2);color:rgba(58,45,34,.72);background:rgba(255,255,255,.4)}
.ghost-btn.light:hover{border-color:rgba(58,45,34,.45);color:#3a2d22}
.counter{font-size:10px;color:rgba(244,234,214,.45);font-variant-numeric:tabular-nums}
.themes{display:flex;gap:6px;margin:16px 0 6px;overflow-x:auto;padding-bottom:2px;scrollbar-width:none}
.themes::-webkit-scrollbar{display:none}
.theme{
  flex:0 0 auto;display:inline-flex;align-items:center;gap:7px;padding:7px 12px 7px 8px;border-radius:999px;
  border:1px solid var(--stroke);background:transparent;color:rgba(244,234,214,.75);
  font:500 11px/1 var(--sans);cursor:pointer;white-space:nowrap;
}
.theme i{width:12px;height:12px;border-radius:50%;display:block;box-shadow:0 0 10px currentColor}
.theme.on{border-color:rgba(255,232,200,.7);background:rgba(255,240,214,.1);color:#fff6e6}
.preview-row{display:flex;align-items:center;gap:14px;margin:10px 0 4px}
#previewLamp{width:104px;height:126px;flex:none;filter:drop-shadow(0 6px 18px rgba(255,170,90,.25))}
.preview-note{font-size:10.5px;color:rgba(244,234,214,.5);max-width:22em}
.sheet-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;margin-top:14px}

/* ------------------------------------------------------------- wish card */
.card-overlay{
  position:fixed;inset:0;z-index:2147483310;display:flex;align-items:center;justify-content:center;padding:20px;
  background:rgba(3,7,16,.62);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);
}
.card-overlay[hidden]{display:none}
.hanji-card{
  position:relative;width:min(420px,100%);padding:34px 28px 26px;
  background:
    radial-gradient(120% 130% at 20% 0%,rgba(255,255,255,.55),transparent 55%),
    radial-gradient(90% 90% at 90% 100%,rgba(196,160,110,.22),transparent 60%),
    linear-gradient(160deg,#f8efdc,#efe2c8 70%,#e9d9ba);
  color:var(--hanji-ink);border-radius:6px 6px 8px 8px;
  box-shadow:0 40px 90px -30px rgba(0,0,0,.85),0 0 0 1px rgba(255,255,255,.4) inset;
  animation:cardIn .4s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes cardIn{from{transform:translateY(18px) scale(.97);opacity:.5}to{transform:none;opacity:1}}
.hanji-card::after{
  content:"";position:absolute;inset:8px;border:1px solid rgba(58,45,34,.16);border-radius:3px;pointer-events:none;
}
.card-thread{
  position:absolute;left:50%;top:-22px;width:1px;height:22px;background:linear-gradient(rgba(255,220,170,.1),rgba(255,220,170,.8));
}
.card-thread::before{
  content:"";position:absolute;left:50%;top:-6px;width:9px;height:9px;transform:translateX(-50%);
  border-radius:50%;background:#ffcf8a;box-shadow:0 0 12px 3px rgba(255,177,92,.6);
}
.card-meta{display:flex;align-items:center;gap:8px;font-size:9.5px;letter-spacing:.16em;text-transform:uppercase;color:#8a7358;margin-bottom:14px}
.card-dot{width:3px;height:3px;border-radius:50%;background:#b7a184}
.card-wish{
  font:400 clamp(20px,3.4vw,26px)/1.55 var(--serif);letter-spacing:-.01em;
  color:#33281f;margin-bottom:18px;word-break:break-word;
}
.card-from{font-size:11px;color:#8a7358;letter-spacing:.04em;margin-bottom:18px}
.card-actions{display:flex;justify-content:flex-end}

/* -------------------------------------------------------------- journal */
.journal{position:fixed;inset:0;z-index:2147483320;display:flex;justify-content:flex-end;background:rgba(3,7,16,.5)}
.journal[hidden]{display:none}
.journal-card{
  position:relative;width:min(420px,100%);height:100%;overflow:auto;
  background:linear-gradient(180deg,rgba(18,26,46,.99),rgba(8,12,24,.99));
  border-left:1px solid var(--stroke);padding:26px 22px calc(28px + env(safe-area-inset-bottom,0px));
  animation:slideIn .3s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes slideIn{from{transform:translateX(30px);opacity:.5}to{transform:none;opacity:1}}
.journal-card h2{margin-bottom:14px}
.journal-list{list-style:none;margin:0;padding:0;display:grid;gap:9px}
.journal-item{
  display:grid;grid-template-columns:10px 1fr auto;gap:10px;align-items:start;
  padding:12px 13px;border:1px solid var(--stroke);border-radius:13px;background:rgba(255,240,214,.04);
  cursor:pointer;text-align:left;color:inherit;font-family:inherit;
}
.journal-item:hover{border-color:rgba(255,208,138,.45);background:rgba(255,240,214,.08)}
.journal-item i{width:9px;height:9px;border-radius:50%;margin-top:5px;box-shadow:0 0 9px currentColor}
.journal-item b{display:block;font:400 14px/1.45 var(--serif);color:#f6ecda;margin-bottom:3px;word-break:break-word}
.journal-item small{font-size:9.5px;letter-spacing:.08em;text-transform:uppercase;color:rgba(244,234,214,.4)}
.journal-empty{font-size:12px;color:rgba(244,234,214,.45);line-height:1.7;margin-top:8px}
.journal-empty[hidden]{display:none}

.toast{
  position:fixed;left:50%;bottom:calc(186px + env(safe-area-inset-bottom,0px));transform:translate(-50%,10px);
  z-index:2147483400;padding:10px 18px;border-radius:999px;background:rgba(255,240,214,.95);color:#2a221a;
  font-size:12px;font-weight:500;max-width:86vw;text-align:center;
  opacity:0;pointer-events:none;transition:opacity .25s,transform .25s;
  box-shadow:0 18px 40px -22px rgba(0,0,0,.9);
}
.toast.is-on{opacity:1;transform:translate(-50%,0)}

/* ------------------------------------------------ dark shared nav bar */
body.dark .dbn-bar{
  background:rgba(8,13,26,.86)!important;
  border-top:1px solid rgba(255,232,200,.12)!important;
  box-shadow:0 -14px 34px -22px rgba(0,0,0,.9)!important;
}
body.dark .dbn-tool{color:rgba(244,234,214,.6)!important}
body.dark .dbn-tool:active{background:rgba(255,232,200,.08)!important}
body.dark .dbn-tool.dbn-accent{color:#ffd08a!important}
body.dark .dbn-tool.dbn-strong{color:#fff6e6!important}
body.dark .dbn-toast{background:rgba(255,240,214,.96);color:#2a221a}
body.dark .dbn-welcome{background:#0d1526;border-bottom:1px solid rgba(255,232,200,.14)}
body.dark .dbn-welcome-txt{color:#f4ead6}
body.dark .dbn-welcome-txt span{color:rgba(244,234,214,.6)}

@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
