/* ============================================================================
   RESET
   ============================================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}


/* ============================================================================
   DESIGN TOKENS
   ============================================================================ */

:root {
  --text: #fff;
  --text-dim: #999;
  --bg: #111;
  --hover-opacity: 0.6;
}

@media (prefers-color-scheme: light) {
  :root {
    --text: #111;
    --text-dim: #666;
    --bg: #fff;
  }
}


/* ============================================================================
   BASE ELEMENTS
   ============================================================================ */

body {
  font: 1.25rem/1.5 system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  padding: 2rem 1.25rem;
  max-width: 48rem;
  margin: 0 auto;
}

h1 {
  font-size: 2.5rem;
  margin: 0 0 0.25rem;
}

h2 {
  font-size: 1.75rem;
  margin: 2rem 0 0.25rem;
}

label {
  display: block;
  margin: 0 0 0.5rem;
  font-weight: 600;
}

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

a:hover {
  opacity: var(--hover-opacity);
}

hr {
  border: none;
  border-top: 1px solid var(--text-dim);
  margin: 2rem 0;
}

input,
textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--text-dim);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  font-family: system-ui, sans-serif;
}

input[type="file"]::file-selector-button {
  padding: 0.5rem 1rem;
  margin-right: 1rem;
  background: var(--text);
  color: var(--bg);
  border: none;
  font: 1rem/1 system-ui, sans-serif;
  font-weight: 600;
  cursor: default;
}

input[type="file"]::file-selector-button:hover {
  opacity: var(--hover-opacity);
}

textarea {
  resize: vertical;
  min-height: 6rem;
}

button {
  width: 100%;
  padding: 1rem;
  background: var(--text);
  color: var(--bg);
  border: none;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.25rem 0 0;
  cursor: default;
}

button:hover {
  opacity: var(--hover-opacity);
}

button:disabled {
  cursor: not-allowed;
}


/* ============================================================================
   LAYOUT
   ============================================================================ */

section {
  margin: 2rem 0;
}

section:first-child {
  margin-top: 0;
}


/* ============================================================================
   COMPONENTS
   ============================================================================ */

.actions {
  display: flex;
  gap: 0.5rem;
}

.actions button {
  width: auto;
  margin: 0;
}

.actions .icon {
  width: 1.5rem;
  height: 1.5rem;
}

.back {
  margin: 0 0 1.25rem;
}

.back .icon {
  width: 2.5rem;
  height: 2.5rem;
}

.data {
  margin: 1rem 0 1.25rem;
}

.data input {
  width: 5rem;
}

.data input::-webkit-inner-spin-button,
.data input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.data input[type=number] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.delete {
  background: #dc2626;
  color: #fff;
}

.delete:hover {
  opacity: 0.9;
}

.form {
  margin: 1.25rem 0;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 1rem;
}

.header .back {
  margin: 0;
}

.header h1 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
}

.icon {
  fill: currentColor;
  display: block;
}

.icon-arrow-up {
  transform: rotate(90deg);
}

.icon-arrow-down {
  transform: rotate(-90deg);
}

.invert {
  text-decoration: underline;
}

.invert:hover {
  color: var(--bg);
  background: var(--text);
  opacity: 1;
}

.login {
  margin: 4rem 0 4rem;
  text-align: center;
}

.login p {
  color: var(--text-dim);
}

.login input[type="password"] {
  max-width: 16rem;
  margin: 1.25rem auto 0;
}

.login .emoji {
  font-size: 6rem;
  line-height: 1;
  margin: 0 auto 1rem;
}

.metadata {
  font-family: monospace;
  font-size: 1rem;
  color: var(--text-dim);
}

.photo {
  max-width: 12rem;
  display: block;
  margin: 1rem 0;
}

.post {
  border: 1px solid var(--text-dim);
  padding: 1rem;
  margin: 1rem 0;
  animation: fadeIn 0.8s ease;
}

.preview {
  max-width: 40%;
  margin: 1rem 0 0;
}

.status {
  margin: 1rem 0 0;
  text-align: center;
  color: var(--text-dim);
}

.status.error {
  color: #dc2626;
}

#list p {
  color: var(--text-dim);
}


/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
