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

:root {
  --bg: #f7f2eb;
  --panel: #fffdf9;
  --ink: #1f1a14;
  --muted: #5a5247;
  --accent: #dd5b34;
  --accent-soft: #f5b59a;
  --shadow: rgba(31, 26, 20, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #fff7ec, #efe5d8 60%, #eadfd1);
  min-height: 100vh;
}

.shell {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: rise 0.6s ease-out;
}

.eyebrow {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

h1 {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(28px, 4vw, 40px);
  margin: 0;
}

.subhead {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  max-width: 520px;
}

.panel {
  background: var(--panel);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 18px 40px var(--shadow);
  border: 1px solid rgba(0, 0, 0, 0.05);
  animation: rise 0.7s ease-out 0.1s backwards;
}

.translate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.label {
  font-weight: 600;
  font-size: 14px;
}

textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 14px;
  font-size: 16px;
  font-family: inherit;
  resize: vertical;
  min-height: 120px;
  background: #fffaf4;
}

.primary {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 16px;
  font-weight: 600;
  background: var(--accent);
  color: white;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  align-self: flex-start;
}

.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(221, 91, 52, 0.35);
}

.notice {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
}

.notice.error {
  background: #ffe1d8;
  color: #8a2e1a;
}

.result {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result h2,
.result h3 {
  margin: 0;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.translation {
  font-size: 20px;
  margin: 0;
}

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

.stored {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

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

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

.history-card {
  background: #fff4ea;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(221, 91, 52, 0.2);
  display: grid;
  gap: 6px;
}

.history-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.history-text {
  margin: 0;
  font-size: 15px;
}

.history-time {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.empty {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .shell {
    padding: 24px 16px 32px;
  }

  .panel {
    padding: 18px;
  }

  .primary {
    width: 100%;
    text-align: center;
  }
}

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