/* Primal Wellness Team Portal — shared design system
   Brand: Calibri, near black #1C1B19, cream #F0E8D8, orange #D4622A, charcoal #34312C. */
:root {
  --bg: #1C1B19;
  --surface: #34312C;
  --cream: #F0E8D8;
  --orange: #D4622A;
  --text: #F0E8D8;
  --text-2: rgba(240,232,216,.84);   /* body copy on dark */
  --text-3: rgba(240,232,216,.70);   /* secondary / labels, still AA */
  --line: rgba(240,232,216,.14);
  --line-2: rgba(240,232,216,.26);
  --orange-tint: rgba(212,98,42,.14);
  --font: Calibri, Carlito, 'Segoe UI', Arial, sans-serif;
  --r: 14px;
  --gutter: 32px;
  --max: 1120px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body { font-family: var(--font); font-size: 17px; line-height: 1.6; background: var(--bg); color: var(--text); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 6px; }
.ico { width: 1em; height: 1em; display: inline-block; vertical-align: -0.15em; color: var(--orange); flex: none; }

/* ---------- type ---------- */
h1, h2, h3, .h1, .h2, .h3 { font-weight: 700; text-transform: uppercase; letter-spacing: .02em; line-height: 1.12; color: var(--cream); text-wrap: balance; }
h1, .h1 { font-size: clamp(32px, 5vw, 48px); }
h2, .h2 { font-size: clamp(24px, 3.4vw, 32px); }
h3, .h3 { font-size: 20px; }
.eyebrow, .hero-label { font-size: 14px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--orange); }
.lede, .hero-sub { font-size: 19px; color: var(--text-2); max-width: 64ch; }
.muted { color: var(--text-3); }

/* ---------- header / nav ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line); }
.site-header .inner { max-width: var(--max); margin: 0 auto; padding: 14px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { text-decoration: none; display: flex; align-items: center; gap: 14px; line-height: 1.1; }
.brand-logo { height: 46px; width: auto; display: block; }
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--orange); }
.brand-sub { font-size: 15px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); padding-left: 14px; border-left: 1px solid var(--line-2); }
.nav { display: flex; gap: 6px; }
.nav a { text-decoration: none; font-size: 17px; font-weight: 700; color: var(--text-2); padding: 10px 16px; border-radius: 10px; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; }
.nav a:hover { background: var(--surface); color: var(--cream); }
.nav a[aria-current="page"] { color: var(--cream); background: var(--surface); box-shadow: inset 0 -3px 0 var(--orange); }

.crumbs { max-width: var(--max); margin: 0 auto; width: 100%; padding: 18px var(--gutter) 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 16px; color: var(--text-3); }
.crumbs a { color: var(--text-2); text-decoration: none; padding: 6px 2px; }
.crumbs a:hover { color: var(--orange); text-decoration: underline; }
.crumbs .sep { opacity: .6; }

/* ---------- layout ---------- */
main { flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 40px var(--gutter) 80px; display: flex; flex-direction: column; gap: 56px; }
.page-head { display: flex; flex-direction: column; gap: 14px; }
section { display: flex; flex-direction: column; gap: 24px; scroll-margin-top: 96px; }
.sec-head { display: flex; flex-direction: column; gap: 10px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.section-title h2 { font-size: 22px; }
.section-title a { font-size: 16px; font-weight: 700; color: var(--orange); text-decoration: none; }
.section-title a:hover { text-decoration: underline; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 28px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }

.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 28px; text-decoration: none; display: flex; flex-direction: column; gap: 12px; min-width: 0; transition: border-color .15s, transform .15s; }
.tile:hover { border-color: var(--orange); transform: translateY(-2px); }
.tile .t-icon { width: 56px; height: 56px; border-radius: 12px; background: var(--bg); display: grid; place-items: center; font-size: 28px; }
.tile .t-title { font-size: 24px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--cream); line-height: 1.15; }
.tile .t-desc { font-size: 17px; color: var(--text-2); flex: 1; }
.tile .t-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.tile .t-meta { font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.tile .t-go { font-size: 17px; font-weight: 700; color: var(--orange); }

/* list rows (folder contents) */
.rows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; padding: 22px 26px; text-decoration: none; min-height: 72px; }
.row + .row { border-top: 1px solid var(--line); }
.row:hover { background: rgba(240,232,216,.04); }
.row:hover .r-title { color: var(--orange); }
.row .r-icon { width: 48px; height: 48px; border-radius: 10px; background: var(--bg); display: grid; place-items: center; font-size: 24px; }
.row .r-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.row .r-title { font-size: 20px; font-weight: 700; color: var(--cream); line-height: 1.25; }
.row .r-desc { font-size: 17px; color: var(--text-2); }
.row .r-side { display: flex; align-items: center; gap: 16px; }
.row .r-go { font-size: 22px; color: var(--orange); }
.date { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--cream); background: var(--orange-tint); border: 1px solid rgba(212,98,42,.45); border-radius: 999px; padding: 6px 12px; white-space: nowrap; }

