/* Takanama. Black and white, two faces: Anton for display, Inter for everything else. */

:root {
  --black: #0a0a0a;
  --white: #f7f7f5;
  --b-step: #171717;
  --b-step2: #242424;
  --b-muted: #a3a3a3;
  --w-step: #ebebe7;
  --w-step2: #dddcd7;
  --w-muted: #575757;

  --display: "Anton", "Noto Sans Bengali", "FreeSans", Impact, sans-serif;
  --text: "Inter", "Noto Sans Bengali", "FreeSans", system-ui, sans-serif;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in: cubic-bezier(.7, 0, .84, 0);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --t-fast: 160ms;
  --t-mid: 420ms;
  --t-slow: 900ms;

  --margin: clamp(16px, 3vw, 40px);
  --radius: 14px;
  --bar-h: 72px;
  color-scheme: dark;
}

[data-field="black"] {
  --bg: var(--black); --fg: var(--white); --muted: var(--b-muted);
  --step: var(--b-step); --step2: var(--b-step2); --line: #2c2c2c;
  background: var(--bg); color: var(--fg);
}
[data-field="white"] {
  --bg: var(--white); --fg: var(--black); --muted: var(--w-muted);
  --step: var(--w-step); --step2: var(--w-step2); --line: #d6d5cf;
  background: var(--bg); color: var(--fg);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + 12px); }
body {
  margin: 0;
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.5;
  font-optical-sizing: auto;
  background: var(--black);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }
