/* =================================================================
   OpenClaw Trader Pro — Editorial Dark
   Tom: brutal honesty, technical reference, lobster accent (🦞)
   ================================================================= */

:root {
  /* Palette — slate-noir base, lobster amber accents */
  --bg:           #0e0f12;
  --bg-2:         #15171c;
  --bg-3:         #1c1f26;
  --line:         rgba(255,255,255,0.08);
  --line-strong:  rgba(255,255,255,0.16);
  --ink:          #e8e6df;
  --ink-mid:      #b3b0a5;
  --ink-dim:      #7a7870;
  --accent:       #ff7a3b;   /* lobster amber */
  --accent-soft:  #ffb37a;
  --accent-deep:  #b4451f;
  --green:        #7cc885;
  --red:          #e57373;

  /* Type — Fraunces (display serif) + JetBrains Mono (mono) + IBM Plex Sans (body) */
  --f-display: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
  --f-body:    'IBM Plex Sans', system-ui, sans-serif;
  --f-mono:    'JetBrains Mono', ui-monospace, 'Courier New', monospace;

  --measure: 70ch;
  --radius: 4px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

/* ===== Reset & base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-soft); text-decoration: underline; text-underline-offset: 3px; }
code, pre { font-family: var(--f-mono); font-size: 0.92em; }
code { background: var(--bg-3); padding: 0.1em 0.4em; border-radius: 3px; color: var(--accent-soft); }
pre { background: var(--bg-2); padding: 1.2rem; border-radius: var(--radius); overflow-x: auto; border: 1px solid var(--line); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

::selection { background: var(--accent); color: var(--bg); }

/* ===== Typography ===== */
h1, h2, h3, h4, h5 {
  font-family: var(--f-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.2rem, 4.2vw, 3.4rem); font-weight: 500; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); margin-top: 2.2em; font-weight: 500; }
h3 { font-size: 1.32rem; margin-top: 1.8em; font-weight: 600; }
h4 { font-size: 1.1rem; margin-top: 1.5em; }

p, ul, ol { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.4em; }
li { margin-bottom: 0.4em; }
strong { color: var(--ink); font-weight: 600; }
em { font-style: italic; color: var(--ink); }
blockquote {
  margin: 1.8em 0;
  padding: 0.4em 0 0.4em 1.6em;
  border-left: 3px solid var(--accent);
  font-family: var(--f-display);
  font-style: italic;
  color: var(--ink-mid);
  font-size: 1.12em;
}

/* ===== Layout ===== */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.measure {
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(14,15,18,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.9rem 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--f-display);
  font-size: 1.18rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand:hover { color: var(--accent-soft); text-decoration: none; }
.brand-mark { font-size: 1.5em; line-height: 1; filter: drop-shadow(0 1px 2px rgba(255,122,59,.3)); }

.primary-nav {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  flex: 1;
  margin-left: 0.5rem;
}
.primary-nav a, .primary-nav .dropdown-toggle {
  font-family: var(--f-body);
  font-size: 0.92rem;
  color: var(--ink-mid);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: color .15s, background .15s;
  white-space: nowrap;
  font-weight: 500;
}
.primary-nav a:hover, .primary-nav .dropdown-toggle:hover,
.primary-nav a.active { color: var(--ink); background: var(--bg-3); text-decoration: none; }

.dropdown { position: relative; }
.dropdown-toggle::after {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-left: 0.4em;
  margin-bottom: 2px;
  vertical-align: middle;
  opacity: 0.7;
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px); left: 0;
  min-width: 200px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.35rem;
  z-index: 200;
}
.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a {
  display: block;
  padding: 0.5rem 0.8rem;
  font-size: 0.92rem;
  color: var(--ink-mid);
  border-radius: 3px;
}
.dropdown-menu a:hover { background: var(--bg-3); color: var(--ink); }

