/* dragonworks.kr — 흑백. 왼쪽 고정 소개 + 오른쪽 서비스 목록 */
:root {
  --bg: #ffffff;
  --panel: #f6f6f7;
  --fg: #09090b;
  --fg-2: #52525b;
  --muted: #8e8e98;
  --line: #e4e4e7;
  --line-2: #d0d0d6;
  --live: #16a34a;
  --down: #dc2626;
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d0f; --panel: #141417; --fg: #f3f3f5; --fg-2: #a0a0ab; --muted: #686873;
    --line: #232329; --line-2: #34343c; --live: #4ade80; --down: #f87171;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0d0f; --panel: #141417; --fg: #f3f3f5; --fg-2: #a0a0ab; --muted: #686873;
  --line: #232329; --line-2: #34343c; --live: #4ade80; --down: #f87171;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans);
  font-size: 16px; line-height: 1.6; letter-spacing: -0.01em; word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}
.theme-anim, .theme-anim * { transition: background-color .3s, border-color .3s, color .3s !important; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; border-radius: 4px; }

/* 작은 고정폭 이름표 */
.label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--fg-2); letter-spacing: .06em; text-transform: uppercase; }
.label > span { display: inline-flex; align-items: center; gap: 8px; }

/* 로고 */
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-size: 23px; font-weight: 800; letter-spacing: -0.04em; }
.mark { display: block; fill: currentColor; transition: transform .4s cubic-bezier(.3, 1.5, .5, 1); }
.brand:hover .mark { transform: translate(2px, -2px) rotate(-4deg); }

.theme-btn {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--fg); cursor: pointer;
}
.theme-btn:hover { border-color: var(--fg); }
.theme-btn svg { grid-area: 1 / 1; transition: transform .35s, opacity .25s; }
.theme-btn .moon { opacity: 0; transform: rotate(-60deg) scale(.6); }
:root[data-theme="dark"] .theme-btn .sun { opacity: 0; transform: rotate(60deg) scale(.6); }
:root[data-theme="dark"] .theme-btn .moon { opacity: 1; transform: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { opacity: 0; transform: rotate(60deg) scale(.6); }
  :root:not([data-theme="light"]) .theme-btn .moon { opacity: 1; transform: none; }
}

/* 두 단 */
.layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); max-width: 1200px; margin: 0 auto; min-height: 100vh; }

/* 왼쪽: 고정 */
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  padding: 36px 28px; background: var(--panel); border-right: 1px solid var(--line); border-left: 1px solid var(--line);
}
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.intro { margin-top: 40px; }
.eyebrow { margin: 0; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: var(--muted); }
.lead { margin: 14px 0 0; font-size: 20px; font-weight: 800; line-height: 1.32; letter-spacing: -0.045em; color: var(--fg); }
.sub { margin: 14px 0 0; font-size: 14px; line-height: 1.65; color: var(--fg-2); }

.status { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.sp-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); transition: background .3s; }
.status.all-ok .sp-dot { background: var(--live); }
.status.some-down .sp-dot { background: var(--down); }
.sp-refresh { width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.sp-refresh:hover { color: var(--fg); }
.sp-refresh.spinning svg { animation: spin .8s linear infinite; }
.sp-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: 0; }
.sp-list li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.sp-list li { grid-template-areas: "dot host ms"; }
.sp-state { grid-area: dot; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .5; animation: blink 1s ease-in-out infinite; font-size: 0; }
.sp-host { grid-area: host; }
.sp-ms { grid-area: ms; color: var(--muted); font-variant-numeric: tabular-nums; }
li.ok .sp-state { background: var(--live); opacity: 1; animation: none; }
li.down .sp-state { background: var(--down); opacity: 1; animation: none; }
li.down .sp-ms { color: var(--down); }
@keyframes blink { 50% { opacity: .15; } }
@keyframes spin { to { transform: rotate(360deg); } }

