/* Company history: Waabi-inspired scrollytelling using Serim's local assets. */
html {
  background: #e8e6e3;
}

html[data-vfh-smooth-wheel="true"] {
  scroll-behavior: auto !important;
}

body.about-history-page {
  --vfh-page-bg: #f2f7f7;
  --vfh-cream: #e8e6e3;
  --vfh-ink: #000;
  --vfh-muted: rgb(0 0 0 / 50%);
  --vfh-accent: #153cd9;
  --vfh-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  padding-top: 0;
  background: #e8e6e3;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.vfh-main {
  width: 100%;
  overflow: clip;
  color: var(--serim-text-secondary, #5c5c5c);
  font-family: var(--vf-font-sans, "UCity Pro", "Pretendard Variable", Pretendard, sans-serif);
}

.vfh-main :where(h1, h2, h3, p, figure, ol, ul, dl, dd) {
  margin: 0;
}

.vfh-main :where(ol, ul) {
  padding: 0;
  list-style: none;
}

.vfh-hero {
  min-height: auto;
  padding-bottom: clamp(2.5rem, 6vh, 4rem);
  background: var(--vfh-page-bg);
}

.vfh-story {
  --vfh-progress: 0;
  position: relative;
  width: 100%;
  padding-block: 7.5rem 6rem;
  background: var(--vfh-cream);
  color: var(--vfh-ink);
}

.vfh-story > .serim-page-gutters {
  max-width: 90rem;
  margin-inline: auto;
}

.vfh-story-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
  text-align: center;
}

.vfh-story-title {
  display: flex;
  width: 100%;
  max-width: 32.8125rem;
  flex-direction: column;
  color: var(--vfh-ink);
  font-family: var(--vf-font-sans, "UCity Pro", "Pretendard Variable", Pretendard, sans-serif);
  font-size: 2.125rem;
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.98;
  text-wrap: balance;
}

.vfh-story-lede {
  max-width: 41.875rem;
  color: var(--vfh-muted);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.4;
  text-wrap: balance;
  word-break: keep-all;
}

.vfh-desktop-break {
  display: none;
}

.vfh-story-stage {
  position: relative;
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 3rem;
  margin-top: 3rem;
  padding-top: 3rem;
}

.vfh-desktop-progress {
  display: none;
}

.vfh-media-column {
  order: -1;
  width: 100%;
  padding-inline: 2.5rem;
}

.vfh-media-frame {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 1.2rem;
  background: #111;
  isolation: isolate;
}

.vfh-media {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.2);
  transform-origin: center;
  will-change: opacity, transform;
}

.vfh-media.is-active {
  z-index: 1;
  opacity: 1;
  transform: scale(1);
}

.vfh-narrative {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4rem;
}

.vfh-mobile-progress {
  position: relative;
  width: 100%;
  height: 0.75rem;
  padding-right: 0.75rem;
  overflow: clip;
}

.vfh-mobile-progress-reveal {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  transform: translateX(-100%);
  will-change: transform;
}

.vfh-mobile-progress-fill {
  height: 0.125rem;
  flex: 1 1 auto;
  background: var(--vfh-accent);
}

.vfh-mobile-progress-dot {
  position: absolute;
  right: 0;
  width: 0.75rem;
  height: 0.75rem;
  margin-left: -100%;
  border-radius: 50%;
  background: var(--vfh-accent);
}

.vfh-step-counter {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.25rem;
  padding: 0;
  color: var(--vfh-ink);
  font-variant-numeric: tabular-nums;
}

.vfh-step-current {
  position: relative;
  display: grid;
  width: 1.875rem;
  height: 1.5rem;
  overflow: hidden;
  font-size: 1.5rem;
  line-height: 1;
}

.vfh-step-number {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  font-variant-numeric: tabular-nums;
  will-change: transform;
}

.vfh-step-total {
  color: var(--vfh-muted);
  font-size: 0.75rem;
  line-height: 1;
}

.vfh-eras {
  display: flex;
  gap: 1.5rem;
  max-width: 100%;
  padding-bottom: 3.75rem;
  overflow-x: auto;
  scroll-padding-inline: 0;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 767px) {
  .vfh-story-stage {
    width: 100vw;
    margin-inline: calc(50% - 50vw);
  }
}

