/* SJS Ethnics AI - boutique magazine theme (dark default, light optional) */
:root,
[data-theme="dark"] {
  --bg: #0e1120;
  --surface: #161a2e;
  --surface-2: #1f2441;
  --line: rgba(239, 230, 210, 0.13);
  --text: #efe6d2;
  --muted: #a8a496;
  --gold: #d2ae5c;
  --madder: #d4585f;
  --band: #2b3a8c;
  --ok: #72c493;
  --accent-bg: #d2ae5c;
  --accent-fg: #14172b;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f9f7f3;
  --surface: #ffffff;
  --surface-2: #efebe3;
  --line: rgba(20, 26, 51, 0.13);
  --text: #141a33;
  --muted: #5e6275;
  --gold: #8a6a1e;
  --madder: #a4343a;
  --band: #1e2a6b;
  --ok: #1f7a4a;
  --accent-bg: #141a33;
  --accent-fg: #f9f7f3;
  --shadow: 0 8px 24px rgba(20, 26, 51, 0.1);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.5; font-size: 16px; }
h1, h2, h3 { font-family: "Bodoni Moda", Didot, Georgia, serif; font-weight: 500; margin: 0; letter-spacing: -0.01em; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* the woven saree-border stripe */
.zari {
  height: 14px;
  background:
    linear-gradient(var(--gold), var(--gold)) top / 100% 2px no-repeat,
    linear-gradient(var(--gold), var(--gold)) bottom / 100% 2px no-repeat,
    repeating-linear-gradient(90deg, var(--madder) 0 10px, var(--band) 10px 12px, var(--gold) 12px 14px, var(--band) 14px 16px);
}
.zari.sweep { animation: sweep 1.1s cubic-bezier(.2,.7,.2,1) both; }
@keyframes sweep { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* login */
#login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 28px 24px; max-width: 420px; margin: 0 auto; }
#login h1 { font-size: 44px; line-height: 1.05; }
#login .tag { color: var(--muted); margin: 8px 0 28px; font-style: italic; font-family: "Bodoni Moda", Georgia, serif; }
#login .zari { margin-bottom: 28px; }

input, select, textarea {
  width: 100%; padding: 13px 14px; margin: 6px 0; border: 1px solid var(--line); border-radius: 12px;
  font: inherit; background: var(--surface); color: var(--text);
}
input::placeholder { color: var(--muted); }
label { display: block; font-size: 13px; color: var(--muted); margin-top: 12px; }

button { font: inherit; font-weight: 600; border: 0; border-radius: 12px; padding: 13px 18px; cursor: pointer; background: var(--accent-bg); color: var(--accent-fg); }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.danger { background: var(--madder); color: #fff; }
button.ok { background: var(--ok); color: #0e1120; }
button.small { padding: 7px 12px; font-size: 14px; border-radius: 10px; }
button.full { width: 100%; margin-top: 14px; }
button:disabled { opacity: 0.55; }
.icon-btn { background: transparent; color: var(--text); padding: 8px; border-radius: 10px; display: inline-flex; }
.icon-btn svg { width: 22px; height: 22px; }
.err { color: var(--madder); font-size: 14px; min-height: 20px; margin-top: 8px; }

/* shell */
header { position: sticky; top: 0; z-index: 5; background: var(--bg); }
.bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 10px; max-width: 760px; margin: 0 auto; }
.brand { font-family: "Bodoni Moda", Georgia, serif; font-size: 24px; font-weight: 500; }
.brand small { display: block; font-family: "Instrument Sans", sans-serif; font-size: 12px; color: var(--muted); font-weight: 400; letter-spacing: 0; }
main { padding: 22px 16px 110px; max-width: 760px; margin: 0 auto; }

nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line); display: flex; z-index: 6; padding-bottom: env(safe-area-inset-bottom); }
nav button { flex: 1; background: none; color: var(--muted); padding: 10px 2px 9px; border-radius: 0; font-size: 12px; font-weight: 500; display: flex; flex-direction: column; align-items: center; gap: 3px; }
nav button svg { width: 24px; height: 24px; }
nav button.active { color: var(--gold); }
nav button.active span { font-weight: 600; }

/* home: cover story */
.lead { margin-bottom: 26px; }
.lead h1 { font-size: 38px; line-height: 1.08; max-width: 14em; }
.lead .status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin: 14px 0 18px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex: none; display: inline-block; }
.dot.PAUSED { background: var(--gold); }
.dot.ERROR { background: var(--madder); }
.dot.DISABLED { background: var(--muted); }

