@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: #183129;
  --muted: #5a6d63;
  --accent: #d6b54a;
  --accent-dark: #22584f;
  --surface: #f8f4ea;
  --surface-strong: #eee5d0;
  --panel: rgba(255, 255, 255, 0.96);
  --border: rgba(24, 49, 41, 0.14);
  --shadow: rgba(24, 49, 41, 0.16);
  --highlight: rgba(214, 181, 74, 0.18);
  --danger: #9a3e2e;
}

* {
  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% 10%, rgba(214, 181, 74, 0.22), transparent 48%),
    radial-gradient(circle at 82% 14%, rgba(34, 88, 79, 0.16), transparent 42%),
    linear-gradient(135deg, #fbf8ef, #f3eee2 58%, #ebe3d1);
  padding: 32px clamp(20px, 4vw, 64px) 80px;
  position: relative;
}

.page-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 18% 28%, rgba(214, 181, 74, 0.12), transparent 55%),
    radial-gradient(circle at 80% 72%, rgba(34, 88, 79, 0.09), transparent 50%);
  mix-blend-mode: multiply;
  opacity: 0.7;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

.site-header {
  margin-bottom: 40px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: inherit;
  text-decoration: none;
}

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

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

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

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

main {
  max-width: 1120px;
  margin: 0 auto;
}

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

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

h1,
h2 {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  margin: 0;
}

h1 {
  font-size: clamp(34px, 4.2vw, 48px);
  margin-bottom: 14px;
}

h2 {
  font-size: clamp(24px, 2.2vw, 30px);
}

.subhead,
.helper-text,
.detection-summary,
.publish-status,
.status {
  color: var(--muted);
  line-height: 1.6;
}

.subhead {
  font-size: 18px;
  margin: 0;
}

.upload-form,
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 22px 44px var(--shadow);
}

.upload-form {
  padding: 24px;
  display: grid;
  gap: 14px;
}

input[type="file"],
input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  font-size: 16px;
  font-family: "Source Serif 4", "Times New Roman", serif;
  background: #fff;
}

input[type="file"] {
  padding: 12px;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--highlight);
}

button {
  border: none;
  background: var(--accent-dark);
  color: #fff;
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 22px;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease;
  justify-self: start;
}

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

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status[data-type="error"],
.publish-status[data-type="error"] {
  color: var(--danger);
}

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

.workspace {
  display: grid;
  gap: 28px;
}

.workspace-grid {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  align-items: start;
}

.panel {
  padding: 28px;
}

.panel-header {
  margin-bottom: 20px;
}

.cover-preview {
  display: block;
  width: 100%;
  border-radius: 18px;
  background: linear-gradient(180deg, #f3f0e6, #ebe3d1);
  border: 1px solid var(--border);
  box-shadow: 0 14px 24px rgba(24, 49, 41, 0.12);
}

.file-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 12px;
  margin: 20px 0 0;
}

.file-facts dt {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.file-facts dd {
  margin: 0;
}

.field-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-grid label {
  display: grid;
  gap: 8px;
}

.field-grid span {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: 13px;
  color: var(--muted);
}

.field-span-2 {
  grid-column: 1 / -1;
}

.publish-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 22px;
  flex-wrap: wrap;
}

.metadata-list {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 10px;
}

.metadata-list li {
  line-height: 1.55;
}

.metadata-list strong {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-weight: 600;
}

.text-preview {
  margin: 18px 0 0;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 340px;
  overflow: auto;
  font-family: "Source Serif 4", "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

.site-footer {
  max-width: 1120px;
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 18px;
}

.footer-logo {
  width: 88px;
  height: auto;
}

.footer-copy p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 860px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    padding: 20px 16px 56px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .field-span-2 {
    grid-column: auto;
  }

  .site-footer {
    align-items: flex-start;
  }
}