.header-utils {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

/* ===== Language picker ===== */
.lang-picker {
  position: relative;
}
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 0.88rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 500;
  transition: border-color .15s;
}
.lang-toggle:hover { border-color: var(--accent); }
.lang-flag { font-size: 1.15em; line-height: 1; }
.lang-toggle::after {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-bottom: 2px;
  opacity: 0.7;
}
.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px); right: 0;
  min-width: 220px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.4rem;
  z-index: 200;
  max-height: 70vh;
  overflow-y: auto;
}
.lang-picker.open .lang-menu { display: block; }
.lang-menu a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.93rem;
  color: var(--ink-mid);
  border-radius: 3px;
}
.lang-menu a:hover { background: var(--bg-3); color: var(--ink); }
.lang-menu a.current { color: var(--accent); background: rgba(255,122,59,0.08); }
.lang-menu a .lang-flag { font-size: 1.25em; }
.lang-menu a .lang-status {
  margin-left: auto;
  font-size: 0.72rem;
  font-family: var(--f-mono);
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.lang-menu a .lang-status.live { color: var(--green); }

/* Mobile menu */
.mobile-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  width: 40px; height: 40px;
  border-radius: var(--radius);
  cursor: pointer;
  align-items: center; justify-content: center;
}
.mobile-toggle svg { width: 18px; height: 18px; }

@media (max-width: 980px) {
  .primary-nav { display: none; }
  .mobile-toggle { display: inline-flex; }
  body.menu-open .primary-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: fixed;
    top: 64px; left: 0; right: 0; bottom: 0;
    background: var(--bg);
    padding: 1.5rem;
    gap: 0.25rem;
    overflow-y: auto;
  }
  body.menu-open .primary-nav a,
  body.menu-open .primary-nav .dropdown-toggle {
    padding: 0.85rem 1rem;
    font-size: 1rem;
  }
  body.menu-open .dropdown-menu {
    display: block;
    position: static;
    border: none;
    box-shadow: none;
    background: var(--bg-2);
    padding: 0.2rem 0 0.2rem 1rem;
    margin: 0.25rem 0;
  }
}

/* ===== Hero / Home ===== */
.hero {
  padding: clamp(4rem, 10vw, 7rem) 0 clamp(3rem, 6vw, 4rem);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255,122,59,0.08), transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(255,122,59,0.05), transparent 50%);
  pointer-events: none;
}
.hero > * { position: relative; }
.hero .eyebrow {
  font-family: var(--f-mono);
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 1.2rem;
  font-weight: 500;
}
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  letter-spacing: -0.035em;
  line-height: 1.02;
  font-weight: 500;
  max-width: 18ch;
  margin-bottom: 1.5rem;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
  font-weight: 500;
}
.hero .lede {
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  color: var(--ink-mid);
  max-width: 60ch;
  margin-bottom: 2rem;
  font-weight: 400;
  line-height: 1.55;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius);
  font-family: var(--f-body);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all .15s;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--accent-soft); color: var(--bg); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ===== Sections / cards ===== */
.section { padding: clamp(3rem, 6vw, 5rem) 0; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 2rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.2rem;
}
.section-head h2 { margin: 0; }
.section-head .eyebrow {
  font-family: var(--f-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  display: block;
  margin-bottom: 0.5rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s, border-color .2s;
}
.card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.card a { color: inherit; text-decoration: none; display: flex; flex-direction: column; height: 100%; }
.card a:hover { text-decoration: none; }

.card-img {
  aspect-ratio: 16/9;
  background: var(--bg-3);
  overflow: hidden;
  position: relative;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }

.card-body { padding: 1.2rem 1.3rem 1.4rem; flex: 1; display: flex; flex-direction: column; }
.card-eyebrow {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 0.6rem;
  font-weight: 500;
}
.card h3 {
  font-size: 1.15rem;
  margin: 0 0 0.6rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.005em;
}
.card a:hover h3 { color: var(--accent-soft); }
.card p {
  font-size: 0.9rem;
  color: var(--ink-mid);
  line-height: 1.55;
  margin: 0;
  flex: 1;
}

/* Featured / pillar cards (full-width treatment) */
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin: 2.5rem 0;
}
.pillar-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem 1.6rem;
  transition: border-color .2s;
}
.pillar-card:hover { border-color: var(--accent); }
.pillar-card h3 { margin-top: 0; }
.pillar-card .meta { font-family: var(--f-mono); font-size: 0.75rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 0.7rem; }

/* ===== Post / article ===== */
.post-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  padding: 3rem 0 5rem;
}
@media (min-width: 1080px) {
  .post-layout { grid-template-columns: minmax(0, 1fr) 260px; }
}

