/* Hair Degree — 심플 미니멀 디자인 (다크 + 옐로 액센트 하나)
   기능 ID는 index.html / app.js 와 동일하게 유지. 외형만. */

:root {
  color-scheme: dark;
  --bg: #0b0b0c;
  --surface: #151517;
  --line: #26262b;
  --text: #f5f5f6;
  --muted: #8b8b92;
  --accent: #ffd23a;
  --radius: 18px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: "Pretendard Variable", Pretendard, -apple-system,
    "Apple SD Gothic Neo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

/* 모바일 퍼스트 단일 컬럼 — 데스크탑에서도 같은 폭으로 깔끔하게 */
.app-shell {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 56px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
}

/* 브랜드 */
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--accent);
  color: #111;
  display: grid;
  place-items: center;
  font-size: 21px;
  font-weight: 800;
}
.brand-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.brand-handle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.brand-handle:hover {
  color: var(--accent);
}
.ig-icon {
  flex-shrink: 0;
}

/* 히어로 카피 */
.hero-copy h1 {
  font-size: 44px;
  font-weight: 900;
  line-height: 1.14;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}
.hero-copy p {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.6;
}

/* 업로드 패널 */
.upload-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.upload-icon {
  font-size: 26px;
  color: var(--accent);
  margin-bottom: 4px;
}
.upload-title {
  font-size: 16px;
  font-weight: 700;
}
.upload-copy {
  font-size: 13px;
  color: var(--muted);
}
.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 16px;
}
.hint {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 10px;
}

/* 버튼 — 심플, 라운드 */
.primary-button,
.secondary-button {
  width: 100%;
  border-radius: 999px;
  padding: 15px 18px;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease,
    border-color 0.12s ease;
}
.primary-button {
  background: var(--accent);
  color: #111;
  border: none;
  font-weight: 800;
}
.secondary-button {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 600;
}
.primary-button:active,
.secondary-button:active {
  transform: scale(0.985);
}
.primary-button:hover {
  opacity: 0.92;
}
.secondary-button:hover {
  border-color: #3a3a42;
}
.ghost-button {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  font-family: inherit;
  padding: 12px;
  cursor: pointer;
}
.ghost-button:hover {
  color: var(--text);
}

/* 워크스페이스 */
.workspace {
  display: flex;
  flex-direction: column;
}

/* 빈 상태 — 결과 전 안내 */
.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.empty-hook {
  font-size: 23px;
  font-weight: 800;
  color: var(--text);
}

/* 스캔 뷰 */
.scan-view,
.result-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.scan-card {
  position: relative;
  width: 100%;
  max-width: 320px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}
#scanImage {
  width: 100%;
  display: block;
}
.scan-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 210, 58, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 210, 58, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
}
.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: scan 1.6s ease-in-out infinite;
}
.scan-corners {
  display: none;
}
@keyframes scan {
  0%,
  100% {
    top: 6%;
  }
  50% {
    top: 94%;
  }
}
.scan-title {
  font-size: 15px;
  font-weight: 700;
}
.scan-copy {
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}

/* 결과 뷰 */
#resultCanvas {
  width: 100%;
  max-width: 360px;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: block;
}
.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 360px;
}
.share-fallback {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  max-width: 360px;
}
.debug-stats {
  font-size: 11px;
  color: var(--muted);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  width: 100%;
  max-width: 360px;
  margin-top: 4px;
}

/* 숨김 / 오프스크린 */
.result-insta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  margin-top: 2px;
}
.result-insta:hover {
  color: var(--accent);
}

.hidden {
  display: none !important;
}
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.scratch-canvas {
  position: fixed;
  left: -9999px;
  top: -9999px;
  visibility: hidden;
}
