/* VastuScope — style.css */
:root {
  --gold: #C8A96E;
  --gold-light: #E8D4A8;
  --gold-dark: #8B6E3A;
  --cream: #FAF7F2;
  --cream-dark: #F0EAE0;
  --ink: #1C1812;
  --ink-muted: #5C5244;
  --ink-faint: #9C8E80;
  --green: #2D5A27;
  --green-light: #EAF3E8;
  --red: #7A1F1F;
  --red-light: #F5EAEA;
  --amber-light: #FDF5E0;
  --border: rgba(200, 169, 110, 0.25);
  --radius: 12px;
}

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

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
}

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

/* ── Layout ── */
.wrap {
  position: relative; z-index: 1;
  max-width: 740px; margin: 0 auto;
  padding: 3rem 1.5rem 6rem;
}

/* ── Header ── */
header { text-align: center; margin-bottom: 2.75rem; }
.logo-ring {
  width: 62px; height: 62px; margin: 0 auto 1.1rem;
  border: 1.5px solid var(--gold); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  animation: ringPulse 4s ease-in-out infinite;
}
@keyframes ringPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 169, 110, 0); }
  50% { box-shadow: 0 0 0 8px rgba(200, 169, 110, 0.1); }
}
.logo-ring::before {
  content: ''; position: absolute; inset: 5px;
  border: 1px solid var(--gold-light); border-radius: 50%;
}
h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2rem, 5vw, 2.6rem);
  font-weight: 500; letter-spacing: -0.02em;
  color: var(--ink); line-height: 1; margin-bottom: 0.35rem;
}
.tagline {
  font-size: 0.78rem; color: var(--ink-faint);
  letter-spacing: 0.14em; text-transform: uppercase;
}
.divider {
  width: 50px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 1.25rem auto;
}

/* ── Cards ── */
.card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 16px rgba(28, 24, 18, 0.04);
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: 0 4px 24px rgba(28, 24, 18, 0.07); }

.section-label {
  font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--gold-dark); font-weight: 500; margin-bottom: 1.1rem;
  display: flex; align-items: center; gap: 8px;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Form Elements ── */
label {
  display: block; font-size: 0.78rem;
  color: var(--ink-muted); margin-bottom: 0.35rem;
}
input, select, textarea {
  width: 100%; padding: 0.7rem 0.9rem;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--cream); font-family: inherit;
  font-size: 0.87rem; color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none; margin-bottom: 1rem; appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 169, 110, 0.13);
  background: #fff;
}
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
textarea { resize: vertical; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239C8E80' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.85rem center;
  padding-right: 2.2rem; cursor: pointer;
}

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }

/* ── Mode Toggle ── */
.mode-toggle {
  display: flex; background: var(--cream-dark);
  border-radius: 8px; padding: 3px; margin-bottom: 1rem; gap: 2px;
}
.mode-btn {
  flex: 1; padding: 0.48rem 0.4rem; border: none; background: transparent;
  border-radius: 6px; font-family: inherit; font-size: 0.78rem;
  color: var(--ink-muted); cursor: pointer; transition: all 0.18s;
  white-space: nowrap;
}
.mode-btn.active {
  background: #fff; color: var(--ink);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08); font-weight: 500;
}
.pane { display: none; }
.pane.show { display: block; }

/* ── Upload zone ── */
.upload-zone {
  border: 1.5px dashed var(--border); border-radius: 8px;
  padding: 1.4rem; text-align: center; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative; margin-bottom: 1rem; background: var(--cream);
}
.upload-zone:hover { border-color: var(--gold); background: var(--amber-light); }
.upload-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0;
  cursor: pointer; margin: 0; padding: 0; border: none; width: 100%; height: 100%;
}
.upload-icon { font-size: 22px; margin-bottom: 5px; display: block; }
.upload-text { font-size: 0.8rem; color: var(--ink-muted); }
.upload-sub { font-size: 0.7rem; color: var(--ink-faint); margin-top: 3px; }

#preview-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 1rem; }
.preview-thumb {
  width: 70px; height: 52px; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--border);
}

/* ── Hint text ── */
.hint { font-size: 0.71rem; color: var(--ink-faint); margin-top: -0.7rem; margin-bottom: 1rem; line-height: 1.5; }
.info-pill {
  background: var(--amber-light); border: 1px solid rgba(200,169,110,0.25);
  border-radius: 6px; padding: 0.55rem 0.85rem;
  font-size: 0.75rem; color: var(--ink-muted); margin-bottom: 1rem; line-height: 1.5;
}

