/* owlhost client area - tokens, base, shared components.
   Dark, minimal, monochrome. Status by shape (diamonds), never by colour. */

:root {
  --bg: #0a0a0b;
  --surface: #0d0d0f;
  --surface-2: #111114;
  --line-0: #1a1a1e;
  --line-1: #18181c;
  --line-2: #1f1f24;
  --line-3: #26262b;
  --line-4: #2e2e33;
  --line-5: #3a3a40;
  --text: #ededeb;
  --text-prose: #b9b9b4;
  --text-muted: #8b8b87;
  --text-dim: #5c5c58;
  --text-fade: #6e6e69;

  --font-display: 'Space Grotesk', Inter, system-ui, sans-serif;
  --font-body: Inter, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: clamp(20px, 4vw, 56px);
  --gutter-app: clamp(16px, 3vw, 40px);
  --ease: cubic-bezier(.3, 0, .2, 1);
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--bg); color-scheme: dark; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
}

a { color: var(--text); }
a:hover { color: #fff; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 1px solid var(--text); outline-offset: 4px; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- cursor: the normal one, a hand over anything clickable ---------- */

a[href], button:not(:disabled), summary, label[for], select, [role="button"], [data-href], input[type="checkbox"], input[type="radio"], input[type="range"], input[type="file"] { cursor: pointer; }
button:disabled, .btn:disabled { cursor: default; }
textarea { cursor: text; }

/* ---------- type ---------- */

.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }

.grad-d {
  background: linear-gradient(100deg, #ededeb 0%, #ededeb 40%, var(--text-fade) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.grad-v {
  background: linear-gradient(180deg, #ededeb 0%, #ededeb 45%, rgba(237, 237, 235, .38) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.label {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; color: var(--text-muted);
}
.eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .05em; color: var(--text-muted);
}

/* ---------- top bar / footer ---------- */

.topbar {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
  padding: 20px var(--gutter-app);
  border-bottom: 1px solid var(--line-0);
}
.topbar-plain { border-bottom: 0; padding: 28px var(--gutter) 0; }

.crumbs {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: .04em;
}
.crumbs a, .crumbs .wordmark { color: var(--text); text-decoration: none; padding: 12px 0; }
.crumbs a.crumb { color: var(--text-muted); padding: 12px 0; transition: color .2s ease; }
.crumbs a.crumb:hover { color: var(--text); }
.crumbs .current { color: var(--text-muted); }
.crumbs .sep { width: 1px; height: 16px; background: #2a2a2f; }
.crumbs .slash { color: var(--text-dim); }

.topbar-user { display: flex; align-items: center; gap: 14px; }
.user-link { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); }
.user-text { display: flex; flex-direction: column; gap: 2px; line-height: 1.2; }
.user-name { font-size: 14px; font-weight: 500; }
.user-mail { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }

.hex {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.avatar {
  width: 36px; height: 36px; background: #1f1f23;
  font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: .02em;
}

.site-footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 0 var(--gutter) 28px;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-muted);
}
.site-footer a { color: var(--text-muted); text-decoration: none; transition: color .2s ease; }
.site-footer a:hover { color: var(--text); }
.site-footer-app {
  width: 100%; max-width: 1360px; margin: 0 auto;
  padding: 20px var(--gutter-app) 28px; border-top: 1px solid var(--line-0);
}

.page-main { flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; padding: 24px var(--gutter-app) 48px; }
.page-main-center {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 40px var(--gutter) 64px;
}

/* ---------- buttons ---------- */

.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 52px; padding: 0 26px;
  border: 1px solid var(--line-5); border-radius: 999px; background: transparent; color: var(--text);
  font-family: var(--font-mono); font-size: 14px; letter-spacing: .03em; text-decoration: none; white-space: nowrap;
  transition: background .25s ease, color .25s ease, border-color .25s ease, transform .15s ease;
}
.btn:active { transform: scale(.97); }
.btn:disabled { cursor: default; }
.btn-solid { border: 0; background: var(--text); color: var(--bg); }
.btn-solid:hover { background: #fff; color: var(--bg); }
.btn-ghost { border-color: var(--line-4); }
.btn-ghost:hover { border-color: var(--text); color: var(--text); }
.btn-fill:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: 12px; gap: 10px; }
.btn-xs { min-height: 36px; padding: 0 12px; font-size: 12px; }
.btn-block { width: 100%; }

.link-btn {
  min-height: 44px; padding: 0 10px; border: 0; background: transparent;
  color: var(--text-muted); font-family: var(--font-mono); font-size: 12px;
  text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--text); }

