/* ============================================================
   NOUS AI — subpage styles (legal docs, API reference)
   Built on the design tokens in site.css; loaded by website/base.html
   ============================================================ */

/* page hero sits below the fixed header; the .page-hero rule in
   site.css already supplies the top clearance and bottom hairline */
.page-hero .crumb{
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 18px;
}
.page-hero .crumb a{ color: var(--green); text-decoration: none; }
.page-hero .crumb a:hover{ text-decoration: underline; }
.page-hero .meta{
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em;
  color: var(--faint); margin-top: 18px;
}

/* soft-ribbons backdrop spanning the hero, endpoint nav and header,
   fading out just above the first content heading */
.doc-hero::before{ display: none; }
body.docs-api .doc-hero{ border-bottom: none; }
body.docs-api main{ position: relative; isolation: isolate; }
body.docs-api main > *{ position: relative; z-index: 1; }
body.docs-api main::before,
body.docs-api main::after{
  content: ""; position: absolute; top: 0; left: 0; right: 0;
  height: var(--ribbon-h, clamp(600px, 70vh, 740px)); z-index: 0; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 48px), transparent 100%);
  mask-image: linear-gradient(180deg, #000 calc(100% - 48px), transparent 100%);
}
body.docs-api main::before{
  background: url("../../images/website/soft-green-ribbons.webp") center top / cover no-repeat;
}
body.docs-api main::after{ background: rgba(251,251,249,.30); }
@media (max-width: 640px){
  body.docs-api main::after{ background: rgba(251,251,249,.58); }
}
.doc-hero h1{ font-weight: 350; }

/* ---------- shared content shell ---------- */
.doc-body{ padding: clamp(40px, 6vh, 72px) 0 clamp(64px, 11vh, 120px); }
.doc-prose{ max-width: 760px; }
.doc-prose .doc-intro{
  font-size: 18px; line-height: 1.7; color: var(--soft); margin-bottom: 8px;
}
.doc-prose .doc-intro strong{ color: var(--ink); font-weight: 600; }

.doc-section{ margin-top: clamp(34px, 4.5vh, 52px); }
.doc-section > h2{
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(20px, 2vw, 26px); letter-spacing: -0.01em; color: var(--ink);
  padding-top: 22px; border-top: 1px solid var(--hair); margin-bottom: 14px;
}
.doc-section > h3{
  font-family: var(--font-display); font-weight: 600;
  font-size: 16px; color: var(--ink); margin: 22px 0 10px;
}
.doc-section p{ color: var(--soft); margin-bottom: 14px; }
.doc-section p strong, .doc-section li strong{ color: var(--ink); font-weight: 600; }
.doc-section ul{ list-style: none; margin: 4px 0 16px; }
.doc-section ul li{
  position: relative; padding: 7px 0 7px 22px; color: var(--soft);
  border-bottom: 1px solid var(--hair);
}
.doc-section ul li:last-child{ border-bottom: none; }
.doc-section ul li::before{
  content: ""; position: absolute; left: 2px; top: 15px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
}
.doc-section a{ color: var(--green); }

/* ============================================================
   API REFERENCE
   ============================================================ */
.api-doc .api-nav{
  display: grid; grid-template-columns: repeat(3, minmax(0, 340px));
  gap: 16px; margin-bottom: clamp(32px, 5vh, 48px);
  justify-content: start;
}
.api-nav-btn{
  display: flex; align-items: center; gap: 13px; text-align: left;
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border: 1px solid rgba(16,21,17,.06); border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  transition: border-color .25s ease, box-shadow .25s ease, background .25s ease, transform .25s ease;
}
.api-nav-btn:hover{
  background: rgba(255,255,255,.82); transform: translateY(-1px);
  border-color: rgba(16,21,17,.1); box-shadow: var(--shadow-lg);
}
.api-nav-btn.active{
  background: rgba(255,255,255,.92); border-color: rgba(47,74,64,.4);
  box-shadow: 0 0 0 1px rgba(47,74,64,.14), var(--shadow);
}
.api-nav-btn .nav-icon{
  flex: none; color: var(--faint); display: flex;
  transition: color .25s ease;
}
.api-nav-btn .nav-icon svg{ width: 24px; height: 24px; }
.api-nav-btn:hover .nav-icon{ color: var(--soft); }
.api-nav-btn.active .nav-icon{ color: var(--green); }
.api-nav-btn .endpoint-name{
  font-family: var(--font-display); font-weight: 600; font-size: 14.5px; color: var(--ink);
}
.api-nav-btn .endpoint-desc{ font-size: 12.5px; color: var(--faint); line-height: 1.45; margin-top: 2px; }

.api-section{ display: none; max-width: 820px; }
.api-section.active{ display: block; }
.api-section .documentation-header-container{ margin-bottom: 8px; }
.api-section h1{
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-family: var(--font-mono); font-weight: 500; font-size: clamp(18px, 2vw, 24px);
  letter-spacing: -0.01em; color: var(--ink);
}
.api-section h2{
  font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--ink);
  padding-top: 20px; border-top: 1px solid var(--hair); margin: 28px 0 12px;
}
.api-section h3{
  font-family: var(--font-display); font-weight: 600; font-size: 14.5px; color: var(--ink);
  margin: 20px 0 10px;
}
.api-section h4{
  font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: .02em;
  color: var(--ink); margin: 16px 0 8px;
}
.api-section p{ color: var(--soft); margin-bottom: 12px; }
.api-section ul{ list-style: none; margin: 6px 0 16px; }
.api-section ul li{
  position: relative; padding: 5px 0 5px 20px; color: var(--soft);
}
.api-section ul li::before{
  content: ""; position: absolute; left: 2px; top: 13px;
  width: 5px; height: 5px; border-radius: 50%; border: 1px solid var(--green);
}
.api-section ul li strong{ color: var(--ink); font-weight: 600; }

