/* Apple Design System Utility Classes
 * Phase 2에서 사용하는 컴포넌트 클래스만 정의 (YAGNI).
 * DESIGN-apple.md 미사용 컴포넌트 (configurator, environment, sticky-bar 등)는
 * 필요 시점에 추가.
 */

/* ===========================
 * BUTTONS
 * =========================== */
.apple-btn-primary {
  display: inline-block;
  background: var(--apple-primary);
  color: #fff;
  font-family: var(--apple-font-text);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.47;
  letter-spacing: -0.374px;
  border-radius: var(--apple-r-pill);
  padding: 11px 22px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s ease, opacity 0.2s ease;
}
.apple-btn-primary:hover { opacity: 0.9; }
.apple-btn-primary:active { transform: scale(0.95); }
.apple-btn-primary:focus-visible { outline: 2px solid var(--apple-primary-focus); outline-offset: 2px; }

.apple-btn-secondary-pill {
  display: inline-block;
  background: transparent;
  color: var(--apple-primary);
  font-family: var(--apple-font-text);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.47;
  letter-spacing: -0.374px;
  border-radius: var(--apple-r-pill);
  padding: 10px 21px;
  border: 1px solid var(--apple-primary);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s ease, background 0.2s ease, color 0.2s ease;
}
.apple-btn-secondary-pill:hover { background: var(--apple-primary); color: #fff; }
.apple-btn-secondary-pill:active { transform: scale(0.95); }
.apple-btn-secondary-pill:focus-visible { outline: 2px solid var(--apple-primary-focus); outline-offset: 2px; }

.apple-btn-dark-utility {
  display: inline-flex;
  align-items: center;
  background: var(--apple-ink);
  color: #fff;
  font-family: var(--apple-font-text);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.29;
  letter-spacing: -0.224px;
  border-radius: var(--apple-r-sm);
  padding: 8px 15px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s ease;
}
.apple-btn-dark-utility:active { transform: scale(0.95); }

/* ===========================
 * TILES (full-bleed sections)
 * =========================== */
.apple-tile {
  width: 100%;
  /* common.css의 글로벌 section { max-width:1200; margin:auto } 무력화 */
  max-width: none;
  margin: 0;
  padding: var(--apple-spc-section) var(--apple-spc-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-sizing: border-box;
}
.apple-tile--light { background: var(--apple-canvas); color: var(--apple-ink); }
.apple-tile--parchment { background: var(--apple-canvas-parchment); color: var(--apple-ink); }
.apple-tile--dark { background: var(--apple-surface-tile-1); color: var(--apple-body-on-dark); }
.apple-tile--dark-2 { background: var(--apple-surface-tile-2); color: var(--apple-body-on-dark); }
.apple-tile--dark-3 { background: var(--apple-surface-tile-3); color: var(--apple-body-on-dark); }

@media (max-width: 640px) {
  .apple-tile { padding: var(--apple-spc-xxl) var(--apple-spc-md); }
}

/* ===========================
 * TYPOGRAPHY
 * =========================== */
.apple-h-hero {
  font-family: var(--apple-font-display);
  font-size: 56px;
  font-weight: 600;
  line-height: 1.07;
  letter-spacing: -0.28px;
  margin: 0;
}
.apple-h-display-lg {
  font-family: var(--apple-font-display);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
}
.apple-lead {
  font-family: var(--apple-font-display);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: 0.196px;
  margin: 0;
}
.apple-tagline {
  font-family: var(--apple-font-display);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.19;
  letter-spacing: 0.231px;
  margin: 0;
}
.apple-body-strong {
  font-family: var(--apple-font-text);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: -0.374px;
  margin: 0;
}
.apple-body {
  font-family: var(--apple-font-text);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.47;
  letter-spacing: -0.374px;
  margin: 0;
}
.apple-caption {
  font-family: var(--apple-font-text);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.43;
  letter-spacing: -0.224px;
  margin: 0;
}
.apple-caption-strong {
  font-family: var(--apple-font-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.29;
  letter-spacing: -0.224px;
  margin: 0;
}
.apple-fine-print {
  font-family: var(--apple-font-text);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.0;
  letter-spacing: -0.12px;
  margin: 0;
}
.apple-dense-link {
  font-family: var(--apple-font-text);
  font-size: 17px;
  font-weight: 400;
  line-height: 2.41;
  margin: 0;
}

/* Mobile typography down-step (per DESIGN-apple.md responsive table) */
@media (max-width: 1068px) {
  .apple-h-hero { font-size: 40px; }
}
@media (max-width: 640px) {
  .apple-h-hero { font-size: 34px; }
  .apple-h-display-lg { font-size: 28px; }
  .apple-lead { font-size: 21px; }
}
@media (max-width: 419px) {
  .apple-h-hero { font-size: 28px; }
}

/* ===========================
 * LINKS
 * =========================== */
.apple-link {
  color: var(--apple-primary);
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.apple-link:hover { opacity: 0.7; }

.apple-link--on-dark {
  color: var(--apple-primary-on-dark);
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.apple-link--on-dark:hover { opacity: 0.7; }

/* ===========================
 * CARDS (store-utility-card pattern)
 * =========================== */
.apple-card-utility {
  background: var(--apple-canvas);
  border: 1px solid var(--apple-hairline);
  border-radius: var(--apple-r-lg);
  padding: var(--apple-spc-lg);
  box-sizing: border-box;
}

/* ===========================
 * FADE-IN-UP override
 * common.css의 .fade-in-up은 opacity:0으로 시작하고 JS(initScrollTrigger)가
 * .visible을 붙여줘야 보임. Apple 리뉴얼은 JS 트리거를 빼므로 자동 keyframe으로 대체.
 * 스코프를 apple-tile 안으로 한정해 다른 페이지(ProjectDetail 등) 영향 없게.
 * =========================== */
.apple-tile .fade-in-up,
.apple-tile.fade-in-up {
  opacity: 1;
  transform: none;
  animation: appleFadeInUp 0.35s ease both;
}
@keyframes appleFadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===========================
 * GLOBAL NAV
 * =========================== */
.apple-global-nav {
  background: var(--apple-surface-black);
  color: #fff;
  height: 44px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-sizing: border-box;
}