.arrow, .icon {
  flex: none; display: block; fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.btn:hover .arrow, .go-row:hover .arrow { animation: nudge .9s ease-in-out infinite; }
.arrow-back { }
.btn:hover .arrow-back { animation-name: nudge-back; }
@keyframes nudge { 0%, 100% { translate: 0 0; } 50% { translate: 4px 0; } }
@keyframes nudge-back { 0%, 100% { translate: 0 0; } 50% { translate: -4px 0; } }

/* send animation: a white layer fills left to right and inverts the text */
.btn-send .send-fill {
  position: absolute; inset: 0; background: var(--text); mix-blend-mode: difference;
  transform-origin: left center; transform: scaleX(0); pointer-events: none;
  transition: transform .8s cubic-bezier(.6, 0, .2, 1);
}
.btn-send .arrow { transition: transform .35s cubic-bezier(.5, 0, .2, 1); }
.btn-send.is-sending .send-fill { transform: scaleX(1); }
.btn-send.is-sending .arrow { transform: translateX(22px); animation: none; }

/* sign-in style: spinner + shimmer, then a drawn check */
.btn .band {
  position: absolute; top: 0; bottom: 0; left: 0; width: 40%; pointer-events: none;
  background: linear-gradient(90deg, rgba(10, 10, 11, 0), rgba(10, 10, 11, .12), rgba(10, 10, 11, 0));
  animation: band 1.1s ease-in-out infinite;
}
@keyframes band { from { transform: translateX(-120%); } to { transform: translateX(320%); } }
.spin {
  display: inline-block; width: 14px; height: 14px;
  border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.pop { animation: pop .35s ease-out both; }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
.tick { stroke-dasharray: 24; animation: tick .4s .1s ease-out both; }
@keyframes tick { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
.fade-in { animation: fade-in .3s ease-out both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- forms ---------- */

.field-group { display: flex; flex-direction: column; gap: 8px; }
.field {
  width: 100%; min-height: 48px; padding: 0 14px;
  background: var(--bg); border: 1px solid var(--line-3); border-radius: 4px;
  color: var(--text); font-size: 15px;
  transition: border-color .2s ease;
}
textarea.field { padding: 14px; min-height: 0; border-radius: 6px; line-height: 1.55; resize: vertical; }
.field:focus { outline: none; border-color: var(--text); }
.field::placeholder { color: var(--text-dim); }
.field[aria-invalid='true'] { border-color: var(--text-muted); }
.field:disabled, .field[readonly] { color: var(--text-muted); }

.check { display: flex; align-items: center; gap: 10px; min-height: 32px; font-size: 14px; color: var(--text-muted); }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--text); }

/* ---------- tiles, rows ---------- */

.tile {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px;
}
.tile-list { padding: 24px 0 8px; display: flex; flex-direction: column; gap: 12px; }
.tile-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 0 24px; }
.tile-title { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 20px; letter-spacing: -.01em; }
.tile-meta { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
a.tile-meta { text-decoration: none; padding: 6px 0; }
a.tile-meta:hover { color: var(--text); }

.row { transition: background .2s ease; }
.row:hover { background: var(--surface-2); }
.go { transition: transform .2s ease, color .2s ease; color: var(--text-dim); }
.row:hover .go { transform: translateX(3px); color: var(--text); }

.scroll {
  scrollbar-width: thin; scrollbar-color: var(--line-4) transparent;
  overflow-y: auto;
}
/* fade out at the bottom only while there is more below (home.js sets .has-more) */
.scroll.has-more {
  padding-bottom: 24px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 48px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 48px), transparent 100%);
}
.scroll::-webkit-scrollbar { width: 6px; }
.scroll::-webkit-scrollbar-thumb { background: var(--line-4); border-radius: 3px; }
.scroll:focus-visible { outline: 1px solid var(--line-5); outline-offset: -1px; }

.tag {
  display: inline-block; padding: 2px 8px; border: 1px solid var(--line-4); border-radius: 2px;
  font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); white-space: nowrap;
}
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 2px;
  background: var(--text); color: var(--bg); font-family: var(--font-mono); font-size: 11px;
}

/* diamonds: filled = ok / done / unread, outlined = maintenance / pending, striped = degraded */
.diamond {
  flex: none; display: inline-block; width: 8px; height: 8px;
  transform: rotate(45deg); background: var(--text); border: 1.5px solid var(--text);
}
.diamond-sm { width: 6px; height: 6px; border-width: 0; }
.diamond.is-outline { background: transparent; }
/* a small outlined diamond has no fill, so it needs its border (it was invisible, which left a gap) */
.diamond-sm.is-outline { border-width: 1px; }
.diamond.is-read { background: var(--line-3); border-color: var(--line-3); }
.diamond.is-dim { background: var(--line-4); border-color: var(--line-4); }
.diamond.is-striped {
  background: repeating-linear-gradient(135deg, var(--text) 0 2px, transparent 2px 4px);
}
.pulse { animation: pulse 2.4s ease-out infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(237, 237, 235, .35); }
  70% { box-shadow: 0 0 0 9px rgba(237, 237, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(237, 237, 235, 0); }
}

/* ---------- the owl ---------- */

.owl { display: block; width: 100%; height: 100%; }
.owl [data-owl-iris], .owl [data-owl-pupil] { will-change: transform; }
.owl [data-owl-brow] { transition: transform .4s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  .pulse, .fade-in, .tick, .pop, .band, .spin { animation: none; }
  .btn-send .send-fill { transition: none; }
}

/* wings: down by default, up over the eyes (cover), a gap to peek through (peek) */
.owl-wing { transform-box: view-box; transition: transform .45s cubic-bezier(.3, .1, .2, 1); transform: translateY(300px); }
.owl-wing-l { transform-origin: 168px 470px; }
.owl-wing-r { transform-origin: 432px 470px; }
.owl[data-wings='cover'] .owl-wing { transform: translateY(0); }
.owl[data-wings='peek'] .owl-wing-l { transform: translate(-46px, 118px) rotate(-10deg); }
.owl[data-wings='peek'] .owl-wing-r { transform: translate(46px, 118px) rotate(10deg); }
.owl-lid { transition: transform .5s cubic-bezier(.3, 0, .2, 1); }
@media (prefers-reduced-motion: reduce) { .owl-wing, .owl-lid { transition: none; } }
.owl-piece { transform-box: fill-box; transform-origin: center; }
.owl-ghosts { transition: opacity .3s ease; }

/* one-line form feedback (errors and small notes) used by the pages that talk to the server */
.form-note { margin: 10px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted, #8b8b87); }
.form-note.is-error { color: var(--text); }
.form-note.is-error::before { content: "◆ "; }
.signout-form { display: contents; }

/* text areas can be dragged taller, but only so far */
textarea { resize: vertical; min-height: 88px; max-height: 360px; }
