/* Ejenix · editorial-infrastructure system
 * --------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@300;400;500;600;700&family=JetBrains+Mono:wght@300;400;500;600&display=swap');

:root{
  /* paper surfaces */
  --paper:        #F2EDE2;
  --paper-2:      #ECE6D7;
  --paper-3:      #E2DAC6;
  --paper-line:   #D6CDB6;

  /* ink surfaces */
  --ink:          #0E0D10;
  --ink-2:        #16151A;
  --ink-3:        #1F1D24;
  --ink-line:     #2A2730;

  /* type */
  --fg:           #14131A;
  --fg-soft:      #4A4754;
  --fg-mute:      #6F6B79;
  --fg-line:      #C9C1AD;

  --fg-d:         #F2EDE2;
  --fg-d-soft:    #B8B2BF;
  --fg-d-mute:    #7E7889;
  --fg-d-line:    #2A2730;

  /* accent — restrained violet from the mark */
  --violet:       oklch(0.46 0.20 290);
  --violet-2:     oklch(0.55 0.21 290);
  --violet-soft:  oklch(0.46 0.20 290 / 0.10);
  --violet-line:  oklch(0.46 0.20 290 / 0.28);

  /* status */
  --green:        oklch(0.62 0.13 150);
  --amber:        oklch(0.72 0.13 70);
  --red:          oklch(0.58 0.18 25);

  --serif:        "Instrument Serif", "Times New Roman", serif;
  --sans:         "Geist", "Helvetica Neue", Helvetica, sans-serif;
  --mono:         "JetBrains Mono", ui-monospace, Menlo, monospace;

  --radius:       6px;
  --radius-lg:    10px;
  --maxw:         1240px;
}

*{ box-sizing: border-box; }
html,body{ margin:0; padding:0; }
html{ -webkit-text-size-adjust:100%; }
body{
  font-family: var(--sans);
  background: var(--paper);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: none; }
img,svg{ display:block; max-width:100%; }
button{ font: inherit; cursor: pointer; }
hr{ border:0; border-top:1px solid var(--fg-line); margin:0; }

/* ── Layout primitives ───────────────────────────────────────────── */

.wrap{ max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.wrap-narrow{ max-width: 980px; margin: 0 auto; padding: 0 28px; }
.section{ padding: 96px 0; position: relative; }
.section-sm{ padding: 56px 0; }
.section-lg{ padding: 140px 0; }
.row{ display:flex; }
.grid{ display:grid; }

.ink{ background: var(--ink); color: var(--fg-d); }
.ink h1,.ink h2,.ink h3{ color: var(--fg-d); }
.ink .eyebrow{ color: var(--fg-d-mute); }
.ink .muted{ color: var(--fg-d-soft); }
.ink hr{ border-top-color: var(--fg-d-line); }

.paper-2{ background: var(--paper-2); }
.paper-3{ background: var(--paper-3); }

/* ── Type ────────────────────────────────────────────────────────── */

.eyebrow{
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-mute);
  font-weight: 500;
}
.eyebrow .dot{
  display:inline-block; width:6px; height:6px; border-radius:50%;
  background: var(--violet); margin-right:8px; vertical-align: 2px;
}

h1, .h1, h2, .h2, h3, .h3 { font-family: var(--sans); letter-spacing: -0.02em; margin: 0; }
.serif{ font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
.serif i{ font-style: italic; }

.display{
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 7.4vw, 108px);
  line-height: 0.98;
  letter-spacing: -0.025em;
}
.display i{ font-style: italic; color: var(--violet); }

.h1{ font-size: clamp(40px, 5.4vw, 72px); line-height: 1.02; font-family: var(--serif); font-weight: 400; }
.h2{ font-size: clamp(32px, 3.6vw, 52px); line-height: 1.05; font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; }
.h3{ font-size: clamp(22px, 2.0vw, 28px); line-height: 1.18; font-weight: 500; letter-spacing: -0.015em; }
.h4{ font-size: 18px; font-weight: 500; letter-spacing: -0.01em; }

.kicker{
  font-family: var(--serif); font-style: italic;
  font-size: clamp(20px, 1.7vw, 26px); color: var(--fg-soft);
}
.lede{
  font-size: clamp(17px, 1.3vw, 20px);
  line-height: 1.45;
  color: var(--fg-soft);
  max-width: 62ch;
}
.ink .lede{ color: var(--fg-d-soft); }
.muted{ color: var(--fg-mute); }
.mono{ font-family: var(--mono); }
.upper{ text-transform: uppercase; letter-spacing: 0.1em; }

/* ── Buttons ─────────────────────────────────────────────────────── */

