/* My Crafty Stash — design system */

:root {
  --paper: #faf7f1;
  --paper-2: #f1ece1;
  --paper-3: #e7e0d2;
  --ink: #1c1915;
  --ink-2: #4a4339;
  --ink-3: #908775;
  --line: #1c1915;
  --line-soft: #d8cfbe;
  --accent: #d8543a;        /* coral / persimmon, slightly muted */
  --accent-soft: #f6e3d9;
  --accent-deep: #9a3a23;
  --mint: #b9d4be;
  --butter: #ecd28a;
  --sky: #b4cbdc;
  --lilac: #cdc1de;
  --shadow: 0 1px 0 rgba(28,25,21,.04), 0 8px 24px rgba(28,25,21,.06);
  --shadow-sm: 0 1px 2px rgba(28,25,21,.06);
  --shadow-lg: 0 1px 0 rgba(28,25,21,.04), 0 18px 40px rgba(28,25,21,.08);
  --radius: 12px;
  --radius-lg: 18px;
  --display-font: "Bricolage Grotesque", "Recoleta", Georgia, serif;
  --body-font: "Inter", system-ui, -apple-system, sans-serif;
  --mono-font: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body-font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
}

a { color: inherit; }

button { font-family: inherit; }

h1, h2, h3, h4 {
  font-family: var(--display-font);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.05;
}

h1 { font-size: clamp(2.4rem, 4.6vw, 4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.7rem, 2.8vw, 2.4rem); letter-spacing: -0.015em; }
h3 { font-size: 1.25rem; letter-spacing: -0.01em; }

.mono { font-family: var(--mono-font); font-size: 0.78rem; letter-spacing: 0.02em; }

/* ─── Layout ──────────────────────────────────────────────────── */

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
}

main { flex: 1; }

/* ─── Nav ─────────────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250,247,241,.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  max-width: 1200px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display-font);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
}

.brand-mark {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--paper);
  font-family: var(--display-font);
  font-weight: 800;
  font-size: 1.05rem;
}

.brand small {
  font-family: var(--mono-font);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: block;
  margin-top: -2px;
}

.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}

.nav-link {
  background: none;
  border: 0;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}

.nav-link:hover { background: var(--accent-soft); color: var(--ink); }

.nav-link.active {
  background: var(--ink);
  color: var(--paper);
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 14px;
  margin-left: 10px;
  border-left: 1px solid var(--line-soft);
}

.nav-right {
  display: flex;
  align-items: center;
}

/* ─── Buttons ─────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  text-decoration: none;
}
.btn:hover { background: var(--accent); border-color: var(--accent); }

.btn.secondary {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line-soft);
}
.btn.secondary:hover { background: var(--paper-2); border-color: var(--ink); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); border-color: transparent; }
.btn.ghost:hover { background: var(--paper-2); color: var(--ink); }

.btn-lg { padding: 15px 24px; font-size: 1rem; }

/* ─── Cards & shapes ──────────────────────────────────────────── */

.card {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 28px;
}
.card.bordered { border-color: var(--line); }

.sticker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  font-family: var(--mono-font);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}
.sticker .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}

.eyebrow {
  font-family: var(--mono-font);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-deep);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 16px; height: 1px; background: var(--accent-deep);
}

/* ─── Footer ─────────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--line-soft);
  background: var(--paper);
  padding: 48px 0 36px;
  margin-top: 100px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 28px;
  align-items: flex-end;
}

.footer .mono { color: var(--ink-3); }

/* ─── Page transitions ───────────────────────────────────────── */

.page {
  opacity: 1;
}

/* ─── Layout variants (toggleable) ────────────────────────────── */

body[data-layout="airy"] .container { max-width: 1140px; }
body[data-layout="airy"] section.section { padding: 110px 0; }
body[data-layout="dense"] section.section { padding: 56px 0; }
body[data-layout="regular"] section.section { padding: 80px 0; }

section.section { padding: 80px 0; }

/* utility */
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.center { text-align: center; }
.muted { color: var(--ink-3); }
.divider {
  height: 1px; background: var(--line-soft); border: 0;
  margin: 32px 0;
}