/* ---------- buttons / forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; border-radius: 10px; font-size: 17px; font-weight: 700; letter-spacing: .02em; cursor: pointer; border: 2px solid transparent; text-decoration: none; }
.btn.primary { background: var(--orange); color: var(--bg); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--cream); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--orange); color: var(--orange); }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field label { font-size: 15px; font-weight: 700; color: var(--text-2); }
.field input, .field textarea { font-size: 17px; color: var(--cream); background: var(--bg); border: 2px solid var(--line-2); border-radius: 10px; padding: 12px 14px; width: 100%; resize: vertical; min-height: 50px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--orange); }

/* ---------- templates page ---------- */
.toc { display: flex; flex-wrap: wrap; gap: 10px; }
.toc a { font-size: 16px; font-weight: 700; color: var(--cream); text-decoration: none; background: var(--surface); border: 1px solid var(--line-2); padding: 10px 18px; border-radius: 999px; min-height: 44px; display: inline-flex; align-items: center; }
.toc a:hover { border-color: var(--orange); color: var(--orange); }
.builder { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px; align-items: start; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form .full, .form-bar { grid-column: 1 / -1; }
.form-bar { display: flex; gap: 12px; flex-wrap: wrap; }
.paper { background: var(--cream); color: var(--bg); border-radius: var(--r); padding: 28px; display: flex; flex-direction: column; gap: 16px; min-width: 0; position: sticky; top: 100px; }
.paper .eyebrow { color: var(--orange); }
.paper .btn.ghost { color: var(--bg); border-color: rgba(28,27,25,.3); }
.prompt { font-size: 18px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.prompt b { background: rgba(212,98,42,.22); border-radius: 4px; padding: 0 4px; font-weight: 700; }
.prompt i.blank { font-style: normal; color: var(--orange); font-weight: 700; }
pre.tpl { font-family: var(--font); font-size: 17px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 20px; max-height: 460px; overflow: auto; }
pre.tpl .bl { color: var(--orange); font-weight: 700; }
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 10px 18px; font-size: 17px; color: var(--text-2); }
.two { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; align-items: start; }
.steps { display: flex; flex-direction: column; gap: 18px; }
.step { display: flex; gap: 16px; align-items: flex-start; font-size: 17px; color: var(--text-2); }
.step .n { font-size: 26px; font-weight: 700; color: var(--orange); line-height: 1; width: 22px; flex: none; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 24px; }
details summary { cursor: pointer; font-size: 18px; font-weight: 700; color: var(--cream); padding: 16px 0; min-height: 44px; }
details[open] { padding-bottom: 24px; }
details .card-head { margin-bottom: 14px; }
ul.rules { list-style: none; display: flex; flex-direction: column; gap: 14px; font-size: 18px; color: var(--text-2); }
ul.rules li { padding-left: 22px; position: relative; }
ul.rules li::before { content: ''; position: absolute; left: 0; top: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.tip { background: var(--orange-tint); border: 1px solid rgba(212,98,42,.45); border-radius: var(--r); padding: 22px 24px; font-size: 18px; color: var(--cream); }
.tip b { color: var(--orange); }

/* ---------- footer / misc ---------- */
.site-footer { border-top: 1px solid var(--line); }
.site-footer .inner { max-width: var(--max); margin: 0 auto; padding: 24px var(--gutter); display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; font-size: 15px; color: var(--text-3); }
.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer .inner { align-items: center; }
.foot-brand { display: inline-flex; align-items: center; gap: 14px; }
.foot-logo { height: 32px; width: auto; display: block; }
.site-footer a:hover { color: var(--orange); }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--cream); color: var(--bg); font-weight: 700; padding: 12px 20px; border-radius: 999px; font-size: 16px; z-index: 60; }

