/* ABITRA — night Pacific. Amber marks the US side, teal marks the Korea side. */
:root {
  --night: #060a18;
  --deep: #0b1126;
  --line: #27304a;
  --bone: #ece8dd;
  --soft: #c2c6d6;
  --mute: #8f98b4;
  --amber: #ffb454;
  --teal: #4fe3d0;
  --display: "Bricolage Grotesque", "Pretendard Variable", Pretendard, "Hiragino Sans", "Yu Gothic UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --text: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --header: 4.5rem;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-padding-top: calc(var(--header) + 1rem);
  background: var(--night);
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--night);
  color: var(--bone);
  font: 400 1.0625rem/1.6 var(--text);
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

/* Without WebGL the page keeps a quiet two-market glow instead of the scene. */
html:not(.has-scene) body {
  background:
    radial-gradient(60rem 40rem at 12% 8%, rgba(255, 180, 84, 0.1), transparent 70%),
    radial-gradient(60rem 44rem at 92% 30%, rgba(79, 227, 208, 0.1), transparent 70%),
    var(--night);
  background-attachment: fixed;
}

h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, select { font: inherit; color: inherit; }
::selection { background: var(--teal); color: var(--night); }

a:focus-visible, button:focus-visible, select:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 4px;
  border-radius: 4px;
}

.wrap { width: min(100% - 3rem, 84rem); margin-inline: auto; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: fixed; left: 1rem; top: -6rem; z-index: 60;
  padding: 0.75rem 1rem; border-radius: 0.5rem;
  background: var(--bone); color: var(--night); font-weight: 600;
}
.skip:focus { top: 1rem; }

#field {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100lvh;
  display: none; pointer-events: none;
}
.has-scene #field { display: block; }

main, .site-footer { position: relative; z-index: 1; }

