/* kuratert. One design, dark: black ground, a pale mint front, a brighter
   mint for what can be touched. Hierarchy is the front at lower strength,
   never another colour; lines are hairlines; nothing has a box unless it
   floats. After workchunk-timeline and mucalc.editor. */

@font-face {
  font-family: "k Nunito";
  src: url("/fonts/nunito-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ground: #000;
  --front: #f1ffed;
  --emph: #b2ffed;
  --line: #2a2d2a;
  --dim: color-mix(in srgb, var(--front) 55%, transparent);
  --faint: color-mix(in srgb, var(--front) 38%, transparent);
  --font: "k Nunito", system-ui, sans-serif;
  --mono: ui-monospace, monospace;
  --measure: 640px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--ground);
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--front);
  font: 15px/1.45 var(--font);
  letter-spacing: -0.02em;
  -webkit-tap-highlight-color: transparent;
}

::selection { background: color-mix(in srgb, var(--emph) 30%, transparent); }

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--front) 35%, transparent);
  text-underline-offset: 2px;
}

a:hover { text-decoration-color: var(--emph); }

button {
  all: unset;
  cursor: pointer;
}

button:focus-visible, a:focus-visible {
  outline: 1px solid var(--emph);
  outline-offset: 2px;
}

code, kbd {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0;
}

kbd {
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
}

/* ------------------------------------------------------------------- bar */

.bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  position: sticky;
  top: 0;
  z-index: 5;
  padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(4px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: var(--ground);
}

.bar h1 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.back, .bar-link {
  flex: none;
  display: grid;
  place-items: center;
  min-height: 44px;
  color: var(--emph);
  text-decoration: none;
}

.back {
  width: 40px;
  padding-bottom: 3px;
  font-size: 24px;
  line-height: 1;
}

.bar-link {
  padding: 0 8px;
  font-size: 13px;
}

/* ------------------------------------------------------------------ chat */

body.chat {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--visible-height, 100dvh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

chat-log {
  flex: 1;
  min-height: 0;
  display: block;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 8px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
}

#log {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  max-width: var(--measure);
  min-height: 100%;
  margin: 0 auto;
}

/* A run of messages from one person starts with a head: who, and when. */

.message { margin-top: 22px; }
.message.continues { margin-top: 6px; }

.head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 2px;
  color: var(--dim);
  font-size: 12px;
}

.head b {
  color: var(--front);
  font-size: 13px;
  font-weight: 700;
}

.message.mine .head b { color: var(--dim); font-weight: 400; }

.head time {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.bubble {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message.mine .bubble { color: color-mix(in srgb, var(--front) 82%, transparent); }

.message.flash { animation: flash 1.6s ease-out; }

@keyframes flash {
  from { background: color-mix(in srgb, var(--emph) 14%, transparent); }
  to { background: transparent; }
}

.day {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 30px 0 4px;
  color: var(--faint);
  font-size: 12px;
}

.day::before {
  content: "";
  width: 12px;
  height: 1px;
  background: var(--emph);
}

.hint {
  margin: 0;
  color: var(--dim);
  font-size: 13px;
}

#log > .hint { margin-top: 22px; }

/* A film named in a sentence. */

.chip {
  color: var(--emph);
  text-decoration: none;
}

.year {
  color: var(--faint);
  font-size: 0.87em;
  font-variant-numeric: tabular-nums;
}

/* A message that is only films. */

.cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card {
  display: flex;
  flex-direction: column;
  padding-left: 12px;
  border-left: 1px solid var(--emph);
  text-decoration: none;
}

.card-kind {
  color: var(--faint);
  font-size: 11px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.card-description {
  margin-top: 2px;
  color: var(--dim);
  font-size: 13px;
}

.new-messages {
  display: none;
  position: sticky;
  bottom: 8px;
  margin: 12px auto 0;
  padding: 6px 12px;
  border: 1px solid var(--emph);
  border-radius: 3px;
  background: var(--ground);
  color: var(--emph);
  font-size: 13px;
}

chat-log.has-new .new-messages { display: block; width: fit-content; }

/* -------------------------------------------------------------- composer */

kuratert-composer {
  flex: none;
  display: block;
  position: relative;
  padding: 0 max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  background: var(--ground);
}

.composer-row {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  max-width: calc(var(--measure) + 16px);
  margin: 0 auto;
}

.editor {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  max-height: 38vh;
  overflow-y: auto;
  position: relative;
  padding: 13px 4px;
  font-size: 16px; /* smaller makes iOS zoom in on focus */
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  caret-color: var(--emph);
  outline: none;
}

.editor.empty::before {
  content: attr(data-placeholder);
  position: absolute;
  color: var(--faint);
  pointer-events: none;
}

.editor .chip { cursor: default; user-select: all; }

.mention-button, .send {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 48px;
  color: var(--emph);
}

.mention-button {
  padding-bottom: 2px;
  font-size: 18px;
}

.send:disabled { color: var(--line); cursor: default; }

#suggestions { display: none; }

kuratert-composer.suggesting #suggestions:not(:empty) {
  display: flex;
  flex-direction: column;
  max-width: var(--measure);
  max-height: 46vh;
  margin: 0 auto;
  padding: 6px 0;
  overflow-y: auto;
  border-bottom: 1px solid var(--line);
}

.suggestion {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 44px;
  padding: 5px 8px 5px 12px;
  border-left: 1px solid transparent;
}

.suggestion.active, .suggestion:active {
  border-left-color: var(--emph);
  color: var(--emph);
}

.suggestion-title { font-weight: 700; }

.suggestion-description {
  overflow: hidden;
  color: var(--dim);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.no-suggestions {
  margin: 0;
  padding: 10px 12px;
  color: var(--dim);
  font-size: 13px;
}

/* ---------------------------------------------------------------- invite */

.invite {
  margin-top: 22px;
  color: var(--dim);
  font-size: 13px;
}

.invite p { margin: 0 0 6px; }

.invite .invite-lead {
  color: var(--front);
  font-size: 15px;
  font-weight: 700;
}

share-link {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}

share-link code {
  color: var(--front);
  overflow-wrap: anywhere;
}

share-link button, .primary {
  display: inline-block;
  padding: 10px 0;
  color: var(--emph);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--emph) 40%, transparent);
  text-underline-offset: 3px;
}

share-link button:hover, .primary:hover { text-decoration-color: var(--emph); }

/* ----------------------------------------------------------------- pages */

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 24px max(16px, env(safe-area-inset-right)) 48px max(16px, env(safe-area-inset-left));
}

