/* ── Skip-to-content (a11y) — visually hidden until focused ── */
.skip-to-content {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 10px 16px;
  background: #111;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 200ms cubic-bezier(0.32, 0.72, 0, 1);
}
.skip-to-content:focus,
.skip-to-content:focus-visible {
  transform: translateY(0);
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ── Global mobile safety (prevent horizontal scroll & force wrapping) ── */
html, body { max-width: 100%; overflow-x: hidden; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* ── P1-15: respect prefers-reduced-motion globally ──
   Per-page styles set `html { scroll-behavior: smooth }`. Override with
   `auto` when the user prefers reduced motion — WCAG SC 2.3.3. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
}

/* ── P3-26: REMOVED — was breaking page scroll in some Safari builds.
   Pull-to-refresh suppression is a nice-to-have, not worth the regression. */

/* ── P3-27: keyboard / switch-control focus visibility ──
   We hide the default outline only on mouse focus. Keyboard users
   (Tab key) still get a clearly visible ring. */
a:focus { outline: none; }
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid #111;
  outline-offset: 3px;
  border-radius: 4px;
}
.lang-switch button:focus-visible,
.ov-lang button:focus-visible {
  outline-offset: 2px;
}

/* ── P3-29: Korean text reads better without negative letter-spacing ── */
html[lang="ko"] body {
  letter-spacing: 0;
}
html[lang="ko"] .hero-title,
html[lang="ko"] .career-tagline,
html[lang="ko"] .footer-left h2,
html[lang="ko"] .detail-title {
  /* Big display type still benefits from a little tracking tightening,
     but less aggressive than for Latin */
  letter-spacing: -0.01em;
}

/* ── P3-30: REMOVED — `transform` on a `position: sticky` element makes
   the element its own containing block, which can break sticky behavior
   and lock page scroll in Chrome / iOS Safari. The micro-flicker on iOS
   blur isn't worth losing scroll. */

/* ── P3-31: keep form fields visible above the sticky header when
       focused (iOS pushes layout up when keyboard opens). ── */
input, select, textarea, .ax-select-trigger {
  scroll-margin-top: 96px;
}
img, video, iframe { max-width: 100%; height: auto; }
* { word-break: keep-all; }
@media (max-width: 480px) {
  * { word-wrap: break-word; overflow-wrap: break-word; }
}

/* ── P0-6: kill sticky blue/grey tap-highlight on iOS/Android ── */
a, button, [role="button"], input, select, textarea, label {
  -webkit-tap-highlight-color: transparent;
}

/* ── P0-1: prevent iOS Safari from auto-zooming on form focus ──
   iOS zooms the page when an input has font-size < 16px. We bump
   inputs/selects/textareas to ≥16px on touch viewports only — desktop
   keeps its tighter type via per-page styles. */
@media (max-width: 1024px) {
  input, select, textarea, .ax-select-trigger {
    font-size: 16px !important;
  }
}

/* ── P0-2: enlarge tap targets to ~36–44px (Apple HIG / Material) ──
   Compound selectors win specificity vs per-page `.lang-switch button`. */
