/* Modified 2026-03-19 AI: full redesign — antiquarian parchment, modern responsive */

:root {
  --ink:        #1c140a;
  --ink-mid:    #3e2e1a;
  --ink-soft:   #6e5840;
  --parch:      #f6f0e4;
  --parch-mid:  #ede3cd;
  --parch-deep: #e0d4b8;
  --rule:       #c4ad8e;
  --accent:     #7c3b2c;
  --accent-lt:  #a05040;
  --white:      #fdfaf4;
  --panel-w:    360px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; }

body {
  background: var(--parch-mid);
  color: var(--ink);
  font-family: 'Spectral', Georgia, serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Paper texture ───────────────────────────────────────── */
.texture-overlay {
  position: fixed; inset: 0; pointer-events: none; z-index: 100;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* ── Layout ──────────────────────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ── Left panel ──────────────────────────────────────────── */
.panel-form {
  width: var(--panel-w);
  flex-shrink: 0;
  background: var(--ink);
  color: var(--parch);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.panel-inner {
  padding: 2.5rem 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ── Header ──────────────────────────────────────────────── */
.back-link {
  font-family: 'Cormorant SC', serif;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--rule);
  text-decoration: none;
  display: block;
  margin-bottom: 1.5rem;
  transition: color 0.2s;
}
.back-link:hover { color: var(--parch); }

.ornament-rule {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.2rem;
}
.ornament-rule::before,
.ornament-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
  opacity: 0.4;
}
.orn { color: var(--accent-lt); font-size: 0.7rem; }

h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: 2.4rem;
  line-height: 1.1;
  color: var(--parch);
  margin-bottom: 0.75rem;
}
h1 em { font-style: italic; color: var(--parch-deep); }

.subhead {
  font-family: 'Spectral', serif;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--rule);
  margin-bottom: 2rem;
}

/* ── Form ────────────────────────────────────────────────── */
form { display: flex; flex-direction: column; gap: 1.4rem; flex: 1; }

.field { display: flex; flex-direction: column; gap: 0.4rem; }

label {
  font-family: 'Cormorant SC', serif;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--rule);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.opt {
  font-family: 'Spectral', serif;
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  font-style: italic;
  text-transform: none;
}

.select-wrap { position: relative; }

select {
  width: 100%;
  padding: 0.6rem 2rem 0.6rem 0.75rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(196,173,142,0.3);
  color: var(--parch);
  font-family: 'Spectral', serif;
  font-size: 0.95rem;
  border-radius: 2px;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
select:focus {
  outline: none;
  border-color: var(--accent-lt);
  background: rgba(255,255,255,0.1);
}
select option { background: var(--ink-mid); color: var(--parch); }

.select-arrow {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--rule);
  font-size: 0.75rem;
  pointer-events: none;
}

button[type="submit"] {
  margin-top: auto;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: var(--parch);
  border: none;
  font-family: 'Cormorant SC', serif;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: background 0.2s;
  margin-top: 1rem;
}
button[type="submit"]:hover { background: var(--accent-lt); }
button[type="submit"]:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-icon { font-size: 1rem; transition: transform 0.2s; }
button[type="submit"]:hover .btn-icon { transform: translateX(3px); }

/* ── Panel footer ────────────────────────────────────────── */
.panel-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(196,173,142,0.2);
  font-family: 'Cormorant SC', serif;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}
.panel-footer a { color: var(--rule); text-decoration: none; }
.panel-footer a:hover { color: var(--parch); }

/* ── Right panel ─────────────────────────────────────────── */
.panel-results {
  flex: 1;
  min-height: 100vh;
  background: var(--parch);
  position: relative;
}

.results-inner {
  padding: 3rem 2.5rem;
  max-width: 700px;
}