.vfh-eras:focus-visible {
  outline: 2px solid var(--serim-text-link-focus-strong, #2547d0);
  outline-offset: 0.5rem;
}

.vfh-eras::-webkit-scrollbar {
  display: none;
}

.vfh-era {
  display: flex;
  width: 100%;
  max-width: none;
  flex: 0 0 100%;
  align-items: flex-start;
  justify-content: center;
  padding-inline: 2.5rem;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.vfh-era-card {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

.vfh-era-title {
  max-width: 18rem;
  color: var(--vfh-ink);
  font-family: var(--vf-font-sans, "UCity Pro", "Pretendard Variable", Pretendard, sans-serif);
  font-size: 2.125rem;
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 1.05;
  text-wrap: balance;
  word-break: keep-all;
}

.vfh-era-years {
  display: grid;
  width: 100%;
  gap: 0;
  color: var(--vfh-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
  text-align: left;
}

.vfh-era-years > div {
  display: grid;
  grid-template-columns: 3.75rem minmax(0, 1fr);
  gap: 0;
  padding-block: 0.875rem;
  border-top: 1px solid rgb(0 0 0 / 14%);
}

.vfh-era-years > div:last-child {
  border-bottom: 1px solid rgb(0 0 0 / 14%);
}

.vfh-era-years dt {
  color: var(--vfh-ink);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.vfh-era-years dd {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

/* Keep longer English words inside the same narrow timeline columns. */
html:lang(en) :is(.vfh-era-title, .vfh-era-years dd) {
  overflow-wrap: anywhere;
  hyphens: auto;
}

@media (min-width: 768px) {
  .vfh-story {
    padding-block: 11.25rem 10rem;
  }

  .vfh-story-title {
    font-size: 5rem;
  }

  .vfh-story-lede {
    font-size: 1.5rem;
    line-height: 1.35;
  }

  .vfh-desktop-break {
    display: inline;
  }

  .vfh-story-stage {
    display: flex;
    width: min(100%, 77.125rem);
    flex-direction: row;
    gap: 11.25rem;
    margin: 6.375rem auto 0;
    padding-top: 6.25rem;
  }

  .vfh-desktop-progress {
    position: absolute;
    z-index: 3;
    top: 0;
    left: 50%;
    display: block;
    width: 0.75rem;
    height: 100%;
    padding-bottom: 50svh;
    overflow: clip;
    transform: translateX(-50%);
    pointer-events: none;
  }

  .vfh-desktop-progress-reveal {
    display: flex;
    width: 100%;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: translateY(-100%);
    will-change: transform;
  }

  .vfh-desktop-progress-fill {
    width: 0.125rem;
    height: 100%;
    flex: 0 0 100%;
    background: var(--vfh-accent);
    transform: translateY(0.375rem);
  }

  .vfh-desktop-progress-dot {
    width: 0.75rem;
    height: 0.75rem;
    flex: 0 0 0.75rem;
    margin-bottom: -100%;
    border-radius: 50%;
    background: var(--vfh-accent);
    transform: translateY(0.375rem);
  }

  .vfh-narrative {
    display: flex;
    width: 100%;
    min-width: 0;
    flex: 1 1 0;
    flex-direction: row;
    align-items: start;
  }

  .vfh-mobile-progress {
    display: none;
  }

  .vfh-step-counter {
    position: sticky;
    top: 0;
    display: flex;
    height: 100svh;
    flex: 0 0 auto;
    align-self: start;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0;
  }

  .vfh-step-current {
    width: 3rem;
    height: 2.5rem;
    font-size: 2.5rem;
  }

  .vfh-eras {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 5.625rem;
    /* Keep the original viewport rhythm while letting longer entries grow. */
    padding: 25svh 0;
    overflow: visible;
  }

  .vfh-era {
    width: 100%;
    max-width: none;
    min-height: 50svh;
    flex: none;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    opacity: 1;
  }

  .vfh-era-card {
    align-items: flex-start;
    opacity: 0.15;
    text-align: left;
    transition: opacity 500ms var(--vfh-ease-out);
  }

  .vfh-era.is-active .vfh-era-card {
    opacity: 1;
  }

  .vfh-era-title {
    max-width: 18.125rem;
    font-size: 2.5rem;
    text-align: left;
  }

  .vfh-era-years {
    max-width: 23rem;
  }

  .vfh-media-column {
    position: sticky;
    top: 0;
    order: 0;
    display: flex;
    width: 100%;
    height: 100svh;
    flex: 1 1 0;
    align-items: center;
    padding: 6.25rem 0;
  }

  .vfh-media-frame {
    width: 100%;
    max-width: 32.8125rem;
    aspect-ratio: 525 / 600;
    margin-inline: auto;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .vfh-story-stage { gap: 3rem; }
  .vfh-step-current { width: 2rem; height: 2rem; font-size: 2rem; }
  .vfh-era-title { font-size: 2.125rem; }
}

@media (prefers-reduced-motion: reduce) {
  .vfh-era-card {
    transition: none;
  }
}
