/* =====================================================================
   Pathox — v6 "easy to scan" layer.
   Grounded in Refero breakdowns of Notion, Perplexity, Brex, Wise:
   warm paper canvas + white cards, 1px hairlines instead of shadows,
   one filled action per screen (marigold), sans headings with tight
   tracking, serif only for reading, 4px spacing grid, pills for chips.
   Mobile (common app patterns, e.g. Duolingo/Headspace): bottom tab bar,
   search first, list rows instead of big cards for long lists.
   ===================================================================== */

/* ---------- default design "Daftar" (id: marker) ---------- */
:root[data-design="marker"][data-theme="light"] {
  --night: #0b1533;
  --ink: #191918; --text: #191918; --body: #4f4b47; --muted: #7a7672;
  --blue: #a35200; --blue-h: #8a4500; --blue-soft: #fff1d6; --blue-line: #f5cf8a;
  --orange: #f2622e; --orange-h: #e0521f; --orange-soft: #ffece4; --orange-ink: #a83a14;
  --green: #1f7a55; --green-soft: #e7f4ec; --red: #c4352b; --red-soft: #fdeeec; --gold: #8d6716; --gold-soft: #fbf1d6;
  --paper: #ffffff; --bg: #f6f5f4; --bg-2: #efedeb; --line: #e8e6e3; --line-2: #dad7d3; --field: #ffffff;
  --btn-bg: #ffb110; --btn-ink: #191918; --btn-hover: #f5a300;
  --side-bg: #fbfaf9; --side-ink: #191918; --side-muted: #6f6b67; --side-line: #ecebe9; --side-active: #fff1d6; --side-active-ink: #191918; --side-mark: #191918; --side-mark-ink: #ffb110;
  --block-bg: #0b1533; --block-2: #16214a; --block-ink: #ffffff; --block-muted: #b8c0d8; --block-line: rgba(255, 255, 255, .12); --block-accent: #ffb110;
  --font-head: "Inter Display", "Inter", system-ui, sans-serif; --head-weight: 650; --head-track: -.022em;
  --radius: 12px; --r-btn: 8px; --r-chip: 999px;
  --shadow: 0 1px 2px rgba(25, 25, 24, .05), 0 8px 24px rgba(25, 25, 24, .06);
}
:root[data-design="marker"][data-theme="dark"] { --font-head: "Inter Display", "Inter", system-ui, sans-serif; --head-weight: 650; --head-track: -.022em; --radius: 12px; --r-btn: 8px; --btn-bg: #ffb110; --btn-hover: #ffc244; --block-accent: #ffb110; }

/* ---------- type scale (all designs): 12 / 14 / 16 / 20 / 24 / 32 / 40 / 56 ---------- */
body { font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
.small { font-size: 13px; } .xs { font-size: 12px; }
.page-heading h1 { font-size: clamp(28px, 2.6vw, 34px); line-height: 1.15; margin: 6px 0 8px; }
.page-heading p { font-size: 15.5px; color: var(--body); }
.panel h2 { font-size: 19px; }
.section { padding: 80px 0; }
.section-heading h2 { font-size: clamp(28px, 3vw, 40px); line-height: 1.12; }
.eyebrow { font-size: 13px; }

/* flat, hairline surfaces — no hover jumps */
:root[data-design="marker"] .panel, :root[data-design="marker"] .stat-card, :root[data-design="marker"] .course-card { box-shadow: none; }
.course-card:hover { transform: none; border-color: var(--line-2); box-shadow: var(--shadow); }
.btn:hover { transform: none; }
.text-link { font-weight: 600; }
:root[data-design="marker"][data-theme="light"] .text-link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--btn-bg); text-decoration-thickness: 2px; text-underline-offset: 4px; }
:root[data-design="marker"][data-theme="light"] .tabs a.active { border-color: var(--ink); }
:root[data-design="marker"][data-theme="light"] .progress span { background: #e09400; }
:root[data-design="marker"][data-theme="light"] .badge.standard, :root[data-design="marker"][data-theme="light"] .badge.trial, :root[data-design="marker"][data-theme="light"] .badge.info { background: #fff1d6; color: #8a4500; }

/* ---------- hero: search first ---------- */
.hero { padding: 56px 0 64px; }
.hero h1 { font-size: clamp(40px, 4.6vw, 64px); letter-spacing: -.035em; line-height: 1.02; }
:root[data-design="marker"] .hero h1 { font-weight: 700; }
.hero-copy { font-size: 17px; max-width: 48ch; }
.hero-search { display: flex; align-items: center; gap: 8px; margin-top: 26px; background: var(--paper); border: 1px solid var(--line-2); border-radius: 14px; padding: 6px 6px 6px 16px; max-width: 560px; box-shadow: var(--shadow); }
.hero-search:focus-within { border-color: var(--ink); }
.hero-search .hs-ic { color: var(--muted); display: flex; }
.hero-search input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 16px; padding: 12px 4px; color: var(--ink); outline: none; }
.hero-search .btn { min-height: 46px; }
.hero-tags { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.hero-tags span { margin-right: 4px; }
.hero-tags button { border: 1px solid var(--line); background: var(--paper); color: var(--body); border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.hero-tags button:hover { border-color: var(--ink); color: var(--ink); }
.hero-actions { margin-top: 22px; }
.hero-actions .btn.lg:first-child { display: none; }
.hero-meta { margin-top: 18px; }

/* ---------- sections overview ---------- */
.sec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.sec-card { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.sec-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.sec-thumb { width: 112px; height: 84px; border-radius: 8px; overflow: hidden; display: block; background: #e9b8ca; }
.sec-thumb svg { width: 100%; height: 100%; display: block; }
.sec-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sec-body b { font-family: var(--font-head); font-weight: var(--head-weight); letter-spacing: var(--head-track); font-size: 18px; line-height: 1.25; }
.sec-body small { color: var(--muted); font-size: 13px; }
.sec-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.sec-list span { font-size: 12.5px; color: var(--body); background: var(--bg-2); border-radius: 999px; padding: 3px 10px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.sec-list .more { background: transparent; color: var(--muted); }
.sec-go { color: var(--muted); padding-right: 6px; }
.sec-card:hover .sec-go { color: var(--ink); }

/* ---------- topic list (long lists scan faster as rows) ---------- */
.topic-list { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.topic-row { display: grid; grid-template-columns: 34px 64px minmax(0, 1fr) 70px auto 28px; gap: 14px; align-items: center; padding: 12px 16px; color: var(--ink); border-top: 1px solid var(--line); }
.topic-row:first-child { border-top: 0; }
.topic-row:hover { background: color-mix(in srgb, var(--bg-2) 60%, transparent); }
.tr-no { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.tr-thumb { width: 64px; height: 48px; border-radius: 6px; overflow: hidden; display: block; background: #e9b8ca; }
.tr-thumb svg, .tr-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tr-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tr-main b { font-weight: 600; font-size: 15.5px; line-height: 1.3; }
.tr-main small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-meta { font-size: 13px; color: var(--muted); text-align: right; white-space: nowrap; }
.tr-st { display: grid; place-items: center; color: var(--muted); }
.topic-row.locked .tr-main b { color: var(--body); }
.tr-done { width: 24px; height: 24px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; }
.tr-done .icon { width: 14px; height: 14px; stroke-width: 2.4; }
.tr-ring { width: 24px; height: 24px; border-radius: 50%; background: conic-gradient(var(--btn-bg) calc(var(--p) * 1%), var(--line) 0); display: grid; place-items: center; }
.tr-ring i { width: 16px; height: 16px; border-radius: 50%; background: var(--paper); display: block; }
.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: var(--paper); gap: 2px; }
.view-toggle button { width: 34px; height: 30px; border: 0; background: transparent; border-radius: 7px; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.view-toggle button.on { background: var(--bg-2); color: var(--ink); }
.view-toggle .icon { width: 17px; height: 17px; }

/* ---------- mobile bottom tab bar ---------- */
.tabbar { display: none; }
@media (max-width: 860px) {
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; border-radius: 10px; min-height: 52px; justify-content: center; cursor: pointer; }
  .tabbar .icon { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--ink); }
  .tabbar a.on .icon { color: var(--blue); }
  :root[data-design="marker"][data-theme="light"] .tabbar a.on .icon { color: #e09400; }
  .workspace-content { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important; }
  .toast-region { bottom: 84px; }
  .workspace-topbar .lang-switch { display: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 980px) { .sec-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 620px) {
  .hero h1 { font-size: 40px; }
  .hero-search { padding: 4px 4px 4px 12px; }
  .hero-search .btn { padding: 10px 14px; }
  .sec-card { grid-template-columns: 76px minmax(0, 1fr); gap: 12px; }
  .sec-thumb { width: 76px; height: 76px; }
  .sec-go { display: none; }
  .topic-row { grid-template-columns: 48px minmax(0, 1fr) 26px; gap: 12px; padding: 12px; }
  .tr-no, .tr-meta, .tr-acc { display: none; }
  .tr-thumb { width: 48px; height: 48px; }
}
@media (max-width: 620px) { .demo-bar .row { flex-wrap: wrap; gap: 6px !important; } .demo-bar select { max-width: 150px; } }
@media (max-width: 620px) {
  .workspace-content .page-heading p { display: none; }
  .workspace-content .page-heading { margin-bottom: 16px; }
  .course-layout .toolbar .chips, .toolbar .chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -16px; padding-right: 16px; }
  .course-layout .toolbar .chips .tag-button { flex: none; }
  .demo-bar select { max-width: 140px; }
}
