/* FlamEL China tune — layout, floats, typography, lang UI */
@font-face {
  font-family: "Pretendard";
  src: url("../fonts/PretendardVariable.woff2") format("woff2-variations"),
       url("../fonts/PretendardVariable.woff2") format("woff2");
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
}

:root {
  --site-safe-bottom: 5.5rem;
  --site-fab-size: 56px;
  --site-fab-gap: 0.75rem;
  --color-ink: #111111;
  --color-body: #3F3F46;
  --color-muted: #71717A;
  --kit-navy: #111111;
  --kit-blue: #e1002a;
  --kit-sky: #e85a55;
  --kit-gold: #c41e3a;
  --font-ko: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans SC",
    "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

body {
  font-family: var(--font-ko);
  color: var(--color-body);
}

/* Korean UI: Pretendard first */
h1, h2, h3, h4, h5, h6,
p, li, button, input, select, textarea, label, a,
.about2-intro__title,
.about2-intro__text,
.about2-intro__sources,
.about2-values__card-title,
.about2-values__card-text,
.hero-slide__title,
.hero-slide__desc,
.page-hero__body,
.bottom-nav__item {
  font-family: var(--font-ko);
}

/* Typography: black / dark gray; red only as accent */
.text-kit-navy,
.text-ink,
.site-logo__sub,
h1, h2, h3, h4,
.list-head__title,
.about2-intro__title,
.about2-values__section-title,
.about2-contact__section-title {
  color: var(--color-ink) !important;
}
.about2-statement__title {
  color: var(--kit-blue) !important;
}
.text-kit-blue,
.text-kit-sky {
  color: var(--color-ink) !important;
}
p, li, .about2-intro__text, .about2-contact__desc {
  color: var(--color-body);
}

/* Landing hero: all slide text white */
.hero-slide__title,
.hero-slide__desc {
  color: #fff !important;
}

/* Accent points only */
.site-footer__btn,
.about2-contact__submit,
.hero-slide__btn,
.btn-sample,
.contact-modal__dialog button[type="submit"],
button.bg-kit-blue,
.bg-kit-blue {
  background: var(--kit-blue) !important;
  color: #fff !important;
  border: 0;
}

.bottom-nav {
  background-color: var(--kit-blue) !important;
}
.bottom-nav__item {
  color: rgba(255, 255, 255, 0.88) !important;
}
.bottom-nav__item:hover,
.bottom-nav__item.is-active {
  color: #fff !important;
}
.bottom-nav__item.is-active {
  box-shadow: inset 0 -2px 0 #fff !important;
}
.site-footer__btn {
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}
a.about2-contact__submit { text-decoration: none; }

/* Mobile: full width. PC: original centered shell */
.site-shell {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: max(0px, env(safe-area-inset-left));
  padding-right: max(0px, env(safe-area-inset-right));
}
@media (min-width: 768px) {
  .site-shell { max-width: 48rem; }
}
@media (min-width: 1024px) {
  .site-shell { max-width: 64rem; }
}

.main-content {
  padding-bottom: calc(var(--site-safe-bottom) + env(safe-area-inset-bottom, 0px));
}
body.is-landing .main-content { padding-bottom: 0; }

/* Landing: viewport-locked full-bleed slider (ignore wrap max-width) */
body.is-landing {
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  height: var(--app-height, 100dvh);
}
body.is-landing .site-shell {
  max-width: none !important;
  width: 100% !important;
  min-height: 0;
  height: 100%;
  margin-left: 0;
  margin-right: 0;
  overflow: hidden;
}
body.is-landing .main-content {
  width: 100%;
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}
body.is-landing .hero-slider {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
body.is-landing .site-header {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}
body.is-landing .site-footer-bar { display: none; }

.contact-fab { display: none !important; }

.wechat-float,
.scroll-top {
  width: var(--site-fab-size) !important;
  height: var(--site-fab-size) !important;
  right: max(16px, env(safe-area-inset-right, 0px)) !important;
  border-radius: 50%;
  box-sizing: border-box;
}
.wechat-float {
  bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px)) !important;
  z-index: 70;
}
.scroll-top {
  bottom: calc(5.25rem + var(--site-fab-size) + var(--site-fab-gap) + env(safe-area-inset-bottom, 0px)) !important;
  z-index: 64;
  display: grid;
  place-items: center;
  padding: 0;
}

/* Force horizontal bottom nav (local Tailwind may miss grid-cols-*) */
.bottom-nav {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav__row {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-auto-flow: column;
  width: 100%;
}
.bottom-nav__item {
  display: flex !important;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

/* Anchor target: clear sticky header when jumping to Contact us */
#contact-info {
  scroll-margin-top: 5.5rem;
}

/* Clear fixed bottom-nav so copyright stays fully visible */
.site-footer-bar {
  margin-bottom: 0;
  padding-bottom: calc(var(--site-safe-bottom) + 0.75rem + env(safe-area-inset-bottom, 0px));
}
.site-footer-bar__inner { max-width: 100%; }

/* Header tools + lang dropdown */
.site-header__tools { flex-shrink: 0; }
.bg-ink { background-color: var(--color-ink); }
.site-lang {
  position: relative;
  flex-shrink: 0;
}
.site-lang__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 3.1rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: var(--color-ink);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.site-lang__caret { opacity: 0.7; transition: transform .15s ease; }
.site-lang.is-open .site-lang__caret { transform: rotate(180deg); }
.site-lang__menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 50;
  min-width: 6.5rem;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1);
}
.site-lang--drawer .site-lang__menu {
  right: auto;
  left: 0;
  min-width: 100%;
}
.site-lang__option {
  display: block;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  color: var(--color-ink);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}
