/* 펭구오픽 공통 앱 쉘: 웹 상단 5탭 + 모바일 하단 5탭 */

:root {
  --app-bottom-content-space: 96px;
}

.app-top-nav {
  display: none;
}

.app-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(0px - env(safe-area-inset-bottom));
  z-index: 80;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  min-height: 82px;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid rgba(190, 233, 247, 0.65);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -8px 24px rgba(36, 59, 83, 0.09);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.app-bottom-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  color: #8a96a3;
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.25px;
  line-height: 1.15;
  transition: color 0.16s, transform 0.16s;
}

.app-bottom-item:hover,
.app-bottom-item.active {
  color: #2f80e7;
}

.app-bottom-item:active {
  transform: translateY(1px);
}

.app-bottom-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: grayscale(1) saturate(0) opacity(0.68);
}

.app-bottom-item.active .app-bottom-icon {
  /* PNG 전체를 단색으로 칠하면 얼굴 디테일이 뭉개져서 원본을 유지한다. */
  filter: none;
}

@media (min-width: 1024px) {
  .app-bottom-nav {
    display: none;
  }

  .app-top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
    max-width: 1440px;
    margin: 0 auto;
    padding: var(--space-3) var(--space-8);
    color: var(--color-navy);
    background: transparent;
    position: relative;
    z-index: 10;
  }

  .app-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-navy);
    text-decoration: none;
    min-width: 220px;
  }

  .app-brand-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
  }

  .app-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
  }

  .app-brand-name {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.6px;
  }

  .app-brand-sub {
    margin-top: 4px;
    color: var(--color-navy-soft);
    font-size: 0.78rem;
    font-weight: var(--font-weight-medium);
  }

  .app-top-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-8);
    flex: 1;
  }

  .app-top-link {
    position: relative;
    color: var(--color-navy);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 800;
    padding: 12px 0;
  }

  .app-top-link::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 2px;
    height: 3px;
    border-radius: var(--radius-pill);
    background: #2f80e7;
    opacity: 0;
    transform: scaleX(0.4);
    transition: opacity 0.16s, transform 0.16s;
  }

  .app-top-link:hover::after,
  .app-top-link.active::after {
    opacity: 1;
    transform: scaleX(1);
  }

  .app-top-auth {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
    min-width: 220px;
  }

  .app-user-name {
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-navy-soft);
    font-size: 0.84rem;
    font-weight: var(--font-weight-bold);
  }

  .app-auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 18px;
    border-radius: 14px;
    font-size: 0.88rem;
    font-weight: 800;
    text-decoration: none;
    box-shadow: var(--shadow-soft);
  }

  .app-auth-btn--ghost {
    color: var(--color-navy);
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(190, 233, 247, 0.9);
  }

  .app-auth-btn--solid {
    color: #fff;
    background: #2f80e7;
    border: 1px solid #2f80e7;
  }
}

/* =====================================================================
 * 공통 페이지 Hero Header (홈 제외 4탭: 모의고사 / 첨삭함 / 표현노트 / 프로필)
 * 홈탭은 별도 home-hero를 사용하므로 이 클래스의 영향을 받지 않음.
 * ===================================================================== */

