/* app/styles — RemoteDesk 세련된 다크 테마 (glassmorphism + aurora) */

:root {
  color-scheme: dark;
  --bg: #06070d;
  --bg-2: #0a0c16;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.07);
  --hairline: rgba(255, 255, 255, 0.09);
  --hairline-strong: rgba(255, 255, 255, 0.16);
  --text: #eef1fb;
  --muted: #94a1c2;
  --faint: #5e6b8a;
  --accent: #5b7cff;
  --accent-2: #21d4d4;
  --violet: #8b5cff;
  --grad: linear-gradient(135deg, #8b5cff 0%, #5b7cff 45%, #21d4d4 100%);
  --grad-soft: linear-gradient(135deg, rgba(139,92,255,.16), rgba(33,212,212,.10));
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --shadow: 0 18px 50px -12px rgba(0, 0, 0, .65);
  --radius: 18px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Apple SD Gothic Neo", sans-serif;
  --mono: "SF Mono", ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, monospace;

  /* 테마 가변 표면(라이트에서 override) */
  --input-bg: rgba(0, 0, 0, .32);
  --input-bg-focus: rgba(0, 0, 0, .45);
  --code-bg: rgba(0, 0, 0, .4);
  --glass: rgba(12, 15, 26, .72);
  --glass-2: rgba(10, 13, 24, .66);
  --glass-3: rgba(10, 13, 24, .86);
  --stage-bg: radial-gradient(80% 80% at 50% 0%, #0d1020, #000);
  --aurora-opacity: .55;
  --hud-val: #fff;
}

/* ── 라이트 테마 ── */
:root[data-theme="light"] {
  --bg: #eef1fa;
  --bg-2: #e3e8f4;
  --surface: rgba(255, 255, 255, .72);
  --surface-2: rgba(24, 36, 74, .05);
  --hairline: rgba(24, 36, 74, .12);
  --hairline-strong: rgba(24, 36, 74, .2);
  --text: #151c33;
  --muted: #54618a;
  --faint: #8591b3;
  --shadow: 0 18px 50px -16px rgba(40, 60, 120, .3);
  --input-bg: rgba(255, 255, 255, .85);
  --input-bg-focus: #fff;
  --code-bg: rgba(24, 36, 74, .05);
  --glass: rgba(255, 255, 255, .8);
  --glass-2: rgba(255, 255, 255, .74);
  --glass-3: rgba(255, 255, 255, .9);
  --stage-bg: radial-gradient(80% 80% at 50% 0%, #dde4f3, #c6d0e8);
  --aurora-opacity: .4;
  --hud-val: var(--text);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font-family: var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
#root { height: 100vh; }
::selection { background: rgba(91, 124, 255, .35); }

/* 스크롤바 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.22); background-clip: padding-box; }

@keyframes auroraDrift { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(4%, -3%, 0) scale(1.12); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }

/* ── 오로라 배경 ── */
.home, .stage { position: relative; isolation: isolate; }
.home::before, .home::after {
  content: ""; position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  filter: blur(90px); opacity: var(--aurora-opacity);
}
.home::before {
  background:
    radial-gradient(40% 40% at 20% 25%, rgba(139,92,255,.55), transparent 70%),
    radial-gradient(35% 35% at 80% 20%, rgba(33,212,212,.40), transparent 70%);
  animation: auroraDrift 18s ease-in-out infinite;
}
.home::after {
  background: radial-gradient(45% 45% at 70% 85%, rgba(91,124,255,.45), transparent 70%);
  animation: auroraDrift 22s ease-in-out infinite reverse;
}

/* ── Home ── */
.home { display: flex; flex-direction: column; height: 100%; overflow-y: auto; scroll-behavior: smooth; }
.home__bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: 16px 32px; background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(16px); border-bottom: 1px solid var(--hairline); }
.home__mark { display: inline-flex; filter: drop-shadow(0 4px 12px rgba(91,124,255,.4)); }
.home__logo { font-size: 20px; font-weight: 800; letter-spacing: -.02em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.home__sub { color: var(--muted); font-size: 13px; font-weight: 500; padding-left: 12px; border-left: 1px solid var(--hairline); }
.home__ready { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--ok);
  background: rgba(52,211,153,.12); border: 1px solid rgba(52,211,153,.28); border-radius: 999px; padding: 5px 12px; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  font-size: 15px; line-height: 1; cursor: pointer; border-radius: 11px; background: var(--surface);
  border: 1px solid var(--hairline); transition: background .15s, transform .12s, border-color .15s; }
.iconbtn { color: var(--text); text-decoration: none; }
.iconbtn:hover { background: var(--surface-2); border-color: var(--hairline-strong); transform: translateY(-1px); }
.iconbtn--text { font-size: 12px; font-weight: 700; letter-spacing: .02em; }

/* Hero */
.hero { max-width: 880px; margin: 0 auto; width: 100%; padding: 56px 32px 8px; text-align: center;
  animation: fadeUp .55s ease both; }
.hero__badge { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .04em;
  color: var(--muted); background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 999px; padding: 6px 14px; margin-bottom: 22px; }
.hero__title { font-size: clamp(30px, 5.2vw, 52px); line-height: 1.08; font-weight: 800;
  letter-spacing: -.03em; margin: 0 0 18px; }
.hero__grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__sub { max-width: 620px; margin: 0 auto; color: var(--muted); font-size: 15.5px; line-height: 1.7; }
.hero__chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }
.hero__chips span { font-size: 13px; font-weight: 500; color: var(--text); background: var(--surface);
  border: 1px solid var(--hairline); border-radius: 999px; padding: 8px 15px; }

.home__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px;
  padding: 36px 32px; max-width: 1080px; margin: 0 auto; width: 100%; }

/* 섹션 헤더(공통) */
.sec-head { max-width: 1080px; margin: 0 auto; width: 100%; padding: 0 32px; text-align: center; }
.sec-eyebrow { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: transparent; background: var(--grad); -webkit-background-clip: text; background-clip: text; }
.sec-title { margin: 8px 0 0; font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -.02em; }

/* 사용법 스텝 */
.steps { padding: 44px 0 8px; }
.steps__grid { max-width: 1080px; margin: 28px auto 0; width: 100%; padding: 0 32px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step { position: relative; background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px;
  padding: 24px; animation: fadeUp .5s ease both; }
.step__n { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: #fff; border-radius: 11px; background: var(--grad);
  box-shadow: 0 8px 20px -8px rgba(91,124,255,.6); margin-bottom: 16px; }
.step h3 { margin: 0 0 8px; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.step p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.65; }
.step p code, .step code { font: 12.5px var(--mono); background: var(--code-bg); padding: 1px 6px; border-radius: 6px; color: var(--text); }
.step .hint-code { margin-top: 12px; white-space: pre; }

/* Features */
.features { padding: 44px 0 16px; }
.features__grid { max-width: 1080px; margin: 28px auto 0; width: 100%; padding: 0 32px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feat { background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px;
  padding: 22px; animation: fadeUp .5s ease both; transition: transform .18s, border-color .18s, background .18s; }
.feat:hover { transform: translateY(-3px); border-color: var(--hairline-strong); background: var(--surface-2); }
.feat__ico { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; border-radius: 12px; background: var(--grad-soft); border: 1px solid var(--hairline); margin-bottom: 14px; }
.feat h3 { margin: 0 0 8px; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.feat p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.65; }

.card { position: relative; background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 16px;
  backdrop-filter: blur(20px) saturate(140%); box-shadow: var(--shadow); animation: fadeUp .5s ease both; }
.card:nth-child(2) { animation-delay: .08s; }
.card--accent { background: var(--grad-soft); border-color: rgba(123,140,255,.28); }
.card--accent::before { content: ""; position: absolute; inset: 0; border-radius: var(--radius); padding: 1px;
  background: linear-gradient(135deg, rgba(139,92,255,.6), rgba(33,212,212,.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; opacity: .5; }

.card__title { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.card__desc { color: var(--muted); font-size: 13.5px; line-height: 1.65; margin: -4px 0 2px; }
.card__desc b { color: var(--text); font-weight: 600; }

.field { display: flex; flex-direction: column; gap: 7px; font-size: 11px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.input { background: var(--input-bg); border: 1px solid var(--hairline); border-radius: 12px;
  padding: 13px 15px; color: var(--text); font-size: 14px; font-family: var(--font); outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s; }
.input::placeholder { color: var(--faint); }
.input:focus { border-color: rgba(91,124,255,.7); background: var(--input-bg-focus);
  box-shadow: 0 0 0 4px rgba(91,124,255,.14); }
.input--big { font-size: 23px; font-weight: 700; letter-spacing: .14em; font-family: var(--mono);
  font-variant-numeric: tabular-nums; padding: 14px 16px; }

.hint-code { background: var(--code-bg); border: 1px solid var(--hairline); border-radius: 10px;
  padding: 11px 13px; color: var(--muted); font: 12px/1.5 var(--mono); overflow-x: auto; margin: 2px 0 0; }

.btn { border: none; border-radius: 13px; padding: 14px 18px; font-size: 15px; font-weight: 700;
  font-family: var(--font); cursor: pointer; transition: transform .12s, box-shadow .2s, filter .2s; }
.btn--primary { color: #fff; background: var(--grad); background-size: 160% 160%;
  box-shadow: 0 10px 30px -8px rgba(91,124,255,.6); }
.btn--primary:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 16px 40px -10px rgba(91,124,255,.7); }
.btn--primary:active { transform: translateY(0) scale(.99); }

.msg { color: var(--bad); font-size: 13px; min-height: 18px; font-weight: 500; }
.home__foot { margin-top: 24px; padding: 32px; border-top: 1px solid var(--hairline);
  display: flex; flex-direction: column; align-items: center; gap: 14px; }
.foot__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.foot__links a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted);
  font-size: 13px; font-weight: 500; text-decoration: none; padding: 7px 13px; border-radius: 999px;
  border: 1px solid transparent; transition: color .15s, background .15s, border-color .15s; }
.foot__links a:hover { color: var(--text); background: var(--surface); border-color: var(--hairline); }
.foot__note { color: var(--faint); font-size: 12px; text-align: center; }
.foot__note b { color: var(--muted); font-weight: 600; }
.foot__brand { color: transparent; background: var(--grad); -webkit-background-clip: text; background-clip: text;
  font-size: 12px; font-weight: 700; letter-spacing: .02em; }

/* ── Session ── */
.stage { width: 100%; height: 100vh; overflow: hidden; background: var(--stage-bg); }
.screen { position: absolute; inset: 0; margin: auto; max-width: calc(100% - 24px); max-height: calc(100% - 64px);
  top: 52px; display: block; border-radius: 12px; cursor: crosshair; outline: none;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.8); background: #000; }

/* toolbar */
.toolbar { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 10;
  display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 16px;
  background: var(--glass); border: 1px solid var(--hairline-strong); border-radius: 999px;
  backdrop-filter: blur(22px) saturate(160%); box-shadow: var(--shadow); max-width: calc(100% - 24px); }
.toolbar__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warn);
  box-shadow: 0 0 10px currentColor; color: var(--warn); animation: pulse 1.6s ease-in-out infinite; }
.toolbar__dot[data-state="ok"] { background: var(--ok); color: var(--ok); animation: none; }
.toolbar__dot[data-state="bad"] { background: var(--bad); color: var(--bad); animation: none; }
.toolbar__dot[data-state="wait"] { background: var(--warn); color: var(--warn); }
.toolbar__state { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.toolbar__file { font-size: 12px; color: var(--accent-2); font-variant-numeric: tabular-nums; max-width: 220px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolbar__spacer { flex: 1; min-width: 6px; }
.toolbar__btn { background: var(--surface-2); border: 1px solid var(--hairline); color: var(--text);
  border-radius: 999px; padding: 7px 14px; font-size: 12.5px; font-weight: 600; font-family: var(--font);
  cursor: pointer; transition: background .15s, transform .12s, border-color .15s; white-space: nowrap; }
.toolbar__btn:hover { background: rgba(255,255,255,.13); border-color: var(--hairline-strong); transform: translateY(-1px); }
.toolbar__btn:active { transform: translateY(0); }
.toolbar__btn--danger { background: rgba(251,113,133,.14); border-color: rgba(251,113,133,.35); color: #ff9bab; }
.toolbar__btn--danger:hover { background: rgba(251,113,133,.24); }

/* HUD */
.hud { position: absolute; top: 64px; left: 16px; z-index: 9;
  background: var(--glass-2); border: 1px solid var(--hairline); border-radius: 14px;
  padding: 12px 16px; backdrop-filter: blur(20px) saturate(150%); box-shadow: var(--shadow);
  user-select: none; pointer-events: none; min-width: 188px; animation: fadeUp .4s ease both; }
.hud__title { font: 700 10px/1 var(--font); letter-spacing: .18em; margin-bottom: 10px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hud__row { display: flex; justify-content: space-between; gap: 20px; padding: 3px 0; font: 12px/1.4 var(--mono); }
.hud__k { color: var(--faint); }
.hud__v { color: var(--hud-val); font-weight: 600; font-variant-numeric: tabular-nums; }

/* File panel */
.fpanel { position: absolute; top: 64px; right: 16px; z-index: 11; width: 330px; max-height: 62vh;
  background: var(--glass-3); border: 1px solid var(--hairline-strong); border-radius: 16px;
  backdrop-filter: blur(24px) saturate(160%); box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden; animation: fadeUp .3s ease both; }
.fpanel__head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px;
  border-bottom: 1px solid var(--hairline); font-weight: 700; font-size: 13px; letter-spacing: .02em; }
.fpanel__x { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1;
  width: 26px; height: 26px; border-radius: 8px; transition: background .15s; }
.fpanel__x:hover { background: var(--surface-2); color: var(--text); }
.fpanel__list { overflow-y: auto; padding: 8px; }
.fpanel__row { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px;
  font-size: 13px; transition: background .15s; }
.fpanel__row:hover { background: var(--surface-2); }
.fpanel__name { flex: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fpanel__size { color: var(--faint); font: 11px var(--mono); }
.fpanel__dl { background: var(--grad); border: none; color: #fff; border-radius: 9px; cursor: pointer;
  width: 30px; height: 28px; font-size: 13px; transition: transform .12s, filter .2s; }
.fpanel__dl:hover { transform: translateY(-1px); filter: brightness(1.1); }
.fpanel__prog { color: var(--accent-2); font: 12px var(--mono); min-width: 34px; text-align: right; }
.fpanel__empty { color: var(--faint); padding: 22px; text-align: center; font-size: 13px; }

@media (max-width: 920px) {
  .features__grid { grid-template-columns: repeat(2, 1fr); }
  .steps__grid { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .home__grid { grid-template-columns: 1fr; }
  .features__grid { grid-template-columns: 1fr; }
  .hero { padding-top: 40px; }
  .toolbar { left: 12px; right: 12px; transform: none; max-width: none; }
  .fpanel { left: 12px; right: 12px; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation: none !important; transition: none !important; }
}