.site-lang__option:hover { background: #f4f4f5; }
.site-lang__option.is-active {
  color: var(--kit-blue);
  background: rgba(225, 0, 42, 0.08);
}

.side-menu__panel { max-width: min(320px, 88vw); }

/* Solution detail + drawer: mobile readability (PC rules stay intact) */
@media (max-width: 767px) {
  .detail-hero {
    gap: 4%;
    margin-bottom: 1.15rem;
  }
  .detail-hero__text { flex-basis: 68%; max-width: 68%; }
  .detail-hero__media { flex-basis: 28%; max-width: 28%; }
  .detail-hero__logo { height: 3.25rem; max-width: min(280px, 100%); }
  .detail-hero h1 {
    font-size: 1.05rem;
    line-height: 1.35;
    margin-bottom: .65rem !important;
  }
  .detail-desc-pill {
    font-size: .74rem;
    padding: .28rem .65rem;
    line-height: 1.4;
  }
  .sol-detail {
    gap: 1.35rem;
    font-size: .9rem;
    line-height: 1.62;
  }
  .sol-h { font-size: .98rem; }
  .sol-h3 { font-size: .9rem; }
  .sol-hl { font-size: .82rem; padding: .6rem .7rem; }
  .sol-table { min-width: 460px; font-size: .72rem; }
  .sol-table th,
  .sol-table td { padding: .4rem .45rem; }
  .sol-fig { margin: .7rem 0 .9rem; }
  .sol-video-link a { word-break: break-word; }
  .side-menu__sub a { font-size: .86rem; }
}
@media (max-width: 379px) {
  .detail-hero__text { flex-basis: 66%; max-width: 66%; }
  .detail-hero__media { flex-basis: 30%; max-width: 30%; }
  .detail-hero h1 { font-size: .98rem; }
  .sol-detail { font-size: .86rem; }
}

@media (max-width: 640px) {
  :root { --site-fab-size: 50px; }
  .wechat-float,
  .scroll-top {
    right: max(12px, env(safe-area-inset-right, 0px)) !important;
  }
}
@media (max-width: 379px) {
  .site-logo__sub { font-size: 0.65rem; line-height: 1.15; }
  .bottom-nav__item { font-size: 0.65rem; padding-top: 0.85rem; padding-bottom: 0.85rem; }
  .hero-slide__title { font-size: clamp(1.35rem, 6vw, 1.85rem); }
  .hero-slide__desc { font-size: 0.85rem; }
}
@media (min-width: 1024px) {
  .wechat-float {
    bottom: calc(2rem + env(safe-area-inset-bottom, 0px)) !important;
  }
  .scroll-top {
    bottom: calc(2rem + var(--site-fab-size) + var(--site-fab-gap) + env(safe-area-inset-bottom, 0px)) !important;
  }
  /* Keep clearance above fixed bottom-nav on desktop too */
  .main-content {
    padding-bottom: calc(var(--site-safe-bottom) + env(safe-area-inset-bottom, 0px));
  }
}

img, video {
  max-width: 100%;
  height: auto;
}

/* Locale typography: keep-all is for Korean; zh/en wrap normally */
html[lang="zh"],
html[lang="zh"] body,
html[lang="en"],
html[lang="en"] body {
  word-break: normal;
  overflow-wrap: anywhere;
}

.btn-sample {
  white-space: nowrap;
  line-height: 1.2;
  max-width: 100%;
}

.page-hero__body {
  max-width: 42rem;
}

@media (max-width: 640px) {
  .portfolio-card__title {
    font-size: clamp(1.1rem, 4.6vw, 1.35rem);
  }
  .portfolio-card__logo {
    max-width: min(200px, 78%);
    height: 2rem;
  }
  .btn-sample {
    font-size: 11px;
    padding: 7px 12px;
  }
  .page-hero {
    margin-bottom: 2rem;
  }
  .page-hero__card {
    min-height: 10.5rem;
  }
  /* Keep last card clear of floating bottom-nav + FAB */
  .portfolio-grid {
    padding-bottom: calc(1.5rem + var(--site-safe-bottom) + env(safe-area-inset-bottom, 0px));
  }
  .page-hero__body {
    /* Avoid first-paint blank while wipe-in starts */
    animation-duration: .55s;
  }
}

/* Required field label: mark aligned to the right end */
.field-label--required,
label.field-label--required,
.about2-contact__field-label.field-label--required {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  width: 100%;
}
.field-label__req {
  flex-shrink: 0;
  margin-left: auto;
  color: var(--kit-blue, #E31837);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.2;
}

/* Under-development pill beside solution logo */
.portfolio-card__logo-wrap,
.detail-hero__logo-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem .7rem;
}
.portfolio-card__dev-pill {
  display: inline-flex;
  align-items: center;
  padding: .28rem .72rem;
  border: 1px solid #e0b4bb;
  border-radius: 999px;
  background: #fff5f6;
  color: #8b1525;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .01em;
  white-space: nowrap;
}
.detail-hero__logo-wrap .portfolio-card__dev-pill {
  font-size: .78rem;
  padding: .32rem .8rem;
}

