/* ============ Conifer demo — shared design tokens & primitives ============ */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --bg: #EADDC6;
  --bg-2: #E4D6BC;
  --panel: #F0E8D8;          /* lighter card surface */
  --panel-2: #EFE7D6;
  --ink: #1B1A15;
  --ink-soft: #38352B;
  --muted: #8C8369;
  --muted-2: #A79D80;
  --line: #CFC4A8;           /* warm hairline */
  --line-2: #DBD1B6;
  --rule: #1B1A15;           /* strong black box rule */
  --blue: #1C7FBE;
  --blue-deep: #176497;
  --green: #4E8E61;
  --amber: #B5853A;
  --shadow: 0 1px 0 rgba(27,26,21,.04);

  --sans: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* dotted grid texture used on cards/screens */
.dotgrid {
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 10px 10px;
  background-position: -1px -1px;
}

/* ---- Stage scaffolding ---- */
.viewport {
  position: fixed; inset: 0;
  overflow: hidden;
  background: transparent;
}
#frame {
  position: absolute;
  top: 50%; left: 50%;
  width: 1000px; height: 1000px;
  transform-origin: center center;
  transform: translate(-50%, -50%) scale(1);
  overflow: hidden;
}
#camera {
  position: absolute; inset: 0;
  transform-origin: 0 0;
  will-change: transform;
}

/* ---- Cursor ---- */
#cursor {
  position: absolute; left: 500px; top: 540px;
  width: 26px; height: 26px;
  margin: -3px 0 0 -3px;
  z-index: 9000; pointer-events: none;
  transition: transform .09s ease;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.28));
}
#cursor.down { transform: scale(.82); }
.click-ripple {
  position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border: 1.5px solid var(--ink); border-radius: 50%;
  z-index: 8999; pointer-events: none;
  animation: ripple .5s ease-out forwards;
}
@keyframes ripple {
  from { transform: scale(.3); opacity: .7; }
  to   { transform: scale(3.6); opacity: 0; }
}

/* caret */
.caret {
  display: inline-block; width: 2px; height: 1.05em;
  background: var(--ink); margin-left: 1px;
  vertical-align: -0.16em;
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---- Mono label primitive ---- */
.kicker {
  font-family: var(--mono);
  font-size: 13px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted);
}

/* ---- Button primitive (matches site) ---- */
.btn {
  font-family: var(--mono); font-size: 18px; letter-spacing: .02em;
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  padding: 16px 30px;
  display: inline-flex; align-items: center; gap: 10px;
  cursor: default; user-select: none;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .12s ease;
}
.btn.ghost { border-color: var(--line); color: var(--muted); }
.btn.press { transform: translateY(1px); }
.btn.solid { background: var(--ink); color: var(--bg); }

/* generic window chrome (brand-native, minimal) */
.win {
  background: var(--panel);
  border: 1.5px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 26px 60px -30px rgba(27,26,21,.55);
}
.win-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 13px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
}
.win-dots { display: flex; gap: 6px; }
.win-dots i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--muted); display: block; }

/* fine corner ticks like the hero frame */
.ticks::before, .ticks::after,
.ticks > .tick-tr, .ticks > .tick-bl {
  content: ""; position: absolute; width: 12px; height: 12px;
  border: 1.5px solid var(--ink); pointer-events: none;
}
.ticks { position: relative; }
.ticks::before { left: 0; top: 0; border-right: 0; border-bottom: 0; }
.ticks::after { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.ticks > .tick-tr { right: 0; top: 0; border-left: 0; border-bottom: 0; }
.ticks > .tick-bl { left: 0; bottom: 0; border-right: 0; border-top: 0; }

/* status dot */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.green { background: var(--green); box-shadow: 0 0 0 0 rgba(78,142,97,.5); animation: pulse 1.8s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(78,142,97,.5); }
  70% { box-shadow: 0 0 0 7px rgba(78,142,97,0); }
  100% { box-shadow: 0 0 0 0 rgba(78,142,97,0); }
}

.mono { font-family: var(--mono); }
.blue { color: var(--blue); }
.tnum { font-variant-numeric: tabular-nums; }

/* ---- Dark theme (synced from the embedding site via postMessage) ---- */
:root[data-theme="dark"] {
  --bg: #15130E;
  --bg-2: #1B1812;
  --panel: #201D16;
  --panel-2: #25221A;
  --ink: #ECE6D8;
  --ink-soft: #C8C0AD;
  --muted: #8C8369;
  --muted-2: #6E6750;
  --line: #36322A;
  --line-2: #423D31;
  --rule: #ECE6D8;
}
