@import url("https://fonts.googleapis.com/css2?family=Source+Serif+4:wght@400;500;600&family=Space+Grotesk:wght@500;600;700&display=swap");

:root {
  --ink: #1f1a14;
  --muted: #6b6157;
  --accent: #d95a2b;
  --accent-dark: #8a2f18;
  --surface: #fffaf4;
  --surface-strong: #f6eee4;
  --border: rgba(31, 26, 20, 0.12);
  --shadow: rgba(31, 26, 20, 0.12);
  --highlight: rgba(217, 90, 43, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Source Serif 4", "Times New Roman", serif;
  color: var(--ink);
  background: radial-gradient(circle at 12% 12%, #fbe9d5, transparent 50%),
    radial-gradient(circle at 80% 10%, #f4d8c9, transparent 45%),
    linear-gradient(135deg, #fdf7f0, #f4efe9 60%, #f1e9df);
  padding: 32px clamp(20px, 4vw, 64px) 80px;
  position: relative;
}

.page-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 20% 30%, rgba(217, 90, 43, 0.14), transparent 55%),
    radial-gradient(circle at 80% 70%, rgba(31, 26, 20, 0.08), transparent 50%);
  mix-blend-mode: multiply;
  opacity: 0.7;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  z-index: 1;
  margin-bottom: 40px;
}

.site-header.has-actions {
  justify-content: space-between;
  gap: 16px;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.share-button {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--accent-dark);
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.share-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.share-button[data-state="copied"] {
  background: var(--highlight);
  border-color: rgba(217, 90, 43, 0.4);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-dark);
}

.logo {
  width: 140px;
  height: auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
}

.brand-tag {
  font-size: 12px;
  color: var(--muted);
}

main {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero {
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: center;
  margin-bottom: 48px;
}

.hero-text {
  animation: fadeUp 0.7s ease-out both;
}

.eyebrow {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-dark);
  margin: 0 0 12px;
}

h1 {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: clamp(32px, 4vw, 44px);
  margin: 0 0 12px;
}

.subhead {
  font-size: 18px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.archive-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 40px var(--shadow);
  animation: fadeUp 0.9s ease-out both;
}

.input-label {
  display: block;
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-bottom: 12px;
}

.input-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

input[type="url"] {
  flex: 1 1 240px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 16px;
  font-family: "Source Serif 4", "Times New Roman", serif;
  background: #fff;
  transition: border-color 0.2s ease;
}

input[type="url"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--highlight);
}

button {
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 22px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 20px rgba(217, 90, 43, 0.22);
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.archive-form.loading button {
  opacity: 0.7;
  cursor: wait;
}

.status {
  min-height: 24px;
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.status[data-type="error"] {
  color: #a22724;
}

.status[data-type="success"] {
  color: #1e6d43;
}

.queue {
  margin-bottom: 40px;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 18px 36px rgba(31, 26, 20, 0.1);
}

.queue-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.queue-title {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: 20px;
  margin: 0 0 6px;
}

.queue-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.queue-button {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
}

.queue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.queue-button.ghost {
  background: #fff;
  color: var(--accent-dark);
  border: 1px solid var(--border);
  box-shadow: none;
}

.queue-empty {
  color: var(--muted);
  font-size: 14px;
}

.queue-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.queue-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}

.queue-label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
}

.queue-checkbox {
  margin-top: 4px;
}

.queue-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.queue-url {
  font-size: 14px;
  word-break: break-all;
}

.queue-time {
  font-size: 12px;
  color: var(--muted);
}

.queue-reason {
  font-size: 13px;
  color: var(--muted);
}

.queue-details {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.queue-details summary {
  cursor: pointer;
  font-weight: 600;
}

.queue-details p {
  margin: 6px 0 0;
  line-height: 1.5;
}

.result {
  background: rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--border);
  box-shadow: 0 30px 60px rgba(31, 26, 20, 0.12);
  animation: fadeUp 0.8s ease-out both;
}

.result.hidden {
  display: none;
}

.result-header {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
}

.result-title {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: 26px;
  margin: 0 0 8px;
}

.result-byline {
  margin: 0;
  color: var(--muted);
}

.result-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  font-size: 14px;
}

.result-links a {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 600;
}

.reader-link-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.copy-button {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--accent-dark);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: none;
}

.copy-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.copy-button[data-state="copied"] {
  background: var(--highlight);
  border-color: rgba(217, 90, 43, 0.4);
}

.result-links a:hover {
  text-decoration: underline;
}

.publish-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.original-url {
  color: var(--muted);
  word-break: break-all;
}

.archive-source {
  color: var(--muted);
  font-size: 12px;
}

.reader-mode {
  padding-top: 24px;
}

.reader-mode .site-header {
  margin-bottom: 20px;
}

.reader-shell {
  max-width: 980px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.reader-info {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.82);
  border-radius: 20px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  box-shadow: 0 18px 36px rgba(31, 26, 20, 0.12);
  margin-bottom: 28px;
}

.reader-title {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: clamp(22px, 3vw, 28px);
  margin: 0 0 8px;
}

.reader-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

.reader-links a {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 600;
}

.reader-links a:hover {
  text-decoration: underline;
}

.reader {
  max-width: 820px;
  margin: 0 auto;
  font-size: 18px;
  line-height: 1.75;
}

.reader h1,
.reader h2,
.reader h3 {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  margin-top: 32px;
}

.reader img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 20px 0;
  box-shadow: 0 12px 24px rgba(31, 26, 20, 0.15);
}

.reader figure {
  margin: 24px 0;
}

.reader blockquote {
  border-left: 3px solid var(--accent);
  margin: 24px 0;
  padding-left: 20px;
  color: var(--muted);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  body {
    padding: 24px 18px 64px;
  }

  .result-links {
    width: 100%;
  }

  button:not(.share-button) {
    width: 100%;
  }
}
