:root {
  --ink: #211a14;
  --muted: #746457;
  --paper: #f6eddc;
  --paper-deep: #e2ceb0;
  --bronze: #8b4f25;
  --bronze-dark: #623719;
  --olive: #596238;
  --shadow: rgba(35, 24, 13, 0.2);
  --whitewash: rgba(255, 250, 239, 0.78);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  background:
    linear-gradient(rgba(246, 237, 220, 0.66), rgba(224, 207, 176, 0.72)),
    url("assets/parchment-marble.png") center / cover fixed,
    var(--paper);
}

button {
  font: inherit;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(20px, 4vw, 56px);
}

.quote-panel {
  width: min(760px, 100%);
  padding: clamp(26px, 5vw, 54px);
  border: 1px solid rgba(98, 55, 25, 0.24);
  background: var(--whitewash);
  box-shadow: 0 28px 80px var(--shadow);
  backdrop-filter: blur(2px);
}

.kicker {
  margin: 0 0 10px;
  color: var(--bronze-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 clamp(24px, 5vw, 42px);
  max-width: 100%;
  font-size: clamp(1.55rem, 4.8vw, 3rem);
  line-height: 1;
  font-weight: 500;
  overflow-wrap: anywhere;
}

h1 cite {
  font-style: italic;
}

.quote-card {
  position: relative;
  min-height: 300px;
  display: grid;
  align-content: center;
  gap: 26px;
  padding: clamp(28px, 6vw, 56px);
  border-block: 2px solid rgba(139, 79, 37, 0.28);
  background:
    linear-gradient(90deg, rgba(139, 79, 37, 0.18), transparent 12%, transparent 88%, rgba(139, 79, 37, 0.18)),
    rgba(255, 252, 246, 0.44);
}

.quote-mark {
  position: absolute;
  top: -20px;
  left: clamp(14px, 4vw, 30px);
  color: rgba(139, 79, 37, 0.24);
  font-size: clamp(6rem, 18vw, 11rem);
  line-height: 1;
  pointer-events: none;
}

.quote-text {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: clamp(1.6rem, 4.6vw, 3.05rem);
  line-height: 1.12;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.quote-text.is-long {
  font-size: clamp(1.35rem, 3.8vw, 2.45rem);
  line-height: 1.16;
}

.quote-text.is-very-long {
  font-size: clamp(1.15rem, 3.2vw, 2rem);
  line-height: 1.2;
}

.quote-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  font-size: clamp(0.95rem, 2.6vw, 1.08rem);
}

.quote-meta time {
  color: var(--muted);
}

.quote-meta span {
  color: rgba(116, 100, 87, 0.68);
}

.quote-meta span:not(:empty)::before {
  content: "· ";
  color: rgba(116, 100, 87, 0.45);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.quote-browser {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(98, 55, 25, 0.3);
  border-radius: 4px;
  color: var(--ink);
  background: rgba(255, 250, 239, 0.74);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.quote-picker {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(98, 55, 25, 0.2);
  border-radius: 4px;
  color: var(--muted);
  background: rgba(255, 250, 239, 0.54);
  font-size: 0.98rem;
}

.quote-picker input {
  width: 76px;
  min-height: 30px;
  border: 1px solid rgba(98, 55, 25, 0.22);
  border-radius: 4px;
  color: var(--ink);
  background: rgba(255, 252, 246, 0.86);
  font: inherit;
  text-align: center;
}

.button {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid rgba(98, 55, 25, 0.3);
  border-radius: 4px;
  color: var(--ink);
  background: rgba(255, 250, 239, 0.74);
  cursor: pointer;
}

.button:hover,
.button:focus-visible,
.icon-button:hover,
.icon-button:focus-visible,
.quote-picker input:focus-visible {
  border-color: var(--bronze);
  outline: 2px solid rgba(139, 79, 37, 0.24);
  outline-offset: 2px;
}

.button-primary {
  color: #fffaf0;
  border-color: var(--bronze-dark);
  background: var(--bronze);
}

.status {
  min-height: 1.4em;
  margin: 14px 0 0;
  color: var(--olive);
  font-size: 0.95rem;
}

@media (max-width: 560px) {
  .shell {
    place-items: stretch;
  }

  .quote-panel {
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .quote-browser {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
  }

  .quote-picker {
    justify-content: center;
  }
}
