/* TJ Loop — premium light design system (trilingual). Same class names, elevated visuals. */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;450;500;600;700&display=swap');

:root {
  --paper: #fbfaf8;          /* warm-white ground */
  --paper-2: #f4f2ee;
  --surface: #ffffff;        /* card */
  --line: rgba(24, 30, 46, 0.08);
  --line-2: rgba(24, 30, 46, 0.14);
  --ink: #181d2a;            /* deep ink */
  --ink-dim: #5b6472;
  --ink-faint: #6b7380;
  --teal: #0fb5a0;           /* refined deep teal */
  --teal-soft: #e3f7f3;
  --coral: #ff7a5c;          /* warm accent */
  --coral-soft: #ffeae3;
  --violet: #6c5ce7;
  --amber: #e0a23c;
  --lime: #3fb56b;
  --danger: #e25563;
  --radius: 20px;
  --radius-sm: 12px;
  --maxw: 1160px;
  --shadow-sm: 0 2px 8px -3px rgba(24,30,46,.10), 0 6px 20px -12px rgba(24,30,46,.10);
  --shadow: 0 8px 24px -10px rgba(24,30,46,.12), 0 24px 60px -28px rgba(24,30,46,.18);
  --shadow-glow: 0 20px 50px -22px rgba(15,181,160,.40);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "Fraunces", Georgia, "Songti SC", serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); line-height: 1.65; -webkit-font-smoothing: antialiased;
  min-height: 100vh; overflow-x: hidden;
}
.bgfx {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 600px at 82% -8%, rgba(15,181,160,0.10), transparent 60%),
    radial-gradient(760px 560px at 6% 4%, rgba(255,122,92,0.09), transparent 58%),
    radial-gradient(680px 600px at 50% 110%, rgba(108,92,231,0.06), transparent 60%),
    var(--paper);
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 0.5em; font-weight: 600; }
h1 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.025em; }
h2 { font-family: var(--serif); font-weight: 500; }
.shell { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.2rem); }
.muted { color: var(--ink-dim); }
.mono { font-family: var(--mono); }
.eyebrow { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--teal); font-weight: 500; }

/* glass — frosted white */
.glass {
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.78));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(16px) saturate(1.1);
  box-shadow: var(--shadow-sm);
}
.card { padding: 24px; transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s; }
.card:hover { box-shadow: var(--shadow); }