.welcome, .home { padding-top: max(48px, 12vh); }

.wordmark {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.wordmark::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 1px;
  margin: 0 10px 0.3em 0;
  vertical-align: middle;
  background: var(--emph);
}

.lead {
  margin: 0 0 28px;
  color: var(--dim);
}

form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

label {
  color: var(--faint);
  font-size: 11px;
}

input:not([type="hidden"]) {
  width: 100%;
  padding: 8px 0;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--front);
  font: 16px/1.4 var(--font); /* smaller makes iOS zoom in on focus */
  letter-spacing: -0.02em;
  caret-color: var(--emph);
  outline: none;
}

input:focus { border-bottom-color: var(--emph); }

form .primary { margin-top: 10px; }

.primary:disabled { color: var(--faint); cursor: default; }

.quiet {
  padding: 8px 0;
  color: var(--dim);
  font-size: 13px;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}

.quiet:hover { color: var(--front); }

.form-error {
  margin: 0;
  color: #ffca2c;
  font-size: 13px;
}

.form-error:empty { display: none; }

.welcome .hint { margin-top: 18px; }

/* Your page: name, passkeys, another device. */

.account { padding-top: 32px; }

.passkeys {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.passkeys li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 14px;
  min-height: 40px;
  border-bottom: 1px solid var(--line);
}

.passkey-here {
  color: var(--faint);
  font-size: 12px;
}

.account share-link { margin-top: 4px; }

section { margin-top: 40px; }

h2, h3 {
  margin: 0 0 10px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 400;
}

.rooms, .quotes, .film-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rooms a, .quotes a, .film-list a {
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.room-name { font-weight: 700; }

.room-snippet, .quote-meta {
  color: var(--dim);
  font-size: 13px;
}

.room-snippet {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rooms a:hover .room-name, .film-list a:hover .card-title { color: var(--emph); }

.quote-meta { font-size: 12px; }

.quote-text {
  margin-top: 2px;
  padding-left: 10px;
  border-left: 2px solid color-mix(in srgb, var(--front) 25%, transparent);
  color: color-mix(in srgb, var(--front) 85%, transparent);
  overflow-wrap: anywhere;
}

.film-list .quote-text { margin-top: 4px; }

.signed-in {
  margin-top: 48px;
  color: var(--faint);
  font-size: 12px;
}

/* A film's own page. */

.entity-title {
  margin: 8px 0 4px;
  color: var(--front);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.entity-title .year { font-size: 15px; font-weight: 400; }

.entity-description {
  margin: 0 0 14px;
  color: var(--dim);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 0;
  font-size: 13px;
}

.links a {
  padding: 6px 0;
  color: var(--emph);
  text-decoration: none;
}