.btn{
  display:inline-flex; align-items:center; gap: 10px;
  height: 44px; padding: 0 18px;
  border-radius: var(--radius);
  font-weight: 500; font-size: 14px; letter-spacing: -0.005em;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
  white-space: nowrap;
}
.btn:active{ transform: translateY(1px); }
.btn .arrow{ transition: transform .2s; }
.btn:hover .arrow{ transform: translate(2px, 0); }

.btn-primary{ background: var(--ink); color: var(--fg-d); }
.btn-primary:hover{ background: #2A2730; }
.ink .btn-primary{ background: var(--fg-d); color: var(--ink); }
.ink .btn-primary:hover{ background: #fff; }

.btn-violet{ background: var(--violet); color: #fff; }
.btn-violet:hover{ background: var(--violet-2); }

.btn-ghost{ background: transparent; color: var(--fg); border-color: var(--fg-line); }
.btn-ghost:hover{ border-color: var(--fg); }
.ink .btn-ghost{ color: var(--fg-d); border-color: var(--fg-d-line); }
.ink .btn-ghost:hover{ border-color: var(--fg-d); }

.btn-sm{ height: 34px; padding: 0 12px; font-size: 13px; }
.btn-lg{ height: 52px; padding: 0 24px; font-size: 15px; }

/* ── Top bar ─────────────────────────────────────────────────────── */

.nav{
  position: sticky; top: 0; z-index: 50;
  background: rgba(242, 237, 226, 0.85);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--fg-line);
}
.nav-inner{
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
  width: 100%; padding: 0 24px;
  position: relative;
}
.nav-left{ display:flex; align-items:center; gap: 36px; }
.nav-links{
  display:flex; align-items:center; gap: 26px;
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
}
.nav-links a{
  font-size: 14px; color: var(--fg-soft); font-weight: 450;
  padding: 6px 0; position: relative;
}
.nav-links a:hover{ color: var(--fg); }
.nav-links a[aria-current="page"]{ color: var(--fg); }
.nav-links a[aria-current="page"]::after{
  content:""; position:absolute; left: 0; right: 0; bottom: -22px;
  height: 1px; background: var(--ink);
}
.nav-right{ display:flex; align-items:center; gap: 14px; }

.brand{ display:flex; align-items:center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; }
.brand-logo{ height: 34px; width: 96px; object-fit: contain; object-position: left center; display: block; }
.brand-mark{
  width: 24px; height: 24px;
  display:grid; place-items:center;
  background: var(--ink); color: #fff; border-radius: 5px;
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  position: relative;
}
.brand-mark::after{
  content: ""; position: absolute; right: -3px; top: 3px;
  width: 6px; height: 6px; background: var(--violet); border-radius: 1px;
}
.brand-name{ font-size: 16px; }

/* mobile nav */
.nav-burger{
  display: none; width: 38px; height: 38px;
  border: 1px solid var(--fg-line); background: transparent;
  border-radius: var(--radius); align-items:center; justify-content:center;
}
.nav-burger svg{ width: 18px; height: 18px; }

@media (max-width: 980px){
  .nav-links{ display: none; }
  .nav-right .btn:not(.btn-primary):not(.btn-violet){ display: none; }
  .nav-burger{ display: inline-flex; }
}

/* mobile drawer */
.nav-drawer{
  position: fixed; inset: 64px 0 0 0; z-index: 49;
  background: var(--paper);
  border-top: 1px solid var(--fg-line);
  transform: translateY(-8px); opacity: 0; pointer-events: none;
  transition: transform .2s, opacity .2s;
  padding: 24px 28px;
}
.nav-drawer.open{ transform: translateY(0); opacity: 1; pointer-events: auto; }
.nav-drawer a{ display:block; padding: 14px 0; font-size: 18px; border-bottom: 1px solid var(--fg-line); }

/* ── Marquee / proof band ────────────────────────────────────────── */

.proof{
  border-top: 1px solid var(--fg-line);
  border-bottom: 1px solid var(--fg-line);
  background: var(--paper-2);
}
.proof-row{
  display:grid; grid-template-columns: repeat(4, 1fr);
}
.proof-cell{
  padding: 28px 24px; border-right: 1px solid var(--fg-line);
}
.proof-cell:last-child{ border-right: 0; }
.proof-num{ font-family: var(--serif); font-size: 44px; line-height: 1; letter-spacing: -0.02em; }
.proof-num span{ font-family: var(--mono); font-size: 16px; color: var(--fg-mute); margin-left: 4px; vertical-align: top; }
.proof-cell .label{ margin-top: 10px; font-size: 12px; color: var(--fg-mute); font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.1em; }

@media (max-width: 760px){
  .proof-row{ grid-template-columns: repeat(2, 1fr); }
  .proof-cell:nth-child(2){ border-right: 0; }
  .proof-cell:nth-child(-n+2){ border-bottom: 1px solid var(--fg-line); }
}

/* ── Cards / surfaces ───────────────────────────────────────────── */

.card{
  background: var(--paper);
  border: 1px solid var(--fg-line);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.card-flat{
  border: 1px solid var(--fg-line);
  border-radius: var(--radius-lg);
  padding: 28px;
  background: transparent;
}
.ink .card,.ink .card-flat{
  background: var(--ink-2); border-color: var(--ink-line); color: var(--fg-d);
}

.tag{
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px;
  font-family: var(--mono); font-size: 11px;
  border: 1px solid var(--fg-line); border-radius: 3px;
  color: var(--fg-soft); background: transparent;
}
.tag.violet{ color: var(--violet); border-color: var(--violet-line); background: var(--violet-soft); }
.tag.green{ color: var(--green); border-color: color-mix(in oklab, var(--green) 30%, transparent); background: color-mix(in oklab, var(--green) 12%, transparent); }
.tag.amber{ color: var(--amber); border-color: color-mix(in oklab, var(--amber) 30%, transparent); background: color-mix(in oklab, var(--amber) 12%, transparent); }
.tag.red{ color: var(--red); border-color: color-mix(in oklab, var(--red) 30%, transparent); background: color-mix(in oklab, var(--red) 12%, transparent); }
.tag .dot{ width: 5px; height: 5px; border-radius:50%; background: currentColor; }

/* ── Section heading layout ─────────────────────────────────────── */

.sec-head{ display:grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-bottom: 56px; align-items: end; }
.sec-head .lede{ margin: 0; }
@media (max-width: 860px){
  .sec-head{ grid-template-columns: 1fr; gap: 18px; }
}

/* ── Possible-now grid ──────────────────────────────────────────── */

.possible{
  border-top: 1px solid var(--fg-line);
}
.possible-row{
  display: grid;
  grid-template-columns: 80px 1fr 130px;
  border-bottom: 1px solid var(--fg-line);
  padding: 22px 0;
  align-items: baseline;
  gap: 24px;
  transition: background .15s;
}
.possible-row:hover{ background: var(--paper-2); }
.possible-row .idx{ font-family: var(--mono); font-size: 12px; color: var(--fg-mute); letter-spacing: 0.04em; padding-left: 4px; }
.possible-row .title{ font-family: var(--serif); font-size: clamp(22px, 2.0vw, 28px); line-height: 1.12; letter-spacing: -0.015em; }
.possible-row .time{ font-family: var(--mono); font-size: 12px; color: var(--violet); text-align: right; padding-right: 4px; letter-spacing: 0.04em; }
.possible-row .time strong{ font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 22px; color: var(--violet); display:block; margin-bottom: 2px; }

@media (max-width: 720px){
  .possible-row{ grid-template-columns: 50px 1fr; gap: 12px; }
  .possible-row .time{ grid-column: 2; text-align: left; padding-right: 0; }
}

/* ── Comparison table ───────────────────────────────────────────── */

.compare{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}
.compare th, .compare td{
  text-align: left;
  padding: 18px 20px;
  border-bottom: 1px solid var(--fg-line);
  vertical-align: top;
}
.compare thead th{
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--fg-mute); font-weight: 500;
  border-bottom: 1px solid var(--fg);
  padding-bottom: 12px; padding-top: 12px;
}
.compare th.col-ejenix{ color: var(--violet); }
.compare th:first-child, .compare td:first-child{ padding-left: 0; }
.compare th:last-child, .compare td:last-child{ padding-right: 0; }
.compare td.col-ejenix{ background: var(--violet-soft); }
.compare td.col-ejenix:first-child{ background: transparent; }
.compare .row-label{ font-weight: 500; color: var(--fg); }
.compare .yes{ color: var(--green); }
.compare .no{ color: var(--red); }
.compare .partial{ color: var(--amber); }
/* Planned, not shipping. A hollow glyph in muted grey so it cannot be mistaken
   for the filled dot that means "included today" — the distinction the
   comparison table exists to make. */
.compare .planned{ color: var(--fg-mute); }
.compare .glyph{ font-family: var(--mono); }

@media (max-width: 760px){
  .compare-wrap{ overflow-x: auto; }
  .compare{ min-width: 720px; }
}

/* ── Console / product visuals ──────────────────────────────────── */

.console{
  background: #0C0B0F;
  border: 1px solid var(--ink-line);
  border-radius: 12px;
  overflow: hidden;
  color: var(--fg-d);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.35), 0 8px 20px -6px rgba(0,0,0,0.15);
}
.console-bar{
  display:flex; align-items:center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ink-line);
  background: linear-gradient(180deg, #14131A 0%, #0F0E13 100%);
  font-family: var(--mono); font-size: 12px; color: var(--fg-d-mute);
}
.console-dots{ display:flex; gap: 6px; }
.console-dots span{ width:10px; height:10px; border-radius:50%; background:#2A2730; }
.console-tabs{ display: flex; gap: 4px; margin-left: 16px; }
.console-tab{
  padding: 6px 12px; border-radius: 4px;
  font-family: var(--mono); font-size: 11px;
  color: var(--fg-d-mute);
}
.console-tab.active{ background: var(--ink-3); color: var(--fg-d); }
.console-body{ padding: 22px 24px; }

/* tiny chart */
.spark{
  display: grid; grid-template-columns: repeat(40, 1fr); gap: 2px; height: 40px; align-items: end;
}
.spark span{
  background: var(--violet); opacity: 0.85; border-radius: 1px;
}

/* progress */
.progress{ height: 6px; background: var(--ink-3); border-radius: 3px; overflow: hidden; }
.progress > span{ display:block; height: 100%; background: var(--violet); }

/* audit timeline */
.tl{ position: relative; padding-left: 22px; }
.tl::before{
  content:""; position: absolute; left: 7px; top: 4px; bottom: 4px;
  width: 1px; background: var(--ink-line);
}
.tl-item{ position: relative; padding: 8px 0; }
.tl-item::before{
  content:""; position: absolute; left: -22px; top: 13px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--violet);
  box-shadow: 0 0 0 3px var(--ink);
}
.tl-item.done::before{ background: var(--green); }
.tl-item.idle::before{ background: var(--ink-3); }
.tl-time{ font-family: var(--mono); font-size: 11px; color: var(--fg-d-mute); }
.tl-title{ font-size: 14px; color: var(--fg-d); margin-top: 2px; }

/* ── Footer ─────────────────────────────────────────────────────── */

.footer{
  background: var(--paper-3); color: var(--fg);
  padding: 72px 0 32px;
  border-top: 1px solid var(--fg-line);
}
.footer-top{
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: 36px; margin-bottom: 56px;
}
.footer h4{
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--fg-mute); margin: 0 0 16px;
  font-weight: 500;
}
.footer ul{ list-style:none; padding:0; margin:0; }
.footer li{ margin: 8px 0; }
.footer a{ color: var(--fg-soft); font-size: 14px; }
.footer a:hover{ color: var(--fg); }
.footer-bottom{
  display:flex; justify-content: space-between; align-items: center;
  padding-top: 24px; border-top: 1px solid var(--fg-line);
  font-size: 12px; color: var(--fg-mute); font-family: var(--mono);
}
.footer-brand p{ color: var(--fg-soft); margin: 14px 0 0; max-width: 28ch; font-size: 14px; }

