:root {
  --bg: #060907;
  --panel: #0a0f0c;
  --panel-2: #0d1410;
  --ink: #dbe7dd;
  --soft: #aebdb2;
  --muted: #7c8e81;
  --faint: #6b7d6f;
  --line: rgba(125, 255, 166, 0.14);
  --line-2: rgba(125, 255, 166, 0.28);
  --green: #62ffa2;
  --green-dim: #2b9a5c;
  --red: #ff7a6b;
  --mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

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

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(800px 520px at 10% -10%, rgba(98, 255, 162, 0.08), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--green);
  color: var(--bg);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.dot {
  width: 5px;
  height: 5px;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}

.muted {
  color: var(--muted);
  line-height: 1.6;
}

/* login */

.login-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  width: min(100%, 420px);
  padding: 34px;
  border: 1px solid var(--line-2);
  background:
    linear-gradient(150deg, rgba(18, 30, 22, 0.86), rgba(7, 11, 8, 0.9)),
    var(--panel);
  box-shadow: 0 40px 100px -60px #000;
}

.login-card .eyebrow {
  margin-bottom: 24px;
}

.login-card h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 58px;
  font-weight: 300;
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.login-card h1 span {
  color: var(--green);
}

.login-card .muted {
  margin: 16px 0 30px;
  font-family: var(--serif);
  font-size: 16px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #050806;
  color: var(--ink);
  outline: none;
}

input {
  padding: 13px 14px;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 13px;
}

input:focus,
textarea:focus {
  border-color: var(--green-dim);
  box-shadow: 0 0 0 1px var(--green-dim);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.button:hover {
  border-color: var(--green);
  color: var(--green);
}

.button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.button--primary {
  border-color: var(--green-dim);
  background: rgba(98, 255, 162, 0.08);
  color: var(--green);
}

.button--primary:hover {
  background: var(--green);
  color: var(--bg);
}

.button--quiet {
  border-color: var(--line);
  color: var(--muted);
}

.button--quiet:hover {
  border-color: var(--line-2);
}

.button--quiet.danger:hover {
  border-color: var(--red);
  color: var(--red);
}

.login-card .button {
  width: 100%;
}

.error {
  min-height: 18px;
  margin: 16px 0 0;
  font-size: 10px;
  line-height: 1.5;
  color: var(--red);
}

/* app */

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 600px;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex: none;
  height: 58px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 9, 7, 0.86);
}

.brand {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.brand span {
  color: var(--faint);
}

.brand:hover span {
  color: var(--green);
}

.bar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.bar-actions a {
  color: var(--muted);
}

.bar-actions a:hover {
  color: var(--green);
}

.layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  flex: none;
  width: 280px;
  padding: 20px 18px;
  border-right: 1px solid var(--line);
  background: var(--panel);
  overflow-y: auto;
}

.create-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

#groups {
  margin-top: 6px;
}

.group {
  padding-top: 18px;
}

.group__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.group__head span {
  color: var(--faint);
}

.file {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--soft);
  text-align: left;
  font-size: 10.5px;
  line-height: 1.4;
}

.file:hover {
  border-color: var(--line);
  color: var(--green);
}

.file.is-active {
  border-color: var(--line-2);
  background: rgba(98, 255, 162, 0.06);
  color: var(--ink);
}

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

.file__draft {
  margin-left: auto;
  flex: none;
  font-size: 7.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
}

.hint {
  margin: auto 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 9px;
  line-height: 1.65;
  color: var(--faint);
}

.hint code {
  color: var(--muted);
}

.editor-pane {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: 22px 26px 18px;
  overflow: hidden;
}

.editor-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex: none;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.editor-title h2 {
  margin: 7px 0 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

#editor {
  flex: 1;
  min-height: 0;
  margin-top: 16px;
  padding: 18px;
  resize: none;
  border-color: var(--line);
  color: var(--soft);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  background:
    linear-gradient(rgba(125, 255, 166, 0.025) 1px, transparent 1px),
    #050806;
  background-size: 100% 28px;
}

#editor:disabled {
  opacity: 0.45;
}

.editor-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex: none;
  margin-top: 14px;
}

.status {
  min-width: 0;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status.is-error {
  color: var(--red);
}

.status.is-ok {
  color: var(--green);
}

.build-log {
  flex: none;
  max-height: 130px;
  margin: 14px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: #050806;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.6;
  overflow: auto;
  white-space: pre-wrap;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 44px));
  padding: 13px 16px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--ink);
  font-size: 10px;
  line-height: 1.55;
  box-shadow: 0 20px 50px -30px #000;
}

.toast.is-error {
  border-color: var(--red);
  color: var(--red);
}

@media (max-width: 820px) {
  .app {
    height: auto;
    min-height: 100vh;
  }

  .bar {
    padding-inline: 16px;
  }

  .bar-actions {
    gap: 12px;
  }

  .layout {
    display: block;
  }

  .sidebar {
    width: 100%;
    max-height: 38vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .hint {
    display: none;
  }

  .editor-pane {
    min-height: 70vh;
    padding: 18px 16px;
  }

  .editor-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .editor-bottom {
    align-items: flex-start;
    flex-direction: column;
  }
}
