/* Two Witness — the house stylesheet.
   In the Tent register (deploy.morado.dev): ordered space, shadow rings
   instead of borders, concentric radii, one accent, restraint. */

:root {
  --ground: #f3f3f1;
  --surface: #ffffff;
  --panel: #fafaf9;
  --ink: #1c1c1a;
  --ink-2: #44443e;
  --muted: #6b6b66;
  --accent: #7a4a12;
  --primary: #26261f;
  --primary-hover: #3a3a32;
  --hover: #f0f0ee;
  --select: #ece9df;
  --ok-bg: #e7f4e4;
  --err-bg: #fbe7e7;
  --warn-bg: #fdf3d8;
  --ring: 0 0 0 1px oklch(0 0 0 / 0.06), 0 1px 2px -1px oklch(0 0 0 / 0.06), 0 2px 4px 0 oklch(0 0 0 / 0.04);
  --ring-hover: 0 0 0 1px oklch(0 0 0 / 0.08), 0 1px 2px -1px oklch(0 0 0 / 0.08), 0 2px 4px 0 oklch(0 0 0 / 0.06);
  --ring-inset: inset 0 0 0 1px oklch(0 0 0 / 0.05), inset 0 1px 2px 0 oklch(0 0 0 / 0.03);
  --ring-field: inset 0 0 0 1px oklch(0 0 0 / 0.09), inset 0 1px 2px 0 oklch(0 0 0 / 0.04);
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-enter: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
* {
  box-sizing: border-box;
}
::selection {
  background: var(--select);
}
body {
  font-family: ui-sans-serif, system-ui, sans-serif;
  background: var(--ground);
  color: var(--ink);
  margin: 0;
  padding: 32px 16px 64px;
  font-size: .875rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
main {
  max-width: 880px;
  margin: 0 auto;
}
main.narrow {
  max-width: 400px;
  margin-top: 6vh;
}
h1 {
  font-size: 1.375rem;
  line-height: 1.25;
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.sub {
  color: var(--muted);
  font-size: .8125rem;
  line-height: 1.55;
  margin-top: 4px;
  text-wrap: pretty;
}

/* surfaces: a white shell, a concentric panel inside */
.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 16px;
  box-shadow: var(--ring);
  padding: 8px 8px 8px 12px;
  margin-bottom: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brandtile {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .875rem;
  flex: none;
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.12), 0 1px 2px oklch(0 0 0 / 0.25);
}
.brandname {
  display: block;
  font-weight: 650;
  font-size: .9375rem;
  line-height: 1.2;
}
.brandsub {
  display: block;
  color: var(--muted);
  font-size: .6875rem;
  line-height: 1.3;
}
.doors {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: none;
}
.card {
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 20px;
  box-shadow: var(--ring);
  padding: 8px;
  margin-top: 16px;
  transition: box-shadow 150ms ease-out;
}
.card:hover {
  box-shadow: var(--ring-hover);
}
.panel {
  background: var(--panel);
  border-radius: 12px;
  box-shadow: var(--ring-inset);
  padding: 16px;
}
.cardtitle {
  font-size: .75rem;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 650;
  margin-bottom: 16px;
}
a {
  color: var(--accent);
}

/* entrance: staggered, and gone for those who ask for stillness */
@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(8px);
    filter: blur(8px);
  }
}
.enter {
  animation: enter 700ms var(--ease-enter) both;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .6875rem;
  line-height: 1.45;
  padding: 2px 8px 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: 2px;
  box-shadow: inset 0 0 0 1px oklch(0 0 0 / 0.05);
}
.pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8a8a84;
  flex: none;
}
.pill.running {
  background: var(--ok-bg);
}
.pill.running .dot {
  background: #2e7d32;
}
.pill.deploying {
  background: var(--warn-bg);
}
.pill.deploying .dot {
  background: #a16207;
}
.pill.inactive {
  background: #eee;
}