.post-header { margin-bottom: 2.5rem; padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.post-meta {
  font-family: var(--f-mono);
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1.2rem;
}
.post-meta a { color: var(--accent); }
.post-meta .sep { color: var(--ink-dim); margin: 0 0.6em; }
.post-title {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-weight: 500;
  margin: 0 0 1rem;
}
.post-excerpt {
  font-family: var(--f-display);
  font-size: clamp(1.1rem, 1.7vw, 1.35rem);
  line-height: 1.5;
  color: var(--ink-mid);
  font-style: italic;
  font-weight: 400;
  margin: 0;
  max-width: 60ch;
}

.post-body {
  font-size: 1.05rem;
  line-height: 1.75;
  max-width: var(--measure);
}
.post-body h2 { font-size: 1.7rem; margin-top: 2.5em; }
.post-body h3 { font-size: 1.25rem; margin-top: 1.8em; }
.post-body p { margin: 0 0 1.25em; color: var(--ink); }
.post-body ul li, .post-body ol li { margin-bottom: 0.55em; line-height: 1.65; }
.post-body img { border-radius: var(--radius); margin: 2em auto; border: 1px solid var(--line); }
.post-body figure { margin: 2em 0; }
.post-body figcaption {
  text-align: center;
  font-family: var(--f-mono);
  font-size: 0.82rem;
  color: var(--ink-dim);
  margin-top: 0.6em;
  line-height: 1.5;
}

/* Callouts */
.callout {
  background: var(--bg-2);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  margin: 2em 0;
  font-size: 0.95rem;
}
.callout p:last-child { margin-bottom: 0; }
.callout-disclaimer {
  border-left-color: var(--red);
  background: rgba(229, 115, 115, 0.06);
}
.callout-tldr {
  border-left-color: var(--green);
  background: rgba(124, 200, 133, 0.06);
}
.callout-tldr strong { color: var(--green); }
.callout-disclaimer strong { color: var(--red); }

/* Sidebar (post page) */
.post-sidebar {
  font-size: 0.92rem;
}
.post-sidebar h4 {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.6rem;
}
.post-sidebar ul { list-style: none; padding: 0; margin: 0 0 2rem; }
.post-sidebar li { margin-bottom: 0.7em; }
.post-sidebar a { color: var(--ink-mid); }
.post-sidebar a:hover { color: var(--accent-soft); }

/* Affiliate links — distinctive styling so users know */
a[data-affiliate] {
  position: relative;
  border-bottom: 1px dashed currentColor;
}
a[data-affiliate]::after {
  content: '↗';
  margin-left: 0.2em;
  font-size: 0.85em;
  opacity: 0.7;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  padding: 4rem 0 2rem;
  color: var(--ink-mid);
  font-size: 0.9rem;
  margin-top: 5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 2.5rem;
  margin-bottom: 3rem;
}
@media (max-width: 800px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
.footer-brand { font-family: var(--f-display); font-size: 1.3rem; color: var(--ink); margin-bottom: 0.5rem; }
.footer-tagline { font-size: 0.88rem; color: var(--ink-dim); line-height: 1.5; }
.footer-col h5 {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin: 0 0 1rem;
  font-weight: 500;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 0.5em; }
.footer-col a { color: var(--ink-mid); font-size: 0.88rem; }
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--ink-dim);
}
.footer-bottom a { color: var(--ink-dim); }

/* ===== Breadcrumbs ===== */
.crumbs {
  font-family: var(--f-mono);
  font-size: 0.78rem;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 1.5rem 0 0;
}
.crumbs a { color: var(--ink-mid); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { margin: 0 0.6em; color: var(--ink-dim); }

/* ===== Category page ===== */
.cat-header {
  padding: 4rem 0 2.5rem;
  border-bottom: 1px solid var(--line);
}
.cat-header .eyebrow {
  font-family: var(--f-mono);
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 1rem;
}
.cat-header h1 { font-size: clamp(2.2rem, 4vw, 3.2rem); margin-bottom: 0.7rem; }
.cat-header p { color: var(--ink-mid); font-size: 1.1rem; max-width: 60ch; }

/* ===== Coming soon (other locales) ===== */
.coming-soon {
  padding: 8rem 0;
  text-align: center;
}
.coming-soon h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}
.coming-soon p {
  color: var(--ink-mid);
  max-width: 50ch;
  margin: 0 auto 2rem;
  font-size: 1.1rem;
}
.coming-soon .flag { font-size: 4rem; margin-bottom: 1.5rem; line-height: 1; }

/* ===== Utility ===== */
.text-center { text-align: center; }
.muted { color: var(--ink-dim); }
.small { font-size: 0.85rem; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: 3rem; }
