/* 랜딩 전용 스타일. 토큰·글래스 컴포넌트는 shared/theme.css가 담당한다. */



html { min-width: 320px; }

.hub {
  width: min(1180px, calc(100% - 44px));
  margin: 0 auto;
  padding: 68px 0 80px;
}

/* ── 인트로 ─────────────────────────────────────────── */
.intro { max-width: 860px; }
.eyebrow, .card-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 0;
  background: transparent;
  color: var(--label-secondary);
}
.eyebrow i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent);
}
.intro h1 {
  margin: 22px 0 0;
  font-size: clamp(42px, 7vw, 84px);
  line-height: .98;
  letter-spacing: -.055em;
  font-weight: 800;
}
.intro h1 em { font-style: normal; color: var(--tint); }

/* ── 자격증 일정 진입점 ─────────────────────────────── */
.calendar-entry {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  width: min(580px, 100%);
  min-height: 78px;
  margin-top: 30px;
  padding: 14px 16px;
  border-radius: var(--r-card);
  background: var(--slab);
  color: var(--slab-ink);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.calendar-entry:hover,
.calendar-entry:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow-raised); }
.calendar-entry__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--r-control);
  background: #176b58;
  color: #fff;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .06em;
}
.calendar-entry__copy { display: flex; flex-direction: column; min-width: 0; }
.calendar-entry__copy b { font-size: 16px; }
.calendar-entry__copy small { margin-top: 2px; color: var(--slab-ink-soft); font-size: 12px; }
.calendar-entry__arrow {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  transition: transform 180ms ease;
}
.calendar-entry:hover .calendar-entry__arrow { transform: translateX(3px); }
/* 내 자격증 요약. 캘린더 진입점 바로 아래에 붙는다. display:grid가 hidden을 이기지 않게 따로 둔다. */
.calendar-entry.credits-entry { margin-top: 12px; }
.calendar-entry.credits-entry[hidden] { display: none; }
.credits-entry .calendar-entry__icon { background: #2c6b49; }

/* ── 카드 그리드 ────────────────────────────────────── */
/* auto-fit + 300px 하한이면 1180px에서 3열이 잡혀 카드 4장이 3+1로 떨어진다.
   시험 수가 짝수로 유지되는 동안은 2열이 균형이 맞고, 넓은 화면에서만
   4열로 펴서 한 줄에 담는다. */
.exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 16px;
  margin-top: 42px;
}
@media (min-width: 700px) {
  .exam-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1240px) {
  .exam-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.exam-card {
  /* --exam-ink는 theme.css의 :root에서 계산되므로 카드마다 인라인으로 꽂는
     --exam-color를 못 읽는다(커스텀 속성은 선언된 요소에서 치환된다).
     카드 단위로 다시 정의해야 시험별 색이 실제로 적용된다. */
  --exam-ink: var(--exam-color, var(--tint));

  position: relative;
  min-height: 190px;
  /* 하단 진입 영역(.enter/.card-chips)이 absolute라 자리를 비워둔다.
     칩이 44px 터치 타깃을 채우므로 그만큼 더 비운다. */
  padding: 20px 20px 78px;
  overflow: hidden;
  border: none;
  border-radius: var(--r-card);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-card);
  color: inherit;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
/* 카드 워터마크. 108px 고정이면 좁은 카드(343px)에서 3분의 1을 차지하고,
   글자 모양에 따라 노출량도 제각각이라(C는 크게, T·I·D는 거의 안 보임)
   카드마다 다르게 읽힌다. 카드 폭에 비례시키고 위치를 글자 폭 기준으로 잡는다. */
.exam-card::after {
  content: attr(data-mark);
  position: absolute; right: -4px; bottom: -18px;
  font-size: clamp(72px, 26%, 108px); font-weight: 900; line-height: 1;
  color: var(--exam-ink, var(--tint)); opacity: .06;
  pointer-events: none;
}
.exam-card:hover, .exam-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-raised);
}

