:root {
  --mist: #edf0f7;
  --paper: #ffffff;
  --ink: #131a35;
  --ink-2: #4a5373;
  --ink-3: #7d86a3;
  --line: #d9deea;
  --indigo: #2b54c9;
  --indigo-deep: #1f3f9e;
  --mark: #ffe27a;
  --cap-edge: #c3cbdf;
  --sans: "Be Vietnam Pro", "Zen Kaku Gothic New", "Segoe UI", system-ui, sans-serif;
  --jp: "Zen Kaku Gothic New", "Be Vietnam Pro", "Yu Gothic UI", "Meiryo", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font: 400 1rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

:lang(ja) { font-family: var(--jp); font-feature-settings: "palt"; }

:lang(vi) { font-family: var(--sans); font-feature-settings: normal; }

/* Content written for one kind of user: a Vietnamese team member or a Japanese client. */
html[lang="ja"] [data-for="vi"],
html[lang="vi"] [data-for="ja"] { display: none; }

/* Japanese visitors: keep the Vietnamese defaults hidden until app.js has swapped the text. */
html[lang="ja"]:not(.ready) [data-i18n] { visibility: hidden; }

h1, h2, h3, p { margin: 0; }

.phrase { display: inline-block; white-space: nowrap; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--indigo);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Top bar */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand img { border-radius: 8px; }

.bar-end { display: flex; align-items: center; gap: 0.75rem; }

.lang {
  display: inline-flex;
  padding: 3px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.lang button {
  font: 600 0.85rem/1 var(--sans);
  color: var(--ink-2);
  background: none;
  border: 0;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
}

.lang button[data-lang="ja"] { font-family: var(--jp); }

.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--indigo);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  border-radius: 12px;
  box-shadow: 0 4px 0 var(--indigo-deep);
  transition: transform 80ms ease, box-shadow 80ms ease, background 120ms ease;
}

.btn:hover { background: #3260dc; }

.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--indigo-deep); }

.btn-small { padding: 0.5rem 0.95rem; font-size: 0.9rem; border-radius: 10px; box-shadow: 0 3px 0 var(--indigo-deep); }

.btn-big { padding: 1rem 1.6rem; font-size: 1.1rem; }

.btn svg { width: 1.1em; height: 1.1em; fill: currentColor; }

/* Hero */

main { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 3rem;
  align-items: center;
  padding: 3.5rem 0 2.5rem;
}

h1 {
  font-size: clamp(2.3rem, 4.4vw, 3.6rem);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

:lang(ja) h1 { font-size: clamp(2.2rem, 4.4vw, 3.6rem); font-weight: 900; letter-spacing: 0; line-height: 1.25; }

:lang(ja) .lede { max-width: 26em; font-size: 1.1rem; line-height: 1.8; }

.lede {
  margin-top: 1.25rem;
  font-size: 1.2rem;
  color: var(--ink-2);
  max-width: 30ch;
}

.cta { margin-top: 2.25rem; }

.cta-meta { margin-top: 0.9rem; font-size: 0.9rem; color: var(--ink-3); }

/* Demo stage: a chat window, the MyTranslate popup and the keys being pressed. */

.stage {
  position: relative;
  padding-bottom: 5.5rem;
}

.chat {
  background: var(--paper);
  border-radius: 16px;
  box-shadow: 0 1px 0 var(--line), 0 30px 60px -30px rgb(19 26 53 / 0.35);
  overflow: hidden;
  font-family: var(--sans);
}

.chat-top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  font-size: 0.95rem;
}

.chat-app { color: var(--ink-3); }

.chat-body { padding: 1.4rem 1.1rem 11rem; }

.msg { display: flex; gap: 0.75rem; }

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9px;
  background: var(--c);
  color: #fff;
  font-weight: 700;
}

.who { font-weight: 700; font-size: 0.92rem; }

.who time { margin-left: 0.4rem; font-weight: 400; font-size: 0.78rem; color: var(--ink-3); }

.text { font-family: var(--jp); font-size: 1rem; line-height: 1.7; margin-top: 0.15rem; }