button,
.btn {
  font: inherit;
  font-size: .8125rem;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--surface);
  box-shadow: var(--ring);
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: box-shadow 150ms ease-out, background-color .12s var(--ease), transform .12s
    var(--ease);
}
button:active,
.btn:active {
  transform: scale(0.96);
}
@media (hover: hover) {
  button:hover,
  .btn:hover {
    box-shadow: var(--ring-hover);
  }
}
button.primary,
.btn.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px oklch(0 0 0 / 0.3), inset 0 1px 0 oklch(1 0 0 / 0.08);
}
@media (hover: hover) {
  button.primary:hover,
  .btn.primary:hover {
    background: var(--primary-hover);
  }
}
button.ghost,
.btn.ghost {
  background: transparent;
  box-shadow: none;
}
@media (hover: hover) {
  button.ghost:hover,
  .btn.ghost:hover {
    background: var(--hover);
    box-shadow: none;
  }
}
button.sm {
  height: 32px;
  padding: 0 12px;
}
button.block,
.btn.block {
  width: 100%;
  justify-content: center;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

form.inline {
  display: inline;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}
label {
  display: block;
  font-size: .75rem;
  margin: 16px 0 4px;
  color: var(--ink-2);
}
label:first-child {
  margin-top: 0;
}
input,
select {
  font: inherit;
  font-size: .875rem;
  height: 40px;
  padding: 8px 10px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--ring-field);
}
input:focus,
select:focus {
  outline: none;
  box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px rgba(122, 74, 18, 0.15);
}
td select {
  width: auto;
  height: 32px;
  font-size: .8125rem;
}
textarea {
  font: inherit;
  font-size: .875rem;
  padding: 8px 10px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--ring-field);
  resize: vertical;
}
textarea:focus {
  outline: none;
  box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px rgba(122, 74, 18, 0.15);
}
@media (max-width: 640px) {
  input,
  select,
  textarea {
    font-size: 16px;
  } /* iOS zooms the page below 16px */
  td select {
    font-size: 16px;
  }
}

.msg {
  border-radius: 12px;
  padding: 12px 16px;
  font-size: .875rem;
  margin-top: 16px;
  line-height: 1.45;
  text-wrap: pretty;
  box-shadow: var(--ring);
  border: 1px solid transparent;
}
.panel .msg:first-child {
  margin-top: 0;
}
.msg.ok {
  background: var(--ok-bg);
}
.msg.err {
  background: var(--err-bg);
}
.warn {
  background: var(--warn-bg);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: .875rem;
  margin-top: 16px;
  line-height: 1.45;
  box-shadow: var(--ring);
  border: 1px solid transparent;
}

.tablewrap {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: .8125rem;
  font-variant-numeric: tabular-nums;
}
th {
  text-align: left;
  padding: 8px;
  color: var(--muted);
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid oklch(0 0 0 / 0.06);
  font-weight: 650;
}
td {
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid oklch(0 0 0 / 0.04);
  vertical-align: top;
  overflow-wrap: anywhere;
}
tr:last-child td {
  border-bottom: none;
}
@media (hover: hover) {
  tr:hover td {
    background: oklch(0 0 0 / 0.015);
  }
}
.meta {
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.5;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 16px 24px;
}
.stat .k {
  font-size: .6875rem;
  line-height: 1.45;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.stat .v {
  font-size: .9375rem;
  line-height: 1.6;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* repos */
.mono {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: .8125rem;
  overflow-wrap: anywhere;
}

/* packages */
.snippet {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: .8125rem;
  line-height: 1.6;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--ring-inset);
  padding: 12px 16px;
  margin: 0;
  overflow-x: auto;
  white-space: pre;
}

/* the sharing room */
.roomcode {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: .14em;
  font-weight: 650;
}
.linkrow {
  display: flex;
  gap: 8px;
  align-items: center;
}
.linkrow input {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: .75rem;
}
.linkrow button {
  flex: none;
}
.seal {
  margin-top: 16px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--ring-inset);
  padding: 12px 16px;
}
.seal .k {
  font-size: .6875rem;
  line-height: 1.45;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.seal .v {
  font-size: 1.0625rem;
  line-height: 1.5;
  font-weight: 650;
  letter-spacing: .01em;
  margin-top: 2px;
}
.seal .meta {
  margin-top: 4px;
}
.stream {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stream li {
  padding: 8px 12px;
  border-radius: 10px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.stream li.me {
  background: var(--select);
  align-self: flex-end;
  max-width: 88%;
}
.stream li.them {
  background: var(--surface);
  box-shadow: var(--ring-inset);
  align-self: flex-start;
  max-width: 88%;
}
.stream li.sys {
  color: var(--muted);
  font-size: .75rem;
  text-align: center;
  padding: 2px 12px;
}
.stream li.file {
  background: var(--panel);
  box-shadow: var(--ring-inset);
  font-size: .8125rem;
}
.progress {
  height: 6px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--ring-inset);
  overflow: hidden;
  margin-top: 16px;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
  transition: width .2s var(--ease);
}