.header .lang-switch button,
.overlay-menu .ov-lang button {
  min-width: 36px;
  min-height: 36px;
  padding: 8px 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* Brand socials: keep visual icon size, expand invisible hit-area */
.brand-socials a,
.brand-socials span {
  position: relative;
}
.brand-socials a::before,
.brand-socials span::before {
  content: '';
  position: absolute;
  inset: -11px;
}

/* ── P0-3: iPhone safe-area insets (notch / home indicator) ── */
@supports (padding: env(safe-area-inset-top)) {
  .header-inner {
    padding-left: max(env(safe-area-inset-left), 16px);
    padding-right: max(env(safe-area-inset-right), 16px);
  }
  .footer-bottom,
  .footer-inner {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .overlay-menu .overlay-inner {
    padding-bottom: max(env(safe-area-inset-bottom), 60px);
  }
}

/* ── Hamburger + Overlay Menu (shared across pages) ── */

.hamburger {
  display: none;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 120;
  position: relative;
  margin-left: auto;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: #111;
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s ease, background 0.3s ease;
  transform-origin: center;
}
.hamburger.is-open span { background: #fff; }
.hamburger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.overlay-menu {
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  z-index: 105;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.overlay-menu.is-open { opacity: 1; pointer-events: auto; }
.overlay-menu .overlay-inner {
  min-height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 100px 24px 60px;
  box-sizing: border-box;
}
.overlay-menu .ov-nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  text-align: center;
}
.overlay-menu .ov-nav a {
  color: #fff;
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  transform: translateY(24px);
  opacity: 0;
  transition: opacity 0.55s cubic-bezier(0.32, 0.72, 0, 1), transform 0.55s cubic-bezier(0.32, 0.72, 0, 1);
}
.overlay-menu.is-open .ov-nav a { opacity: 1; transform: translateY(0); }
.overlay-menu.is-open .ov-nav a:nth-child(1) { transition-delay: 0.06s; }
.overlay-menu.is-open .ov-nav a:nth-child(2) { transition-delay: 0.12s; }
.overlay-menu.is-open .ov-nav a:nth-child(3) { transition-delay: 0.18s; }
.overlay-menu.is-open .ov-nav a:nth-child(4) { transition-delay: 0.24s; }
.overlay-menu.is-open .ov-nav a:nth-child(5) { transition-delay: 0.30s; }
.overlay-menu.is-open .ov-nav a:nth-child(6) { transition-delay: 0.36s; }
.overlay-menu .ov-nav a:hover { opacity: 0.65; }
/* P2-23: visually mute "coming soon" links (IR placeholder) */
.nav a[aria-disabled="true"],
.footer-right a[aria-disabled="true"],
.overlay-menu .ov-nav a[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
}
.nav a[aria-disabled="true"]:hover,
.footer-right a[aria-disabled="true"]:hover,
.overlay-menu .ov-nav a[aria-disabled="true"]:hover {
  opacity: 0.4;
}

/* P2-21: indicate current page in mobile overlay nav */
.overlay-menu .ov-nav a.active {
  position: relative;
  font-weight: 800;
}
.overlay-menu .ov-nav a.active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #ff3a3a;
}

.overlay-menu .ov-bottom {
  margin-top: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease 0.42s, transform 0.5s cubic-bezier(0.32, 0.72, 0, 1) 0.42s;
}
.overlay-menu.is-open .ov-bottom { opacity: 1; transform: translateY(0); }
.overlay-menu .ov-lang {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 500;
  color: #888;
  letter-spacing: 0.04em;
}
.overlay-menu .ov-lang button {
  background: none; border: none; padding: 0;
  font: inherit; color: inherit; cursor: pointer;
}
.overlay-menu .ov-lang button.active { color: #fff; font-weight: 600; }
.overlay-menu .ov-lang .sep { width: 1px; height: 9px; background: rgba(255,255,255,0.2); }
.overlay-menu .ov-login {
  background: #fff; color: #000;
  padding: 13px 32px;
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  transition: background 0.2s;
}
.overlay-menu .ov-login:hover { background: #ddd; }

body.menu-open { overflow: hidden; }
body.menu-open .header {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  z-index: 110;
}
body.menu-open .header .logo img {
  filter: invert(1) brightness(2);
  transition: filter 0.3s ease;
}

/* ─── 4 Breakpoints (shared baseline) ─── */
/* BP2 (≤1024) — hamburger activates */
@media (max-width: 1024px) {
  .nav, .header-actions { display: none !important; }
  .hamburger { display: flex; }
}
/* BP3 (≤768) — mobile shifts */
@media (max-width: 768px) {
  .overlay-menu .overlay-inner { padding: 80px 20px 40px; }
  .overlay-menu .ov-nav a { font-size: 32px; }
}
/* BP4 (≤480) — small mobile */
@media (max-width: 480px) {
  .hamburger { width: 40px; height: 40px; }
  .overlay-menu .overlay-inner { padding: 60px 16px 32px; }
  .overlay-menu .ov-nav { gap: 10px; }
  .overlay-menu .ov-nav a { font-size: 26px; }
  .overlay-menu .ov-bottom { margin-top: 36px; }
}