/* The selected part of the message, grown character by character like a mouse drag. */
.sel {
  background: var(--mark);
  border-radius: 3px;
  padding: 1px 0;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.composer {
  margin: 0 1.1rem 1.1rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  min-height: 3.4rem;
  transition: border-color 200ms ease;
}

.stage.typing .composer { border-color: var(--ink-3); }

.composer-text { font-size: 1rem; line-height: 1.6; min-height: 1.6em; }

.composer-text.ja { font-family: var(--jp); }

.composer-text.flash { animation: flash 700ms ease; }

@keyframes flash {
  from { background: var(--mark); }
  to { background: transparent; }
}

.caret {
  display: inline-block;
  width: 2px;
  height: 1.15em;
  margin-left: 1px;
  vertical-align: -0.2em;
  background: var(--ink);
  visibility: hidden;
}

.stage.typing .caret { visibility: visible; animation: blink 1s steps(1) infinite; }

@keyframes blink { 50% { opacity: 0; } }

.popup {
  position: absolute;
  left: 9%;
  right: 4%;
  top: 9.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 50px -12px rgb(19 26 53 / 0.35), 0 2px 6px rgb(19 26 53 / 0.08);
  padding: 0.9rem 1.1rem 1rem;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transform-origin: 20% 0;
  transition: opacity 180ms ease, transform 220ms cubic-bezier(.2, .9, .3, 1.2);
  pointer-events: none;
}

.stage[data-scene="k"] .popup,
.stage[data-scene="l"] .popup { top: auto; bottom: 10.4rem; transform-origin: 20% 100%; }

.popup.open { opacity: 1; transform: none; }

.popup-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-3);
}

.dot { width: 8px; height: 8px; border-radius: 50%; background: #1d8a6d; }

.popup-text {
  margin-top: 0.5rem;
  font-size: 1.12rem;
  line-height: 1.6;
  min-height: 1.6em;
}

.popup-text.ja { font-family: var(--jp); }

.popup-foot {
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--ink-2);
  min-height: 1.4em;
  opacity: 0;
  transition: opacity 200ms ease;
}

.popup-foot.show { opacity: 1; }

.popup-foot kbd {
  font: 600 0.75rem/1 var(--sans);
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--cap-edge);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--mist);
}

