:root {
  --text: #0f1419;
  --muted: #536471;
  --line: #eff3f4;
  --border: #cfd9de;
  --card-border: #e3e8ea;
  --blue: #1d9bf0;
  --blue-dark: #1a8cd8;
  --red: #c53030;
  --green: #0f7b45;
  --bg: #f7f9f9;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 24px 72px;
}

/* hero */
.hero {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  padding: 30px 32px;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 24px;
  box-shadow: 0 1px 2px rgba(15, 20, 25, 0.04);
}

.portrait {
  width: 140px;
  height: 140px;
  border-radius: 22px;
  object-fit: cover;
  flex: none;
  border: 1px solid var(--card-border);
  background: var(--line);
}

.hero-body {
  flex: 1;
  min-width: 0;
}

.hero h1 {
  margin: 2px 0 10px;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.6px;
}

.hero-text {
  max-width: 68ch;
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.55;
}

/* add a tweet */
.add {
  max-width: 620px;
  margin-top: 22px;
}
.add form { display: flex; gap: 8px; }
.add input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
}
.add input::placeholder { color: #8b98a5; }
.add input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(29, 155, 240, 0.16);
}
.add button {
  height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 120ms ease;
}
.add button:hover { background: var(--blue-dark); }
.add button:disabled { opacity: 0.6; cursor: default; }

.note {
  min-height: 18px;
  margin: 10px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}
.note.err { color: var(--red); }
.note.ok { color: var(--green); }

/* catalog */
.archive { margin-top: 30px; }
.feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 24px;
}
.feed li { min-width: 0; }

.shot {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 20, 25, 0.04);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.feed li:hover .shot {
  border-color: var(--border);
  box-shadow: 0 6px 20px rgba(15, 20, 25, 0.08);
}

.src {
  display: inline-block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}
.src:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@keyframes flash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(29, 155, 240, 0); }
  25% { box-shadow: 0 0 0 4px rgba(29, 155, 240, 0.45); }
}
.flash .shot { animation: flash 1.3s ease; }

.empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 28px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}
.entry-text {
  margin: 0;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

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

@media (max-width: 900px) {
  .page { padding: 20px 18px 56px; }
  .hero { gap: 20px; padding: 24px; }
  .portrait { width: 112px; height: 112px; border-radius: 18px; }
  .hero h1 { font-size: 26px; }
  .feed { gap: 24px 18px; }
}

@media (max-width: 760px) {
  .feed { grid-template-columns: minmax(0, 1fr); gap: 26px; }
}

@media (max-width: 640px) {
  .hero {
    flex-direction: column;
    gap: 18px;
    padding: 22px;
    border-radius: 20px;
  }
  .portrait { width: 96px; height: 96px; border-radius: 16px; }
  .hero h1 { margin-top: 0; font-size: 24px; }
  .hero-text { font-size: 15px; }
  .add { margin-top: 18px; }
  .add form { flex-direction: column; }
  .add button { width: 100%; }
  .archive { margin-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .shot, .add button { transition: none; }
  .flash .shot { animation: none; }
}
