/* Beforeworks — additions on top of the Webflow stylesheet.
   New components use the bw- prefix; overrides of Webflow classes are grouped at the end. */

:root {
  --bw-accent: var(--강조, #e3384c);
  --bw-line: #2a2a2a;
  --bw-line-strong: rgba(255, 255, 255, .22);
  --bw-muted: rgba(255, 255, 255, .56);
  --bw-soft: rgba(255, 255, 255, .78);
  --bw-ease: cubic-bezier(.645, .045, .355, 1);
  --bw-out: cubic-bezier(.16, 1, .3, 1);
  --bw-display: "Archivo Semiexpanded", sans-serif;
  --bw-sans: Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
::selection { background: var(--bw-accent); color: #fff; }
#ceo, #profile, #intro { scroll-margin-top: 1.5rem; }

/* Korean text: break between words, not inside them */
.bodytext, .body-large, .body-extra-large, .body-extra-large-section2, .dropdown-content,
.bw-ceo, .bw-profile, .bw-404 { word-break: keep-all; overflow-wrap: break-word; }

/* ---------- shared resets inside new components (Webflow sets p/ul globally) ---------- */
.bw-ceo p, .bw-profile p, .bw-404 p, .bw-ceo h3, .bw-ceo h4, .bw-profile h2 { margin: 0; opacity: 1; }
.bw-ceo ul, .bw-ceo ol, .bw-profile dl, .bw-profile dd { list-style: none; margin: 0; padding: 0; }
.bw-ico { width: 1em; height: 1em; flex: none; }

/* ---------- reveal on scroll (site.js adds .bw-js and .is-in) ---------- */
.bw-js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity .9s var(--bw-out), transform 1.1s var(--bw-out), clip-path 1.4s var(--bw-out);
  transition-delay: var(--d, 0s);
}
.bw-js [data-reveal].is-in { opacity: 1; transform: none; }
.bw-mask { overflow: hidden; padding-bottom: .06em; }
.bw-js [data-reveal="rise"] { opacity: 1; transform: translate3d(0, 105%, 0); }
.bw-js [data-reveal="line"] { opacity: 1; transform: scaleX(0); transform-origin: 0 50%; }
.bw-js [data-reveal="line"].is-in { transform: none; }
.bw-js [data-reveal="clip"] { opacity: 1; transform: none; clip-path: inset(100% 0 0 0); }
.bw-js [data-reveal="clip"].is-in { clip-path: inset(0 0 0 0); }

/* ---------- buttons: the site's own .button (text + underline + circled arrow) ----------
   Webflow animates its buttons through interaction ids; ours have none, so the hover lives here:
   the underline retracts and redraws, the arrow leaves and a second one slides in. */
.bw-nbtn { align-items: flex-end; min-height: 44px; }
.bw-nbtn .button-underline { transform-origin: 100% 50%; }
.bw-nbtn .button-arrow-inside,
.bw-nbtn .button-arrow-inside-second { transition: transform .5s var(--bw-ease); }
.bw-nbtn .button-arrow-inside-second { transform: translate(-180%, 180%); }
.bw-nbtn .button-arrow { transition: border-color .4s var(--bw-ease); }
.bw-nbtn.is-down .button-arrow { transform: rotate(135deg); }   /* ↗ turned to ↓ */
@media (hover: hover) {
  .bw-nbtn:hover .button-underline { animation: bw-underline .75s var(--bw-ease); }
  .bw-nbtn:hover .button-arrow-inside { transform: translate(180%, -180%); }
  .bw-nbtn:hover .button-arrow-inside-second { transform: none; }
}
@keyframes bw-underline {
  0% { transform: scaleX(1); transform-origin: 100% 50%; }
  45% { transform: scaleX(0); transform-origin: 100% 50%; }
  55% { transform: scaleX(0); transform-origin: 0 50%; }
  100% { transform: scaleX(1); transform-origin: 0 50%; }
}
.bw-nbtn:focus-visible, .bw-dock-item:focus-visible, .bw-more summary:focus-visible {
  outline: 2px solid var(--bw-accent);
  outline-offset: 4px;
}
.bw-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1.25rem 2.5rem; }

.bw-kicker { font-family: var(--bw-sans); font-size: .9rem; color: var(--bw-muted); }

/* ---------- hero additions ---------- */
#ani-1 .div-block.flex.fullpage { flex-direction: column; justify-content: center; align-items: flex-start; }
.bw-hero-cta {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  margin-top: 3.5rem;
  animation: bw-fade-up 1.1s var(--bw-out) 1.4s both;
}
.bw-scroll {
  position: absolute;
  left: 2rem;
  bottom: 2.25rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: .9rem;
  color: var(--bw-muted);
  font-family: var(--bw-display);
  font-size: .7rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  animation: bw-fade-up 1s var(--bw-out) 2s both;
}
.bw-scroll i { position: relative; width: 1px; height: 44px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.bw-scroll i::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 45%;
  background: #fff;
  animation: bw-scroll-line 2.2s var(--bw-ease) infinite;
}
@keyframes bw-fade-up { from { opacity: 0; transform: translate3d(0, 24px, 0); } to { opacity: 1; transform: none; } }
@keyframes bw-scroll-line { 0% { transform: translateY(-100%); } 100% { transform: translateY(240%); } }

/* ---------- scroll progress ---------- */
.bw-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  height: 2px;
  background: var(--bw-accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* ---------- CEO (same grid and row rhythm as the site's other sections) ---------- */
.bw-ceo.section { margin-top: 0; padding-top: 9rem; padding-bottom: 6rem; }
.bw-ceo-intro { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 5fr); gap: 1.5rem 3rem; align-items: stretch; }
.bw-ceo-photo { margin: 0; aspect-ratio: 4 / 5; overflow: hidden; background: #141414; }
.bw-ceo-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  transform: scale(var(--bw-zoom, 1.12));
  will-change: transform;
}
.bw-ceo-id { display: flex; flex-direction: column; justify-content: space-between; gap: 3rem; }
.bw-ceo-lead {
  font-family: var(--bw-sans);
  font-size: clamp(1.5rem, 2.2vw, 2.25rem);
  font-weight: 300;
  line-height: 1.38;
  letter-spacing: -.03em;
  color: var(--bw-soft);
}
.bw-ceo-lead strong { color: #fff; font-weight: 600; }
.bw-eyebrow { color: var(--bw-muted); font-family: var(--bw-sans); font-size: .9rem; }
.bw-name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem .9rem;
  margin: .6rem 0 1.25rem !important;
  font-family: var(--bw-sans);
  font-size: clamp(2rem, 2.6vw, 2.6rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.03em;
}
.bw-name span { font-family: var(--bw-display); font-size: 1rem; font-weight: 500; letter-spacing: 0; color: var(--bw-muted); text-transform: uppercase; }
.bw-edu li { color: var(--bw-soft); font-family: var(--bw-sans); font-size: .95rem; line-height: 1.75; }
.bw-ceo-card .bw-actions { margin-top: 2rem; }
.bw-ceo-card .bw-nbtn { font-size: 1.05rem; }

/* rows: big Archivo title on the left (40%), list on the right — like "우리가 하는 일" */
.bw-rows { margin-top: 5rem; border-top: 1px solid var(--dark-grey); }
.bw-row {
  display: grid;
  grid-template-columns: 40% minmax(0, 1fr);
  align-items: start;
  padding: 2.75rem 0;
  border-bottom: 1px solid var(--dark-grey);
}
.bw-row-title {
  margin: 0 !important;
  font-family: var(--bw-display);
  font-size: clamp(1.5rem, 2.1vw, 2.25rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.bw-list li, .bw-career-item {
  color: var(--bw-soft);
  font-family: var(--bw-sans);
  font-size: 1rem;
  line-height: 1.6;
  padding: .3rem 0;
  transition: color .3s var(--bw-ease), padding-left .3s var(--bw-ease), opacity .9s var(--bw-out), transform 1.1s var(--bw-out);
}
.bw-career-item { display: grid; grid-template-columns: 2rem minmax(0, 1fr); align-items: baseline; }
.bw-badge { color: var(--bw-muted); font-size: .8rem; }
.bw-career-item.is-now { color: #fff; }
.bw-career-item.is-now .bw-badge { color: var(--bw-accent); }
/* hover like the FAQ rows: a quiet nudge to the right */
@media (hover: hover) {
  .bw-list li:hover, .bw-career-item:hover { color: #fff; padding-left: .6rem; }
}
.bw-sublabel { margin: 0 0 .5rem !important; color: var(--bw-muted); font-family: var(--bw-sans); font-size: .85rem; }
.bw-more .bw-sublabel { margin-top: 1.75rem !important; }

/* "전체 보기": the FAQ's plus-circle, turned into × when open */
.bw-more summary {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  min-height: 44px;
  margin-top: 1.25rem;
  color: #fff;
  font-family: var(--bw-sans);
  font-size: 1rem;
  list-style: none;
  cursor: pointer;
  transition: opacity .3s var(--bw-ease);
}
.bw-more summary::-webkit-details-marker { display: none; }
.bw-more summary img { width: 28px; height: 28px; transition: transform .45s var(--bw-ease); }
.bw-more summary em { color: var(--bw-muted); font-style: normal; }
.bw-more summary:hover { opacity: .6; }
.bw-more[open] summary img { transform: rotate(45deg); }
.bw-more-close, .bw-more[open] .bw-more-open { display: none; }
.bw-more[open] .bw-more-close { display: inline; }
.bw-more[open] > ul, .bw-more[open] > p { animation: bw-fade-up .6s var(--bw-out) both; }
.bw-more[open] > ul:first-of-type { margin-top: .75rem; }

/* ---------- company profile (same layout as the site's other sections) ---------- */
.bw-profile.section { margin-top: 0; padding-top: 2rem; padding-bottom: 7rem; }
.bw-pf-title { margin: 0 0 2.5rem; }
.bw-pf-title > .bw-mask { display: block; }
.bw-pf-title > .bw-mask > span { display: block; }
.bw-pf-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 1.5rem;
  margin-top: 2.5rem;
}
.bw-pf-label { grid-column: 1 / 4; color: var(--white); }
.bw-pf-body { grid-column: 4 / 13; }
.bw-pf-lead {
  font-family: var(--bw-sans);
  font-size: clamp(1.6rem, 2.3vw, 2.25rem);
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: -.03em;
}
.bw-pf-sub { margin-top: 1.5rem !important; color: var(--bw-soft); }
/* stat rows mirror "우리가 하는 일": big Archivo figure on the left, Korean label in the middle column */
.bw-pf-stats { margin: 3.5rem 0 3rem !important; border-top: 1px solid var(--dark-grey); }
.bw-pf-row {
  display: grid;
  grid-template-columns: 40% minmax(0, 1fr);
  align-items: center;
  padding: 2.25rem 0;
  border-bottom: 1px solid var(--dark-grey);
}
.bw-pf-row dt { grid-column: 2; grid-row: 1; font-family: var(--bw-sans); font-size: 1rem; }
.bw-pf-row dd {
  grid-column: 1;
  grid-row: 1;
  font-family: var(--bw-display);
  font-size: clamp(2.25rem, 3.2vw, 3rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}
.bw-pf-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1.25rem 2.5rem; }
.bw-pf-meta { color: var(--bw-muted); font-family: var(--bw-sans); font-size: .85rem; line-height: 1; padding-bottom: .15rem; }

/* ---------- 404 ---------- */
.bw-404.section { min-height: 78vh; min-height: 78svh; margin-top: 0; padding-top: 12rem; padding-bottom: 6rem; }
.bw-404-title { margin: 1.5rem 0 2rem; }
.bw-404-sub { max-width: 32em; margin-bottom: 2.5rem !important; color: var(--bw-soft); font-family: var(--bw-sans); font-size: 1.05rem; line-height: 1.65; }

/* ---------- mobile quick-contact dock ---------- */
.bw-dock { display: none; }

/* ---------- Webflow overrides ---------- */
/* .body-small capitalises every word, which turned the address into "Contact@Beforeworks.Io" */
a[href^="mailto:"] { text-transform: none; }

@supports (height: 100svh) {
  .div-block.flex.fullpage { height: calc(100svh - 22rem); }
}

/* ---------- responsive ---------- */
@media screen and (max-width: 991px) {
  .bw-ceo-intro { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 1.5rem 2rem; }
  .bw-pf-label { grid-column: 1 / 13; margin-bottom: 1.5rem !important; }
  .bw-pf-body { grid-column: 1 / 13; }
}

@media screen and (max-width: 767px) {
  /* readability: Webflow shrinks body copy to ~13px on phones */
  .bodytext, .bodytext.corevalue, .bodytext.work, .bodytext.small { font-size: 15px; line-height: 1.65; }
  .body-large, .body-large.second { font-size: 16px; line-height: 1.65; }
  .dropdown-content, .dropdown-content p { font-size: 15px; line-height: 1.65; }
  @supports (height: 100svh) { .div-block.flex.fullpage { height: calc(94svh - 10rem); } }

  .bw-hero-cta { margin-top: 2.5rem; gap: 1rem 2rem; }
  .bw-scroll { display: none; }

  .bw-ceo.section { padding-top: 5.5rem; padding-bottom: 3.5rem; }
  .bw-ceo-intro { grid-template-columns: 1fr; gap: 2rem; }
  .bw-ceo-photo { aspect-ratio: 4 / 4.6; }
  .bw-ceo-id { gap: 2rem; }
  .bw-ceo-lead { font-size: 1.4rem; }
  .bw-rows { margin-top: 3rem; }
  .bw-row { grid-template-columns: 1fr; gap: 1.25rem; padding: 2rem 0; }
  .bw-row-title br { display: none; }
  .bw-list li, .bw-career-item { font-size: .95rem; }

  .bw-profile.section { padding-top: 1rem; padding-bottom: 4.5rem; }
  .bw-pf-title { font-size: 15vw; letter-spacing: -1.2vw; margin-bottom: 1.5rem; }
  .bw-pf-grid { margin-top: 1.75rem; }
  .bw-pf-lead { font-size: 1.4rem; }
  .bw-pf-stats { margin: 2.5rem 0 2.25rem !important; }
  .bw-pf-row { grid-template-columns: 42% minmax(0, 1fr); padding: 1.5rem 0; }
  .bw-pf-row dd { font-size: 2rem; }
  .bw-pf-row dt { font-size: .95rem; }

  .bw-404.section { padding-top: 9rem; }

  .bw-dock {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 900;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 999px;
    background: rgba(18, 18, 18, .78);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
    transform: translate3d(0, calc(100% + 24px), 0);
    transition: transform .55s var(--bw-out);
  }
  .bw-dock.is-shown { transform: none; }
  .bw-dock-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border-radius: 999px;
    color: #fff;
    font-family: var(--bw-sans);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -.01em;
  }
  .bw-dock-item.is-primary { background: var(--bw-accent); }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .bw-js [data-reveal] { opacity: 1; transform: none; clip-path: none; }
  .bw-ceo-photo img { transform: none; }
}
