/*
Theme Name: ORSTAC
Theme URI: https://orstac.com/
Author: ORSTAC
Description: Lightweight custom theme for ORSTAC (Open Source Robots and Technical Analyses). No page builder, no paid template.
Version: 1.4.0
Requires at least: 6.4
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: orstac
*/
/* Self-hosted brand fonts (SIL OFL), latin subset, variable weights */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("assets/fonts/inter.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 600 700; font-display: swap; src: url("assets/fonts/space-grotesk.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("assets/fonts/jetbrains-mono.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ORSTAC design system v1 (Nov 2026). Tokens derived from the ORSTAC Assistant avatar. */
:root {
  --ink: #0F0B14;
  --surface: #1A1222;
  --surface-2: #231830;
  --plum: #321B38;
  --signal: #39E1FE;
  --violet: #B443E9;
  --magenta: #F644D6;
  --steel: #7792BC;
  --text: #EDEAF2;
  --muted: #A49DB0;
  --line: #2E2340;
  --up: #2BD99F;
  --down: #FF5A6E;
  --radius: 14px;
  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--text); font: 16px/1.6 var(--font-body); }
a { color: var(--signal); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 12px; letter-spacing: -0.01em; }
h1 { font-size: clamp(34px, 5vw, 56px); }
h2 { font-size: clamp(26px, 3vw, 36px); }
h3 { font-size: 20px; }
p { margin: 0 0 14px; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(15, 11, 20, 0.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font: 700 20px var(--font-head); letter-spacing: 0.12em; }
.brand img { width: 34px; height: 34px; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--muted); font-size: 15px; }
.nav a.active, .nav a:hover { color: var(--text); text-decoration: none; }
.obtn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 10px; font: 600 15px var(--font-body); border: 1px solid transparent; cursor: pointer; }
.obtn-primary { background: var(--signal); color: #071318; }
.obtn-primary:hover { text-decoration: none; filter: brightness(1.08); }
.obtn-ghost { border-color: var(--line); color: var(--text); background: transparent; }
.obtn-ghost:hover { border-color: var(--steel); text-decoration: none; }
.menu-toggle { display: none; }

/* Hero */
.hero { padding: 80px 0 56px; background: radial-gradient(1000px 420px at 75% -10%, rgba(50, 27, 56, 0.9), transparent 70%); }
.hero .wrap { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-block; font: 600 12px var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--signal); margin-bottom: 14px; }
.hero p.lead { font-size: 19px; color: var(--muted); max-width: 560px; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.hero-card .row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.hero-card .row:last-child { border-bottom: 0; }
.grade { display: inline-block; min-width: 26px; text-align: center; font: 700 13px var(--font-mono); border-radius: 6px; padding: 2px 6px; }
.g-a { background: rgba(43, 217, 159, .15); color: var(--up); }
.g-b { background: rgba(57, 225, 254, .14); color: var(--signal); }
.g-c { background: rgba(180, 67, 233, .16); color: #CF8BF2; }
.g-d { background: rgba(255, 90, 110, .15); color: var(--down); }

/* Sections */
section { padding: 64px 0; border-top: 1px solid var(--line); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card .num { font: 700 13px var(--font-mono); color: var(--signal); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stat b { display: block; font: 700 32px var(--font-head); }
.stat span { color: var(--muted); font-size: 14px; }
.code { background: #0B0810; border: 1px solid var(--line); border-radius: 10px; padding: 16px; font: 14px/1.7 var(--font-mono); color: #CFE9F2; overflow-x: auto; white-space: pre; }
.code .c { color: var(--muted); }
.bar { height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; }

/* Posts */
.post-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.post-card .thumb { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--plum), #12202B); display: grid; place-items: center; }
.post-card .thumb svg { width: 72%; opacity: .9; }
.post-card .body { padding: 18px 20px 22px; }
.chip { display: inline-block; font: 600 11px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--signal); border: 1px solid rgba(57, 225, 254, .35); border-radius: 999px; padding: 3px 9px; margin-bottom: 10px; }
.post-card h3 { font-size: 19px; }
.post-card .meta { font-size: 13px; color: var(--muted); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 28px; }
.filters a { font-size: 14px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; }
.filters a.on { color: #071318; background: var(--signal); border-color: var(--signal); }

/* Risk notice + .site-footer */
.notice { background: rgba(255, 90, 110, .07); border: 1px solid rgba(255, 90, 110, .35); border-radius: var(--radius); padding: 16px 18px; font-size: 14px; color: #F3C9CF; }
.site-footer { border-top: 1px solid var(--line); padding: 40px 0; color: var(--muted); font-size: 14px; }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
.site-footer h4 { color: var(--text); font: 600 14px var(--font-head); margin: 0 0 10px; }
.site-footer a { color: var(--muted); display: block; margin-bottom: 6px; }

@media (max-width: 900px) {
  .hero .wrap, .grid-3, .grid-4, .site-footer .cols { grid-template-columns: 1fr; }
  .nav { display: none; }
  .menu-toggle { display: inline-flex; margin-left: auto; }
  .site-header .obtn-primary { display: none; }
  .hero { padding: 48px 0 32px; }
  section { padding: 44px 0; }
}

/* layout helpers + overflow safety */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
.hero .wrap > *, .split > *, .grid-3 > *, .grid-4 > *, .site-footer .cols > * { min-width: 0; }
.hero-card .row { gap: 12px; flex-wrap: wrap; }
.hero-card .row span:last-child { text-align: right; margin-left: auto; }
.bar-head { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between; font-size: 14px; margin-bottom: 10px; }
.code { max-width: 100%; }
h1, h2, h3 { overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .wrap { padding: 0 16px; }
  .hero .actions .obtn { flex: 1 1 auto; justify-content: center; }
}

/* ---------- WordPress layer ---------- */
.mt { margin-top: 22px; }
.down { color: var(--down); }
.hero-cmd { font-size: 12px; margin-bottom: 8px; }
.split-center { align-items: center; }
.legend { margin: 12px 0 0; font-size: 14px; }
.principles { margin: 0; padding-left: 20px; line-height: 2; }
.bar-a { background: var(--up); }
.bar-b { background: var(--signal); }
.bar-c { background: var(--violet); }
.bar-d { background: var(--down); }
.hero-compact { padding: 56px 0 24px; }
.hero .wrap.wrap-block { display: block; }
.h1-compact { font-size: clamp(30px, 4vw, 44px); }
.listing { border-top: 0; padding-top: 8px; }

/* nav menu markup from wp_nav_menu */
.nav ul.menu { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.nav li a { color: var(--muted); font-size: 15px; }
.nav li.current-menu-item a, .nav li a:hover { color: var(--text); text-decoration: none; }
.nav-cta-mobile { display: none; }

/* cards */
.post-card .thumb { overflow: hidden; }
.post-card .thumb img:not(.thumb-emblem) { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card .thumb .thumb-emblem { width: 40%; height: auto; }
.post-card h3 a { color: var(--text); }
.post-card h3 a:hover { color: var(--signal); text-decoration: none; }
.post-card .excerpt { font-size: 15px; }
a.chip:hover { text-decoration: none; border-color: var(--signal); }

/* search */
.search-form { display: flex; gap: 8px; max-width: 520px; margin-top: 4px; }
.search-form input[type="search"] { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--text); padding: 10px 14px; font: 15px var(--font-body); }
.search-form input[type="search"]:focus { outline: 2px solid var(--signal); outline-offset: 1px; }

/* pagination */
.pagination { margin-top: 32px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.page-numbers { border: 1px solid var(--line); border-radius: 10px; padding: 8px 13px; color: var(--muted); font-size: 14px; }
.page-numbers.current { background: var(--signal); border-color: var(--signal); color: #071318; }
a.page-numbers:hover { color: var(--text); border-color: var(--steel); text-decoration: none; }

/* single post */
.wrap-narrow { max-width: 780px; }
.entry-header { padding: 56px 0 18px; background: radial-gradient(900px 360px at 75% -20%, rgba(50, 27, 56, 0.85), transparent 70%); }
.entry-title { font-size: clamp(30px, 4.4vw, 46px); }
.entry-header .meta { color: var(--muted); font-size: 14px; }
.entry-thumb img { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); display: block; }
.entry-content { padding-top: 24px; padding-bottom: 12px; font-size: 17px; line-height: 1.75; }
.entry-content > * { max-width: 100%; }
.entry-content h2 { font-size: 28px; margin: 36px 0 12px; }
.entry-content h3 { font-size: 22px; margin: 30px 0 10px; }
.entry-content h4 { font: 600 18px var(--font-head); margin: 24px 0 8px; }
.entry-content ul, .entry-content ol { padding-left: 22px; margin: 0 0 16px; }
.entry-content li { margin-bottom: 6px; }
.entry-content blockquote { margin: 22px 0; padding: 14px 20px; border-left: 3px solid var(--violet); background: var(--surface); border-radius: 0 10px 10px 0; color: var(--muted); }
.entry-content img, .entry-content video, .entry-content iframe { max-width: 100%; height: auto; border-radius: 10px; }
.entry-content figure { margin: 22px 0; }
.entry-content figcaption, .wp-caption-text { color: var(--muted); font-size: 14px; margin-top: 6px; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; display: block; overflow-x: auto; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.entry-content th { background: var(--surface); }
.entry-content code { font: 0.9em var(--font-mono); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.entry-content pre { background: #0B0810; border: 1px solid var(--line); border-radius: 10px; padding: 16px; overflow-x: auto; font: 14px/1.7 var(--font-mono); }
.entry-content pre code { background: none; border: 0; padding: 0; }
.entry-content hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.entry-content a { text-decoration: underline; text-underline-offset: 2px; }
.alignwide { max-width: 1060px; }
.alignfull { width: 100%; }
.aligncenter { margin-left: auto; margin-right: auto; display: block; }
.alignleft { float: left; margin: 4px 20px 12px 0; }
.alignright { float: right; margin: 4px 0 12px 20px; }
.entry-footer { padding-bottom: 48px; }
.entry-footer .notice { margin-top: 20px; }
.tags a { display: inline-block; font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; margin: 0 6px 6px 0; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 15px; }
.post-nav div:last-child { text-align: right; }

/* comments */
.comments { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.comments-title { font-size: 22px; }
.comment-list { list-style: none; padding: 0; }
.comment-list .comment-body { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; font-size: 15px; }
.comment-list .avatar { border-radius: 50%; vertical-align: middle; margin-right: 8px; }
.comment-meta, .comment-metadata a { color: var(--muted); font-size: 13px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--text); padding: 10px 12px; font: 15px var(--font-body); }
.comment-form .submit { background: var(--signal); color: #071318; border: 0; border-radius: 10px; padding: 11px 18px; font: 600 15px var(--font-body); cursor: pointer; }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 24px; color: var(--muted); font-size: 14px; }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
.site-footer .cols > * { min-width: 0; }
.site-footer h4 { color: var(--text); font: 600 14px var(--font-head); margin: 0 0 10px; }
.site-footer a { color: var(--muted); display: block; margin-bottom: 6px; }
.site-footer .brand { color: var(--text); display: flex; margin-bottom: 10px; }
.footer-legal { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; }
.footer-legal p { margin: 0 0 6px; }

/* accessibility */
.screen-reader-text { border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important; }
.skip-link:focus { clip: auto; clip-path: none; height: auto; width: auto; left: 12px; top: 12px; z-index: 100; background: var(--signal); color: #071318; padding: 10px 14px; border-radius: 8px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
body.admin-bar .site-header { top: 32px; }

@media (max-width: 900px) {
  .site-footer .cols, .post-nav { grid-template-columns: 1fr; }
  .post-nav div:last-child { text-align: left; }
  .header-cta { display: none; }
  .nav.open { display: flex; flex-direction: column; align-items: stretch; gap: 0; position: absolute; top: 68px; left: 0; right: 0; background: var(--ink); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .nav.open ul.menu { flex-direction: column; gap: 0; }
  .nav.open li a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
  .nav.open .nav-cta-mobile { display: inline-flex; justify-content: center; margin-top: 14px; }
  .entry-content { font-size: 16px; }
  .alignleft, .alignright { float: none; margin: 12px 0; }
}
@media (max-width: 782px) {
  body.admin-bar .site-header { top: 46px; }
}
.nav a.nav-cta-mobile { color: #071318; }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }

/* Legacy post tables carry light-theme inline colors: force readable dark-theme colors */
.entry-content table td, .entry-content table th { color: var(--text) !important; border-color: var(--line) !important; background: transparent !important; }
.entry-content table th { background: var(--surface) !important; }
.site-footer .foot-h { color: var(--text); font: 600 14px var(--font-head); margin: 0 0 10px; }
.post-card .card-title { font-size: 19px; margin: 0 0 12px; }
.post-card .card-title a { color: var(--text); }
.post-card .card-title a:hover { color: var(--signal); text-decoration: none; }

/* Deriv account call to action (1.2.0) */
.hero-note { font-size: 13px; margin-top: 10px; }
.cta-box { display: flex; align-items: center; justify-content: space-between; gap: 20px; background: linear-gradient(135deg, rgba(57, 225, 254, .10), rgba(180, 67, 233, .12)); border: 1px solid rgba(57, 225, 254, .35); border-radius: var(--radius); padding: 20px 22px; }
.cta-box p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.cta-title { font-family: var(--font-head); font-size: 19px; color: var(--text); }
.cta-box .obtn { flex: 0 0 auto; }
.entry-footer .cta-box { margin-top: 28px; }
#start { padding-top: 0; }
.header-cta-2 { margin-right: 8px; }
@media (max-width: 720px) {
  .cta-box { flex-direction: column; align-items: stretch; text-align: left; }
  .cta-box .obtn { justify-content: center; }
}

/* 1.3.0: ORSTAC Runner section */
#runner .runner-list { list-style: none; padding: 0; margin: 18px 0 22px; display: grid; gap: 10px; }
#runner .runner-list li { padding-left: 18px; position: relative; color: var(--muted); }
#runner .runner-list li::before { content: ""; position: absolute; left: 0; top: .6em; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); }
#runner .runner-list b { color: var(--text); }
#runner .actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* /bots/ page */
#ways .card { display: flex; flex-direction: column; gap: 10px; }
#ways .card .obtn { margin-top: auto; align-self: flex-start; }
#mybots .runner-list { list-style: none; padding: 0; margin: 18px 0 22px; display: grid; gap: 10px; }
#mybots .runner-list li { padding-left: 18px; position: relative; color: var(--muted); }
#mybots .runner-list li::before { content: ""; position: absolute; left: 0; top: .6em; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); }
#mybots .runner-list b { color: var(--text); }
.faq-item { margin-bottom: 10px; }
.faq-item summary { cursor: pointer; list-style-position: outside; }
.faq-item p { margin: 10px 0 0; }