/* ── Empty state ─────────────────────────────────────────── */
.results-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  color: var(--rule);
  gap: 1rem;
}
.empty-glyph {
  font-size: 2rem;
  opacity: 0.3;
  animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.5; }
}
.results-empty p {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

/* ── Suggestion cards ────────────────────────────────────── */
#results { display: flex; flex-direction: column; gap: 1.5rem; }

.results-heading {
  font-family: 'Cormorant SC', serif;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.results-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
  opacity: 0.5;
}

.suggestion-card {
  background: var(--white);
  border: 1px solid var(--parch-deep);
  border-radius: 2px;
  padding: 1.75rem 1.75rem 1.25rem;
  position: relative;
  box-shadow: 0 2px 12px rgba(28,20,10,0.07);
  animation: cardIn 0.4s ease both;

  /* Notecard ruled lines effect */
  background-image: repeating-linear-gradient(
    transparent,
    transparent 27px,
    rgba(196,173,142,0.18) 27px,
    rgba(196,173,142,0.18) 28px
  );
  background-position: 0 2.25rem;
}

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

.card-number {
  position: absolute;
  top: 0.6rem;
  right: 0.9rem;
  font-family: 'Cormorant SC', serif;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--rule);
  opacity: 0.5;
}

.suggestion-body {
  font-family: 'Courier Prime', 'Courier New', monospace;
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--ink-mid);
  white-space: pre-wrap;
  position: relative;
  z-index: 1;
}

.card-footer {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
  padding-top: 0.75rem;
  border-top: 1px solid var(--parch-deep);
}

.copy-btn {
  font-family: 'Cormorant SC', serif;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  background: none;
  border: 1px solid var(--rule);
  padding: 0.3rem 0.9rem;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s;
}
.copy-btn:hover { background: var(--accent); color: var(--white); border-color: var(--accent); }
.copy-btn.copied {
  background: var(--parch-mid);
  color: var(--ink-soft);
  border-color: var(--parch-deep);
}

/* ── Status / error ──────────────────────────────────────── */
.status-msg {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1rem;
  padding: 2rem 0;
}
.error-msg {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--accent);
  font-size: 1rem;
  padding: 2rem 0;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 700px) {
  .layout { flex-direction: column; }

  .panel-form {
    width: 100%;
    height: auto;
    position: static;
  }

  .panel-inner { padding: 2rem 1.5rem; }

  h1 { font-size: 2rem; }

  form { gap: 1.1rem; }

  button[type="submit"] { margin-top: 0.5rem; }

  .panel-results { min-height: auto; }

  .results-inner { padding: 2rem 1.5rem; }

  .suggestion-card { padding: 1.25rem 1.25rem 1rem; }
}

@media (min-width: 701px) and (max-width: 1024px) {
  :root { --panel-w: 300px; }
  h1 { font-size: 2rem; }
}

/* ── Single-card result layout ───────────────────────────── */
.result-card-wrap {
  background: var(--white);
  border: 1px solid var(--parch-deep);
  border-radius: 2px;
  padding: 2rem 2rem 1.5rem;
  box-shadow: 0 2px 12px rgba(28,20,10,0.07);
  animation: cardIn 0.35s ease both;
  background-image: repeating-linear-gradient(
    transparent,
    transparent 27px,
    rgba(196,173,142,0.18) 27px,
    rgba(196,173,142,0.18) 28px
  );
  background-position: 0 2.25rem;
}

.result-card-wrap .suggestion-body {
  font-family: 'Courier Prime', 'Courier New', monospace;
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--ink-mid);
  white-space: pre-wrap;
  position: relative;
  z-index: 1;
  margin: 0;
}

.card-actions {
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--parch-deep);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.action-btn {
  font-family: 'Cormorant SC', serif;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  background: none;
  border: 1px solid var(--rule);
  padding: 0.35rem 1rem;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s;
}

.copy-btn {
  color: var(--accent);
}
.copy-btn:hover  { background: var(--accent); color: var(--white); border-color: var(--accent); }
.copy-btn.copied { background: var(--parch-mid); color: var(--ink-soft); border-color: var(--parch-deep); }

.another-btn {
  display: none;
}
