/* =========================================================
   PEPSTORE brand landing
   - Brand: storefront main blue #2a5bd8 (pepstore-ui globals.css --color-main)
   - Theme: light by default, dark via prefers-color-scheme (tokens only)
   - Radius rule: cards, images & dialog 16px / inner tiles 10px / buttons & chips pill
   - Z-index scale: nav 50, skip-link 100 (dialog uses the browser top layer)
   ========================================================= */

/* Page subset of Pretendard (only the glyphs this page uses, preloaded in <head>).
   Any glyph added later falls back to the full dynamic-subset "Pretendard Variable". */
@font-face {
  font-family: "Pretendard Page";
  src: url("../fonts/pretendard/pretendard-page.woff2") format("woff2-variations"),
    url("../fonts/pretendard/pretendard-page.woff2") format("woff2");
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --font-sans: "Pretendard Page", "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    system-ui, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;

  --bg: #f4f5f8;
  --bg-tint: #eaeef5;
  --surface: #fcfdfe;
  --ink: #0e1422;
  --ink-2: #384152;
  --muted: #5a6475;
  --line: #dde2ea;
  --accent: #2a5bd8;
  --accent-hover: #1c409a;
  --accent-text: #2a5bd8;
  --accent-soft: #e6edfc;
  --on-accent: #fbfcff;
  --shadow-md: 0 1px 2px rgb(14 20 34 / 0.04), 0 18px 40px -22px rgb(42 91 216 / 0.45);
  --shadow-dialog: 0 32px 80px -32px rgb(14 20 34 / 0.5);
  --nav-bg: rgb(244 245 248 / 0.84);
  --scroll-thumb: #c5ccd8;

  --radius: 16px;
  --radius-sm: 10px;
  --pill: 999px;
  --badge: 48px;
  --container: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
  --section-y: clamp(80px, 9vw, 128px);
  --nav-h: 68px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0e16;
    --bg-tint: #0e1420;
    --surface: #141b29;
    --ink: #edf1f7;
    --ink-2: #c3cad7;
    --muted: #97a1b2;
    --line: #253046;
    --accent: #2a5bd8;
    --accent-hover: #3563dc;
    --accent-text: #86a4f7;
    --accent-soft: #16213b;
    --on-accent: #fbfcff;
    --shadow-md: 0 20px 44px -26px rgb(0 0 0 / 0.8);
    --shadow-dialog: 0 32px 80px -24px rgb(0 0 0 / 0.85);
    --nav-bg: rgb(10 14 22 / 0.8);
    --scroll-thumb: #3a4762;
  }
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  scrollbar-gutter: stable;
}

html.has-dialog {
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  letter-spacing: -0.011em;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

picture {
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p,
figure {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--accent-text);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-y);
}

.section--tint {
  background: var(--bg-tint);
}

.i {
  width: 1em;
  height: 1em;
  flex: none;
  fill: currentColor;
}

.br-d {
  display: none;
}

@media (min-width: 768px) {
  .br-d {
    display: inline;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: var(--pill);
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 12px;
}

/* ---------- Type ---------- */
.display {
  font-size: clamp(2.25rem, 1rem + 3vw, 3.5rem);
  line-height: 1.2;
  letter-spacing: -0.038em;
  font-weight: 780;
}

.h2 {
  font-size: clamp(1.75rem, 1.2rem + 1.7vw, 2.625rem);
  line-height: 1.3;
  letter-spacing: -0.032em;
  font-weight: 750;
}

.h3 {
  font-size: 1.1875rem;
  line-height: 1.42;
  letter-spacing: -0.022em;
  font-weight: 700;
}

.lead {
  font-size: clamp(1.0625rem, 1rem + 0.28vw, 1.1875rem);
  line-height: 1.75;
  color: var(--ink-2);
  max-width: 36em;
}

.body {
  color: var(--ink-2);
  font-size: 1rem;
  max-width: 40em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
  font-weight: 650;
  color: var(--accent-text);
}

.eyebrow .i {
  font-size: 1.125rem;
}

.accent {
  color: var(--accent-text);
}

.section-head {
  display: grid;
  justify-items: start;
  gap: 16px;
  margin-bottom: clamp(40px, 5vw, 60px);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: var(--pill);
  font: inherit;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease),
    border-color 0.25s var(--ease), transform 0.2s var(--ease);
}

