/* masterUncle 서비스 런처 — 외부 리소스 없이 동작하는 정적 스타일 */

:root {
  color-scheme: dark;
  --bg: #0e151d;
  --bg-raise: #141d27;
  --text: #edf2f6;
  --muted: #a9b6c3;
  --line: rgba(255, 255, 255, 0.08);
  --mint: #86d8bd;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --gutter: clamp(16px, 4vw, 40px);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(56rem 30rem at 50% -12rem, rgba(134, 216, 189, 0.16), transparent 70%),
    radial-gradient(40rem 24rem at 100% 0, rgba(120, 140, 230, 0.07), transparent 70%),
    linear-gradient(180deg, #111a23 0%, var(--bg) 46rem);
  background-repeat: no-repeat;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: rgba(134, 216, 189, 0.35);
  color: #fff;
}

.frame {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: calc(1160px + var(--safe-left) + var(--safe-right));
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding:
    calc(var(--safe-top) + 18px)
    calc(var(--safe-right) + var(--gutter))
    calc(var(--safe-bottom) + 28px)
    calc(var(--safe-left) + var(--gutter));
}

/* 헤더 */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.brand img {
  display: block;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  box-shadow:
    0 0 0 1px rgba(134, 216, 189, 0.28),
    0 8px 22px -8px rgba(134, 216, 189, 0.55);
}

.brand span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

/* 본문 */
main {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(32px, 8vh, 80px);
}

.intro {
  max-width: 40rem;
  margin-bottom: clamp(28px, 5vw, 48px);
}

.intro p {
  margin: 0;
}

.intro .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 6px 12px 6px 10px;
  border: 1px solid rgba(134, 216, 189, 0.28);
  border-radius: 999px;
  background: rgba(134, 216, 189, 0.1);
  color: var(--mint);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.3;
}

.intro .eyebrow::before {
  content: "";
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 3px rgba(134, 216, 189, 0.2);
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(2.25rem, 7.2vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.intro p:not(.eyebrow) {
  color: var(--muted);
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  word-break: keep-all;
  overflow-wrap: anywhere;
}

/* 서비스 카드 */
nav {
  min-width: 0;
}

.services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 2.4vw, 20px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.services li {
  display: flex;
  min-width: 0;
}

.webtoon {
  --accent: #86d8bd;
  --accent-soft: rgba(134, 216, 189, 0.13);
  --accent-line: rgba(134, 216, 189, 0.3);
  --accent-glow: rgba(134, 216, 189, 0.22);
}

.novel {
  --accent: #bba9f7;
  --accent-soft: rgba(187, 169, 247, 0.14);
  --accent-line: rgba(187, 169, 247, 0.32);
  --accent-glow: rgba(187, 169, 247, 0.22);
}

.ai {
  --accent: #f49ac1;
  --accent-soft: rgba(244, 154, 193, 0.13);
  --accent-line: rgba(244, 154, 193, 0.3);
  --accent-glow: rgba(244, 154, 193, 0.2);
}

.hotdeal {
  --accent: #f3c766;
  --accent-soft: rgba(243, 199, 102, 0.13);
  --accent-line: rgba(243, 199, 102, 0.3);
  --accent-glow: rgba(243, 199, 102, 0.2);
}

.sketch {
  --accent: #ff9682;
  --accent-soft: rgba(255, 150, 130, 0.13);
  --accent-line: rgba(255, 150, 130, 0.3);
  --accent-glow: rgba(255, 150, 130, 0.2);
}

.markdown {
  --accent: #7fb6ff;
  --accent-soft: rgba(127, 182, 255, 0.13);
  --accent-line: rgba(127, 182, 255, 0.3);
  --accent-glow: rgba(127, 182, 255, 0.2);
}

.tracer {
  --accent: #b8e26a;
  --accent-soft: rgba(184, 226, 106, 0.13);
  --accent-line: rgba(184, 226, 106, 0.3);
  --accent-glow: rgba(184, 226, 106, 0.2);
}

.card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  min-height: 176px;
  padding: clamp(14px, 3.4vw, 24px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: clamp(16px, 3vw, 22px);
  background:
    linear-gradient(160deg, var(--accent-soft) 0%, rgba(255, 255, 255, 0.015) 58%),
    var(--bg-raise);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 14px 32px -20px rgba(0, 0, 0, 0.8);
  color: var(--text);
  text-decoration: none;
  touch-action: manipulation;
}

.card::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -70px;
  right: -60px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 68%);
  pointer-events: none;
}

.service-icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: clamp(48px, 12vw, 68px);
  height: clamp(48px, 12vw, 68px);
  margin-bottom: clamp(8px, 2vw, 14px);
  border: 1px solid var(--accent-line);
  border-radius: clamp(14px, 3vw, 20px);
  background: var(--accent-soft);
  box-shadow: 0 10px 24px -14px var(--accent);
  color: var(--accent);
}

.service-icon svg {
  display: block;
  width: 62%;
  height: 62%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.service-name {
  font-size: clamp(1.0625rem, 2.4vw, 1.3125rem);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.description {
  color: var(--muted);
  font-size: clamp(0.875rem, 1.8vw, 0.9688rem);
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.arrow {
  display: inline-grid;
  flex-shrink: 0;
  place-items: center;
  align-self: flex-end;
  width: 36px;
  height: 36px;
  margin-top: auto;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1;
}

.card:active {
  background:
    linear-gradient(160deg, var(--accent-soft) 0%, var(--accent-soft) 100%),
    var(--bg-raise);
}

.card:focus-visible {
  border-color: var(--accent);
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* 마우스처럼 hover가 가능한 장치에서만 hover 효과 */
@media (hover: hover) and (pointer: fine) {
  .card:hover {
    border-color: var(--accent-line);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.06),
      0 20px 40px -22px var(--accent-glow),
      0 18px 36px -22px rgba(0, 0, 0, 0.85);
  }

  .card:hover .arrow {
    background: var(--accent);
    color: var(--bg);
  }
}

/* 움직임은 사용자가 줄이기를 원하지 않을 때만 */
@media (prefers-reduced-motion: no-preference) {
  .card,
  .arrow {
    transition:
      transform 0.2s ease,
      border-color 0.2s ease,
      box-shadow 0.2s ease,
      background-color 0.2s ease,
      color 0.2s ease;
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .card:hover {
    transform: translateY(-4px);
  }

  .card:hover .arrow {
    transform: translateX(3px);
  }
}

/* 데스크톱에서 3열로 배치 */
@media (min-width: 900px) {
  .services {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .card {
    min-height: 208px;
    padding: 20px;
  }
}

/* 아주 좁은 화면(320px 등) */
@media (max-width: 359px) {
  :root {
    --gutter: 14px;
  }

  .services {
    gap: 10px;
  }

  .card {
    min-height: 164px;
    padding: 13px;
  }

  .service-name {
    font-size: 1rem;
  }

  .arrow {
    width: 32px;
    height: 32px;
  }
}

/* 고대비 모드 */
@media (prefers-contrast: more) {
  :root {
    --muted: #d3dce4;
    --line: rgba(255, 255, 255, 0.4);
  }
}

@media (forced-colors: active) {
  .card {
    border: 1px solid CanvasText;
  }

  .card:focus-visible {
    outline-color: Highlight;
  }

  .service-icon,
  .arrow {
    border-color: CanvasText;
  }
}
