@import url('https://fonts.googleapis.com/css2?family=Gowun+Batang:wght@400;700&family=Gowun+Dodum&family=Noto+Sans+KR:wght@800;900&display=swap');

@font-face {
  font-family: 'Gmarket Sans';
  src: url('assets/gmarket-sans/GmarketSansTTFBold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gmarket Sans';
  src: url('assets/gmarket-sans/GmarketSansTTFMedium.ttf') format('truetype');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gmarket Sans';
  src: url('assets/gmarket-sans/GmarketSansTTFLight.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

/* The original Windows metrics leave excess space below button labels.
 * Keep the same glyphs, but center their ink (about .32em above baseline)
 * within the line box. SVG icons retain their existing flex alignment. */
@font-face {
  font-family: 'Gmarket Sans Controls';
  src: url('assets/gmarket-sans/GmarketSansTTFBold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  ascent-override: 82%;
  descent-override: 18%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Gmarket Sans Controls';
  src: url('assets/gmarket-sans/GmarketSansTTFMedium.ttf') format('truetype');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  ascent-override: 82%;
  descent-override: 18%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Gmarket Sans Controls';
  src: url('assets/gmarket-sans/GmarketSansTTFLight.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
  ascent-override: 82%;
  descent-override: 18%;
  line-gap-override: 0%;
}

/*
 * JIPFOOD typography system
 * This file is loaded last so the preview can be tuned without rewriting the
 * original page styles. Keep all global type decisions here.
 */
:root {
  --sans: 'Gmarket Sans', Pretendard, 'Malgun Gothic', sans-serif;

  --type-display: clamp(48px, 5vw, 64px);
  --type-page-title: clamp(40px, 4vw, 48px);
  --type-section-title: clamp(30px, 3vw, 36px);
  --type-card-title: 20px;
  --type-body-large: 17px;
  --type-body: 16px;
  --type-body-small: 14px;
  --type-caption: 12px;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --leading-display: 1.35;
  --leading-heading: 1.48;
  --leading-body: 1.8;
  --tracking-heading: -.04em;
  --tracking-body: -.015em;
}

html,
body,
button,
input,
select,
textarea,
body * {
  font-family: var(--sans) !important;
  font-synthesis: weight;
}

/* Use the same Gmarket Sans face as the moving home-banner copy everywhere. */
main,
main *,
.site-footer,
.site-footer *,
dialog,
dialog * {
  font-family: 'Gmarket Sans', Pretendard, 'Malgun Gothic', sans-serif !important;
}

/* The moving home-banner headlines retain the selected display face. */
body[data-page='home'] .hero-photo-copy h2 {
  font-family: 'Gmarket Sans', Pretendard, 'Malgun Gothic', sans-serif !important;
  font-weight: 700;
}

body {
  font-size: var(--type-body);
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-body);
  font-weight: var(--weight-regular);
}

/* Common navigation */
.main-nav > a,
.section-nav > a {
  font-size: 16px;
  line-height: 1.5;
  font-weight: var(--weight-medium);
  letter-spacing: -.02em;
}

.local-nav-title {
  font-size: 13px;
  line-height: 1.5;
  font-weight: var(--weight-semibold);
}

.local-nav-links a,
.local-nav-toggle {
  font-size: 14px;
  line-height: 1.6;
  font-weight: var(--weight-regular);
  letter-spacing: -.015em;
}

.local-nav-links a[aria-current] {
  font-weight: var(--weight-semibold);
}

/* Page and section hierarchy */
.page-heading h1,
.catalogue-heading h1,
.product-overview-lead h1,
.company-story-lead h1 {
  font-size: var(--type-page-title);
  line-height: var(--leading-display);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-heading);
}

.section-heading h2,
.section-title,
.home-section-heading h2,
.home-company-heading h2,
.company-section-heading h2,
.product-packaging h2,
.film-heading h2,
.brochure-ceo h2,
.company-history-inner h2 {
  font-size: var(--type-section-title);
  line-height: var(--leading-heading);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-heading);
}

h3,
.catalogue-card-title,
.home-product-name,
.official-store-card > h3,
.packaging-options h3 {
  font-size: var(--type-card-title);
  line-height: 1.55;
  font-weight: var(--weight-semibold);
  letter-spacing: -.025em;
}

.eyebrow,
.company-kicker,
.home-section-label,
.family-eyebrow,
.card-kicker {
  font-size: var(--type-caption);
  line-height: 1.6;
  font-weight: var(--weight-semibold);
  letter-spacing: .04em;
}

.page-heading > p:last-child,
.company-lead-description,
.family-intro,
.family-story-description,
.product-dialog-description,
.product-dialog-details p {
  font-size: var(--type-body);
  line-height: var(--leading-body);
  font-weight: var(--weight-regular);
}

.section-heading > p,
.company-section-heading > p,
.home-company-heading > p,
.card-body p,
.catalogue-card-description,
.official-store-card > p,
.product-packaging p {
  font-size: var(--type-body-small);
  line-height: var(--leading-body);
  font-weight: var(--weight-regular);
}

/* Home hero remains the only display-sized heading. */
body[data-page='home'] .hero-copy h1 {
  font-size: var(--type-display);
  line-height: var(--leading-display);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-heading);
}

body[data-page='home'] .hero-copy h1 span,
body[data-page='home'] .hero-copy h1 strong {
  font-weight: inherit;
}

body[data-page='home'] .hero-copy > p:not(.hero-brand-label) {
  font-size: var(--type-body);
  line-height: var(--leading-body);
}

.hero-brand-label,
.hero-cta,
.inline-link,
.outline-link,
.solid-link,
.purchase-button {
  font-size: var(--type-body-small);
  line-height: 1.6;
  font-weight: var(--weight-medium);
}

/* Shared optical centering for text controls on every page and breakpoint.
 * Include label children because the global typography rule sets their font. */
body :is(
  .brochure-filters,
  .history-filter,
  .purchase-button,
  .outline-link,
  .solid-link,
  .hero-cta,
  .store-toggle,
  .store-dropdown,
  .language-switch,
  .local-nav-toggle,
  .section-nav,
  .catalogue-tabs,
  .signature-arrange-tools
),
body :is(
  .brochure-filters,
  .history-filter,
  .purchase-button,
  .outline-link,
  .solid-link,
  .hero-cta,
  .store-toggle,
  .store-dropdown,
  .language-switch,
  .local-nav-toggle,
  .section-nav,
  .catalogue-tabs,
  .signature-arrange-tools
) * {
  font-family: 'Gmarket Sans Controls', 'Gmarket Sans', Pretendard, 'Malgun Gothic', sans-serif !important;
}

@media (max-width: 600px) {
  :root {
    --type-display: 36px;
    --type-page-title: 32px;
    --type-section-title: 28px;
    --type-card-title: 19px;
    --type-body-large: 16px;
    --type-body: 15px;
    --type-body-small: 13px;
    --type-caption: 11px;
  }

  .main-nav > a,
  .section-nav > a {
    font-size: 14px;
  }

  .local-nav-title {
    font-size: 12px;
  }

  .local-nav-links a,
  .local-nav-toggle {
    font-size: 14px;
  }
}

@media (max-width: 360px) {
  :root {
    --type-display: 32px;
    --type-page-title: 30px;
    --type-section-title: 26px;
    --type-card-title: 18px;
  }
}