.btn .i {
  font-size: 1.125rem;
  transition: transform 0.3s var(--ease);
}

.btn:hover .i {
  transform: translateX(3px);
}

.btn:hover .i--caret,
.footer__link:hover .i--caret {
  transform: translateY(2px);
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-md);
}

.btn--primary:hover {
  background: var(--accent-hover);
}

.btn--ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: var(--muted);
}

.btn--sm {
  height: 42px;
  padding: 0 18px;
  font-size: 0.9375rem;
  box-shadow: none;
}

.icon-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--pill);
  background: var(--bg-tint);
  color: var(--ink-2);
  font-size: 1.25rem;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}

.icon-btn:hover {
  background: var(--line);
  color: var(--ink);
}

.icon-btn:active {
  transform: scale(0.94);
}

/* ---------- Nav ---------- */
.top-sentinel {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav {
    background: var(--bg);
  }
}

.nav.is-scrolled {
  border-bottom-color: var(--line);
}

.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  padding: 6px 0;
}

.brand__logo {
  width: auto;
  height: 25px;
}

@media (prefers-color-scheme: dark) {
  .brand__logo {
    filter: brightness(0) invert(0.93);
  }
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.nav__links a {
  padding: 8px 14px;
  border-radius: var(--pill);
  font-size: 0.9375rem;
  font-weight: 560;
  color: var(--ink-2);
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.nav__links a:hover,
.nav__links a[aria-current="true"] {
  color: var(--ink);
  background: var(--bg-tint);
}

@media (max-width: 899px) {
  .nav__links {
    display: none;
  }
}

/* ---------- Screen 1: Hero ---------- */
.hero {
  padding-block: clamp(40px, 6.5vw, 96px);
}

.hero__grid {
  display: grid;
  gap: 40px;
  align-items: center;
}

.hero__copy {
  display: grid;
  justify-items: start;
  gap: 22px;
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.hero__media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

@media (min-width: 960px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    gap: 56px;
  }
}

/* Facts band directly below the hero */
.facts {
  border-block: 1px solid var(--line);
  background: var(--surface);
}

.facts__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.facts__item {
  display: grid;
  gap: 2px;
  padding: 26px 18px;
}

.facts__item:nth-child(odd) {
  padding-left: 0;
}

.facts__item:nth-child(even) {
  border-left: 1px solid var(--line);
}

.facts__item:nth-child(n + 3) {
  border-top: 1px solid var(--line);
}

.facts__value {
  font-size: clamp(1.625rem, 1.2rem + 1.1vw, 2.125rem);
  font-weight: 760;
  letter-spacing: -0.035em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.facts__label {
  font-size: 0.9375rem;
  color: var(--muted);
}

@media (min-width: 900px) {
  .facts__list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .facts__item,
  .facts__item:nth-child(odd) {
    padding: 34px 28px;
  }

  .facts__item:first-child {
    padding-left: 0;
  }

  .facts__item + .facts__item {
    border-left: 1px solid var(--line);
  }

  .facts__item:nth-child(n + 3) {
    border-top: 0;
  }
}

/* ---------- Screen 2: Why (bento, 4 cells) ---------- */
.bento {
  display: grid;
  gap: 16px;
}

.tile {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}

.tile p {
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.7;
}

.tile__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 6px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 1.375rem;
}

.tile--tint {
  background: var(--accent-soft);
  border-color: transparent;
}

.tile--tint .tile__icon {
  background: var(--surface);
}

.tile--accent {
  background: var(--accent);
  border-color: transparent;
  color: var(--on-accent);
}

.tile--accent p {
  color: var(--on-accent);
  opacity: 0.9;
}

.tile--accent .tile__icon {
  background: rgb(255 255 255 / 0.16);
  color: var(--on-accent);
}

.tile--photo {
  padding: 0;
  gap: 0;
  align-content: stretch;
  grid-template-rows: minmax(220px, 1fr) auto;
}

.tile--photo picture {
  overflow: hidden;
}

.tile--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile__body {
  display: grid;
  gap: 8px;
  padding: 24px 28px 28px;
}

.tile__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 560;
  white-space: nowrap;
}

.chip .i {
  font-size: 1.125rem;
  color: var(--accent-text);
}

/* Tablet: wide tile on top, photo tile beside the two small tiles. */
@media (min-width: 640px) {
  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tile--wide {
    grid-column: span 2;
  }

  .tile--tall {
    grid-row: span 2;
  }
}

@media (min-width: 1024px) {
  .bento {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .tile--wide {
    grid-column: span 4;
    padding: 36px;
  }

  .tile--tall {
    grid-column: span 2;
    grid-row: span 2;
  }

  .tile--third {
    grid-column: span 2;
  }
}

/* ---------- Screen 3: Products & own brands ---------- */
.marquee {
  margin-bottom: 40px;
  padding-inline: var(--gutter);
}

.marquee__track {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: var(--container);
  margin-inline: auto;
}

.marquee .chip {
  height: 48px;
  padding: 0 20px;
  border: 1px solid var(--line);
  font-size: 1rem;
}

.marquee .chip .i {
  font-size: 1.25rem;
}

.marquee__track > .is-clone {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .js .marquee {
    padding-inline: 0;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  }

  .js .marquee__track {
    flex-wrap: nowrap;
    width: max-content;
    max-width: none;
    animation: marquee 56s linear infinite;
  }

  .js .marquee:hover .marquee__track {
    animation-play-state: paused;
  }

  .js .marquee__track > .is-clone {
    display: inline-flex;
  }
}

@keyframes marquee {
  to {
    transform: translateX(calc(-50% - 5px));
  }
}

.brands {
  display: grid;
  gap: 16px;
}

.brand-card {
  display: grid;
  align-content: start;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}

.brand-card__media {
  position: relative;
  background: #0b0d12;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

/* Absolute so the portrait photo never dictates the card height. */
.brand-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}

.brand-card__body {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 28px;
}

.brand-card__name {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.brand-card__name .h3 {
  font-size: 1.5rem;
}

.brand-card__en {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--muted);
}

.lineup {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.lineup li {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--pill);
  background: var(--bg-tint);
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.brand-card__media--logo {
  display: grid;
  place-items: center;
  background: var(--bg-tint);
}

.brand-card__media--logo picture {
  width: min(62%, 360px);
}

.brand-card__media--logo img {
  position: static;
  width: 100%;
  height: auto;
  object-fit: contain;
}

@media (min-width: 640px) and (max-width: 899px) {
  .brand-card__media {
    aspect-ratio: 16 / 10;
  }
}

@media (min-width: 900px) {
  .brands {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brand-card {
    grid-template-rows: auto 1fr;
    align-content: stretch;
  }

  .brand-card__media {
    aspect-ratio: 16 / 10;
  }
}

/* ---------- Screen 4: Platform timeline ---------- */
.flow {
  display: grid;
  gap: 32px;
}

.flow__step {
  position: relative;
  display: grid;
  grid-template-columns: var(--badge) minmax(0, 1fr);
  column-gap: 18px;
  align-items: start;
  align-content: start;
}

/* Connector to the next step: vertical on small screens, horizontal on desktop. */
.flow__step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(var(--badge) / 2 - 1px);
  top: calc(var(--badge) + 8px);
  bottom: -24px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(var(--accent-text), var(--line));
  transform-origin: top center;
}

.flow__badge {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: var(--badge);
  height: var(--badge);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 1.375rem;
}

.flow__body {
  display: grid;
  align-content: start;
  gap: 8px;
  padding-top: 10px;
}

.flow__body p {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--ink-2);
}

.flow__list {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.flow__list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 560;
  color: var(--ink-2);
}

.flow__list .i {
  font-size: 1rem;
  color: var(--accent-text);
}

/* The hub is the one elevated block: it is the center of the operating model. */
.flow__step--hub .flow__badge {
  background: var(--accent);
  color: var(--on-accent);
}

.flow__step--hub .flow__body {
  padding: 18px 20px 20px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-md);
}

.flow__step--hub .flow__body p,
.flow__step--hub .flow__list li,
.flow__step--hub .flow__list .i {
  color: var(--on-accent);
}

.flow__step--hub .flow__body p {
  opacity: 0.92;
}

@media (min-width: 1080px) {
  .flow {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 28px;
  }

  .flow__step {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 22px;
  }

  .flow__step:not(:last-child)::after {
    left: calc(var(--badge) + 12px);
    right: -16px;
    top: calc(var(--badge) / 2 - 1px);
    bottom: auto;
    width: auto;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-text), var(--line));
    transform-origin: left center;
  }

  .flow__body {
    padding-top: 0;
  }
}