/* password gate */
#gate { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 16px; }
.gate-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 40px 32px; width: 400px; max-width: 100%; text-align: center; display: flex; flex-direction: column; gap: 14px; }
.gate-logo { font-size: 22px; font-weight: 700; color: var(--orange); letter-spacing: .1em; text-transform: uppercase; }
.gate-sub { font-size: 16px; color: var(--text-2); margin-bottom: 8px; }
.gate-input { width: 100%; background: var(--bg); border: 2px solid var(--line-2); border-radius: 10px; padding: 14px; color: var(--cream); font-size: 18px; text-align: center; letter-spacing: .08em; min-height: 52px; }
.gate-input:focus { outline: none; border-color: var(--orange); }
.gate-btn { width: 100%; background: var(--orange); color: var(--bg); border: none; border-radius: 10px; min-height: 52px; font-size: 18px; font-weight: 700; cursor: pointer; }
.gate-error { font-size: 16px; color: var(--orange); display: none; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .builder, .two { grid-template-columns: 1fr; }
  .paper { position: static; }
}
@media (max-width: 700px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  .site-header .inner { flex-direction: column; align-items: stretch; gap: 10px; padding-top: 12px; padding-bottom: 8px; }
  .brand { gap: 12px; }
  .brand-logo { height: 38px; }
  .brand-sub { font-size: 14px; padding-left: 12px; }
  .nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .nav a { justify-content: center; font-size: 15px; padding: 8px 4px; }
  .nav a .ico { display: none; }
  html { scroll-padding-top: 140px; }
  section { scroll-margin-top: 140px; }
  main { padding-top: 24px; padding-bottom: 56px; gap: 44px; }
  .lede, .hero-sub { font-size: 17px; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .card, .tile { padding: 22px 18px; }
  .tile .t-title { font-size: 21px; }
  .row { grid-template-columns: auto 1fr; gap: 14px; padding: 18px; }
  .row .r-side { grid-column: 2; justify-content: space-between; }
  .row .r-icon { width: 42px; height: 42px; font-size: 21px; align-self: start; }
  .row .r-title { font-size: 18px; }
  .row .r-desc { font-size: 16px; }
  .form { grid-template-columns: 1fr; }
  .form-bar .btn, .card-head .btn { flex: 1 1 auto; }
  .paper { padding: 22px 18px; }
  .prompt, pre.tpl { font-size: 16px; }
  details { padding: 2px 18px; }
  .crumbs { padding-top: 14px; font-size: 15px; }
}

/* home: section summaries + news */
.tile .t-list { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 17px; color: var(--cream); }
.tile .t-list li { padding-left: 18px; position: relative; }
.tile .t-list li::before { content: ''; position: absolute; left: 0; top: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.news { list-style: none; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.news li { display: flex; align-items: center; gap: 18px; padding: 18px 24px; font-size: 17px; color: var(--text-2); flex-wrap: wrap; }
.news li + li { border-top: 1px solid var(--line); }
.news b { color: var(--cream); }
.lede b { color: var(--cream); }
.tip a { color: var(--orange); font-weight: 700; }
@media (max-width: 700px) { .news li { padding: 16px 18px; gap: 10px; } }

/* What's new: announcement style, distinct from cards */
.news { background: rgba(212,98,42,.08); border: 1px solid rgba(212,98,42,.35); border-left: 4px solid var(--orange); }
.news li + li { border-top: 1px solid rgba(212,98,42,.22); }
.news .date { background: var(--orange); color: var(--bg); border-color: var(--orange); }
.news .date .ico { color: var(--bg); }

/* more brand color */
h1 .accent { color: var(--orange); }
.tile .t-icon, .row .r-icon { background: var(--orange); }
.tile .t-icon .ico, .row .r-icon .ico { color: var(--bg); }

/* tabs (AI Prompt Generator) */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: -24px; }
.tab { display: flex; align-items: center; gap: 14px; text-align: left; background: var(--surface); border: 2px solid var(--line); border-radius: var(--r); padding: 16px 20px; cursor: pointer; color: var(--text-2); min-height: 72px; }
.tab b { display: block; font-size: 19px; text-transform: uppercase; letter-spacing: .02em; color: var(--cream); }
.tab small { display: block; font-size: 15px; color: var(--text-3); }
.tab-n { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 17px; border: 2px solid var(--line-2); color: var(--text-2); }
.tab:hover { border-color: var(--line-2); }
.tab[aria-selected="true"] { border-color: var(--orange); background: rgba(212,98,42,.08); }
.tab[aria-selected="true"] .tab-n { background: var(--orange); border-color: var(--orange); color: var(--bg); }
.panel-tab { display: flex; flex-direction: column; gap: 24px; }
.panel-tab[hidden] { display: none; }
@media (max-width: 700px) { .tabs { gap: 8px; } .tab { padding: 12px; gap: 10px; } .tab b { font-size: 16px; } .tab small { font-size: 13px; } .tab-n { width: 30px; height: 30px; font-size: 15px; } }
