:root {
  --canvas-bg: #ebebeb;
  --stamp-paper: #f6f4ea;
  --stamp-blank: #f2f1e6;
  --stamp-blank-inner: rgba(30, 29, 25, 0.06);
  --ink-primary: #111111;
  --ink-secondary: #4a4842;
  --ink-muted: #7c786e;
  --popover-bg: #fcfbf7;
  --hairline: rgba(17, 17, 17, 0.12);
  --hairline-strong: rgba(17, 17, 17, 0.22);
  --font-sans: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--canvas-bg);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-break: keep-all;
  font-variant-numeric: tabular-nums;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--ink-primary);
  outline-offset: 3px;
}

/* Pure Chrome-Free Stamp Album Stage */
.album-stage {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 4.8vh, 56px) clamp(16px, 4.4vw, 88px);
}

.stamp-sheet-grid {
  width: 100%;
  max-width: 1480px;
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  grid-auto-rows: auto;
  column-gap: clamp(6px, 1.15vw, 20px);
  row-gap: clamp(8px, 1.25vw, 18px);
  align-items: stretch;
}

/* Stamp Wrapper Casts Delicate Shadow Around Perforated Teeth */
.stamp-cell {
  position: relative;
  aspect-ratio: 1 / 1.04;
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.11));
  transition: transform 160ms var(--ease), filter 160ms var(--ease);
}

.stamp-cell:hover,
.stamp-cell:focus-within {
  transform: translateY(-2px);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.16));
  z-index: 5;
}

/* Authentic 4-Edge Perforated Postage Stamp Silhouette */
.stamp-paper {
  --r: 2.7px;
  --s: 8.5px;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 5px;
  background-color: var(--stamp-paper);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  -webkit-mask:
    radial-gradient(circle var(--r) at 50% 0, #0000 96%, #000) 0 0 / var(--s) 100% repeat-x,
    radial-gradient(circle var(--r) at 50% 100%, #0000 96%, #000) 0 0 / var(--s) 100% repeat-x,
    radial-gradient(circle var(--r) at 0 50%, #0000 96%, #000) 0 0 / 100% var(--s) repeat-y,
    radial-gradient(circle var(--r) at 100% 50%, #0000 96%, #000) 0 0 / 100% var(--s) repeat-y;
  -webkit-mask-composite: source-in;
  mask:
    radial-gradient(circle var(--r) at 50% 0, #0000 96%, #000) 0 0 / var(--s) 100% repeat-x,
    radial-gradient(circle var(--r) at 50% 100%, #0000 96%, #000) 0 0 / var(--s) 100% repeat-x,
    radial-gradient(circle var(--r) at 0 50%, #0000 96%, #000) 0 0 / 100% var(--s) repeat-y,
    radial-gradient(circle var(--r) at 100% 50%, #0000 96%, #000) 0 0 / 100% var(--s) repeat-y;
  mask-composite: intersect;
}

/* Full Vector Infographic Stamp Plate (Zero Pixelated Small Font) */
.stamp-vector-plate {
  display: block;
  width: 100%;
  height: 100%;
}

/* Uncollected Blank Cream Stamp (AD-Style Blank Stamp Page) */
.stamp-paper.is-blank {
  background-color: var(--stamp-blank);
  padding: 7px;
}

.blank-inner-frame {
  width: 100%;
  height: 100%;
  border: 1px solid var(--stamp-blank-inner);
  position: relative;
}

.blank-corner-tick {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 5px;
  height: 5px;
  border-right: 1px solid rgba(30, 29, 25, 0.16);
  border-bottom: 1px solid rgba(30, 29, 25, 0.16);
}

/* AD Stamp (Pure Vector Infographic AD Plate) */
.stamp-paper.is-ad {
  background-color: var(--stamp-blank);
  padding: 7px;
}

.ad-vector-svg {
  width: 58%;
  height: auto;
  display: block;
}

/* Top-Right 3x2 Wide YouTube Shorts / Promo Video Frame (Cols 11-13, Rows 2-3 in 14x7) */
.promo-video-cell {
  grid-column: 11 / span 3;
  grid-row: 2 / span 2;
  position: relative;
  background: #14191f;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

.promo-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.promo-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 132px;
  background: #141a21;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.promo-infographic-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.promo-play-btn {
  position: relative;
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.68);
  background: rgba(15, 20, 25, 0.65);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 150ms var(--ease), background-color 150ms var(--ease);
}

.promo-play-btn:hover {
  transform: scale(1.06);
  background: rgba(15, 20, 25, 0.90);
}

/* Bottom-Right 3x1 Embedded Infographic Wordmark Image (Cols 12-14, Row 7 in 14x7) */
.brand-signature-cell {
  grid-column: 12 / span 3;
  grid-row: 7;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 2px 2px 0;
}

.brand-wordmark-img {
  display: block;
  width: 96%;
  max-width: 256px;
  height: auto;
  user-select: none;
}

.sheet-dots {
  margin-top: 6px;
  padding-left: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sheet-dot-btn {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sheet-dot-btn span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(17, 17, 17, 0.22);
  transition: transform 140ms var(--ease), background-color 140ms var(--ease);
}

.sheet-dot-btn.is-active span,
.sheet-dot-btn:hover span {
  background: #111111;
  transform: scale(1.25);
}

/* Hover Popover Card (Description + Clickable Hyperlink) */
.hover-card {
  position: fixed;
  z-index: 60;
  width: 296px;
  background: var(--popover-bg);
  border: 1px solid var(--hairline-strong);
  border-radius: 6px;
  padding: 14px 15px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.06);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 140ms var(--ease), transform 140ms var(--ease);
}

.hover-card.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.hc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.hc-num {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-muted);
}

.hc-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 3px;
  background: #e8e6dc;
  color: var(--ink-secondary);
}

.hc-badge.is-live {
  background: #dcfce7;
  color: #166534;
}

.hc-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-primary);
}

.hc-desc {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-secondary);
}

.hc-links {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 10px;
  background: #f1efe6;
  border-radius: 4px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: var(--ink-secondary);
}

.hc-links a {
  color: var(--ink-primary);
  font-weight: 600;
  text-decoration: underline;
}

.hc-btns {
  display: flex;
  gap: 6px;
}

.btn-solid,
.btn-outline {
  flex: 1;
  height: 32px;
  padding: 0 10px;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-solid {
  background: var(--ink-primary);
  color: #ffffff;
  border: 1px solid var(--ink-primary);
}

.btn-outline {
  background: transparent;
  color: var(--ink-primary);
  border: 1px solid var(--hairline-strong);
}

/* Stamp Back Postcard Modal (AI Data Bank: Usage Guide & Download Tab) */
.postcard-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(17, 17, 17, 0.36);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.postcard-backdrop[hidden] {
  display: none;
}

.postcard-sheet {
  width: 100%;
  max-width: 620px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--popover-bg);
  border: 1px solid var(--hairline-strong);
  border-radius: 6px;
  padding: 28px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.22);
}

.pc-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
}