.planner-row {
  display: grid;
  grid-template-columns: var(--badge) minmax(0, 1fr);
  column-gap: 18px;
  align-items: start;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.planner-row__text {
  display: grid;
  gap: 6px;
  padding-top: 10px;
}

.planner-row p {
  max-width: 46em;
  font-size: 0.9375rem;
  color: var(--ink-2);
}

/* ---------- Screen 5: Partners & contact ---------- */
.partner {
  display: grid;
  gap: 40px;
  align-items: center;
}

.partner__media img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
}

.partner__copy {
  display: grid;
  gap: 24px;
}

.partner__types {
  display: grid;
  gap: 22px 32px;
  padding-block: 28px;
  border-block: 1px solid var(--line);
}

.ptype {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 14px;
}

.ptype .i {
  grid-row: span 2;
  margin-top: 2px;
  font-size: 1.5rem;
  color: var(--accent-text);
}

.ptype strong {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ptype span {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-2);
}

.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
}

.contact__lines {
  display: grid;
  gap: 2px;
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.contact__lines a {
  font-weight: 650;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
  transition: text-decoration-color 0.2s var(--ease);
}

.contact__lines a:hover {
  text-decoration-color: var(--accent-text);
}

@media (min-width: 640px) {
  .partner__types {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .partner {
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    gap: 72px;
  }
}

/* ---------- Footer ---------- */
.footer {
  padding-block: 44px 60px;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--muted);
}

.footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.footer__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--ink-2);
  transition: color 0.2s var(--ease);
}