/* nav */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(251,250,248,0.72); backdrop-filter: blur(16px) saturate(1.2); border-bottom: 1px solid var(--line); }
.nav-inner { height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.08rem; letter-spacing: -0.01em; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--ink-dim); font-size: 0.92rem; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--ink); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 0.92rem; font-weight: 600; cursor: pointer;
  padding: 0.66rem 1.25rem; border-radius: 999px; border: 1px solid transparent;
  transition: transform 0.25s cubic-bezier(.2,.7,.2,1), box-shadow 0.3s, background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { color: #fff; background: linear-gradient(180deg, #1ad0b8, var(--teal)); box-shadow: var(--shadow-glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 24px 56px -22px rgba(15,181,160,.6); }
.btn-violet { color: #fff; background: linear-gradient(180deg, #ff927a, var(--coral)); box-shadow: 0 16px 40px -18px rgba(255,122,92,.6); }
.btn-violet:hover { transform: translateY(-2px); }
.btn-ghost { color: var(--ink); background: #fff; border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { background: var(--paper-2); transform: translateY(-1px); }
.btn-sm { padding: 0.44rem 0.9rem; font-size: 0.84rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 0.82rem; color: var(--ink-dim); font-weight: 500; }
.input, select.input, textarea.input {
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 0.74rem 0.9rem; width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input::placeholder { color: var(--ink-faint); }
.input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
textarea.input { resize: vertical; min-height: 96px; }

/* chips / badges */
.chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 0.72rem; color: var(--ink-dim); padding: 0.3rem 0.7rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; }
.badge { font-size: 0.72rem; font-weight: 600; padding: 0.22rem 0.62rem; border-radius: 999px; }
.badge.pending { color: var(--amber); background: rgba(224,162,60,0.14); }
.badge.paying { color: var(--amber); background: rgba(224,162,60,0.14); }
.badge.paid { color: var(--teal); background: var(--teal-soft); }
.badge.delivered { color: var(--lime); background: rgba(63,181,107,0.14); }
.badge.cancelled { color: var(--ink-faint); background: rgba(24,30,46,0.06); }
.badge.open { color: var(--violet); background: rgba(108,92,231,0.14); }
.badge.resolved { color: var(--ink-dim); background: rgba(24,30,46,0.06); }
.badge.unknown { color: var(--ink-faint); background: rgba(24,30,46,0.06); }

/* layout helpers */
.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.row { display: flex; gap: 12px; align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.section { padding-block: clamp(2.8rem, 7vw, 5.5rem); }
.center { text-align: center; }
.hidden { display: none !important; }

/* hero */
.hero { position: relative; padding-block: clamp(3rem, 9vw, 7rem); overflow: hidden; }
.hero-media { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.hero-media img, .hero-media video { width: 100%; height: 100%; object-fit: cover; opacity: 0.5; mask-image: linear-gradient(180deg, #000 30%, transparent 96%); }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); max-width: 16ch; }
.hero .lead { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--ink-dim); max-width: 56ch; }
.float-img { border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }

/* product/feature cards with imagery */
.media-top { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 14px; background: var(--paper-2); }

/* steps (the loop) */
.steps { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.step { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--ink-dim); }
.step .dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); font-family: var(--mono); font-size: 0.7rem; background: #fff; }
.step.active .dot { background: linear-gradient(180deg, #1ad0b8, var(--teal)); color: #fff; border-color: transparent; box-shadow: var(--shadow-glow); }
.sep { color: var(--ink-faint); }

/* lang switcher */
.lang { position: relative; }
.lang-btn { cursor: pointer; }
.lang-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 152px; padding: 6px; z-index: 60; background: #fff; }
.lang-menu button { display: flex; width: 100%; justify-content: space-between; padding: 0.52rem 0.62rem; border: none; background: transparent; color: var(--ink-dim); font: inherit; font-size: 0.9rem; cursor: pointer; border-radius: 8px; }
.lang-menu button:hover, .lang-menu button.active { background: var(--teal-soft); color: var(--ink); }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); z-index: 200; padding: 0.78rem 1.2rem; border-radius: 14px; background: #fff; border: 1px solid var(--line-2); box-shadow: var(--shadow); color: var(--ink); opacity: 0; transition: all 0.3s; pointer-events: none; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: rgba(226,85,99,0.5); color: var(--danger); }

/* bot widget */
.bot-fab { position: fixed; right: 22px; bottom: 22px; z-index: 90; width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer; background: linear-gradient(180deg, #1ad0b8, var(--teal)); box-shadow: var(--shadow-glow); display: grid; place-items: center; transition: transform .25s; }
.bot-fab:hover { transform: translateY(-2px) scale(1.04); }
.bot-panel { position: fixed; right: 22px; bottom: 90px; z-index: 90; width: min(372px, calc(100vw - 44px)); height: 470px; display: flex; flex-direction: column; overflow: hidden; background: #fff; }
.bot-head { padding: 15px 17px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.bot-log { flex: 1; overflow-y: auto; padding: 15px; display: flex; flex-direction: column; gap: 10px; }
.bot-msg { max-width: 82%; padding: 0.62rem 0.85rem; border-radius: 14px; font-size: 0.9rem; line-height: 1.5; }
.bot-msg.user { align-self: flex-end; background: linear-gradient(180deg,#1ad0b8,var(--teal)); color: #fff; }
.bot-msg.bot { align-self: flex-start; background: var(--paper-2); border: 1px solid var(--line); }
.bot-input { display: flex; gap: 8px; padding: 13px; border-top: 1px solid var(--line); }

/* tables / lists */
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: none; }

/* scroll reveal + motion */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.floaty { animation: floaty 6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } .floaty { animation: none; } }

/* responsive */
@media (max-width: 860px) {
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .nav-links { gap: 14px; }
  .hide-sm { display: none; }
}