/* ---- header */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 40;
  transition: background-color 0.3s, backdrop-filter 0.3s;
}
.is-scrolled .site-header {
  background: rgba(6, 10, 24, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.header-row { height: var(--header); display: flex; align-items: center; gap: 1.25rem; }

.brand { display: inline-flex; align-items: center; gap: 0.6rem; flex: none; }
.brand svg { width: 2.1rem; height: 1.25rem; }
.brand b { font: 800 1.3rem/1 var(--display); font-stretch: 100%; letter-spacing: 0.04em; }
.mark-us { fill: var(--amber); }
.mark-kr { fill: var(--teal); }
.brand-note { color: var(--mute); font-size: 0.875rem; padding-left: 1.25rem; border-left: 1px solid var(--line); }

.site-nav { margin-left: auto; display: flex; gap: 1.9rem; font-size: 0.9375rem; font-weight: 500; }
.site-nav a { color: var(--soft); padding-block: 0.4rem; white-space: nowrap; }
.site-nav a:hover { color: var(--bone); }

.locale select {
  appearance: none; cursor: pointer;
  padding: 0.4rem 2rem 0.4rem 0.9rem;
  font-size: 0.875rem; font-weight: 500;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(11, 17, 38, 0.6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23c2c6d6' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 0.8rem center / 0.6rem;
}
.locale select:hover { border-color: var(--mute); }
.locale option { background: var(--deep); color: var(--bone); }

.progress {
  position: absolute; left: 0; top: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--amber), var(--teal));
  transform: scaleX(0); transform-origin: left;
}

/* ---- first screen: slogan and the four stores */
.first-screen {
  min-height: 100svh;
  display: grid; grid-template-rows: 1fr auto;
  padding-top: var(--header);
}

.hero { align-self: end; padding-block: 2rem 2.75rem; }

.hero h1 {
  font: 700 clamp(4.2rem, 11.4vw, 12rem) / 0.84 var(--display);
  font-stretch: 80%;
  letter-spacing: -0.02em;
  margin-left: -0.04em;
}
.hero h1 span { display: block; }

.hero-body {
  margin-top: 1.9rem; max-width: 34rem;
  font-size: clamp(1.125rem, 1.5vw, 1.375rem); line-height: 1.5;
  color: var(--soft); white-space: pre-line;
}

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0.6rem 1.5rem;
  border: 1px solid rgba(236, 232, 221, 0.32); border-radius: 999px;
  background: rgba(6, 10, 24, 0.45);
  font-weight: 600; font-size: 1rem; line-height: 1.2; cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.button:hover { border-color: var(--bone); }
.button-solid { background: var(--bone); border-color: var(--bone); color: var(--night); }
.button-solid:hover { background: #fff; border-color: #fff; }
.button:disabled { cursor: progress; background: transparent; color: var(--mute); border-color: var(--line); }

.route { display: flex; align-items: center; gap: 0.7rem; margin-top: 2.5rem; color: var(--mute); font-size: 0.9375rem; }
.route-line { width: 4.5rem; height: 1px; background: linear-gradient(90deg, var(--amber), var(--teal)); }
.route-text { margin-left: 0.5rem; }
.pin { font: 700 0.8125rem/1 var(--display); letter-spacing: 0.06em; }
.pin-us { color: var(--amber); }
.pin-kr { color: var(--teal); }

.channels {
  display: grid; grid-template-columns: 1fr auto; align-items: baseline; row-gap: 0.9rem;
  padding-block: 1.25rem 1.75rem;
  border-top: 1px solid var(--line);
}
.channels h2 { font: 600 1rem/1.4 var(--text); }
.scroll-cue { grid-area: 1 / 2; color: var(--mute); font-size: 0.875rem; }
.scroll-cue:hover { color: var(--bone); }
.channels ul { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); }
.channels li + li { border-left: 1px solid var(--line); }
.channels a {
  display: grid; gap: 0.15rem; height: 100%;
  padding: 0.85rem 1.25rem;
  background: rgba(6, 10, 24, 0.5);
  transition: background-color 0.2s;
}
.channels li:first-child a { padding-left: 0; background: none; }
.channels a:hover { background: rgba(39, 48, 74, 0.55); }
.channels li:first-child a:hover { background: none; }
.channels small { color: var(--mute); font-size: 0.8125rem; }
.channels strong { font: 650 clamp(1.25rem, 1.9vw, 1.75rem) / 1.15 var(--display); font-stretch: 88%; }
.channels a:hover strong { color: var(--teal); }
.channels a.is-direct:hover strong { color: var(--amber); }

/* ---- chapters: copy on the left, the scene on the right */
.chapter {
  position: relative;
  min-height: 100svh;
  display: grid; grid-template-columns: minmax(0, 35rem) 1fr; align-items: center;
  padding-block: 7rem;
}

.chapter h2, .services h2 {
  font: 650 clamp(2.5rem, 5.2vw, 5rem) / 0.98 var(--display);
  font-stretch: 84%;
  letter-spacing: -0.012em;
  white-space: pre-line;
}

.etymology { margin-bottom: 1.25rem; font: 500 1.25rem/1.3 var(--display); color: var(--mute); }
.body { margin-top: 1.6rem; max-width: 31rem; font-size: 1.1875rem; color: var(--soft); }

.legend {
  align-self: end; justify-self: end;
  display: flex; gap: 2.5rem;
  margin-bottom: 4svh;
}
.legend div { padding-left: 0.9rem; border-left: 2px solid; }
.legend dt { color: var(--mute); font-size: 0.8125rem; }
.legend dd { font: 600 1.375rem/1.3 var(--display); font-stretch: 90%; }
.legend dd.role { margin-top: 0.15rem; font: 400 0.9375rem/1.4 var(--text); color: var(--soft); }
.legend .key-us { border-color: var(--amber); }
.legend .key-kr { border-color: var(--teal); }

/* ---- sample order */
.order {
  margin-top: 2.25rem; max-width: 31rem;
  padding: 1.25rem 1.4rem 1.4rem;
  border: 1px solid var(--line); border-radius: 0.9rem;
  background: rgba(11, 17, 38, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.order-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.order-head h3 { font: 600 1.0625rem/1.3 var(--text); }
.order-head span { color: var(--mute); font-size: 0.875rem; }

.order-steps { counter-reset: step; margin-top: 1rem; }
.order-steps li {
  counter-increment: step;
  position: relative;
  display: flex; align-items: center; gap: 0.9rem;
  padding-block: 0.6rem;
  color: var(--mute);
  transition: color 0.25s;
}
.order-steps li::before {
  content: counter(step);
  flex: none; width: 1.75rem; height: 1.75rem;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  font: 600 0.8125rem/1 var(--display);
  transition: background-color 0.25s, border-color 0.25s, color 0.25s;
}
.order-steps li + li::after {
  content: ""; position: absolute; left: 0.875rem; top: -0.6rem;
  width: 1px; height: 1.2rem; background: var(--line);
}
.order-steps li.is-done { color: var(--bone); }
.order-steps li.is-done::before { background: var(--teal); border-color: var(--teal); color: var(--night); }
.order-steps li.is-done + li::after, .order-steps li.is-done::after { background: var(--teal); }
.order-steps li[aria-current="step"] { font-weight: 600; }

.order-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.1rem; margin-top: 1rem; }
#order-status { color: var(--soft); font-size: 0.9375rem; min-height: 1.5em; }
.order.is-complete #order-status { color: var(--teal); }

/* ---- services */
.services, .partners {
  background: rgba(6, 10, 24, 0.82);
  border-block: 1px solid var(--line);
}
.services { padding-block: clamp(5rem, 10vw, 9rem); }
.service-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem 4.5rem; margin-top: 3.5rem; }
.service-group h3 { font: 500 1rem/1.4 var(--text); color: var(--mute); padding-bottom: 0.9rem; border-bottom: 1px solid var(--line); }
.service-group a {
  display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 0.2rem 1.5rem;
  padding-block: 1.4rem;
  border-bottom: 1px solid var(--line);
}
.service-group strong {
  grid-column: 1 / -1;
  font: 650 clamp(1.75rem, 2.8vw, 2.5rem) / 1.1 var(--display); font-stretch: 86%; letter-spacing: -0.02em;
  transition: color 0.2s;
}
.service-group span { color: var(--soft); }
.service-group em { font-style: normal; color: var(--mute); font-size: 0.875rem; }
.service-group:first-child a:hover strong { color: var(--amber); }
.service-group:last-child a:hover strong { color: var(--teal); }

/* ---- contact */
.stamp {
  align-self: end; justify-self: end;
  margin-bottom: 6svh; padding: 0.55rem 1.1rem;
  border: 2px solid var(--teal); border-radius: 0.3rem;
  outline: 1px solid var(--teal); outline-offset: 3px;
  color: var(--teal);
  font: 700 1.125rem/1 var(--display); letter-spacing: 0.08em;
  transform: rotate(-6deg);
}

/* ---- partners and footer */
.partners { padding-block: 3.5rem; border-bottom: 0; }
.partners .wrap { display: grid; grid-template-columns: minmax(0, 14rem) 1fr; gap: 2rem; align-items: start; }
.partners h2 { font: 600 1.25rem/1.4 var(--text); }
.partner-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.partner-list h3 { font: 600 1.0625rem/1.4 var(--text); margin-bottom: 0.4rem; }
.partner-list a { display: block; width: fit-content; color: var(--soft); padding-block: 0.15rem; }
.partner-list a:hover, .footer-link:hover { color: var(--bone); text-decoration: underline; text-underline-offset: 0.3em; }

.site-footer { background: var(--night); border-top: 1px solid var(--line); padding-block: 2rem 2.5rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2.5rem; }
.entities { display: flex; flex-wrap: wrap; gap: 0.4rem 2rem; color: var(--soft); font-size: 0.9375rem; }
.entities .pin { margin-right: 0.35rem; }
.footer-link { margin-left: auto; color: var(--mute); font-size: 0.9375rem; }

/* ---- languages with longer or denser headlines */
html:lang(ko) .hero h1, html:lang(ja) .hero h1, html:lang(zh-Hans) .hero h1 {
  font-size: clamp(3.6rem, 9.6vw, 10rem); line-height: 1.02; font-weight: 800; letter-spacing: -0.045em;
}
html:lang(es) .hero h1 { font-size: clamp(3.2rem, 8.4vw, 8.75rem); line-height: 0.9; }
html:lang(ko) :is(.chapter, .services) h2, html:lang(ja) :is(.chapter, .services) h2, html:lang(zh-Hans) :is(.chapter, .services) h2 { line-height: 1.14; font-weight: 700; font-size: clamp(2.25rem, 4.5vw, 4.25rem); }
html:lang(ja), html:lang(zh-Hans) { word-break: normal; }
html:lang(ja) body, html:lang(zh-Hans) body { word-break: normal; line-break: strict; }

/* ---- one load sequence: the headline rises while the particles gather */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .hero h1 span { animation: rise 1s cubic-bezier(0.2, 0.7, 0.1, 1) both; }
  .hero h1 span + span { animation-delay: 0.12s; }
  .hero-body, .hero .actions, .route, .channels { animation: settle 0.9s 0.5s ease-out both; }
  @keyframes rise { from { opacity: 0; transform: translateY(0.35em); } }
  @keyframes settle { from { opacity: 0; } }
}