.footer__link .i {
  transition: transform 0.3s var(--ease);
}

.footer__link:hover {
  color: var(--ink);
}

.footer__info {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 20px;
}

.footer__copy {
  margin-top: 14px;
}

/* ---------- Branch picker dialog ---------- */
.branch-dialog {
  width: min(560px, calc(100% - 32px));
  max-width: none;
  height: min(720px, calc(100dvh - 48px));
  max-height: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-dialog);
  overflow: hidden;
}

.branch-dialog[open] {
  display: flex;
}

.branch-dialog::backdrop {
  background: rgb(10 14 22 / 0.48);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.branch-dialog__inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
}

.branch-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 14px;
}

.branch-dialog__title {
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.35;
}

.branch-dialog__desc {
  margin-top: 4px;
  font-size: 0.9375rem;
  color: var(--muted);
}

.branch-search {
  display: grid;
  gap: 8px;
  padding: 0 24px 14px;
}

.branch-search__label {
  font-size: 0.875rem;
  font-weight: 650;
  color: var(--ink-2);
}

.branch-search__field {
  position: relative;
}

.branch-search__field .i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.125rem;
  color: var(--muted);
  pointer-events: none;
}

.branch-search__input {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

.branch-search__input::placeholder {
  color: var(--muted);
}

/* Column flex + gap: hidden sections (display:none) leave no stray spacing. */
.branch-dialog__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 24px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 24px 20px;
}

.branch-dialog__body > * {
  flex-shrink: 0;
}

@media (hover: hover) {
  .branch-item:hover .branch-arrow {
    transform: translate(2px, -2px);
  }

  .branch-item:hover {
    background: var(--bg-tint);
  }
}

.branch-arrow {
  flex: none;
  font-size: 1.125rem;
  color: var(--accent-text);
  transition: transform 0.25s var(--ease);
}