img, svg, canvas { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { color: inherit; }
::selection { background: var(--white); color: var(--black); }
[data-field="white"] ::selection { background: var(--black); color: var(--white); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; left: 12px; top: 12px; z-index: 1200; padding: 12px 18px; border-radius: 999px;
  background: var(--white); color: var(--black); font-weight: 600; transform: translateY(-160%);
  transition: transform var(--t-fast) var(--ease-out);
}
.skip:focus { transform: none; }
:focus-visible { outline: 3px solid var(--fg, var(--white)); outline-offset: 3px; border-radius: 6px; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- type ---------- */

.display {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: .9;
  letter-spacing: -.01em;
  margin: 0;
}
.h-section { font-size: clamp(56px, 9vw, 148px); }
.h-sub { font-size: clamp(34px, 4vw, 56px); }
.lead { font-size: clamp(18px, 1.6vw, 22px); line-height: 1.45; max-width: 46ch; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; line-height: 1.45; }

/* Line mask reveal for headings */
.mask { display: block; overflow: hidden; padding-bottom: .04em; margin-bottom: -.04em; }
.mask > span { display: block; }

/* ---------- buttons ---------- */

.btn {
  --b-bg: var(--fg); --b-fg: var(--bg);
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border: 0; border-radius: 999px;
  background: var(--b-bg); color: var(--b-fg);
  font-weight: 600; font-size: 16px; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: transform var(--t-fast) var(--ease-out), color var(--t-mid) var(--ease-out);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--step2);
  transform: scaleX(0); transform-origin: right center;
  transition: transform var(--t-mid) var(--ease-out);
}
.btn:hover::before { transform: scaleX(1); transform-origin: left center; }
.btn:hover { color: var(--fg); }
.btn:active { transform: scale(.97); }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; pointer-events: none; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn--ghost { --b-bg: var(--step); --b-fg: var(--fg); }
.btn--ghost::before { background: var(--fg); }
.btn--ghost:hover { color: var(--bg); }
.btn--wide { width: 100%; }
.btn--lg { min-height: 60px; font-size: 18px; padding: 0 30px; }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn .orb-slot { display: none; }
.btn[aria-busy="true"] .orb-slot { display: inline-block; }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 999px;
  background: var(--step); color: var(--fg);
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.icon-btn:hover { background: var(--fg); color: var(--bg); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 20px; height: 20px; }

.link-btn {
  border: 0; background: none; padding: 6px 0; font-weight: 600; text-decoration: underline;
  text-underline-offset: 4px; text-decoration-thickness: 2px; color: var(--fg);
}

/* ---------- form fields ---------- */

.field { display: grid; gap: 8px; }
.field > label, .field > .label { font-size: 14px; font-weight: 600; }
.field .hint { font-size: 13px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 52px; padding: 14px 16px; border: 2px solid transparent; border-radius: 12px;
  background: var(--step); color: var(--fg); outline: none;
  transition: border-color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: 1; }
.input:hover, .select:hover, .textarea:hover { background: var(--step2); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--fg); background: var(--bg); }
.input[aria-invalid="true"] { border-color: var(--fg); background: var(--bg); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-error { font-size: 14px; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.field-error::before { content: "!"; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--fg); color: var(--bg); font-size: 12px; font-weight: 800; }

/* Password with show toggle */
.pw { display: flex; gap: 8px; }
.pw .input { flex: 1; min-width: 0; }
.pw .icon-btn { width: 52px; height: 52px; flex: none; }
.pw .icon-btn[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.is-shake { animation: shake 420ms var(--ease-out); }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }

/* Checkbox */
.check { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; font-weight: 600; cursor: pointer; }
.check input { appearance: none; -webkit-appearance: none; width: 26px; height: 26px; margin: 0; border-radius: 8px; background: var(--step2); display: grid; place-items: center; cursor: pointer; transition: background var(--t-fast) var(--ease-out); }
.check input::after { content: ""; width: 12px; height: 7px; border-left: 3px solid var(--bg); border-bottom: 3px solid var(--bg); transform: translateY(-2px) rotate(-45deg) scale(0); transition: transform var(--t-mid) var(--ease-out); }
.check input:checked { background: var(--fg); }
.check input:checked::after { transform: translateY(-2px) rotate(-45deg) scale(1); }
.check input:focus-visible { outline: 3px solid var(--fg); outline-offset: 2px; }

/* Chips (radio pills) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.chips legend { font-size: 14px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 999px;
  background: var(--step); color: var(--fg); font-size: 14px; font-weight: 600; user-select: none;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), transform var(--t-mid) var(--ease-out);
}
.chip:hover span { background: var(--step2); }
.chip input:checked + span { background: var(--fg); color: var(--bg); transform: scale(1.04); }
.chip input:focus-visible + span { outline: 3px solid var(--fg); outline-offset: 2px; }
.chip-btn {
  min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--step); font-size: 14px; font-weight: 600;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.chip-btn:hover, .chip-btn[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

/* Segmented control */
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--step); gap: 2px; }
.seg button {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; font-weight: 600; font-size: 14px;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.seg svg, .chip svg { width: 15px; height: 15px; }

/* Status tags: shape plus words, never colour alone */
.tag {
  display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 12px; border-radius: 999px;
  font-size: 13px; font-weight: 700; background: var(--step); color: var(--fg); white-space: nowrap;
}
.tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.tag--pending::before { background: transparent; box-shadow: inset 0 0 0 2px currentColor; }
.tag--approved::before { border-radius: 2px; }
.tag--purchased::before, .tag--restocked::before { width: 12px; border-radius: 4px; }
.tag--completed { background: var(--fg); color: var(--bg); }
.tag--rejected { background: transparent; text-decoration: line-through; box-shadow: inset 0 0 0 2px var(--step2); }
.tag--rejected::before { display: none; }
.prio-urgent { background: var(--fg); color: var(--bg); }

/* ---------- top bar ---------- */

.bar {
  position: sticky; top: 0; z-index: 60; height: var(--bar-h);
  display: flex; align-items: center; gap: 24px; padding: 0 var(--margin);
  transition: transform var(--t-mid) var(--ease-out);
}
.bar.is-hidden { transform: translateY(-100%); }
.wordmark {
  font-family: var(--display); text-transform: uppercase; font-size: 30px; line-height: 1; text-decoration: none;
  display: inline-flex; align-items: center; gap: 10px; letter-spacing: .005em;
}
.wordmark svg { width: 30px; height: 30px; }
.bar nav { display: flex; gap: 4px; margin-left: 12px; }
.bar nav a {
  position: relative; padding: 10px 12px; text-decoration: none; font-weight: 600; font-size: 15px; color: var(--muted);
  transition: color var(--t-fast) var(--ease-out);
}
.bar nav a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px; background: var(--fg);
  transform: scaleX(0); transform-origin: left; transition: transform var(--t-mid) var(--ease-out);
}
.bar nav a:hover, .bar nav a[aria-current="true"] { color: var(--fg); }
.bar nav a:hover::after, .bar nav a[aria-current="true"]::after { transform: scaleX(1); }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.sync { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.sync-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--fg); flex: none; }
.sync[data-state="error"] .sync-dot { background: transparent; box-shadow: inset 0 0 0 2px var(--fg); }
.sync[data-state="loading"] .sync-dot { display: none; }
.sync .orb-slot { width: 20px; height: 20px; display: none; }
.sync[data-state="loading"] .orb-slot { display: block; }