/* type rhythm */
.kicker {
  font-family: var(--mono-font);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.lead {
  font-size: 1.1rem;
  color: var(--ink-2);
  line-height: 1.55;
}

/* section headers */
.section-head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 48px;
  align-items: end;
  margin-bottom: 48px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line-soft);
}
.section-head h2 { max-width: 560px; }
@media (max-width: 720px) {
  .section-head { grid-template-columns: 1fr; gap: 16px; }
}

/* form */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}
.field label {
  font-family: var(--mono-font);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.field input, .field textarea {
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--paper);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  outline: none;
  transition: border-color .15s;
}
.field input:focus, .field textarea:focus {
  border-color: var(--ink);
}
.field .err { color: var(--accent-deep); font-size: 0.85rem; }

/* responsive */
@media (max-width: 900px) {
  .hero-grid, .footer-cols, .features-grid, .data-grid, .stats-row, .specs-row, .upcoming-row {
    grid-template-columns: 1fr !important;
  }
  .features-grid > div, .data-grid > div, .stats-row > div, .specs-row > div {
    border-right: 0 !important;
    border-left: 0 !important;
    border-bottom: 1px solid var(--line-soft);
    padding-left: 0; padding-right: 0;
  }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-auth { padding-left: 0; margin-left: 0; border-left: 0; }
  h1 { font-size: 2.2rem; }
  .container { padding: 0 20px; }
  section.section { padding: 48px 0 !important; }
}


/* ─── Animations & overlays ───────────────────────────────────── */

@keyframes videoMove {
  from { background-position: 0 0; }
  to   { background-position: 240px 240px; }
}

@keyframes barProgress {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20,18,14,.78);
  backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.modal-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  max-width: 100%;
}

/* ── My Stash (read-only cloud view) ─────────────────────────────────── */

.stash-toolbar {
  display: flex;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--paper);
  padding: 10px 0 14px;
}
.stash-search {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper-3);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}
.stash-type {
  padding: 12px 10px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--paper-3);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  max-width: 44%;
}

.stash-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 640px) { .stash-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .stash-grid { grid-template-columns: repeat(4, 1fr); } }

.stash-card {
  display: block;
  text-align: left;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--paper-2);
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  overflow: hidden;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.stash-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stash-card-photo {
  position: relative;
  aspect-ratio: 1;
  background: var(--paper-3);
}
.stash-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.stash-card-noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--ink-3);
  font-size: 0.85rem;
}
.stash-card-name {
  padding: 10px 12px 0;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.stash-card .kicker { padding: 0 12px 12px; }

.stash-stock-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stash-pill-disc {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 9px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  color: var(--ink-3);
  font-size: 0.7rem;
  font-weight: 600;
}

.stash-skeleton {
  aspect-ratio: 0.78;
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--paper-2) 40%, var(--paper-3) 50%, var(--paper-2) 60%);
  background-size: 200% 100%;
  animation: stash-shimmer 1.4s infinite;
}
@keyframes stash-shimmer {
  from { background-position: 100% 0; }
  to   { background-position: -100% 0; }
}

.stash-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent);
  animation: stash-spin 0.9s linear infinite;
}
@keyframes stash-spin { to { transform: rotate(360deg); } }

.stash-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(28, 25, 21, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
@media (min-width: 640px) {
  .stash-overlay { align-items: center; padding: 32px; }
}
.stash-detail {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--paper);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
@media (min-width: 640px) {
  .stash-detail { border-radius: var(--radius-lg); }
}
.stash-detail-photo {
  background: var(--paper-3);
  max-height: 46vh;
  display: flex;
  justify-content: center;
}
.stash-detail-photo img {
  max-width: 100%;
  max-height: 46vh;
  object-fit: contain;
}
.stash-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line-soft);
  background: var(--paper);
  color: var(--ink);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}
.stash-badge {
  padding: 3px 10px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
}
.stash-sentiment {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--paper-2);
  color: var(--ink-2);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
.stash-sentiment:hover { background: var(--accent-soft); }
.stash-meta {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 8px 14px;
  align-items: baseline;
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
}

.nav-user-chip {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line-soft);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-user-flyout {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  min-width: 220px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  text-align: left;
}