.branch-area__group + .branch-area__group {
  margin-top: 16px;
}

.branch-area__title {
  margin-bottom: 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ink-2);
}

.branch-area__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.branch-area__chips a {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 11px;
  border-radius: var(--pill);
  background: var(--bg-tint);
  font-size: 0.8125rem;
  color: var(--ink-2);
  white-space: nowrap;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

@media (hover: hover) {
  .branch-area__chips a:hover {
    background: var(--accent-soft);
    color: var(--accent-text);
  }
}

.branch-open-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.branch-open {
  --branch-row: 68px;
  max-height: calc(var(--branch-row) * 5 + 12px);
  padding: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(#000 calc(100% - 32px), transparent);
  mask-image: linear-gradient(#000 calc(100% - 32px), transparent);
}

.branch-open::-webkit-scrollbar {
  display: none;
}

.branch-open.is-end {
  -webkit-mask-image: none;
  mask-image: none;
}

.branch-dialog__body {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
}

.branch-dialog__body::-webkit-scrollbar {
  width: 6px;
}

.branch-dialog__body::-webkit-scrollbar-thumb {
  border-radius: var(--pill);
  background: var(--scroll-thumb);
}

.branch-open li + li {
  border-top: 1px solid var(--line);
}

.branch-item:focus-visible {
  outline-offset: -3px;
}

.branch-item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--branch-row);
  padding: 0 10px;
  border-radius: var(--radius-sm);
  transition: background-color 0.2s var(--ease);
}

.branch-item__text {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 1px;
  line-height: 1.45;
}

.branch-item__name {
  font-weight: 650;
}

.branch-item__meta,
.branch-item__host {
  font-size: 0.8125rem;
  color: var(--muted);
}

@media (max-width: 479px) {
  .branch-item__host {
    display: none;
  }
}

.branch-dialog__body .is-waiting {
  display: none;
}

.branch-loading {
  display: grid;
  flex: 1 0 auto;
  place-items: center;
  min-height: 160px;
}

.branch-loading__spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--line);
  border-top-color: var(--accent-text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.branch-note {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-tint);
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.branch-dialog__foot {
  padding: 14px 24px 20px;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--muted);
}

.branch-dialog__foot a {
  font-weight: 650;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}

/* Small screens: bottom sheet */
@media (max-width: 639px) {
  .branch-dialog {
    width: 100%;
    height: 88dvh;
    margin: auto 0 0;
    border-bottom: 0;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .branch-dialog__head {
    padding: 20px 20px 12px;
  }

  .branch-search {
    padding-inline: 20px;
  }

  .branch-dialog__body {
    padding-inline: 20px;
  }

  .branch-dialog__foot {
    padding: 12px 20px calc(16px + env(safe-area-inset-bottom));
  }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
    transition-delay: calc(var(--i, 0) * 90ms);
  }

  .js .reveal.is-in {
    opacity: 1;
    transform: none;
  }

  /* Timeline connectors draw in order after each step appears. */
  .js .flow__step::after {
    transform: scaleY(0);
    transition: transform 0.7s var(--ease);
    transition-delay: calc(var(--i, 0) * 90ms + 420ms);
  }

  .js .flow__step.is-in::after {
    transform: none;
  }

  .hero__copy > * {
    animation: rise 0.9s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 90ms + 80ms);
  }

  .hero__media {
    animation: settle 1.2s var(--ease) both 0.2s;
  }

  .branch-dialog[open] {
    animation: dialog-in 0.32s var(--ease);
  }

  .branch-dialog[open]::backdrop {
    animation: fade-in 0.25s ease;
  }
}

@media (prefers-reduced-motion: no-preference) and (min-width: 1080px) {
  .js .flow__step::after {
    transform: scaleX(0);
  }

  .js .flow__step.is-in::after {
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) and (max-width: 639px) {
  .branch-dialog[open] {
    animation-name: sheet-in;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

/* Transform only: the hero image is the LCP element, so it must never start invisible. */
@keyframes settle {
  from {
    transform: scale(0.965);
  }
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

@keyframes sheet-in {
  from {
    transform: translateY(100%);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}