/* ---------- thinking orb host ---------- */
.orb-slot { display: inline-block; width: 20px; height: 20px; flex: none; }
.orb-slot--lg { width: 64px; height: 64px; }

/* ---------- toast ---------- */
.toasts { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 1100; display: grid; gap: 8px; transform: translateX(-50%); width: min(460px, calc(100vw - 24px)); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 16px;
  background: var(--white); color: var(--black); font-weight: 600; font-size: 15px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
  animation: toast-in var(--t-mid) var(--ease-out) both;
  pointer-events: auto;
}
.toast[data-kind="error"] { background: var(--black); color: var(--white); box-shadow: 0 0 0 2px var(--white), 0 18px 50px rgba(0, 0, 0, .45); }
.toast.is-out { animation: toast-out 220ms var(--ease-in) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(.98); } }

/* ---------- dialogs ---------- */
dialog.sheet {
  width: min(560px, calc(100vw - 24px)); max-height: min(92vh, 900px); padding: 0; border: 0; border-radius: 28px;
  background: var(--bg); color: var(--fg); overflow: auto;
  box-shadow: 0 40px 120px rgba(0, 0, 0, .6);
}
dialog.sheet::backdrop { background: rgba(0, 0, 0, .72); }
dialog.sheet[open] { animation: sheet-in var(--t-mid) var(--ease-out) both; }
dialog.sheet[open]::backdrop { animation: fade-in var(--t-mid) var(--ease-out) both; }
dialog.sheet.is-closing { animation: sheet-out 220ms var(--ease-in) both; }
dialog.sheet.is-closing::backdrop { animation: fade-out 220ms var(--ease-in) both; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px) scale(.96); } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 24px 12px; background: var(--bg); }
.sheet-head h2 { font-size: clamp(36px, 6vw, 52px); }
.sheet-body { padding: 8px 24px 28px; display: grid; gap: 18px; }
.sheet-body p { margin: 0; }
.confirm-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- reveal on scroll (only when JS runs) ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out); transition-delay: var(--d, 0ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js .mask[data-reveal] { opacity: 1; transform: none; }
.js .mask[data-reveal] > span { transform: translateY(105%); transition: transform 1s var(--ease-out); transition-delay: var(--d, 0ms); }
.js .mask[data-reveal].is-in > span { transform: none; }

/* ---------- odometer ---------- */
.odo { display: inline-flex; align-items: flex-start; white-space: nowrap; font-variant-numeric: tabular-nums; }
.odo-col { display: inline-block; height: 1em; overflow: hidden; line-height: 1; }
.odo-strip { display: flex; flex-direction: column; transition: transform 1.1s var(--ease-out); transition-delay: var(--d, 0ms); }
.odo-strip > span { height: 1em; line-height: 1; text-align: center; }
.odo-ch { display: inline-block; line-height: 1; height: 1em; }
.odo-cur { font-family: "Noto Sans Bengali", "FreeSans", var(--text); font-weight: 700; font-size: .46em; line-height: 1; margin: .1em .06em 0 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; transition-delay: 0ms !important; scroll-behavior: auto !important; }
  .js [data-reveal], .js .mask[data-reveal] > span { opacity: 1; transform: none; }
}