/* HTTP method badge */
.http-method, .endpoint-box{
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
  background: var(--green); color: #fff; padding: 4px 9px; border-radius: 6px;
}

/* inline code */
.api-section code, .api-section code-h, .doc-section code{
  font-family: var(--font-mono); font-size: 0.86em;
  background: var(--tint); color: var(--green-deep);
  padding: 2px 6px; border-radius: 5px; word-break: break-word;
}

/* tables — wrapped so wide param tables scroll horizontally on narrow screens
   instead of being clipped by the page's overflow guard */
.table-scroll{
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 8px 0 20px; border-radius: var(--r);
}
.api-section table{
  width: 100%; min-width: 460px; border-collapse: collapse; margin: 0;
  font-size: 13.5px; border: 1px solid var(--hair); border-radius: var(--r);
  overflow: hidden;
}
.api-section th, .api-section td{
  text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--hair);
  vertical-align: top;
}
.api-section th{
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--faint); background: var(--tint-2); font-weight: 500;
}
.api-section td{ color: var(--soft); }
.api-section tr:last-child td{ border-bottom: none; }

/* code blocks */
.code-example{
  border: 1px solid var(--night-hair); border-radius: var(--r-lg);
  overflow: hidden; margin: 12px 0 22px; background: var(--night);
}
.code-header{
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--night-2);
  border-bottom: 1px solid var(--night-hair);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; color: var(--night-soft);
}
.copy-btn{
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--night-hair); border-radius: 6px;
  color: var(--night-soft); padding: 4px 9px; font-size: 11px;
  transition: color .2s ease, border-color .2s ease;
}
.copy-btn:hover{ color: var(--mint); border-color: var(--mint); }
.copy-btn svg{ width: 13px; height: 13px; }
pre.code-block{
  margin: 0; padding: 16px 18px 16px 28px; overflow-x: auto;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.65; color: var(--night-text);
  tab-size: 8; -moz-tab-size: 8;
}
pre.code-block code-box{ font-family: var(--font-mono); white-space: pre; }
.json-key{ color: var(--mint); }
.json-string{ color: #C6D8CF; }

@media (max-width: 760px){
  .api-doc .api-nav{ grid-template-columns: 1fr; }
}

/* ============================================================
   AUTH (login)
   ============================================================ */
.auth{
  min-height: calc(100vh - 68px);
  display: flex; align-items: center; justify-content: center;
  padding: clamp(110px, 15vh, 150px) var(--pad) clamp(56px, 8vh, 84px);
}
.auth-card{
  width: 100%; max-width: 420px;
  background: rgba(255,255,255,.62);
  backdrop-filter: blur(22px) saturate(1.15);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: clamp(30px, 4vw, 44px);
}
.auth-card h1{
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 30px); letter-spacing: -0.01em; color: var(--ink);
}
.auth-card .auth-sub{ color: var(--soft); font-size: 15px; margin: 8px 0 28px; }
.auth-card form .btn{ width: 100%; justify-content: center; margin-top: 4px; }
.auth-error{
  background: #FBF0EC; border: 1px solid #E7C3B6; border-radius: 8px;
  color: #B0492F; font-size: 13.5px; padding: 11px 14px; margin-bottom: 20px;
}
.auth-alt{
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--hair);
  text-align: center; font-size: 14px; color: var(--soft);
}
.auth-alt a{ color: var(--green); font-weight: 500; }

/* minimal footer (login): only the bottom bar, no double divider */
.site-footer.footer-min .footer-bottom{ border-top: none; }

/* transparent header on the login page only */
body.auth-page .site-header,
body.auth-page .site-header.scrolled{
  background: transparent;
  -webkit-backdrop-filter: none; backdrop-filter: none;
  border-bottom-color: transparent;
}

/* ---------- animated image background (login) ---------- */
.auth{ position: relative; overflow: hidden; isolation: isolate; }
/* the ribbons image, slowly drifting */
.auth::before{
  content: ""; position: absolute; inset: -10%; z-index: 0; pointer-events: none;
  background: url("../../images/website/soft-green-ribbons.webp") center / cover no-repeat;
  animation: authPan 20s ease-in-out infinite alternate;
  will-change: transform;
}
/* light veil to keep the form legible while the ribbons show through */
.auth::after{
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: rgba(251,251,249,.32);
}
.auth .auth-card{ position: relative; z-index: 1; }

@keyframes authPan{
  from{ transform: scale(1.08) translate3d(-3%, -2%, 0) rotate(-0.7deg); }
  to{ transform: scale(1.2) translate3d(3%, 2%, 0) rotate(0.7deg); }
}
@media (prefers-reduced-motion: reduce){
  .auth::before{ animation: none; transform: scale(1.04); }
}