.figures { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border-radius: 20px; padding: 18px 8px; box-shadow: var(--shadow); margin-bottom: 30px; }
.figures > div { text-align: center; padding: 0 6px; }
.figures > div + div { border-left: 1px solid var(--line); }
.figures .n { font-family: "Bodoni Moda", Georgia, serif; font-size: 36px; line-height: 1; }
.figures .l { font-size: 13px; color: var(--muted); margin-top: 6px; }

h2.sec { font-size: 24px; margin: 0 0 4px; }
p.note { color: var(--muted); font-size: 14px; margin: 0 0 14px; max-width: 34em; }
section.block { margin-bottom: 32px; }

.banner { background: var(--surface-2); border-left: 4px solid var(--madder); border-radius: 14px; padding: 16px; margin-bottom: 24px; }
.banner b { font-family: "Bodoni Moda", Georgia, serif; font-size: 20px; font-weight: 500; display: block; margin-bottom: 4px; }
.banner p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }

.team .agent { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.team .agent:first-child { border-top: 0; }
.team .name { flex: 1; font-size: 15px; }
.team .st { font-size: 12px; color: var(--muted); }

.safety { background: var(--surface); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); }
.safety .zari { margin: -20px -20px 16px; width: calc(100% + 40px); border-radius: 20px 20px 0 0; }

/* products: portrait cards */
.page-title { font-size: 34px; margin-bottom: 18px; }
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 14px; }
.pcard .ph { aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden; background: var(--surface-2); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); }
.pcard .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard .ph span { font-family: "Bodoni Moda", Georgia, serif; font-size: 44px; color: var(--gold); }
.pcard h3 { font-size: 18px; line-height: 1.2; margin-top: 10px; }
.pcard .meta { font-size: 14px; color: var(--muted); margin-top: 2px; }
.pcard .stat { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin-top: 4px; }
.empty { text-align: center; padding: 40px 10px; color: var(--muted); }
.empty h2 { color: var(--text); font-size: 26px; margin-bottom: 8px; }

/* create form */
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0 4px; }
.shot .box { aspect-ratio: 4 / 5; border: 1.5px dashed var(--gold); border-radius: 14px; background: var(--surface); display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--gold); }
.shot .box img { width: 100%; height: 100%; object-fit: cover; }
.shot .box svg { width: 28px; height: 28px; }
.shot b { display: block; text-align: center; font-size: 14px; margin: 8px 0 6px; font-weight: 600; }
.shot .btns { display: grid; gap: 6px; }
.shot .btns label { margin: 0; text-align: center; background: var(--surface-2); color: var(--text); border-radius: 9px; padding: 8px 4px; font-size: 13px; font-weight: 600; cursor: pointer; }
.shot input[type=file] { display: none; }

.card { background: var(--surface); border-radius: 16px; padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card b { font-family: "Bodoni Moda", Georgia, serif; font-weight: 500; font-size: 18px; }
.muted { color: var(--muted); font-size: 14px; }

.toast { position: fixed; left: 16px; right: 16px; bottom: 90px; max-width: 420px; margin: 0 auto; background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 12px; z-index: 20; text-align: center; font-weight: 500; }

@media (min-width: 640px) { .lead h1 { font-size: 46px; } .pgrid { grid-template-columns: repeat(3, 1fr); } }
@media (prefers-reduced-motion: reduce) { .zari.sweep { animation: none; } * { scroll-behavior: auto !important; } }