/* ---------- Sign-in screen (shared by the app and the back office) ---------- */
.lg-wrap { min-height: 100svh; display: grid; grid-template-rows: auto 1fr; padding: var(--margin); }
.lg-wrap > .wordmark { align-self: start; margin: 8px 0 0; }
.lg { align-self: center; justify-self: center; width: min(1200px, 100%); display: grid; justify-items: center; gap: 28px; padding: 32px 0 56px; text-align: center; }
.lg-title { font-size: min(15vw, 150px); line-height: .86; white-space: nowrap; }
.lg-title .mask { display: block; }
.lg-sub { margin: -10px 0 0; max-width: 44ch; color: var(--muted); font-size: 17px; }
.lg-accounts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 18px; }
.lg-acc {
  display: grid; justify-items: center; gap: 10px; width: 112px; padding: 6px 4px; border: 0; border-radius: 18px;
  background: none; color: var(--fg); cursor: pointer;
}
.lg-av {
  width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center;
  background: var(--step); color: var(--fg); font-weight: 800; font-size: 26px; letter-spacing: .01em;
  transition: transform 520ms cubic-bezier(.34, 1.5, .64, 1), background var(--t-mid) var(--ease-out), color var(--t-mid) var(--ease-out), box-shadow var(--t-mid) var(--ease-out);
}
.lg-av svg { width: 30px; height: 30px; }
.lg-nm { max-width: 108px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 700; color: var(--muted); transition: color var(--t-mid) var(--ease-out); }
.lg-acc:hover .lg-av { transform: translateY(-4px); background: var(--step2); }
.lg-acc:active .lg-av { transform: scale(.94); }
.lg-acc[aria-checked="true"] .lg-av { background: var(--fg); color: var(--bg); box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px var(--fg); transform: scale(1.06); }
.lg-acc--other[aria-checked="true"] .lg-av { background: var(--fg); color: var(--bg); }
.lg-acc[aria-checked="true"] .lg-nm { color: var(--fg); }
.lg-acc:focus-visible { outline: none; }
.lg-acc:focus-visible .lg-av { outline: 3px solid var(--fg); outline-offset: 10px; }
.lg-card {
  width: 100%; max-width: 440px; display: grid; gap: 16px; padding: 28px; border-radius: 28px;
  background: var(--step); text-align: left;
}
.lg-card .input { background: var(--bg); }
.lg-card .input:hover { background: var(--bg); }
.lg-card .pw .icon-btn { background: var(--bg); }
.lg-card .pw .icon-btn[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.lg-forget { justify-self: center; font-size: 14px; color: var(--muted); }
.lg-forget:hover { color: var(--fg); }
.lg-card.is-swap { animation: lg-swap 520ms var(--ease-out); }
@keyframes lg-swap { from { opacity: .3; transform: translateY(10px) scale(.985); } }
.js .lg-accounts li { opacity: 0; transform: translateY(18px); }
.js .is-in .lg-accounts li { opacity: 1; transform: none; transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); transition-delay: calc(200ms + var(--i) * 70ms); }
.js .lg-card, .js .lg-sub { opacity: 0; transform: translateY(22px); }
.js .is-in .lg-card, .js .is-in .lg-sub { opacity: 1; transform: none; transition: opacity 800ms var(--ease-out) 320ms, transform 800ms var(--ease-out) 320ms; }
@media (max-width: 560px) {
  .lg { gap: 22px; padding-top: 36px; }
  .lg-av { width: 72px; height: 72px; font-size: 22px; }
  .lg-acc { width: 100px; }
  .lg-nm { max-width: 98px; font-size: 13px; }
  .lg-accounts { gap: 12px 6px; }
  .lg-card { padding: 22px; border-radius: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .js .lg-accounts li, .js .lg-card, .js .lg-sub { opacity: 1; transform: none; }
}
