/* ── CSS Variables ── */
:root {
  /* Three-colour palette: Navy / Cream / Muted Red */
  --bg:          #f2ece0;
  --bg2:         #e8e0d0;
  --surface:     #faf6ee;
  --border:      #d8d0c0;
  --border-dark: #b8aa94;
  --accent:      #8c2a1e;
  --accent2:     #8c2a1e;
  --ink:         #1c2b3a;
  --ink-mid:     #2d3f50;
  --ink-light:   #4a5a6a;
  --rule:        #d8d0c0;
  --font:        'Bitter', serif;
  --sans:        'Bitter', serif;
  --serif:       'Bitter', serif;
  --body-serif:  'Bitter', serif;

  /* Legacy aliases — used by forms, memory page, admin (do not remove) */
  --paper:        #f2ece0;
  --paper-dark:   #e8e0d0;
  --paper-mid:    #e8e0d0;
  --red:          #8c2a1e;
  --blue:         #1c2b3a;
  --yellow:       #8c2a1e;
  --green:        #8c2a1e;
  --purple:       #8c2a1e;
  --faded:        #7a8a96;
  --cream:        #faf6ee;
  --warm-white:   #faf6ee;
  --ink-faint:    #7a8a96;
  --header-bg:    #1c2b3a;
  --teal:         #8c2a1e;
  --teal-light:   #a8352a;
  --amber:        #8c2a1e;
  --amber-light:  #a8352a;
  --shadow:       0 1px 3px rgba(28,43,58,0.10);
  --shadow-hover: 0 2px 8px rgba(28,43,58,0.18);
  --radius:       3px;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
}