.side-foot { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); }
.side-foot a { text-decoration: none; }
.side-foot a:hover { color: var(--fg); }

/* 오른쪽 */
.content { padding: 36px 40px 64px; display: flex; flex-direction: column; gap: 44px; min-width: 0; }
.apps { margin-top: 16px; display: grid; gap: 16px; }

.app {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: stretch;
  min-height: 236px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  text-decoration: none; background: var(--bg); transition: border-color .25s;
}
.app:hover { border-color: var(--fg); }
.app-info { padding: 26px 28px; display: flex; flex-direction: column; }
.app-name { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.app h3 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.2; }
.host { font-family: var(--mono); font-size: 12.5px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.app p { margin: 8px 0 0; font-size: 15px; color: var(--fg-2); }
.app-meta { margin-top: auto; padding-top: 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--fg-2); }
.badge b { font-weight: 500; }
.badge i { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--live); }
.badge i::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--live); animation: ping 2.2s cubic-bezier(0, 0, .2, 1) infinite; }
.badge.down { color: var(--down); }
.badge.down i, .badge.down i::after { background: var(--down); }
@keyframes ping { 75%, 100% { transform: scale(2.4); opacity: 0; } }
.stack { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.stack li { font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px; letter-spacing: 0; }

.shot { position: relative; background: var(--panel); border-left: 1px solid var(--line); overflow: hidden; }
.phone {
  position: absolute; left: 50%; top: 30px; width: 200px; translate: -50% 0;
  border-radius: 26px; padding: 6px; background: var(--fg);
  box-shadow: 0 24px 40px -24px rgba(0, 0, 0, .45);
  transition: translate .6s cubic-bezier(.2, .7, .1, 1);
}
:root[data-theme="dark"] .phone { background: #2a2a31; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .phone { background: #2a2a31; } }
.phone img { display: block; width: 100%; height: auto; border-radius: 20px; transition: filter .5s ease; }
.app:hover .phone { translate: -50% -16px; }
/* 평소엔 흑백, 마우스를 올리면 원래 색 (마우스 없는 기기는 처음부터 컬러) */
@media (hover: hover) {
  .phone img { filter: grayscale(1) contrast(1.04); }
  .app:hover .phone img { filter: none; }
}
.only-dark { display: none !important; }
:root[data-theme="dark"] .only-light { display: none !important; }
:root[data-theme="dark"] .only-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .only-light { display: none !important; }
  :root:not([data-theme="light"]) .only-dark { display: block !important; }
}

.go { position: absolute; right: 18px; top: 18px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); font-size: 15px; z-index: 2; transition: background .25s, color .25s, border-color .25s, transform .25s; }
.app:hover .go { background: var(--fg); color: var(--bg); border-color: var(--fg); transform: rotate(45deg); }

.next { display: flex; justify-content: space-between; gap: 12px; padding: 16px 28px; border: 1px dashed var(--line-2); border-radius: 14px; font-size: 13px; color: var(--muted); }