.card-head {
  /* .enter의 카드 전체 히트 영역보다 위에 있어야 '숨기기'가 눌린다. */
  position: relative; z-index: 3;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.card-label { color: var(--exam-ink, var(--tint)); }

.card-hide {
  /* 터치 타깃 44px을 확보하되, 보이는 알약은 그대로 두려고
     여백 대신 ::after 히트 영역을 덧댄다. */
  position: relative;
  border: 1px solid var(--glass-line); border-radius: var(--r-pill);
  padding: 4px 11px;
  background: var(--glass-bg-strong); color: var(--muted);
  font-family: inherit; font-size: 11px; font-weight: 600;
  cursor: pointer; transition: 150ms ease;
}
.card-hide::after {
  content: "";
  position: absolute; left: 0; right: 0; top: 50%;
  height: var(--tap); transform: translateY(-50%);
}
.card-hide:hover { border-color: var(--tint); color: var(--tint); }

.exam-card h2 {
  position: relative; z-index: 1;
  margin: 16px 0 6px;
  font-size: clamp(21px, 2.6vw, 29px);
  line-height: 1.08; letter-spacing: -.04em;
}
.exam-card p {
  position: relative; z-index: 1;
  margin: 0; color: var(--muted); font-size: 13.5px;
}

/* 단일 시험 — 하단 진입 링크가 카드 전체의 히트 영역을 갖는다.
   (::after를 카드 전체로 늘려 '숨기기' 버튼보다 아래 레이어에 깔린다) */
.enter {
  position: absolute; left: 20px; right: 20px; bottom: 18px; z-index: 1;
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 12px; border-top: 1px solid var(--glass-line);
  color: inherit; text-decoration: none;
  font-size: 13px; font-weight: 750;
}
.enter::after {
  content: "";
  position: absolute; inset: -1000px -20px -18px -20px;
  z-index: -1;
}
.enter b {
  width: 28px; height: 28px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--tint); color: var(--tint-ink);
  transition: transform 180ms ease;
}
.exam-card:hover .enter b { transform: translateX(3px); }

/* 필기·실기처럼 시험이 여럿이면 칩으로 나눠 들어간다. */
.card-chips {
  position: absolute; left: 20px; right: 20px; bottom: 18px; z-index: 2;
  display: flex; flex-wrap: wrap; gap: 8px;
  padding-top: 12px; border-top: 1px solid var(--glass-line);
}
.card-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: var(--tap); min-width: 84px;
  padding: 7px 16px;
  border: none; border-radius: var(--r-pill);
  background: var(--fill-quaternary); color: inherit; text-decoration: none;
  font-size: 13px; font-weight: 600;
  transition: 160ms ease;
}
.card-chip span { color: var(--muted); transition: transform 160ms ease; }
.card-chip:hover, .card-chip:focus-visible {
  border-color: transparent;
  background: var(--tint); color: var(--tint-ink);
}
.card-chip:hover span, .card-chip:focus-visible span {
  color: var(--tint-ink); transform: translateX(2px);
}

/* ── 상태·푸터 ──────────────────────────────────────── */
.catalog-status {
  grid-column: 1 / -1;
  margin: 0; padding: 30px 4px;
  color: var(--muted); font-size: 14px;
}
.catalog-status.error { color: var(--no); }

.hidden-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin-top: 24px; padding: 13px 17px;
  border-radius: var(--r-group);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-card);
}
.hidden-info { margin: 0; color: var(--muted); font-size: 12.5px; }
.hidden-restore {
  margin-left: auto;
  border: 1px solid var(--glass-border); border-radius: var(--r-sm);
  padding: 7px 14px;
  background: var(--glass-bg-strong); color: var(--ink);
  font-family: inherit; font-size: 12.5px; font-weight: 650;
  cursor: pointer; transition: 150ms ease;
}
.hidden-restore:hover { border-color: var(--tint); background: var(--tint); color: var(--tint-ink); }

@media (max-width: 620px) {
  .hub { width: calc(100% - 32px); padding: 44px 0 64px; }
  .calendar-entry { margin-top: 24px; }
  .exam-grid { margin-top: 30px; }
}

/* 시험 고유색은 라이트 기준 값이라 어두운 카드 위에서 2.8~3.0:1까지 떨어진다.
   글자로 쓰는 쪽만 밝기를 올린다(워터마크는 6% 불투명도라 영향이 없다). */
@media (prefers-color-scheme: dark) {
  .exam-card { --exam-ink: color-mix(in srgb, var(--exam-color, var(--tint)) 70%, white); }
}
/* Account/session controls: keep the current privilege level visible on home. */
#account-controls { font-size: 14px; }
#account-controls button { min-height: 40px; padding: 8px 13px; border: 1px solid #cbc9bf; border-radius: 8px; background: #fffefa; color: #242820; cursor: pointer; font: inherit; }
#account-controls button:disabled { opacity: .55; cursor: wait; }
#account-controls small { color: #66685e; }