@media (max-width: 980px){
  .footer-top{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px){
  .footer-top{ grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-brand{ grid-column: 1 / -1; }
  .footer-bottom{ flex-direction: column; gap: 12px; align-items: flex-start; }
}

/* ── Misc ───────────────────────────────────────────────────────── */

.rule{ height: 1px; background: var(--fg-line); }
.ink .rule{ background: var(--ink-line); }

.hr-section{ border-top: 1px solid var(--fg-line); }

.center{ text-align: center; }
.stack-sm > * + *{ margin-top: 8px; }
.stack > * + *{ margin-top: 16px; }
.stack-lg > * + *{ margin-top: 24px; }

.grid-2{ display:grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.grid-3{ display:grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-4{ display:grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
@media (max-width: 980px){
  .grid-3{ grid-template-columns: 1fr 1fr; }
  .grid-4{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px){
  .grid-2,.grid-3,.grid-4{ grid-template-columns: 1fr; }
}

/* reveal on scroll */
.reveal{ opacity: 0; transform: translateY(8px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in{ opacity: 1; transform: translateY(0); }

/* selection */
::selection{ background: var(--violet); color: white; }

/* ── Mobile safety net (added 2026-05-26 in mobile responsiveness pass) ────
   Prevents horizontal scroll on viewports ≤ 760px and constrains media to
   the page width. Specific page bugs (docs sidebar, blog images) are
   addressed below as targeted overrides rather than rebuilding layouts. */
@media (max-width: 760px) {
  html, body { overflow-x: hidden; }
  img, video, iframe { max-width: 100%; height: auto; }
  table { max-width: 100%; }

  /* docs.html: collapse the sticky sidebar on mobile — content has its own
     in-page nav (search, anchors) so this is the right tradeoff for now. */
  .docs-side { display: none !important; }

  /* blog.html: any dashboard/preview widget on mobile gets a scroll container
     instead of overflowing the page. */
  .dashboard-preview, .console-preview, [data-mobile-scroll] {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* eyebrow/mono labels were overflowing on index — allow word-break for very
     long uppercase-tracked labels. */
  .mono.upper, .eyebrow { word-break: break-word; }
}