/* ── Buttons ── */
.analyze-btn {
  width: 100%; padding: 0.95rem; background: var(--ink);
  color: var(--gold-light); border: none; border-radius: 8px;
  font-family: inherit; font-size: 0.88rem; font-weight: 500;
  letter-spacing: 0.04em; cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 2px 12px rgba(28,24,18,0.18);
}
.analyze-btn:hover { background: #2C2820; box-shadow: 0 4px 20px rgba(28,24,18,0.28); }
.analyze-btn:active { transform: scale(0.99); }
.analyze-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.spinner {
  width: 17px; height: 17px; flex-shrink: 0;
  border: 2px solid rgba(200,169,110,0.3);
  border-top-color: var(--gold);
  border-radius: 50%; animation: spin 0.75s linear infinite; display: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Progress Log ── */
.progress-log {
  background: var(--ink); border-radius: 10px;
  padding: 1.25rem; margin-top: 1rem; display: none;
}
.log-title {
  font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 0.75rem;
}
.log-entry {
  font-size: 0.78rem; color: rgba(232,212,168,0.6);
  padding: 0.22rem 0; display: flex; align-items: flex-start;
  gap: 8px; line-height: 1.4; transition: color 0.3s;
}
.log-entry::before { content: '›'; color: var(--gold); flex-shrink: 0; }
.log-entry.active { color: var(--gold-light); }
.log-entry.done { color: rgba(232,212,168,0.3); }

/* ── Error ── */
.error-box {
  background: var(--red-light); border: 1px solid rgba(122,31,31,0.2);
  border-radius: 8px; padding: 0.85rem 1rem;
  font-size: 0.84rem; color: var(--red); display: none; margin-bottom: 1rem;
}

/* ── Results ── */
#results { display: none; }

.direction-display {
  text-align: center; padding: 1.75rem;
  background: var(--cream-dark); border-radius: 10px;
  margin-bottom: 1.25rem; border: 1px solid var(--border);
}
.compass-wrap { display: inline-block; width: 116px; height: 116px; margin-bottom: 0.85rem; }
.compass-svg { width: 116px; height: 116px; }
.dir-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.45rem; font-weight: 500; margin-bottom: 0.2rem;
}
.dir-sub { font-size: 0.78rem; color: var(--ink-faint); }
.dir-source { font-size: 0.69rem; color: var(--gold-dark); margin-top: 5px; font-style: italic; }

.overall-score {
  text-align: center; padding: 1.5rem;
  background: var(--ink); border-radius: 10px;
  color: var(--gold-light); margin-bottom: 1.25rem;
}
.overall-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 3.4rem; font-weight: 600; color: var(--gold); line-height: 1;
}
.overall-label { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.65; margin-top: 3px; }
.overall-verdict {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem; margin-top: 0.4rem; font-style: italic;
}

.score-bar-wrap { margin-bottom: 1.25rem; }
.score-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.4rem; }
.score-name { font-size: 0.85rem; font-weight: 500; }
.score-val {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem; font-weight: 600; color: var(--gold-dark);
}
.score-track { height: 5px; background: var(--cream-dark); border-radius: 99px; overflow: hidden; }
.score-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--gold-light), var(--gold));
  transition: width 1.1s cubic-bezier(.22, 1, .36, 1); width: 0%;
}
.score-fill.low { background: linear-gradient(90deg, #f5c4c4, #c0392b); }
.score-fill.mid { background: linear-gradient(90deg, #fde9b8, #d4a017); }

.finding {
  padding: 0.9rem 1.1rem; border-radius: 8px;
  margin-bottom: 0.65rem; border-left: 3px solid;
  font-size: 0.84rem; line-height: 1.6;
}
.finding.good { background: var(--green-light); border-color: var(--green); color: #1A3A17; }
.finding.warn { background: var(--amber-light); border-color: #D4A017; color: #5A3E00; }
.finding.bad  { background: var(--red-light); border-color: var(--red); color: var(--red); }
.finding-title { font-weight: 500; margin-bottom: 2px; }

.reco-list { list-style: none; }
.reco-list li {
  padding: 0.65rem 0 0.65rem 1.1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.84rem; line-height: 1.6;
  color: var(--ink-muted); position: relative;
}
.reco-list li::before { content: '→'; position: absolute; left: 0; color: var(--gold); }
.reco-list li:last-child { border-bottom: none; }

.sources-list { font-size: 0.72rem; color: var(--ink-faint); line-height: 1.9; }
.sources-list a { color: var(--gold-dark); text-decoration: none; }
.sources-list a:hover { text-decoration: underline; }

/* ── Footer ── */
footer {
  text-align: center; margin-top: 3rem;
  font-size: 0.72rem; color: var(--ink-faint);
  letter-spacing: 0.04em;
}
footer a { color: var(--gold-dark); text-decoration: none; }

/* ── Fade-in animation ── */
.fade-in { animation: fadeIn 0.5s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ── Responsive ── */
@media (max-width: 480px) {
  .wrap { padding: 2rem 1rem 5rem; }
  .card { padding: 1.35rem; }
  .mode-btn { font-size: 0.72rem; padding: 0.42rem 0.3rem; }
}