body.exam-survey .pengu-page-hero,
body.history-page .pengu-page-hero,
body.notes-page .pengu-page-hero,
body.profile-page .pengu-page-hero {
  --pengu-hero-icon-size: 58px;
  --pengu-hero-icon-glyph: 34px;
  --pengu-hero-mascot-size: 112px;
  --pengu-hero-img-scale: 1;
  --pengu-hero-mascot-y: 0px;
  width: min(100%, 880px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 28px 8px 22px;
}

body.exam-survey .pengu-page-hero-copy,
body.history-page .pengu-page-hero-copy,
body.notes-page .pengu-page-hero-copy,
body.profile-page .pengu-page-hero-copy {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

body.exam-survey .pengu-page-hero-icon,
body.history-page .pengu-page-hero-icon,
body.notes-page .pengu-page-hero-icon,
body.profile-page .pengu-page-hero-icon {
  flex: 0 0 auto;
  width: var(--pengu-hero-icon-size);
  height: var(--pengu-hero-icon-size);
  display: grid;
  place-items: center;
  color: #4f6680;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(190, 220, 244, 0.86);
  box-shadow: 0 8px 22px rgba(36, 59, 83, 0.10);
}

body.exam-survey .pengu-page-hero-icon img,
body.history-page .pengu-page-hero-icon img,
body.notes-page .pengu-page-hero-icon img,
body.profile-page .pengu-page-hero-icon img,
body.exam-survey .pengu-page-hero-icon svg,
body.history-page .pengu-page-hero-icon svg,
body.notes-page .pengu-page-hero-icon svg,
body.profile-page .pengu-page-hero-icon svg {
  width: var(--pengu-hero-icon-glyph);
  height: var(--pengu-hero-icon-glyph);
  object-fit: contain;
}

body.exam-survey .pengu-page-hero-icon svg,
body.history-page .pengu-page-hero-icon svg,
body.notes-page .pengu-page-hero-icon svg,
body.profile-page .pengu-page-hero-icon svg {
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

body.exam-survey .pengu-page-hero-text,
body.history-page .pengu-page-hero-text,
body.notes-page .pengu-page-hero-text,
body.profile-page .pengu-page-hero-text {
  min-width: 0;
}

body.exam-survey .pengu-page-hero-title,
body.history-page .pengu-page-hero-title,
body.notes-page .pengu-page-hero-title,
body.profile-page .pengu-page-hero-title {
  margin: 0;
  color: var(--color-navy);
  font-size: clamp(2.25rem, 8vw, 2.8rem);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: none;
}

body.exam-survey .pengu-page-hero-subtitle,
body.history-page .pengu-page-hero-subtitle,
body.notes-page .pengu-page-hero-subtitle,
body.profile-page .pengu-page-hero-subtitle {
  margin: 8px 0 0;
  color: #425873;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.4;
  text-shadow: none;
}

body.exam-survey .pengu-page-hero-mascot,
body.history-page .pengu-page-hero-mascot,
body.notes-page .pengu-page-hero-mascot,
body.profile-page .pengu-page-hero-mascot {
  justify-self: end;
  align-self: center;
  width: var(--pengu-hero-mascot-size);
  height: var(--pengu-hero-mascot-size);
  display: flex;
  align-items: center;
  justify-content: center;
}

body.exam-survey .pengu-page-hero-mascot img,
body.history-page .pengu-page-hero-mascot img,
body.notes-page .pengu-page-hero-mascot img,
body.profile-page .pengu-page-hero-mascot img {
  width: calc(100% * var(--pengu-hero-img-scale));
  max-height: calc(100% * var(--pengu-hero-img-scale));
  height: auto;
  object-fit: contain;
  display: block;
  transform: translateY(var(--pengu-hero-mascot-y));
  filter: drop-shadow(0 8px 18px rgba(36, 59, 83, 0.13));
}

@media (max-width: 560px) {
  body.exam-survey .pengu-page-hero,
  body.history-page .pengu-page-hero,
  body.notes-page .pengu-page-hero,
  body.profile-page .pengu-page-hero {
    --pengu-hero-icon-size: 48px;
    --pengu-hero-icon-glyph: 28px;
    --pengu-hero-mascot-size: 96px;
    grid-template-columns: minmax(0, 1fr) var(--pengu-hero-mascot-size);
    gap: 10px;
    min-height: 132px;
    padding: 22px 0 18px;
  }

  body.exam-survey .pengu-page-hero-copy,
  body.history-page .pengu-page-hero-copy,
  body.notes-page .pengu-page-hero-copy,
  body.profile-page .pengu-page-hero-copy {
    justify-self: start;
    gap: 12px;
  }

  body.exam-survey .pengu-page-hero-icon,
  body.history-page .pengu-page-hero-icon,
  body.notes-page .pengu-page-hero-icon,
  body.profile-page .pengu-page-hero-icon {
    border-radius: 16px;
  }

  body.exam-survey .pengu-page-hero-text,
  body.history-page .pengu-page-hero-text,
  body.notes-page .pengu-page-hero-text,
  body.profile-page .pengu-page-hero-text {
    text-align: left;
  }

  body.exam-survey .pengu-page-hero-title,
  body.history-page .pengu-page-hero-title,
  body.notes-page .pengu-page-hero-title,
  body.profile-page .pengu-page-hero-title {
    font-size: clamp(1.9rem, 8vw, 2.15rem);
    line-height: 1.05;
  }

  body.exam-survey .pengu-page-hero-subtitle,
  body.history-page .pengu-page-hero-subtitle,
  body.notes-page .pengu-page-hero-subtitle,
  body.profile-page .pengu-page-hero-subtitle {
    margin-top: 7px;
    font-size: 0.9rem;
    line-height: 1.32;
  }

  body.exam-survey .pengu-page-hero-mascot,
  body.profile-page .pengu-page-hero-mascot {
    --pengu-hero-img-scale: 1.24;
  }

  body.notes-page .pengu-page-hero-mascot {
    --pengu-hero-img-scale: 0.89;
  }
}

@media (max-width: 380px) {
  body.exam-survey .pengu-page-hero,
  body.history-page .pengu-page-hero,
  body.notes-page .pengu-page-hero,
  body.profile-page .pengu-page-hero {
    --pengu-hero-mascot-size: 84px;
    grid-template-columns: minmax(0, 1fr) var(--pengu-hero-mascot-size);
    gap: 8px;
  }
}

@media (min-width: 1024px) {
  body.exam-survey .pengu-page-hero,
  body.history-page .pengu-page-hero,
  body.notes-page .pengu-page-hero,
  body.profile-page .pengu-page-hero {
    --pengu-hero-icon-size: 72px;
    --pengu-hero-icon-glyph: 42px;
    --pengu-hero-mascot-size: 166px;
    min-height: 240px;
    gap: 56px;
    padding: 52px 28px 46px;
  }

  body.exam-survey .pengu-page-hero-copy,
  body.history-page .pengu-page-hero-copy,
  body.notes-page .pengu-page-hero-copy,
  body.profile-page .pengu-page-hero-copy {
    gap: 24px;
  }

  body.exam-survey .pengu-page-hero-title,
  body.history-page .pengu-page-hero-title,
  body.notes-page .pengu-page-hero-title,
  body.profile-page .pengu-page-hero-title {
    font-size: clamp(3rem, 4vw, 3.55rem);
  }

  body.exam-survey .pengu-page-hero-subtitle,
  body.history-page .pengu-page-hero-subtitle,
  body.notes-page .pengu-page-hero-subtitle,
  body.profile-page .pengu-page-hero-subtitle {
    margin-top: 12px;
    font-size: 1.08rem;
  }

  body.exam-survey .pengu-page-hero-mascot,
  body.profile-page .pengu-page-hero-mascot {
    --pengu-hero-img-scale: 1.18;
  }

  body.notes-page .pengu-page-hero-mascot {
    --pengu-hero-img-scale: 0.9;
  }
}
