/* ReXynth web - faithful to src/ui/theme.cpp palette.
   Hard rectangles: zero border-radius anywhere. */

:root {
  --bg:        #141414;
  --bg-alt:    #101010;
  --panel:     #1b1b1b;
  --panel-alt: #222222;
  --border:    #3a3a3a;
  --text:      #d8d8c8;
  --text-dim:  #6e6e62;
  --accent:    #dfdf4f;
  --accent-dim:#5f5f2f;
  --clip:      #2a2a28;
  --clip-border:#4b4b3f;
  --clip-sel:  #d8d84f;
  --grid:      #4a4838;
  --lane:      #20201d;
  --ghost:     #8f8f2f;
  --warn:      #b04040;
  --wedge:     rgba(79,216,216,0.55);
  --mono: "IBM Plex Mono", "JetBrains Mono", "Fira Mono", ui-monospace, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; border-radius: 0 !important; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  image-rendering: pixelated;
}

/* faint scanline texture, like a phosphor panel */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.012) 0px,
    rgba(255,255,255,0.012) 1px,
    transparent 1px,
    transparent 3px);
  z-index: 9999;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, kbd, pre { font-family: var(--mono); }
code { color: var(--ghost); background: var(--bg-alt); padding: 0 3px; border: 1px solid var(--border); }
kbd { color: var(--accent); border: 1px solid var(--border); background: var(--panel-alt); padding: 0 4px; }
b.ok-t { color: var(--accent); }

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.brand { display: flex; align-items: baseline; gap: 8px; }
.logo { font-size: 17px; font-weight: 700; letter-spacing: 1px; color: var(--accent); }
.tag {
  font-size: 11px; color: var(--bg-alt); background: var(--accent);
  padding: 1px 6px; font-weight: 700;
}
.topnav { display: flex; gap: 16px; align-items: center; font-size: 12px; }
.topnav a { color: var(--text); }
.topnav a:hover { color: var(--accent); }
.topnav a.dl {
  color: var(--bg-alt); background: var(--accent);
  padding: 3px 12px; font-weight: 700;
}
.topnav a.dl:hover { background: #ffff66; text-decoration: none; }

/* ---- hero ---- */
.hero { max-width: 1060px; margin: 54px auto 30px; padding: 0 18px; }
.hero h1 { font-size: 30px; line-height: 1.25; letter-spacing: 0.5px; }
.hero .hl { color: var(--accent); }
.hero .sub { margin-top: 14px; max-width: 780px; color: var(--text); }
.hero .sub .dim, .dim { color: var(--text-dim); }

/* ---- DAW mock ---- */
.daw-wrap { max-width: 1060px; margin: 26px auto 8px; padding: 0 18px; }
.daw {
  border: 1px solid var(--border);
  background: var(--panel);
  user-select: none;
}
.titlebar {
  display: flex; align-items: center;
  background: #141412; border-bottom: 1px solid var(--border);
  padding: 4px 8px; font-size: 12px;
}
.titlebar .t { flex: 1; color: var(--text); }
.tbtn {
  width: 22px; height: 18px; display: grid; place-items: center;
  color: var(--text-dim); cursor: default; font-size: 12px;
}
.tbtn:hover { background: var(--panel-alt); color: var(--text); }
.tbtn.act { background: var(--accent-dim); color: var(--text); }

.menubar {
  display: flex; gap: 2px; padding: 2px 6px;
  background: #121211; border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.menubar span { padding: 2px 9px; color: var(--text); cursor: default; }
.menubar span:hover { background: #32322a; }

.toolbar {
  display: flex; align-items: center; gap: 2px;
  padding: 3px 6px; background: #1c1c1a; border-bottom: 1px solid var(--border);
}
.tbtn2 {
  width: 26px; height: 22px; position: relative;
  background: #1c1c1a; border: 1px solid transparent;
  cursor: pointer; display: grid; place-items: center;
}
.tbtn2:hover { background: #2e2e24; border-color: var(--border); }
.tbtn2.act { background: #46462c; border-color: var(--ghost); }
.toolbar .sep {
  width: 1px; height: 16px; background: #34342c; margin: 0 5px;
}
.zoomlabel { font-size: 11px; color: var(--text-dim); min-width: 42px; text-align: center; }

/* primitive icons drawn with CSS shapes */
.ic { display: block; }
.ic-play {
  width: 0; height: 0;
  border-left: 9px solid var(--text);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  margin-left: 2px;
}
.ic-stop { width: 11px; height: 11px; background: var(--text); }
.ic-rec { width: 10px; height: 10px; background: var(--warn); }
.ic-rew, .ic-fwd { width: 0; height: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.ic-rew { border-right: 9px solid var(--text); border-left: 0; }
.ic-fwd { border-left: 9px solid var(--text); border-right: 0; }
.ic-select {
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 11px solid var(--text);
  transform: rotate(38deg);
}
.ic-knife {
  width: 3px; height: 13px; background: var(--text);
  transform: rotate(45deg);
  box-shadow: 3px 3px 0 0 var(--bg-alt);
}
.ic-loop, .ic-rev {
  border: 2px solid var(--text); border-top-color: transparent;
  width: 13px; height: 13px; position: relative;
}
.ic-rev { transform: rotate(180deg); }
.ic-zoomin, .ic-zoomout, .ic-gear { position: relative; }
.ic-zoomin::before, .ic-zoomout::before {
  content: ""; position: absolute; left: 4px; top: 10px; width: 11px; height: 3px;
  background: var(--text);
}
.ic-zoomin::after {
  content: ""; position: absolute; left: 8px; top: 6px; width: 3px; height: 11px;
  background: var(--text);
}
.ic-gear::before {
  content: ""; position: absolute; left: 5px; top: 5px; width: 12px; height: 12px;
  border: 2px solid var(--text);
}
.ic-gear::after {
  content: ""; position: absolute; left: 9px; top: 9px; width: 4px; height: 4px;
  background: var(--text);
}

/* ---- workspace ---- */
.workspace { display: flex; min-height: 320px; }

.hdrs { width: 148px; flex: none; background: var(--bg-alt); border-right: 1px solid var(--border); }
.hdr {
  height: 52px; border-bottom: 1px solid #2a2a24;
  padding: 6px 8px; position: relative;
}
.hdr .tname { font-size: 12px; }
.hdr .thue { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.hdr .tbtns { display: flex; gap: 3px; margin-top: 5px; }
.hdr .tb {
  width: 17px; height: 14px; font-size: 10px;
  display: grid; place-items: center;
  background: var(--panel-alt); border: 1px solid var(--border);
  color: var(--text-dim); cursor: default;
}
.hdr .tb:hover { color: var(--text); border-color: var(--ghost); }
.hdr .tb.on { background: var(--accent-dim); color: var(--text); }

.arr { flex: 1; position: relative; overflow: hidden; background: var(--lane); }
.ruler {
  height: 24px; position: relative;
  background: var(--panel-alt); border-bottom: 1px solid var(--border);
}
.ruler .tick { position: absolute; bottom: 0; width: 1px; height: 6px; background: var(--grid); }
.ruler .tick.big { height: 11px; background: var(--ghost); }
.ruler .lbl {
  position: absolute; top: 3px; font-size: 10px; color: var(--text-dim);
}
.ruler .loopband {
  position: absolute; top: 0; bottom: 0;
  background: rgba(223,223,79,0.08);
  border-left: 2px solid var(--ghost); border-right: 2px solid var(--ghost);
}

.lanes { position: relative; height: 260px; overflow: hidden; }
.lane { height: 52px; border-bottom: 1px solid #26261f; position: relative; }
.lane .gl { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(74,72,56,0.35); }

/* clips */
.clip {
  position: absolute; top: 3px; height: 46px;
  background: var(--clip);
  border: 1px solid var(--clip-border);
  cursor: pointer;
  box-shadow: 2px 3px 0 0 rgba(8,10,14,0.43); /* cozy bed shadow */
}
.clip:hover { box-shadow: 2px 3px 0 0 rgba(8,10,14,0.43), 0 0 0 1px rgba(255,255,255,0.04); }
.clip.sel {
  border-color: var(--clip-sel);
  box-shadow: 2px 3px 0 0 rgba(8,10,14,0.43), 0 0 0 2px rgba(255,206,96,0.08);
}
.clip .wav { position: absolute; left: 1px; right: 1px; top: 4px; bottom: 3px; opacity: 0.85; }
.clip .cname {
  position: absolute; left: 4px; top: 2px; font-size: 10px;
  color: var(--text); text-shadow: 0 1px 0 #000;
  white-space: nowrap; overflow: hidden; max-width: 90%;
}
.clip.sel .cname { color: var(--clip-sel); }

/* fade corner triangles - always visible, like the DAW */
.fade {
  position: absolute; top: 1px; width: 0; height: 0;
}
.fade.in {
  left: 1px; border-top: 11px solid var(--wedge);
  border-right: 11px solid transparent;
}
.fade.out {
  right: 1px; border-top: 11px solid var(--wedge);
  border-left: 11px solid transparent;
}
.fade.big.in { border-top-width: 0; border-right-width: 0; border-left: 0; }
.fade.big.in {
  border-top: 14px solid var(--wedge);
  border-right: 22px solid transparent;
}
.fade.big.out {
  border-top: 14px solid var(--wedge);
  border-left: 22px solid transparent;
}

/* playhead + knife */
.playhead {
  position: absolute; top: -24px; bottom: 0; width: 1px;
  background: var(--accent); z-index: 30; pointer-events: none;
}
.playhead i {
  position: absolute; top: 0; left: -4px; width: 0; height: 0;
  border-top: 8px solid var(--accent);
  border-left: 5px solid transparent; border-right: 5px solid transparent;
}
.knife {
  position: absolute; top: -24px; bottom: 0; width: 1px;
  background: #ffaa3c; z-index: 29; pointer-events: none;
  box-shadow: 0 0 6px 1px rgba(255,170,60,0.35);
  display: none;
}
.knife.on { display: block; }

.statusbar {
  display: flex; gap: 18px; align-items: center;
  padding: 3px 10px; font-size: 11px; color: var(--text-dim);
  background: #121211; border-top: 1px solid var(--border);
}
.statusbar b { color: var(--accent); font-weight: 400; }
.statusbar .right { margin-left: auto; }

.cap { color: var(--text-dim); font-size: 12px; margin-top: 8px; }
.cap kbd { font-size: 11px; }

/* ---- sections ---- */
section { max-width: 1060px; margin: 44px auto; padding: 0 18px; }
section h2 {
  font-size: 18px; margin-bottom: 14px; color: var(--text);
  border-left: 4px solid var(--accent); padding-left: 10px;
}

.grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
}
.card {
  background: var(--panel); border: 1px solid var(--border);
  padding: 12px 14px;
}
.chead {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 6px;
}
.dot { width: 8px; height: 8px; display: inline-block; }
.dot.ok { background: var(--accent); }
.card p { color: var(--text); font-size: 12px; }

.specs { width: 100%; border-collapse: collapse; border: 1px solid var(--border); }
.specs td {
  border-bottom: 1px solid #2a2a24; padding: 6px 12px; font-size: 12px;
}
.specs tr:last-child td { border-bottom: 0; }
.specs td:first-child { color: var(--text-dim); width: 180px; }

.cta { text-align: left; }
.btn {
  display: inline-block; margin: 6px 0 16px;
  background: var(--accent); color: var(--bg-alt);
  font-weight: 700; padding: 8px 22px; font-size: 13px;
}
.btn:hover { background: #ffff66; text-decoration: none; }
.term {
  background: var(--bg-alt); border: 1px solid var(--border);
  padding: 12px 14px; font-size: 12px; color: var(--text);
  overflow-x: auto;
}

footer {
  display: flex; gap: 18px; align-items: center;
  max-width: 1060px; margin: 40px auto 30px; padding: 14px 18px 0;
  border-top: 1px solid var(--border);
  color: var(--text); font-size: 12px;
}
footer .dim { color: var(--text-dim); }

@media (max-width: 720px) {
  .hero h1 { font-size: 22px; }
  .hdrs { width: 96px; }
  .hdr .tbtns { display: none; }
}