/* 의견 보내기 */
.fb { padding-top: 32px; border-top: 1px solid var(--line); }
.fb-note { margin: 10px 0 0; font-size: 14.5px; color: var(--fg-2); }
.fb-form { margin-top: 18px; display: grid; gap: 12px; }
.row3 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr); gap: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; font-size: 14.5px; color: var(--fg); background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; transition: border-color .15s, background .15s;
}
.field select { -webkit-appearance: none; appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.field textarea { resize: vertical; min-height: 104px; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--fg); background-color: var(--bg); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.fb-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.fb-msg { margin: 0; font-size: 14px; color: var(--muted); min-height: 1.4em; }
.fb-msg.err { color: var(--down); }
.fb-msg.ok { color: var(--live); }
.fb-msg.ok::before { content: "✓ "; display: inline-block; animation: pop .4s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { from { transform: scale(0); } }
.btn {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 14.5px; font-weight: 600;
  padding: 10px 24px; border: 1px solid var(--fg); border-radius: 8px; background: var(--fg); color: var(--bg); cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.btn:hover { opacity: .85; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn .spin { display: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.btn.busy .spin { display: inline-block; }

/* 등장 */
.rise { opacity: 0; filter: blur(6px); transform: translateY(10px); animation: rise .8s cubic-bezier(.2, .7, .1, 1) forwards; animation-delay: calc(var(--i, 0) * 110ms + 60ms); }
@keyframes rise { to { opacity: 1; filter: none; transform: none; } }
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s cubic-bezier(.2, .7, .1, 1) calc(var(--d, 0) * 100ms), transform .8s cubic-bezier(.2, .7, .1, 1) calc(var(--d, 0) * 100ms), border-color .25s; }
.js .reveal.in { opacity: 1; transform: none; }

/* 글 페이지 (방침·404) */
.page { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 72px; border-bottom: 1px solid var(--line); }
.doc { padding: 36px 0 56px; }
.doc .back { font-size: 14px; color: var(--muted); text-decoration: none; }
.doc .back:hover { color: var(--fg); }
.doc h1 { font-size: clamp(28px, 5vw, 38px); letter-spacing: -0.035em; margin: 18px 0 6px; line-height: 1.25; }
.doc .meta { font-size: 14px; color: var(--muted); margin: 0 0 28px; }
.doc h2 { font-size: 18px; margin: 34px 0 10px; letter-spacing: -0.02em; }
.doc p, .doc li { color: var(--fg-2); font-size: 15.5px; }
.doc ul { padding-left: 1.2em; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-top: 1px solid var(--line); }
.doc th { width: 6em; color: var(--muted); font-weight: 500; white-space: nowrap; }
.doc tr:last-child th, .doc tr:last-child td { border-bottom: 1px solid var(--line); }
.doc code { font-family: var(--mono); font-size: .9em; background: var(--panel); padding: 1px 6px; border-radius: 4px; letter-spacing: 0; }
.page-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; padding: 18px 0 32px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.page-foot nav { display: flex; gap: 16px; }
.page-foot a { text-decoration: none; }
.page-foot a:hover { color: var(--fg); }

/* 테마 바꿀 때 버튼 자리에서 원으로 퍼지기 (View Transitions 되는 브라우저만) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { clip-path: circle(0 at var(--tx, 100%) var(--ty, 0)); animation: wipe .6s cubic-bezier(.6, 0, .2, 1) forwards; }
@keyframes wipe { to { clip-path: circle(var(--tr, 150vmax) at var(--tx, 100%) var(--ty, 0)); } }

@media (max-width: 1000px) {
  .layout { grid-template-columns: 280px minmax(0, 1fr); }
  .content { padding: 32px 28px 56px; }
  .app { grid-template-columns: minmax(0, 1fr) 210px; }
  .phone { width: 172px; }
  .row3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .row3 .field:last-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; padding: 22px 20px 26px; border-left: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-foot { display: none; }
  .intro { margin-top: 28px; }
  .lead { font-size: 20px; }
  .status { margin-top: 22px; padding-top: 16px; }
  .content { padding: 28px 20px 24px; gap: 36px; }
  .app { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .app-info { padding: 22px 20px; }
  .app h3 { font-size: 24px; }
  .shot { height: 220px; border-left: 0; border-top: 1px solid var(--line); }
  .phone { width: 196px; top: 24px; }
  .next { padding: 14px 20px; flex-direction: column; gap: 2px; }
  .row3 { grid-template-columns: minmax(0, 1fr); }
  .row3 .field:last-child { grid-column: auto; }
  .fb-bottom .btn { width: 100%; justify-content: center; }
  .m-foot { display: grid !important; }
  .page { padding: 0 20px; }
  .page-head { height: 60px; }
}
.m-foot { display: none; gap: 6px; padding: 20px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.m-foot a { text-decoration: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rise, .js .reveal { opacity: 1 !important; filter: none !important; transform: none !important; }
}