/* subtle paper grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── SITE HEADER ── */
.site-header {
  background: var(--nav-bg, #1c2b3a);
  border-bottom: 3px solid var(--logo-accent, #8c2a1e);
}
.site-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 58px;
}
.logo {
  font-family: var(--font);
  font-size: var(--logo-size, 1.9rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1;
  text-decoration: none;
  flex-shrink: 0;
}
.logo span { color: var(--logo-accent, #8c2a1e); }
.header-url {
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  flex-shrink: 0;
}
.header-nav {
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: 0;
}
.header-nav a {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--nav-link-color, #8aa0b0);
  text-decoration: none;
  padding: 0 1rem;
  height: 58px;
  display: flex;
  align-items: center;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.header-nav a:hover,
.header-nav a.active {
  background: rgba(255,255,255,0.08);
  color: var(--nav-active-color, #fff);
}
.header-search {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.header-search-input {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 3px;
  padding: 4px 8px;
  font-family: var(--sans);
  font-size: 0.7rem;
  color: #fff;
  width: 110px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.header-search-input::placeholder { color: rgba(255,255,255,0.4); }
.header-search-input:focus { border-color: var(--logo-accent, #8c2a1e); background: rgba(255,255,255,0.12); }
.header-search-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
  padding: 0 4px;
  line-height: 1;
}
.header-cta {
  flex-shrink: 0;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--logo-accent, #8c2a1e);
  border: 2px solid var(--logo-accent, #8c2a1e);
  padding: 0.4rem 0.9rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.header-cta:hover {
  background: var(--logo-accent, #8c2a1e);
  color: var(--nav-bg, #1c2b3a);
}

/* Hamburger button */
.hamburger {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.8);
  font-size: 1rem;
  padding: 3px 8px;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}

/* ── HERO BANNER ── */
.hero-banner {
  background: var(--hero-bg, #1c2b3a);
  position: relative;
  overflow: hidden;
  padding: 3.5rem 1.5rem 3rem;
}
.hero-watermark {
  position: absolute;
  right: -0.02em;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font);
  font-size: 13rem;
  font-weight: 900;
  color: rgba(255,255,255,0.05);
  letter-spacing: -0.04em;
  line-height: 1;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}
.hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.hero-eyebrow {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--logo-accent, #8c2a1e);
  border: 1.5px solid var(--logo-accent, #8c2a1e);
  padding: 0.3rem 0.9rem;
  margin-bottom: 1.1rem;
}
.hero-heading {
  font-family: var(--font);
  font-size: var(--hero-heading-size, 3rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  margin: 0 0 0.15rem;
}
.hero-heading-accent {
  font-family: var(--font);
  font-size: var(--hero-heading-size, 3rem);
  font-weight: 700;
  color: var(--logo-accent, #8c2a1e);
  line-height: 1.1;
  margin: 0 0 1rem;
}
.hero-subtext {
  font-family: var(--sans);
  font-size: var(--hero-subtext-size, 0.9rem);
  font-style: var(--hero-subtext-style, normal);
  color: rgba(255,255,255,0.6);
  line-height: 1.6;
  max-width: 420px;
  margin: 0;
}

/* ── POLAROID STACK ── */
.hero-with-polaroids {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
  align-items: center;
}
.hero-polaroids {
  position: relative;
  height: 300px;
}
.polaroid {
  position: absolute;
  background: #fff;
  padding: 10px 10px 36px 10px;
  box-shadow: 3px 5px 16px rgba(0,0,0,0.35);
  width: 175px;
}
.polaroid img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  filter: saturate(0.85);
}
.polaroid-caption {
  font-family: 'Bitter', serif;
  font-size: 0.72rem;
  font-weight: 400;
  color: #555;
  text-align: center;
  padding-top: 8px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.polaroid-1 { transform: rotate(-4deg) translate(-110px, 15px); z-index: 1; }
.polaroid-2 { transform: rotate(2deg)  translate(10px,  -5px); z-index: 3; }
.polaroid-3 { transform: rotate(5deg)  translate(120px,  20px); z-index: 2; }
@media (max-width: 900px) {
  .hero-with-polaroids { grid-template-columns: 1fr; }
  .hero-polaroids { display: none; }
}

/* ── LAYOUT WRAPPER ── */
.wrapper {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ── FLASH MESSAGES ── */
.flash-wrap { padding: 0 1rem; }
.flash {
  max-width: 1180px;
  margin: 12px auto 0;
  padding: 12px 18px;
  font-size: 14px;
  font-family: var(--sans);
  border: 1px solid;
}
.flash-success { background: #dce8ee; color: #1c2b3a; border-color: #a0bcc8; }
.flash-error   { background: #f0dcd8; color: #8c2a1e; border-color: #d4a8a0; }
.flash-info    { background: #e8eff4; color: #1c2b3a; border-color: #a0bcc8; }

/* ── FEATURED SECTION WRAPPER ── */
.featured-section {
  background: var(--featured-bg, var(--bg));
  margin-left: -1rem;
  margin-right: -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
  padding-bottom: 1rem;
}

/* ── SECTION RULE ── */
.section-rule {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.4rem 0 0.8rem;
}
.section-rule-label {
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}
.section-rule-line {
  flex: 1;
  height: 1px;
  background: var(--rule);
}
.section-rule-sub {
  font-family: var(--sans);
  font-size: 0.7rem;
  color: var(--ink-light);
  white-space: nowrap;
}

/* ── FEATURED GRID ── */
.featured-grid {
  display: grid;
  grid-template-columns: 1fr 1.9fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-bottom: 1px;
}
/* Explicit placement: hero at col 2, spanning both rows */
.featured-grid .ftile:nth-child(1) { grid-column: 1; grid-row: 1; }
.featured-grid .ftile:nth-child(2) { grid-column: 2; grid-row: 1 / 3; }
.featured-grid .ftile:nth-child(3) { grid-column: 3; grid-row: 1; }
.featured-grid .ftile:nth-child(4) { grid-column: 1; grid-row: 2; }
.featured-grid .ftile:nth-child(5) { grid-column: 3; grid-row: 2; }

.ftile {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg2);
}
.ftile > a.ftile-link {
  position: absolute;
  inset: 0;
  z-index: 3;
}
.ftile-img {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  transition: transform 0.4s ease;
}
.ftile-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  transition: transform 0.4s ease;
}
.ftile:hover .ftile-img,
.ftile:hover .ftile-img img { transform: scale(1.04); }

/* warm dark gradient overlay */
.ftile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(20,14,6,0.92) 0%,
    rgba(20,14,6,0.35) 50%,
    rgba(20,14,6,0.05) 100%
  );
  pointer-events: none;
  z-index: 1;
}
.ftile-body {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 1rem 1.1rem;
  z-index: 2;
  pointer-events: none;
}
.ftile-tag {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
  color: #8c2a1e;
}
.ftile-title {
  font-family: var(--font);
  font-weight: 600;
  color: #f2ece0;
  line-height: 1.25;
  font-size: 0.95rem;
}
.ftile-side { height: 240px; }
/* Hero = 2nd tile in featured grid (memories[0]) */
.featured-grid .ftile:nth-child(2) { height: 481px; }
.featured-grid .ftile:nth-child(2) .ftile-body { padding: 1.5rem; }
.featured-grid .ftile:nth-child(2) .ftile-tag  { font-size: 0.68rem; }
.featured-grid .ftile:nth-child(2) .ftile-title { font-size: 1.55rem; line-height: 1.2; }
.featured-grid .ftile:nth-child(2) .ftile-img   { font-size: 5rem; }

/* ── BOTTOM ROW ── */
.bottom-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-top: none;
  margin-bottom: 0;
}
.ftile-bottom { height: 220px; }
.ftile-bottom .ftile-title { font-size: 0.9rem; }

/* ── CARD GRID (V2 compact, 4-col) ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-bottom: 2rem;
}
/* 2-col inside feed column (category/decade/search pages) */
.feed-col .card-grid {
  grid-template-columns: repeat(2, 1fr);
}

.card {
  background: var(--surface);
  transition: background 0.2s;
  display: flex;
  flex-direction: column;
}
.card:hover { background: var(--bg2); }

.card-img-wrap {
  aspect-ratio: 4/3;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: var(--ink-light);
  text-decoration: none;
}
.card-img-wrap img,
.card-img-wrap .card-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: opacity 0.2s;
}
.card:hover .card-img-wrap img,
.card:hover .card-img-wrap .card-photo { opacity: 0.88; }

.card-body {
  padding: 0.75rem 0.85rem 0.9rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-tag {
  font-family: var(--sans);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 0.25rem;
}
.card-tag.tag-green { color: var(--accent2); }
.card-title {
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 0.4rem;
  flex: 1;
}
.card-title a { color: var(--ink); transition: color 0.15s; }
.card-title a:hover { color: var(--accent); }
.card-byline {
  font-size: 0.67rem;
  color: var(--ink-light);
  font-family: var(--sans);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.card-byline::before {
  content: '—';
  color: var(--rule);
}

/* ── FEED CONTROLS (used by category/decade/search/index) ── */
.feed-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0 0.75rem;
  flex-wrap: wrap;
}
.control-label {
  font-family: var(--sans);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-light);
}
.decade-btn {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  background: none;
  border: 1px solid var(--border);
  color: var(--ink-light);
  padding: 2px 8px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-block;
}
.decade-btn:hover,
.decade-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #f2ece0;
}
.sort-divider { width: 1px; height: 16px; background: var(--rule); margin: 0 4px; }
.sort-btn {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  background: none;
  border: 1px solid var(--ink-light);
  color: var(--ink-mid);
  padding: 2px 10px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-block;
}
.sort-btn.active { background: var(--ink); border-color: var(--ink); color: #f2ece0; }

/* ── DIGEST ROW ── */
.digest-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
.digest-list {
  border: 1px solid var(--border);
  background: var(--surface);
}
.digest-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  border-bottom: 1px solid var(--bg2);
  transition: background 0.15s;
  text-decoration: none;
  color: var(--ink);
}
.digest-item:last-child { border-bottom: none; }
.digest-item:hover { background: var(--bg2); }
.digest-thumb {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  border-right: 1px solid var(--bg2);
  background: var(--bg2);
  overflow: hidden;
}
.digest-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.digest-text { padding: 0.6rem 0.8rem; }
.digest-tag {
  font-family: var(--sans);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 0.15rem;
}
.digest-title {
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}
.digest-sub {
  font-size: 0.65rem;
  color: var(--ink-light);
  margin-top: 0.2rem;
  font-family: var(--sans);
}

/* ── SIDEBAR (index page) ── */
.sidebar { display: flex; flex-direction: column; }
.sidebar-box {
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 1rem;
}
.sidebar-head {
  background: var(--ink);
  color: #f2ece0;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.5rem 0.85rem;
}
.sidebar-item {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--bg2);
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--ink-mid);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.15s;
  text-decoration: none;
}
.sidebar-item:last-child { border-bottom: none; }
.sidebar-item:hover { background: var(--bg2); }
.sidebar-count {
  font-size: 0.68rem;
  color: var(--ink-light);
  background: var(--bg2);
  padding: 0.1rem 0.4rem;
  font-family: var(--sans);
}
.submit-box {
  border: 1px solid var(--border);
  background: var(--ink);
  padding: 1.25rem;
  text-align: center;
}
.submit-box h3 {
  font-family: var(--font);
  font-size: 1rem;
  color: #f2ece0;
  margin-bottom: 0.4rem;
}
.submit-box p {
  font-size: 0.73rem;
  color: #7a8a96;
  margin-bottom: 0.85rem;
  line-height: 1.5;
  font-family: var(--sans);
}
.submit-btn {
  display: inline-block;
  background: var(--accent);
  color: #f2ece0;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.55rem 1.25rem;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
  text-decoration: none;
}
.submit-btn:hover { background: #6e1f16; }

/* ── PAGINATION ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
  padding-bottom: 2rem;
}
.page-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 18px;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-mid);
  transition: background 0.15s;
  text-decoration: none;
}
.page-btn:hover { background: var(--bg2); }
.page-info { font-family: var(--sans); font-size: 0.78rem; color: var(--ink-light); }

/* ── EMPTY STATE ── */
.empty-feed { text-align: center; padding: 80px 24px; }
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-feed h3 {
  font-family: var(--font);
  font-weight: 700;
  font-size: 1.4rem;
  margin-bottom: 10px;
}
.empty-feed p {
  color: var(--ink-light);
  margin-bottom: 24px;
  font-family: var(--sans);
  font-size: 0.9rem;
}
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #f2ece0;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.55rem 1.25rem;
  transition: background 0.2s;
  text-decoration: none;
}
.btn-primary:hover { background: #6e1f16; }

/* ── CATEGORIES PAGE ── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}
.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2rem 1rem;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.cat-card:hover { background: var(--bg2); border-color: var(--border-dark); }
.cat-card-emoji { font-size: 2.5rem; line-height: 1; }
.cat-card-label { font-family: var(--font); font-size: 1rem; font-weight: 700; color: var(--ink); }
.cat-card-count { font-family: var(--sans); font-size: 0.8rem; color: var(--ink-light); }

/* ── FOOTER ── */
.site-footer {
  background: var(--ink);
  padding: 1.5rem 2rem;
  border-top: 3px solid var(--accent);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-logo {
  font-family: var(--font);
  font-weight: 700;
  font-size: 1.2rem;
  color: #8aa0b0;
  letter-spacing: -0.02em;
}
.footer-logo span { color: var(--accent); }
.footer-tagline {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-style: italic;
  color: #7a8a96;
}
.footer-nav { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-nav a {
  font-family: var(--sans);
  font-size: 0.72rem;
  color: #7a8a96;
  transition: color 0.15s;
}
.footer-nav a:hover { color: #8aa0b0; }
.footer-copy {
  font-family: var(--sans);
  font-size: 0.68rem;
  color: #4a5a6a;
}

/* ── CATEGORY PLACEHOLDER BACKGROUNDS ── */
.bg-phones         { background: linear-gradient(135deg, #1a0e0e, #3a1a14, #5a2018); }
.bg-computers      { background: linear-gradient(135deg, #0e1a2a, #1a3050, #2a5080); }
.bg-gaming         { background: linear-gradient(135deg, #0e1a0e, #1a3020, #2a5030); }
.bg-cameras        { background: linear-gradient(135deg, #1a140e, #3a2a14, #5a4020); }
.bg-audio          { background: linear-gradient(135deg, #140e1a, #2a1a3a, #4a2a5a); }
.bg-tv_video       { background: linear-gradient(135deg, #1a1a0e, #3a3a14, #5a5020); }
.bg-wheels         { background: linear-gradient(135deg, #1a0e0e, #3a1a14, #6a2a20); }
.bg-tools          { background: linear-gradient(135deg, #1a140e, #3a2a10, #5a3e1c); }
.bg-sporting_goods { background: linear-gradient(135deg, #0e140e, #1a2a14, #304a20); }
.bg-everything_else{ background: linear-gradient(135deg, #0e1414, #143030, #1a4a4a); }

/* Category badge (used by memory page) */
.cat-badge {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.68rem;
  padding: 2px 8px;
  border: 1px solid currentColor;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: inline-block;
  background: none;
}
.badge-phones    { color: var(--accent); }
.badge-computers { color: var(--accent2); }
.badge-gaming    { color: var(--blue); }
.badge-cameras   { color: var(--teal); }
.badge-audio     { color: var(--purple); }
.badge-wheels    { color: var(--amber); }
.badge-tv_video  { color: var(--blue); }
.badge-tools          { color: #8c2a1e; }
.badge-sporting_goods { color: #8c2a1e; }
.badge-everything_else{ color: var(--teal); }

/* ── LEGACY SIDEBAR WIDGETS (used by memory.html sidebar) ── */
.sidebar-widget {
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  margin-bottom: 1rem;
}
.widget-header {
  background: var(--ink);
  padding: 8px 14px;
}
.widget-title {
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #f2ece0;
}
.widget-body { padding: 12px 14px; }
.share-cta-text {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-mid);
  line-height: 1.5;
  margin-bottom: 10px;
}
.btn-share-sidebar {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--accent);
  color: #f2ece0;
  border: none;
  padding: 8px 18px;
  cursor: pointer;
  display: block;
  width: 100%;
  text-align: center;
  transition: background 0.2s;
  text-decoration: none;
}
.btn-share-sidebar:hover { background: #6e1f16; }

.popular-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--bg2);
  text-decoration: none;
  color: var(--ink);
}
.popular-item:last-child { border-bottom: none; }
.popular-count {
  font-family: var(--font);
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
  min-width: 24px;
}
.popular-name {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-mid);
}
.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--bg2);
  text-decoration: none;
  color: var(--ink);
  transition: padding-left 0.15s;
}
.cat-item:last-child { border-bottom: none; }
.cat-item:hover { padding-left: 4px; }
.cat-item-name {
  font-family: var(--sans);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cat-item-count {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--ink-light);
}

/* ── LIGHTBOX ── */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
#lightbox img {
  max-width: 94vw;
  max-height: 94vh;
  object-fit: contain;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

/* ── MOBILE NAV ── */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--ink);
  z-index: 200;
  overflow-y: auto;
}
.mobile-nav.open { display: block; }
.mobile-nav-inner {
  padding: 1rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.mobile-nav-close {
  align-self: flex-end;
  background: none;
  border: none;
  color: #8aa0b0;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  line-height: 1;
}
.mobile-nav-inner a {
  color: rgba(255,255,255,0.8);
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 10px 12px;
  border-bottom: 1px solid #0e1820;
  transition: background 0.15s;
}
.mobile-nav-inner a:hover { background: #0e1820; color: #f2ece0; }
.mobile-nav-heading {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 10px 12px 2px;
  font-family: var(--sans);
}

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
  .header-nav { display: none; }
  .header-search { display: none; }
  .header-cta { display: none; }
  .header-url { display: none; }
  .hamburger { display: block; }
  .logo { font-size: var(--logo-size, 1.6rem); }
  .featured-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }
  .featured-grid .ftile:nth-child(1) { grid-column: 1; grid-row: 1; }
  .featured-grid .ftile:nth-child(2) { grid-column: 1 / 3; grid-row: 2; height: 280px; }
  .featured-grid .ftile:nth-child(3) { grid-column: 2; grid-row: 1; }
  .featured-grid .ftile:nth-child(4) { grid-column: 1; grid-row: 3; }
  .featured-grid .ftile:nth-child(5) { grid-column: 2; grid-row: 3; }
  .ftile-side { height: 200px; }
  .bottom-row { grid-template-columns: 1fr 1fr; }
  .bottom-row .ftile-bottom:nth-child(3) { grid-column: 1 / 3; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .digest-grid { grid-template-columns: 1fr; }
  .digest-grid .sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
}

@media (max-width: 600px) {
  .logo { font-size: 1.5rem; }
  .hero-heading, .hero-heading-accent { font-size: 2rem; }
  .hero-watermark { font-size: 8rem; }
  .wrapper { padding: 0 0.5rem; }
  .featured-grid { grid-template-columns: 1fr; grid-template-rows: auto; }
  .featured-grid .ftile:nth-child(1),
  .featured-grid .ftile:nth-child(2),
  .featured-grid .ftile:nth-child(3),
  .featured-grid .ftile:nth-child(4),
  .featured-grid .ftile:nth-child(5) {
    grid-column: 1; grid-row: auto;
    height: 200px;
  }
  .bottom-row { grid-template-columns: 1fr; }
  .bottom-row .ftile-bottom:nth-child(3) { grid-column: 1; }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .digest-grid .sidebar { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; text-align: center; padding: 1.25rem 1rem; }
}

/* ══════════════════════════════════════════════════════
   FORM PAGES — preserve existing styles unchanged
   ══════════════════════════════════════════════════════ */

/* ── Submit form ── */
.submit-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  font-family: var(--font);
}
.submit-header { text-align: center; margin-bottom: 40px; }
.submit-eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--amber); margin-bottom: 12px;
}
.submit-title { font-family: var(--font); font-size: 36px; font-weight: 900; margin-bottom: 10px; }
.submit-sub { font-family: var(--font); font-weight: 400; color: var(--ink-faint); }

.submit-form { display: flex; flex-direction: column; gap: 28px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-label { font-weight: 600; font-size: 15px; color: var(--ink); }
.form-optional { font-weight: 400; color: var(--ink-faint); font-size: 13px; }
.form-hint { font-size: 14px; color: var(--ink-light); }
.form-input {
  background: var(--warm-white);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 11px 14px;
  font-family: var(--font);
  font-size: 17px;
  color: var(--ink);
  transition: border-color .15s;
  width: 100%;
}
.form-input:focus { outline: none; border-color: var(--teal); }
.form-input::placeholder { color: #8a9aaa; opacity: 1; }
.input-error { border-color: #8c2a1e !important; background: #fff8f8 !important; }
.field-error { color: #8c2a1e; font-size: 13px; font-weight: 600; margin-top: 6px; }
.form-textarea { min-height: 180px; resize: vertical; line-height: 1.6; }
.form-select { cursor: pointer; }
.form-year { max-width: 160px; }
.form-short { max-width: 380px; }
.form-divider { border: none; border-top: 2px dashed var(--border); }
.about-you-intro { font-size: 16px; color: var(--ink); }

.upload-area {
  background: var(--warm-white);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.upload-area:hover { border-color: var(--teal); background: #f5f0e8; }
.upload-icon { font-size: 32px; margin-bottom: 8px; }
.upload-text { font-weight: 600; color: var(--ink-light); margin-bottom: 6px; }
.upload-hint { font-size: 12px; color: var(--ink-faint); }
.photo-preview { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.photo-preview img { max-width: 200px; border-radius: 8px; border: 2px solid var(--border); }
.remove-photo {
  background: none; border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 12px;
  font-size: 13px; cursor: pointer; color: var(--ink-faint);
  transition: all .15s;
}
.remove-photo:hover { border-color: #8c2a1e; color: #8c2a1e; }

.username-status { font-size: 13px; font-weight: 500; margin-top: 4px; display: block; }
.username-status.available { color: #1c2b3a; }
.username-status.taken { color: var(--amber); }
.username-status.checking { color: var(--ink-faint); }

.form-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.btn-submit {
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  padding: 14px 32px;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: background .15s, transform .1s;
  font-family: var(--font);
}
.btn-submit:hover { background: var(--teal-light); transform: translateY(-1px); }
.form-note { font-size: 14px; color: var(--ink-light); }

/* ── Success page ── */
.success-wrap {
  max-width: 600px; margin: 0 auto;
  padding: 64px 24px 80px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  font-family: var(--font);
}
.success-icon { font-size: 64px; }
.success-title { font-family: var(--font); font-weight: 900; font-size: 36px; }
.success-sub { font-family: var(--font); font-weight: 400; color: var(--ink-faint); }
.success-note { font-size: 14px; color: var(--teal); background: #d4eeee; padding: 12px 20px; border-radius: var(--radius); }
.share-link-box {
  display: flex; align-items: center; gap: 12px;
  background: var(--warm-white); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 16px;
  font-family: monospace; font-size: 13px; margin-top: 8px;
}
.btn-copy {
  background: var(--teal); color: #fff; border: none;
  border-radius: 6px; padding: 6px 14px; font-size: 13px;
  font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s;
}
.btn-copy:hover { background: var(--teal-light); }

/* ── Memory page ── */
.memory-wrap { max-width: 1100px; margin: 0 auto; padding: 32px 24px 80px; font-family: var(--font); }
.memory-header {
  background: var(--warm-white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 28px 24px;
  margin-bottom: 28px; box-shadow: var(--shadow);
}
.memory-title { font-family: var(--font); font-weight: 900; font-size: 32px; margin: 10px 0 8px; line-height: 1.2; }
.memory-device { font-size: 14px; color: var(--teal); font-weight: 600; margin-bottom: 8px; }
.memory-byline { font-size: 13px; color: var(--ink-faint); }
.memory-layout { display: grid; grid-template-columns: 1fr 280px; gap: 28px; align-items: start; }
.memory-photo { margin-bottom: 24px; }
.memory-photo img { border-radius: var(--radius); border: 1px solid var(--border); width: 100%; }
.memory-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 24px; }
.gallery-img { width: 100%; height: 220px; object-fit: contain; border-radius: var(--radius); border: 1px solid var(--border); background: var(--cream); }
.memory-story {
  font-family: var(--font); font-weight: 400; font-size: 17px; line-height: 1.85;
  color: var(--ink-light); margin-bottom: 28px;
  background: var(--warm-white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
}
.memory-story p { margin: 0 0 1.2em; }
.memory-story p:last-child { margin-bottom: 0; }
.taken-photo-section { margin-bottom: 28px; }
.taken-photo-label { font-family: var(--font); font-weight: 700; font-size: 18px; margin-bottom: 12px; }
.taken-photo-section img { border-radius: var(--radius); border: 1px solid var(--border); }
.memory-actions { margin-bottom: 32px; }

/* Emoji picker toolbar */
.emoji-toolbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.emoji-btn { background: var(--paper-mid); border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; font-size: 18px; cursor: pointer; transition: background .15s; line-height: 1; }
.emoji-btn:hover { background: var(--paper-dark); }

/* Reaction bar */
.reaction-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.reaction-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--paper); border: 1.5px solid var(--border);
  border-radius: 20px; padding: 4px 12px; font-size: 15px; cursor: pointer;
  transition: all .15s; user-select: none;
}
.reaction-btn:hover { border-color: var(--ink); background: var(--paper-dark); }
.reaction-btn.active { border-color: var(--accent); background: #f5e8e6; }
.reaction-btn .r-count { font-size: 12px; font-weight: 700; color: var(--ink); min-width: 8px; }
.reaction-btn.active .r-count { color: var(--accent); }
.btn-action {
  background: var(--warm-white); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 18px; font-size: 14px;
  cursor: pointer; transition: border-color .15s, color .15s;
  font-family: var(--font);
}
.btn-action:hover { border-color: var(--teal); color: var(--teal); }

.comments-section { background: var(--warm-white); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.comments-title { font-family: var(--font); font-weight: 700; font-size: 22px; margin-bottom: 20px; }
.comment-list { display: flex; flex-direction: column; gap: 20px; margin-bottom: 32px; }
.comment { padding: 16px; background: var(--cream); border-radius: 8px; border: 1px solid var(--border); }
.comment.reply { margin-left: 24px; background: var(--warm-white); }
.comment-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.comment-author { font-weight: 600; font-size: 14px; font-family: var(--font); }
.comment-time { font-size: 12px; color: var(--ink-faint); flex: 1; font-family: var(--font); }
.flag-btn { background: none; border: none; font-size: 12px; cursor: pointer; opacity: 0.4; transition: opacity .15s; padding: 2px; }
.flag-btn:hover { opacity: 1; }
.comment-body { font-family: var(--font); font-weight: 400; font-size: 15px; line-height: 1.65; color: var(--ink-light); }
.comment-body.deleted { color: var(--ink-faint); }
.comment-footer { margin-top: 8px; }
.reply-btn { background: none; border: none; font-size: 13px; color: var(--ink-faint); cursor: pointer; transition: color .15s; font-family: var(--font); }
.reply-btn:hover { color: var(--teal); }
.replies { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.reply-form { margin-top: 12px; }
.reply-textarea { min-height: 80px; margin-bottom: 8px; }
.reply-fields { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn-reply {
  background: var(--teal); color: #fff; border: none;
  border-radius: 8px; padding: 8px 18px; font-size: 14px;
  font-weight: 600; cursor: pointer; white-space: nowrap; font-family: var(--font);
}
.comment-form-wrap { border-top: 1px solid var(--border); padding-top: 24px; }
.comment-form-title { font-family: var(--font); font-weight: 700; font-size: 20px; margin-bottom: 16px; }
.comment-fields { display: flex; gap: 12px; margin: 12px 0; flex-wrap: wrap; }
.comment-fields .form-short { flex: 1; min-width: 180px; }

.memory-sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 90px; }
.sidebar-card {
  background: var(--warm-white); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px;
}
.sidebar-title { font-family: var(--font); font-weight: 700; font-size: 16px; margin-bottom: 14px; color: var(--ink); }
.cat-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--ink); text-decoration: none; transition: color .15s;
}
.cat-link:last-child { border-bottom: none; }
.cat-link:hover { color: var(--teal); }
.cat-count { font-size: 11px; color: var(--ink-faint); }

.related-list { display: flex; flex-direction: column; gap: 12px; }
.related-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--cream); transition: border-color .15s;
}
.related-card:hover { border-color: var(--teal); }
.related-thumb {
  width: 42px; height: 42px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.related-title { font-weight: 600; font-size: 13px; color: var(--ink); line-height: 1.3; font-family: var(--font); }
.related-device { font-size: 11px; color: var(--ink-faint); margin-top: 2px; font-family: var(--font); }

/* Page wrap — used by category/decade/search/memory pages */
.page-wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 28px 24px 48px;
  display: grid;
  grid-template-columns: 1fr 270px;
  gap: 32px;
  font-family: var(--font);
}
.feed-col { min-width: 0; }

@media (max-width: 900px) {
  .memory-layout { grid-template-columns: 1fr; }
  .memory-sidebar { display: none; }
  .comment-fields { flex-direction: column; }
  .page-wrap { grid-template-columns: 1fr; }
}

/* ── Static pages ── */
.static-wrap { max-width: 720px; margin: 0 auto; padding: 48px 24px 80px; font-family: var(--font); }
.static-title { font-family: var(--font); font-weight: 900; font-size: 36px; margin-bottom: 28px; }
.static-body { font-family: var(--font); font-weight: 400; font-size: 16px; line-height: 1.85; color: var(--ink-light); }
.static-body h2 { font-family: var(--font); font-weight: 700; font-size: 22px; color: var(--ink); margin: 28px 0 12px; }
.static-body p { margin-bottom: 16px; }
.static-body ul { margin: 0 0 16px 20px; }
.static-body li { margin-bottom: 6px; }
.static-body a { color: var(--teal); text-decoration: underline; }

/* ── Manage page ── */
.manage-wrap { max-width: 680px; margin: 0 auto; padding: 48px 24px 80px; font-family: var(--font); }
.manage-title { font-family: var(--font); font-weight: 900; font-size: 28px; color: var(--teal); margin-bottom: 6px; }
.manage-sub { color: var(--ink-faint); font-size: 14px; margin-bottom: 36px; }
.manage-section { background: var(--warm-white); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 32px; margin-bottom: 24px; }
.manage-section h2 { font-family: var(--font); font-weight: 700; font-size: 18px; margin-bottom: 20px; color: var(--ink); }

/* Search page */
.feed-controls + p { font-family: var(--font); }