/* ---- medium screens */
@media (max-width: 1180px) {
  .brand-note { display: none; }
  .site-nav { gap: 1.3rem; }
}

/* ---- narrow screens: the scene sits above, the copy below */
@media (max-width: 860px) {
  :root { --header: 6.1rem; }
  .wrap { width: min(100% - 2.5rem, 84rem); }
  .site-header { background: rgba(6, 10, 24, 0.72); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
  .header-row { height: auto; flex-wrap: wrap; gap: 0 1rem; padding-top: 0.7rem; }
  .locale { margin-left: auto; }
  .site-nav {
    order: 3; width: 100%; margin: 0.25rem 0 0; gap: 1.25rem;
    overflow-x: auto; scrollbar-width: none; font-size: 0.875rem;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { padding-block: 0.65rem; }

  .first-screen { display: block; min-height: 0; }
  .hero { min-height: calc(100svh - var(--header)); display: grid; align-content: end; padding-block: 44svh 2rem; }
  .hero h1 { font-size: clamp(3.5rem, 18vw, 6.5rem); }
  html:lang(ko) .hero h1, html:lang(ja) .hero h1, html:lang(zh-Hans) .hero h1 { font-size: clamp(3rem, 15.5vw, 5.5rem); }
  html:lang(es) .hero h1 { font-size: clamp(2.6rem, 13vw, 5rem); }
  .hero-body { margin-top: 1.25rem; }
  .actions { margin-top: 1.5rem; }
  .route { margin-top: 1.75rem; flex-wrap: wrap; }
  .route-text { margin-left: 0; width: 100%; }

  .channels ul { grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
  .channels li { border-bottom: 1px solid var(--line); }
  .channels li:nth-child(odd) { border-left: 0; }
  .channels a, .channels li:first-child a { padding: 0.9rem 0.9rem 0.9rem 0; background: none; }
  .channels li:nth-child(even) a { padding-left: 0.9rem; }
  .scroll-cue { display: none; }

  .chapter { display: block; min-height: 100svh; padding-block: 50svh 4rem; }
  .legend { margin: 0 0 1.75rem; gap: 1.5rem; justify-content: flex-start; justify-self: start; }
  .legend dd { font-size: 1.125rem; }
  .legend dd.role { font-size: 0.875rem; }
  .chapter .copy { display: flow-root; }
  #origin .legend, #operations .legend { margin-top: 2rem; margin-bottom: 0; }
  .stamp { display: inline-block; justify-self: start; margin: 2.5rem 0 0; }
  .body { font-size: 1.0625rem; }

  .service-groups { grid-template-columns: 1fr; margin-top: 2.5rem; }
  .service-group a { grid-template-columns: 1fr; }
  .partners .wrap, .partner-list { grid-template-columns: 1fr; }
  .partner-list { gap: 1.5rem; }
  .footer-link { margin-left: 0; }
}
