/*
 * MedQraft 패밀리 대문 (medqraft.app)
 *
 * 구성(2026-09-24 오너 지시): 화면 가운데에 회사 이름을 크게, 그 아래 제품을 큼지막한 버튼으로 가로 배열.
 * 로그인 화면의 장치는 따르지 않는다. 색 · 글꼴만 패밀리 정본(Q-Atelier lib/design/tokens.ts)을 쓴다.
 * 강조색은 샴페인 하나. 모션은 «떠오름»(translateY + opacity)뿐이고 이징은 ease-out expo.
 */

:root {
  --bg: #0c0c0c;
  --surface: #141414;
  --border: #242424;
  --border-hi: #333333;
  --text: #f0ebe0;
  --subtle: #b7b0a5;
  --muted: #898271;
  --gold: #b8935a;
  --ribbon-1: 0.07;
  --ribbon-2: 0.04;
  --mark-dark: block;
  --mark-light: none;
  --font-ui: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, Menlo, ui-monospace, 'Pretendard Variable', monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 10px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #faf9f6;
    --surface: #ffffff;
    --border: #e4e0d8;
    --border-hi: #d3cdc1;
    --text: #1c1a16;
    --subtle: #4f4a41;
    --muted: #726b5e;
    --gold: #8a6838;
    --ribbon-1: 0.08;
    --ribbon-2: 0.05;
    --mark-dark: none;
    --mark-light: block;
    color-scheme: light;
  }
}

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

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

/* ── 배경 리본(옅게) ──────────────────────────────────── */
.ribbons { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ribbons svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ribbons .stop { stop-color: var(--gold); }
.ribbon-1 { opacity: var(--ribbon-1); animation: drift-1 32s ease-in-out infinite; transform-origin: 50% 50%; }
.ribbon-2 { opacity: var(--ribbon-2); animation: drift-2 38s ease-in-out infinite; transform-origin: 50% 50%; }
@keyframes drift-1 {
  0%, 100% { transform: translate3d(-3%, -2%, 0) scale(1.02); }
  50% { transform: translate3d(2%, 1%, 0) scale(1.05); }
}
@keyframes drift-2 {
  0%, 100% { transform: translate3d(2%, 1%, 0) scale(1.03); }
  50% { transform: translate3d(-2%, -1%, 0) scale(1.06); }
}

/* ── 한 화면 ──────────────────────────────────────────── */
.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 32px 40px;
}

/* ── 회사 이름 ────────────────────────────────────────── */
.masthead { text-align: center; }

/* 회사 정식 로고(가로형). 색과 모양은 원본 그대로, 어두운 화면엔 흰 판 · 밝은 화면엔 검은 판. */
.logo { margin: 0; line-height: 0; }
.logo-img {
  width: min(760px, 82vw);
  height: auto;
  margin: 0 auto;
}
.logo-on-dark { display: var(--mark-dark); }
.logo-on-light { display: var(--mark-light); }

.tagline {
  margin: 26px 0 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--subtle);
  word-break: keep-all;
}
.family-label {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.family-label::before, .family-label::after {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--gold);
  opacity: 0.7;
}

/* ── 제품 버튼 ────────────────────────────────────────── */
.products {
  list-style: none;
  margin: 64px 0 0;
  padding: 0;
  width: 100%;
  max-width: 1120px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.product {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 236px;
  padding: 28px 28px 24px;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: inherit;
  text-decoration: none;
  transition: transform 320ms var(--ease), border-color 320ms var(--ease), background-color 320ms var(--ease);
}

a.product:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 6%, var(--surface));
}
a.product:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* 화살표가 있는 칸과 없는 칸의 글줄이 같은 높이에 오도록 머리 높이를 고정한다. */
.product-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 22px;
  margin-bottom: 22px;
}
.product-index {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1;
  color: var(--gold);
}
.product-arrow {
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  transition: color 320ms var(--ease);
}
a.product:hover .product-arrow, a.product:focus-visible .product-arrow { color: var(--gold); }

.product-name {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
}
.product-desc {
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--subtle);
  word-break: keep-all;
}
/* 한글 단추 글귀라 자간 · 대문자 변환을 두지 않는다(2026-10-22 오너 결정 · 영어 글귀 없앰) */
.product-go {
  margin-top: auto;
  padding-top: 22px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
a.product:hover .product-go { color: var(--gold); }

.product.is-soon { border-style: dashed; background: transparent; }
.product.is-soon .product-name { color: var(--subtle); }
.product.is-soon .product-go { color: var(--muted); }

/* ── 바닥 ─────────────────────────────────────────────── */
.foot {
  margin-top: 56px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-align: center;
}
.foot a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--border-hi); }
.foot a:hover { color: var(--text); }

/* ── 떠오름 ───────────────────────────────────────────── */
.rise { opacity: 0; transform: translateY(8px); animation: rise 760ms var(--ease) forwards; }
.rise-1 { animation-delay: 40ms; }
.rise-2 { animation-delay: 120ms; }
.rise-3 { animation-delay: 220ms; }
.rise-4 { animation-delay: 300ms; }
.rise-5 { animation-delay: 380ms; }
@keyframes rise { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .ribbon-1, .ribbon-2 { animation: none; }
  .rise { opacity: 1; transform: none; animation: none; }
  .product, .product-arrow { transition: none; }
  a.product:hover { transform: none; }
}

/* ── 좁은 화면: 버튼을 세로로 ─────────────────────────── */
@media (max-width: 900px) {
  .stage { justify-content: flex-start; padding: 64px 16px 32px; }
  .family-label { letter-spacing: 0.12em; font-size: 10.5px; }
  .family-label::before, .family-label::after { display: none; }
  .products { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 44px; }
  .product { min-height: 0; padding: 22px 20px 20px; }
  .product-top { margin-bottom: 14px; }
  .product-name { font-size: 24px; }
  .product-go { padding-top: 16px; }
  .foot { margin-top: 40px; }
}