.pc-tabs {
  display: flex;
  gap: 6px;
  margin: 16px 0;
}

.pc-tab {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 4px;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--ink-secondary);
}

.pc-tab.is-active {
  background: var(--ink-primary);
  color: #ffffff;
  border-color: var(--ink-primary);
}

.pc-close {
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  width: 30px;
  height: 30px;
  font-size: 15px;
  color: var(--ink-secondary);
}

.pc-guide-list {
  margin: 12px 0 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-secondary);
}

.pc-guide-list li + li {
  margin-top: 6px;
}

.pc-footer {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* Search Engine & AdSense Rich Text Catalog Drawer */
.databank-archive {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(20px, 8vw, 136px) 56px;
}

.databank-archive[hidden] {
  display: none;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.archive-card {
  background: var(--popover-bg);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 18px 20px;
}

/* Responsive Adjustments */
@media (max-width: 880px) {
  .stamp-sheet-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
  }
  .promo-video-cell {
    grid-column: 4 / span 3;
    grid-row: 2 / span 2;
  }
  .brand-signature-cell {
    grid-column: 5 / span 3;
    grid-row: auto;
  }
}

@media (max-width: 580px) {
  .album-stage {
    padding: 20px 12px;
  }
  .stamp-sheet-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }
  .promo-video-cell {
    grid-column: 1 / span 4;
    grid-row: 3 / span 2;
    aspect-ratio: 16 / 9;
  }
  .brand-signature-cell {
    grid-column: 1 / span 4;
    grid-row: auto;
    padding-top: 8px;
  }
  .archive-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
