/* ===== /features/api — 12 section, mockup terminal/endpoint bằng HTML+CSS =====
   Dùng lại .pp-sec/.pp-card/.pp-pill từ site/styles.css (mục PUBLISH PAGE). Tiền tố riêng: .api-  */

.api-copy h2 { margin: 16px 0 0; font-size: clamp(30px, 3.6vw, 48px); line-height: 1.06; letter-spacing: -.035em; color: var(--pp-ink); }
.api-copy p { margin: 16px 0 0; font-size: 16.5px; line-height: 1.6; color: var(--pp-mute); }
.api-lbl { display: block; font: 700 9.5px/1 ui-monospace, Menlo, monospace; letter-spacing: .16em; text-transform: uppercase; color: var(--pp-mute); }
.api-m { display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 5px; font: 800 9.5px/1 ui-monospace, Menlo, monospace;
  letter-spacing: .06em; color: #141311; background: #c8f751; flex: 0 0 auto; }
.api-m-get { background: #2dd4bf; }
.api-m-post { background: #c8f751; }
.api-m-patch { background: #ffb020; }
.api-m-delete { background: #ff5a5f; color: #fff; }

/* ---- 1. hero ---- */
.api-stage { position: relative; height: 452px; max-width: 1240px; margin: 4px auto 0; }
.api-grid { position: absolute; left: -10%; right: -10%; bottom: -40px; height: 260px; z-index: 1; overflow: hidden;
  background-image: linear-gradient(rgba(45,212,191,.22) 1px, transparent 1px), linear-gradient(90deg, rgba(45,212,191,.22) 1px, transparent 1px);
  background-size: 74px 46px; transform: perspective(420px) rotateX(66deg); transform-origin: bottom center;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 45%, transparent 92%); mask-image: linear-gradient(180deg, transparent, #000 45%, transparent 92%); }
.api-planet { position: absolute; left: 2%; bottom: 26px; width: 260px; height: 260px; border-radius: 50%; z-index: 2;
  background: radial-gradient(circle at 34% 28%, #3a3224 0%, #1e1a13 52%, #0f0d0a 100%);
  box-shadow: inset 0 0 0 1px rgba(255,160,77,.25), 0 0 80px rgba(255,122,26,.16); }
.api-planet span { position: absolute; inset: -22px -46px; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; transform: rotate(-18deg); }
.api-planet::after { content: ""; position: absolute; inset: 12% 6%; border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, rgba(255,255,255,.10), transparent 55%); }
.api-console { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); width: min(520px, 92%); z-index: 4;
  border-radius: 14px; overflow: hidden; background: rgba(21,20,15,.94); border: 1px solid #3a362c;
  box-shadow: 0 40px 70px rgba(0,0,0,.55); backdrop-filter: blur(6px); }
.api-console-bar { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid #2c2921; }
.api-console-bar code { font: 600 12px/1 ui-monospace, Menlo, monospace; color: #f5f5f6; }
.api-console-bar em { margin-left: auto; font: 700 9px/1 ui-monospace, monospace; font-style: normal; letter-spacing: .1em; color: #8f8b80;
  border: 1px solid #3a362c; border-radius: 999px; padding: 3px 7px; }
.api-console-body { margin: 0; padding: 14px 16px 16px; font: 500 12.5px/1.6 ui-monospace, Menlo, monospace; color: #cfcabb; white-space: pre; overflow-x: auto; }
.api-console-res { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border-top: 1px dashed #3a362c;
  background: rgba(45,212,191,.07); }
.api-s201 { font: 700 10.5px/1 ui-monospace, monospace; letter-spacing: .08em; color: #2dd4bf; }
.api-console-res code { font: 500 11.5px/1 ui-monospace, monospace; color: #c8f751; }
.api-fchip { position: absolute; z-index: 3; display: grid; gap: 1px; padding: 8px 12px; border-radius: 11px;
  background: rgba(28,27,22,.9); border: 1px solid #3a362c; font: 700 13px/1 ui-monospace, monospace; color: #f5f5f6; }
.api-fchip b { font-size: 14px; color: #c8f751; }
.api-fchip i { font-style: normal; font-size: 9px; letter-spacing: .08em; color: #9a958a; text-transform: uppercase; }
.api-fchip-a { left: 20%; top: 34px; }
.api-fchip-b { right: 24%; top: 18px; }
.api-mascot { position: absolute; right: 4%; bottom: 4px; height: 288px; width: auto; z-index: 5; filter: drop-shadow(0 26px 40px rgba(0,0,0,.55)); }

/* nhịp dọc từng section, đo theo bản Ocoya */
.api-s2 { padding: 150px 0; }
.api-s3 { padding: 136px 0; }
.api-s5 { padding: 132px 0; }
.api-s7 { padding: 160px 0; }
.api-s9 { padding: 104px 0; }
.api-s10 { padding: 96px 0; }

/* ---- 2. one call ---- */
.api-flow { display: grid; grid-template-columns: 1fr .78fr 1.15fr; gap: 34px; align-items: center; position: relative; z-index: 2; }
.api-fl { min-width: 0; }
.api-mini { margin-top: 10px; padding: 18px 18px; border-radius: 14px; background: #181712; border: 1px solid #34312a;
  font: 600 12px/1.5 ui-monospace, Menlo, monospace; color: #cfcabb; }
.api-mini pre { margin: 8px 0 0; font: 500 12px/1.75 ui-monospace, monospace; color: #9a958a; white-space: pre; }
.api-mini-res { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  font: 700 10px/1 ui-monospace, monospace; letter-spacing: .06em; color: #2dd4bf; background: rgba(45,212,191,.1);
  border: 1px solid rgba(45,212,191,.28); }
.api-mini-res code { font: 500 11px/1 ui-monospace, monospace; color: #c8f751; }
.api-fmid { display: grid; justify-items: center; gap: 2px; text-align: center; }
.api-fmid img { width: auto; height: 158px; margin-bottom: 8px; filter: drop-shadow(0 14px 22px rgba(0,0,0,.45)); }
.api-fmid b { font-size: 15px; color: var(--pp-ink); }
.api-fmid small { font-size: 11.5px; color: var(--pp-mute); max-width: 150px; line-height: 1.4; }
.api-tgt { margin-bottom: 16px; }
.api-ics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.api-ics .pp-ic { width: 40px; height: 40px; border-radius: 11px; font-size: 13px; }
.api-note { margin: 10px 0 0; font-size: 13px !important; line-height: 1.55; color: var(--pp-mute); }

/* ---- 3. endpoint wall ---- */
.api-explorer { display: grid; grid-template-columns: 1fr 404px; gap: 20px; align-items: start; position: relative; z-index: 2; }
.api-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 26px; }
.api-grp b { display: block; margin-bottom: 10px; font: 700 9.5px/1 ui-monospace, monospace; letter-spacing: .12em; color: #8f8b80; }
.api-ep { display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px 9px; margin-bottom: 5px; border-radius: 8px;
  background: transparent; border: 1px solid transparent; cursor: pointer; text-align: left;
  font: 600 12px/1 ui-monospace, Menlo, monospace; color: #cfcabb; transition: background .12s, border-color .12s; }
.api-ep span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.api-ep:hover { background: rgba(255,255,255,.05); }
.api-ep.on { background: rgba(255,122,26,.12); border-color: rgba(255,122,26,.4); color: #ffe0c4; }
.api-ep i { font-style: normal; }
.api-ep .api-get { color: #2dd4bf; } .api-ep .api-post { color: #c8f751; }
.api-ep .api-patch { color: #ffb020; } .api-ep .api-delete { color: #ff5a5f; }
.api-detail { padding: 20px; border-radius: 16px; background: #181712; border: 1px solid #34312a; color: #f5f5f6;
  box-shadow: 0 30px 60px rgba(0,0,0,.35); }
.api-detail-top { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid #2c2921; }
.api-detail-top code { font: 700 13px/1 ui-monospace, Menlo, monospace; color: #f5f5f6; }
.api-dd { margin: 14px 0 18px; font-size: 13.5px; line-height: 1.55; color: #c9c9d1; min-height: 62px; }
.api-detail .api-lbl { margin-bottom: 8px; color: #8f8b80; }
.api-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.api-chips span { padding: 5px 9px; border-radius: 7px; font: 600 10.5px/1 ui-monospace, monospace; color: #cfcabb;
  background: #221f18; border: 1px solid #38342b; }
.api-ret { margin: 0; font: 600 11.5px/1.5 ui-monospace, monospace; color: #2dd4bf; min-height: 34px; }
.api-full { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 13px; font-weight: 600; color: var(--orange); }
.api-full .ic { width: 14px; height: 14px; }

/* ---- 4. auth ---- */
.api-two { display: grid; grid-template-columns: 1fr 1.02fr; gap: 56px; align-items: start; position: relative; z-index: 2; }
.api-know { margin-top: 24px; padding: 16px 18px; border-radius: 14px; background: var(--pp-card); border: 1px solid var(--pp-line); }
.api-know b { font-size: 13.5px; color: var(--pp-ink); }
.api-know ul { margin: 10px 0 0; padding-left: 16px; display: grid; gap: 6px; font-size: 13px; line-height: 1.5; color: var(--pp-mute); }
.api-steps { list-style: none; margin: 0; padding: 18px; display: grid; gap: 16px; border-radius: 16px;
  background: #181712; border: 1px solid #34312a; color: #f5f5f6; }
.api-steps li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.api-steps li > span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  font: 700 11px/1 ui-monospace, monospace; color: #141311; background: var(--orange); }
.api-steps b { font-size: 14.5px; color: #f5f5f6; }
.api-steps p { margin: 4px 0 8px; font-size: 13px; line-height: 1.5; color: #a9a9b3; }
.api-steps code { display: block; padding: 9px 11px; border-radius: 8px; background: #121109; border: 1px solid #2c2921;
  font: 500 11px/1.6 ui-monospace, Menlo, monospace; color: #c8f751; white-space: pre-wrap; overflow-wrap: anywhere; }
.api-steps-foot { margin: 14px 0 0; padding: 0 4px; font-size: 12.5px; line-height: 1.5; color: var(--pp-mute); }
.api-win-top { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #1c1b16; }
.api-win-top i { width: 8px; height: 8px; border-radius: 50%; background: #ff5f57; }
.api-win-top i:nth-child(2) { background: #febc2e; }
.api-win-top i:nth-child(3) { background: #28c840; }
.api-win-top span { margin-left: 8px; font: 600 10.5px/1 ui-monospace, monospace; color: #8f8b80; }
.api-foot { margin: 26px 0 0; text-align: center; font-size: 13px; color: var(--pp-mute); }

/* ---- 5. languages ---- */
.pp-two.pp-two-rev { position: relative; }
.api-lang { position: relative; z-index: 2; border-radius: 16px; overflow: hidden; background: #15140f; border: 1px solid #34312a;
  box-shadow: 0 40px 80px rgba(0,0,0,.4); color: #f5f5f6; }
.api-lang-top { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: #1c1b16; border-bottom: 1px solid #2c2921; flex-wrap: wrap; }
.api-dots { display: inline-flex; gap: 5px; }
.api-dots i { width: 8px; height: 8px; border-radius: 50%; background: #ff5f57; }
.api-dots i:nth-child(2) { background: #febc2e; }
.api-dots i:nth-child(3) { background: #28c840; }
.api-tabs { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.api-tab { padding: 5px 9px; border-radius: 7px; border: 1px solid transparent; background: transparent; cursor: pointer;
  font: 600 10.5px/1 ui-monospace, monospace; color: #8f8b80; }
.api-tab:hover { color: #cfcabb; }
.api-tab.on { color: #141311; background: var(--orange); }
.api-file { display: flex; align-items: center; gap: 7px; padding: 8px 14px; font: 600 10.5px/1 ui-monospace, monospace; color: #8f8b80;
  border-bottom: 1px solid #2c2921; }
.api-file i { width: 6px; height: 6px; border-radius: 50%; background: #2dd4bf; }
.api-lang pre { margin: 0; padding: 20px 16px 18px; font: 500 11.5px/1.75 ui-monospace, Menlo, monospace; color: #cfcabb;
  white-space: pre; overflow-x: auto; min-height: 344px; max-height: 380px; }
.api-lang-res { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px;
  border-top: 1px dashed #3a362c; background: rgba(45,212,191,.07); }
.api-lang-res span { font: 700 10.5px/1 ui-monospace, monospace; letter-spacing: .08em; color: #2dd4bf; }
.api-lang-res code { font: 500 11px/1 ui-monospace, monospace; color: #c8f751; }
.api-lang-mascot { position: absolute; right: 4%; left: auto; bottom: -46px; height: 132px; width: auto; z-index: 1;
  filter: drop-shadow(0 18px 30px rgba(0,0,0,.5)); pointer-events: none; }

/* ---- 6. status strip ---- */
.api-strip { height: 58px; display: flex; align-items: center; overflow: hidden; background: #c8f751; color: #141311;
  border-block: 1px solid rgba(20,19,17,.18); }
.api-strip-in { display: flex; gap: 26px; white-space: nowrap; width: max-content; animation: api-marq 38s linear infinite;
  font: 700 11.5px/1 ui-monospace, Menlo, monospace; letter-spacing: .1em; text-transform: uppercase; }
.api-strip-in span { display: inline-flex; align-items: center; gap: 26px; }
.api-strip-in i { font-style: normal; opacity: .45; }
@keyframes api-marq { to { transform: translateX(-50%); } }

/* ---- 7. async ---- */
.api-async { display: grid; grid-template-columns: .82fr 1fr 1.12fr; gap: 16px; align-items: stretch; position: relative; z-index: 2; }
.api-term { border-radius: 16px; overflow: hidden; background: #15140f; border: 1px solid #34312a; color: #f5f5f6;
  display: flex; flex-direction: column; }
.api-term-body { position: relative; flex: 1; display: grid; align-content: start; gap: 4px; padding: 18px; min-height: 436px; }
.api-term-body code { font: 700 13px/1 ui-monospace, monospace; color: #8f8b80; }
.api-term-body img { position: absolute; left: 50%; bottom: 44px; transform: translateX(-50%); height: 150px; width: auto; opacity: .95; }
.api-term-body b { margin-top: auto; font-size: 14px; color: #f5f5f6; }
.api-term-body small { font: 500 11px/1.5 ui-monospace, monospace; color: #2dd4bf; }
.api-acards { display: grid; gap: 12px; align-content: start; }
.api-acard { background: #181712; border-color: #34312a; padding: 24px; }
.api-acard b { font-size: 14.5px; color: #f5f5f6; }
.api-acard p { margin: 6px 0 0; font-size: 12.5px; line-height: 1.55; color: #a9a9b3; }
.api-status { padding: 20px; border-radius: 16px; background: #181712; border: 1px solid #34312a; color: #f5f5f6; }
.api-status > b { display: block; margin-bottom: 14px; font-size: 13px; color: #f5f5f6; }
.api-status ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 13px; }
.api-status li { display: grid; grid-template-columns: 8px 168px 1fr; gap: 8px; align-items: baseline; }
.api-s { width: 7px; height: 7px; border-radius: 50%; transform: translateY(-1px); }
.api-s-gen { background: #a1a1aa; } .api-s-draft { background: #8f8b80; } .api-s-wait { background: #ffb020; }
.api-s-client { background: #ffa04d; } .api-s-go { background: #2dd4bf; } .api-s-ok { background: #34d399; } .api-s-err { background: #ff5a5f; }
.api-status code { font: 700 10px/1.4 ui-monospace, monospace; letter-spacing: .02em; color: #ffcf8a; overflow-wrap: anywhere; }
.api-status li span { font-size: 11.5px; line-height: 1.45; color: #a9a9b3; }

/* ---- 8. webhook ---- */
.api-hook { display: grid; grid-template-columns: 1fr 56px .88fr; gap: 16px; align-items: center; position: relative; z-index: 2; }
.api-hook-codes { display: grid; gap: 14px; }
.api-codecard { padding: 14px 16px; border-radius: 14px; background: #181712; border: 1px solid #34312a; color: #f5f5f6; }
.api-codecard code { display: block; margin-top: 8px; font: 700 12px/1 ui-monospace, monospace; color: #f5f5f6; }
.api-codecard small { display: block; margin-top: 4px; font-size: 11.5px; line-height: 1.45; color: #8f8b80; }
.api-codecard pre { margin: 10px 0 0; padding: 10px 11px; border-radius: 8px; background: #121109; border: 1px solid #2c2921;
  font: 500 10.5px/1.6 ui-monospace, monospace; color: #cfcabb; white-space: pre; overflow-x: auto; }
.api-hook-mid { display: grid; justify-items: center; gap: 6px; color: var(--pp-mute); }
.api-hook-mid .ic { width: 20px; height: 20px; color: var(--orange); }
.api-hook-mid span { font: 700 9px/1 ui-monospace, monospace; letter-spacing: .12em; }
.api-hook-res { padding: 18px; border-radius: 16px; background: #181712; border: 1px solid #34312a; color: #f5f5f6; }
.api-ct { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: #f5f5f6; }
.api-ct .ic { width: 15px; height: 15px; color: #c8f751; }
.api-hook-res ol { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.api-hook-res li { display: grid; grid-template-columns: 26px 1fr; gap: 11px; align-items: start; }
.api-hook-res li > span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px;
  font: 700 10px/1 ui-monospace, monospace; color: #141311; background: #2dd4bf; }
.api-hook-res li b { font-size: 13px; color: #f5f5f6; }
.api-hook-res li p { margin: 3px 0 0; font-size: 12px; line-height: 1.5; color: #a9a9b3; }
.api-warn { margin: 14px 0 0; padding: 10px 12px; border-radius: 9px; font-size: 11.5px; line-height: 1.5;
  color: #ffd9b8; background: rgba(255,122,26,.12); border: 1px solid rgba(255,122,26,.3); }

/* ---- 9. recipes ---- */
.api-recipes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; position: relative; z-index: 2; }
.api-recipe { display: flex; flex-direction: column; padding: 20px; min-height: 268px; }
.api-rec { font: 700 9.5px/1 ui-monospace, monospace; letter-spacing: .1em; color: var(--orange); }
.api-recipe h3 { margin: 10px 0 0; font-size: 16px; }
.api-recipe p { margin: 6px 0 14px; }
.api-rec-eps { margin-top: auto; display: grid; gap: 6px; }
.api-rec-ep { display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 7px;
  font: 600 10.5px/1 ui-monospace, monospace; color: #cfcabb; background: #201e17; border: 1px solid #302d25; }
.api-rec-ep b { display: grid; place-items: center; width: 15px; height: 15px; border-radius: 4px; font-size: 8.5px;
  color: #141311; background: #6f6b60; }
.api-rec-ep i { font-style: normal; color: #c8f751; }

/* ---- 10. same engine ---- */
.api-engine { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; position: relative; z-index: 2; }
.api-same { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.api-same span { display: flex; align-items: center; gap: 10px; padding: 18px 16px; border-radius: 12px;
  font: 700 13px/1.2 ui-monospace, Menlo, monospace; letter-spacing: .02em; color: var(--pp-ink);
  background: var(--pp-card); border: 1px solid var(--pp-line); }
.api-same .ic { width: 16px; height: 16px; color: var(--teal); flex: 0 0 auto; }
.api-haves { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 40px; position: relative; z-index: 2; }
.api-have { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-content: start; }
.api-have .api-ic-box { grid-row: span 2; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  color: #141311; background: #ffb020; }
.api-have .api-ic-box .ic { width: 17px; height: 17px; }
.api-have b { font-size: 14.5px; color: var(--pp-ink); }
.api-have p { grid-column: 2; margin: 0; }
.api-copy .btn { margin-top: 22px; }

html[data-theme="light"] .api-rec-ep { background: #f1f1f4; border-color: #e1e1e6; color: #24242a; }
html[data-theme="light"] .api-rec-ep b { background: #c9c9d0; color: #141418; }
html[data-theme="light"] .api-rec-ep i { color: #1f6b5f; }
html[data-theme="light"] .api-mini-res { color: #0f766e; background: rgba(45,212,191,.16); border-color: rgba(45,212,191,.42); }
html[data-theme="light"] .api-mini-res code { color: #3f6b00; }
html[data-theme="light"] .api-engine .btn-ghost { color: #141418; border-color: #c9c9d0; background: #fff; }

@media (max-width: 1000px) {
  .api-flow { grid-template-columns: 1fr; gap: 20px; }
  .api-fmid { order: -1; }
  .api-fmid small { max-width: none; }
  .api-explorer { grid-template-columns: 1fr; }
  .api-two, .api-engine { grid-template-columns: 1fr; gap: 28px; }
  .api-async { grid-template-columns: 1fr; }
  .api-hook { grid-template-columns: 1fr; }
  .api-hook-mid { display: none; }
  .api-recipes { grid-template-columns: 1fr 1fr; }
  .api-lang-mascot { display: none; }
}
@media (max-width: 700px) {
  .api-s2, .api-s3, .api-s5, .api-s7, .api-s9, .api-s10 { padding: 74px 0; }
  .api-stage { height: 430px; }
  .api-grid { display: none; }
  .api-planet { width: 170px; height: 170px; left: -40px; bottom: 90px; }
  .api-console { top: 0; width: 100%; }
  .api-console-body { font-size: 10.5px; padding: 12px; }
  .api-fchip { display: none; }
  .api-mascot { height: 132px; right: -10px; bottom: 0; }
  .api-groups { grid-template-columns: 1fr; gap: 16px; }
  .api-status li { grid-template-columns: 8px 1fr; }
  .api-status li span { grid-column: 2; }
  .api-recipes, .api-haves, .api-same { grid-template-columns: 1fr; }
}