.popup del { color: #b4372a; text-decoration-thickness: 1.5px; }

.popup ins { text-decoration: none; background: #dff3e8; color: #155e3d; border-radius: 3px; padding: 0 2px; }

/* Mouse scene: the cursor selects the message, the quick bar appears, the cursor clicks "Translate". */

.qbar {
  position: absolute;
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 28px -8px rgb(19 26 53 / 0.3), 0 2px 4px rgb(19 26 53 / 0.06);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 160ms ease;
  pointer-events: none;
}

.qbar.open { opacity: 1; transform: none; }

.qbtn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 2rem;
  padding: 0 0.7rem 0 0.55rem;
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}

.qbtn svg, .mode-mouse svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.qbtn-primary { background: var(--indigo); color: #fff; transition: background 80ms ease, transform 80ms ease; }

.qbtn-primary.down { background: var(--indigo-deep); transform: scale(0.96); }

.cursor {
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  will-change: transform;
}

.cursor.show { opacity: 1; }

.cursor.glide { transition: opacity 200ms ease, transform 650ms cubic-bezier(.45, 0, .2, 1); }

.cursor svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.cursor-arrow { fill: var(--ink); stroke: #fff; stroke-width: 1.4; stroke-linejoin: round; }

.cursor-ibeam { display: none; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; transform: translate(-50%, -50%); }

.cursor.ibeam .cursor-arrow { display: none; }

.cursor.ibeam .cursor-ibeam { display: block; }

.mouse {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  justify-content: center;
}

.mouse svg { width: 3.1rem; height: 4.6rem; overflow: visible; filter: drop-shadow(0 5px 0 var(--cap-edge)) drop-shadow(0 12px 14px rgb(19 26 53 / 0.25)); }

.mouse-body { fill: #fff; stroke: var(--line); stroke-width: 1.5; }

.mouse-line { fill: none; stroke: var(--cap-edge); stroke-width: 1.5; }

.mouse-left { fill: transparent; transition: fill 90ms ease; }

.mouse-left.down { fill: var(--indigo); }

.stage[data-scene="m"] .keys { display: none; }

.stage[data-scene="m"] .mouse { display: flex; }

/* Keycaps: the one loud element. They sink when the demo "presses" them. */

.keys {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  gap: 0.7rem;
}

.key {
  --edge: var(--cap-edge);
  display: grid;
  place-items: center;
  min-width: 4.6rem;
  height: 4.2rem;
  padding: 0 1.1rem;
  font: 600 1.05rem/1 var(--sans);
  color: var(--ink);
  background: linear-gradient(#fff, #f4f6fb);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 6px 0 var(--edge), 0 14px 22px -10px rgb(19 26 53 / 0.35);
  transition: transform 90ms ease, box-shadow 90ms ease, background 90ms ease;
}

.key-letter { min-width: 4.2rem; font-size: 1.6rem; font-weight: 800; }

.key-enter { display: none; }

.stage.enter-step .key-enter { display: grid; }

.stage.enter-step .key:not(.key-enter) { display: none; }

.key.down {
  transform: translateY(5px);
  box-shadow: 0 1px 0 var(--edge), 0 4px 8px -6px rgb(19 26 53 / 0.4);
  background: linear-gradient(#f5f7ff, #e7ecfb);
}

.key-letter.down { background: var(--indigo); color: #fff; --edge: var(--indigo-deep); border-color: var(--indigo); }

/* Mode tabs: clicking one plays that shortcut in the demo. */

.modes { padding: 1rem 0 4.5rem; }

.mode-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.mode {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
  font: 600 1.05rem/1.35 var(--sans);
  color: var(--ink-2);
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 1.1rem 1.2rem;
  cursor: pointer;
  overflow: hidden;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

:lang(ja) .mode { font-family: var(--jp); font-weight: 700; }

.mode:hover { border-color: var(--cap-edge); color: var(--ink); }

.mode[hidden] { display: none; }

/* A Japanese visitor has three shortcuts, not four. */
.modes[data-count="3"] .mode-list { grid-template-columns: repeat(3, 1fr); }

.mode[aria-selected="true"] { background: var(--paper); border-color: var(--paper); color: var(--ink); box-shadow: 0 1px 0 var(--line); }

.mode kbd {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  font: 800 1.2rem/1 var(--sans);
  color: var(--ink);
  background: linear-gradient(#fff, #f4f6fb);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 3px 0 var(--cap-edge);
}

.mode[aria-selected="true"] kbd { background: var(--indigo); color: #fff; border-color: var(--indigo); box-shadow: 0 3px 0 var(--indigo-deep); }

.progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: var(--indigo);
  transform: scaleX(0);
  transform-origin: left;
}

.mode[aria-selected="true"] .progress { animation: progress var(--dur, 9s) linear forwards; }

.modes.paused .progress { animation: none; }

@keyframes progress { to { transform: scaleX(1); } }

.mode-hint { margin-top: 1rem; text-align: center; color: var(--ink-3); font-size: 0.92rem; }

/* Context: the same message pasted alone into ChatGPT versus read with its thread. */

.context { padding: 1rem 0 5rem; text-align: center; }

.context-lede { margin: 1rem auto 0; max-width: 36em; color: var(--ink-2); font-size: 1.1rem; }

.compare {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
  text-align: left;
}

.case {
  margin: 0;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border-radius: 20px;
}

.case-plain { background: transparent; border: 1.5px dashed var(--cap-edge); }

.case-smart { background: var(--paper); box-shadow: 0 30px 60px -34px rgb(19 26 53 / 0.4); }

.case figcaption {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 1.75rem;
  font-weight: 700;
  font-size: 1rem;
}

.case-plain figcaption { color: var(--ink-2); }

.case figcaption img { border-radius: 5px; }

.thread-chip {
  margin-left: auto;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--mist);
  color: var(--ink-2);
  font-size: 0.8rem;
  font-weight: 600;
}

.thread { margin-top: 1.1rem; display: grid; gap: 0.45rem; }

.tmsg {
  font-size: 0.92rem;
  line-height: 1.55;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  background: var(--mist);
}

.case-smart .tmsg { background: #f4f6fb; }

.tmsg b { display: block; font-family: var(--sans); font-size: 0.75rem; color: var(--ink-3); font-weight: 600; }

.tmsg.unseen { opacity: 0.35; filter: blur(1.5px); }

.tmsg u { text-decoration: none; background: var(--mark); border-radius: 3px; padding: 0 2px; }

.case-plain .tmsg:not(.unseen) { background: var(--paper); }

.result {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  font-size: 1.1rem;
  line-height: 1.6;
  flex: 1;
}

.result mark { border-radius: 3px; padding: 0 2px; color: inherit; }

.result .vague { background: #fbe5e2; text-decoration: underline wavy #c42b1c 1px; text-underline-offset: 4px; }

.result .clear { background: #dff3e8; }

.verdict {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.verdict::before {
  content: "";
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.verdict-bad { color: #b4372a; --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zm3.2 10.1-1.1 1.1L8 9.1l-2.1 2.1-1.1-1.1L6.9 8 4.8 5.9l1.1-1.1L8 6.9l2.1-2.1 1.1 1.1L9.1 8z'/%3E%3C/svg%3E"); }

.verdict-good { color: #1a7f4b; --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zM6.8 11.6 3.6 8.4l1.1-1.1 2.1 2.1 4.6-4.6 1.1 1.1z'/%3E%3C/svg%3E"); }

/* Getting started */

.start {
  background: var(--paper);
  border-radius: 28px;
  padding: 3.5rem 3rem;
  text-align: center;
}

h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

:lang(ja) h2 { font-weight: 900; letter-spacing: 0; }

.steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin: 2.75rem 0 0;
  padding: 0;
  text-align: left;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-top: 3.6rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: var(--mist);
  font-weight: 800;
  font-size: 1.1rem;
}

/* A thin line joins the step numbers, since the steps are done in order. */
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 1.3rem;
  left: 3.4rem;
  right: -1.2rem;
  height: 2px;
  background: var(--mist);
}

h3 { font-size: 1.15rem; font-weight: 700; }

.steps p { margin-top: 0.3rem; color: var(--ink-2); }

.promises {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin: 2.75rem 0 2.25rem;
  padding: 0;
}

.promises li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--mist);
  border-radius: 999px;
  padding: 0.5rem 1rem 0.5rem 0.75rem;
  font-size: 0.92rem;
  font-weight: 500;
}

.promises li::before {
  content: "";
  width: 1rem;
  height: 1rem;
  background: var(--indigo);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6.3 11.6 2.7 8l1.1-1.1 2.5 2.5 5.9-5.9 1.1 1.1z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6.3 11.6 2.7 8l1.1-1.1 2.5 2.5 5.9-5.9 1.1 1.1z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.smartscreen { margin-top: 1.1rem; font-size: 0.85rem; color: var(--ink-3); }

.foot {
  display: flex;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
  font-size: 0.85rem;
  color: var(--ink-3);
}

/* Smaller screens */

@media (max-width: 1100px) {
  .mode-list { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 2.5rem; padding-top: 2rem; }
  .compare { grid-template-columns: 1fr; }
  :lang(ja) .lede { max-width: 26em; font-size: 1.1rem; line-height: 1.8; }

.lede { max-width: none; }
}

@media (max-width: 720px) {
  .bar { padding: 1rem; }
  main { padding: 0 1rem; }
  .brand span { display: none; }
  .mode-list,
  .modes[data-count="3"] .mode-list { grid-template-columns: 1fr; gap: 0.6rem; }
  .case { padding: 1.1rem; }
  .thread-chip { margin-left: 0; }
  .qbtn { padding: 0 0.5rem 0 0.4rem; font-size: 0.8rem; }
  .steps { grid-template-columns: 1fr; gap: 1.5rem; }
  .steps li { padding: 0 0 0 3.6rem; min-height: 2.6rem; }
  .steps li:not(:last-child)::after { display: none; }
  .start { padding: 2.5rem 1.25rem; border-radius: 20px; }
  .key { min-width: 3.6rem; height: 3.5rem; padding: 0 0.8rem; font-size: 0.95rem; }
  .key-letter { min-width: 3.5rem; font-size: 1.35rem; }
  .popup { left: 4%; right: 4%; }
  .popup-text { font-size: 1rem; }
  .foot { padding: 2rem 1rem 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
