/* threadit.co — fall palette, white ground, stitched details */
:root {
  --bg: #fffdf9;            /* warm white */
  --ink: #3f2d20;           /* warm dark brown text */
  --muted: #8a7364;
  --line: #e8ded2;
  --rust: #c2410c;
  --cranberry: #9f1239;
  --choc: #5c3a21;
  --gold: #b45309;
  --gold-soft: #fde68a;
  --cream: #faf3e8;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--sans); color: var(--ink); background: var(--bg); line-height: 1.6; }
a { color: var(--cranberry); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem 1.5rem; background: rgba(255,253,249,.95);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: .55rem; color: var(--choc); }
.brand:hover { text-decoration: none; }
.wm { font-family: var(--serif); font-weight: 700; font-size: 1.35rem; letter-spacing: -.01em; }
.wm em { font-style: normal; color: var(--rust); font-size: .8em; }
.nav nav { display: flex; align-items: center; gap: 1.35rem; }
.nav nav a { color: var(--ink); font-size: .95rem; font-weight: 500; }
.nav nav a:hover { color: var(--cranberry); text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: .7rem; }
.btn {
  display: inline-block; padding: .6rem 1.25rem; border-radius: 999px;
  font-weight: 600; font-size: .92rem; border: 1px solid transparent;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--cranberry); color: #fff; }
.btn-primary:hover { background: #7f0e30; color: #fff; }
.btn-ghost { border-color: var(--line); color: var(--ink); background: #fff; }
.btn-ghost:hover { border-color: var(--rust); color: var(--rust); }

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(160deg, #fffdf9 0%, var(--cream) 55%, #f7e8d0 100%);
  padding: 4.5rem 1.5rem 4rem; text-align: center;
  border-bottom: 1px solid var(--line);
}
.hero h1 { font-family: var(--serif); font-size: 3rem; letter-spacing: -.015em; color: var(--choc); }
.hero .sub { font-size: 1.15rem; color: var(--muted); max-width: 36rem; margin: 1rem auto 2rem; }
.search {
  display: flex; max-width: 34rem; margin: 0 auto 1.4rem;
  background: #fff; border: 1px solid var(--line); border-radius: 999px; overflow: hidden;
  box-shadow: 0 6px 24px rgba(92,58,33,.08);
}
.search input {
  flex: 1; border: none; outline: none; padding: .9rem 1.3rem;
  font: inherit; font-size: 1rem; background: transparent; color: var(--ink);
}
.search button {
  border: none; background: var(--rust); color: #fff; font: inherit; font-weight: 600;
  padding: 0 1.6rem; cursor: pointer;
}
.search button:hover { background: var(--cranberry); }
.pills { display: flex; flex-wrap: wrap; gap: .55rem; justify-content: center; margin-bottom: 2rem; }
.pill {
  padding: .4rem 1rem; border: 1px dashed #d8c3a5; border-radius: 999px;
  background: #fff; font-size: .85rem; font-weight: 600; color: var(--choc);
}
.pill:hover { border-color: var(--rust); color: var(--rust); text-decoration: none; border-style: solid; }
.hero-btns { display: flex; gap: .8rem; justify-content: center; }

/* ---------- craft tiles (pure CSS placeholders) ---------- */
.tile {
  position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line);
}
.tile::before { /* stitched inner border — the threadit signature */
  content: ""; position: absolute; inset: 8px; border: 2px dashed rgba(255,255,255,.75);
  border-radius: 6px;
}
.tile span {
  position: absolute; left: 10px; bottom: 8px; font-size: .68rem; font-weight: 700;
  color: rgba(255,255,255,.9); letter-spacing: .08em; text-transform: uppercase;
}
.t-weave { background:
  repeating-linear-gradient(45deg, rgba(255,255,255,.12) 0 2px, transparent 2px 9px),
  repeating-linear-gradient(-45deg, rgba(255,255,255,.12) 0 2px, transparent 2px 9px),
  #c2410c; }
.t-plaid { background:
  repeating-linear-gradient(0deg, rgba(159,18,57,.45) 0 14px, transparent 14px 38px),
  repeating-linear-gradient(90deg, rgba(180,83,9,.5) 0 18px, transparent 18px 46px),
  #faf3e8; }
.t-plaid::before { border-color: rgba(92,58,33,.45); }
.t-plaid span { color: var(--choc); }
.t-hoop { background:
  radial-gradient(circle at 50% 50%, transparent 0 30%, rgba(255,255,255,.35) 30% 33%, transparent 33%),
  radial-gradient(circle at 50% 50%, #f7e8d0 0 28%, transparent 28%),
  #5c3a21; }
.t-xstitch { background:
  repeating-conic-gradient(rgba(255,255,255,.18) 0% 25%, transparent 0% 50%) 0 0 / 14px 14px,
  #9f1239; }
.t-linen { background:
  repeating-linear-gradient(0deg, rgba(92,58,33,.12) 0 1px, transparent 1px 5px),
  repeating-linear-gradient(90deg, rgba(92,58,33,.12) 0 1px, transparent 1px 5px),
  #e9dcc5; }
.t-linen::before { border-color: rgba(92,58,33,.4); }
.t-linen span { color: var(--choc); }
.t-gold { background:
  repeating-linear-gradient(-45deg, rgba(255,255,255,.14) 0 3px, transparent 3px 12px),
  #b45309; }

/* ---------- sections & cards ---------- */
section { padding: 3.5rem 1.5rem; max-width: 1160px; margin: 0 auto; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.6rem; }
.sec-head h2 { font-family: var(--serif); font-size: 1.8rem; color: var(--choc); }
.sec-head a { font-size: .9rem; font-weight: 600; color: var(--rust); }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; transition: box-shadow .15s ease, transform .15s ease;
}
.card:hover { box-shadow: 0 10px 30px rgba(92,58,33,.12); transform: translateY(-2px); }
.card .body { padding: .9rem 1rem 1.1rem; }
.card h3 { font-size: .98rem; line-height: 1.35; color: var(--ink); }
.card .by { font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.card .meta { display: flex; justify-content: space-between; align-items: center; margin-top: .6rem; }
.price { font-weight: 700; color: var(--gold); font-size: .95rem; }
.likes { font-size: .8rem; color: var(--muted); }
.tag {
  display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--cranberry); background: #fdf0f3;
  padding: .15rem .5rem; border-radius: 4px; margin-bottom: .45rem;
}

/* masonry for the gallery */
.masonry { columns: 4; column-gap: 1.2rem; }
.masonry .card { break-inside: avoid; margin-bottom: 1.2rem; display: block; }
.masonry .card:hover { text-decoration: none; }
.t-tall { aspect-ratio: 3 / 4; }
.t-sq { aspect-ratio: 1 / 1; }

/* community rows */
.comm .card { padding: 1.2rem 1.3rem; }
.comm .card h3 { font-size: 1.02rem; }
.comm .meta { color: var(--muted); font-size: .82rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* CTA band */
.cta {
  background: linear-gradient(120deg, var(--cranberry), var(--choc));
  color: #fdeee8; text-align: center; padding: 3.5rem 1.5rem; max-width: none;
}
.cta h2 { font-family: var(--serif); font-size: 2rem; color: #fff; }
.cta p { margin: .8rem auto 1.6rem; max-width: 30rem; color: #f3d5c8; }
.cta .btn { background: var(--gold-soft); color: var(--choc); }
.cta .btn:hover { background: #fff; color: var(--choc); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); background: var(--cream); padding: 2.5rem 1.5rem; }
.foot-inner { max-width: 1160px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
.foot h4 { font-family: var(--serif); font-size: .95rem; color: var(--choc); margin-bottom: .6rem; }
.foot a { display: block; color: var(--muted); font-size: .88rem; margin-bottom: .35rem; }
.foot a:hover { color: var(--rust); }
.foot .mark { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.foot-blurb { font-size: .85rem; color: var(--muted); }
.foot-lower { margin-top: 1.5rem; }
.foot .note { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 1.2rem;
  font-size: .8rem; color: var(--muted); text-align: center; }

/* ---------- auth dialog + member nav ---------- */
.nav-hi {
  font-size: .9rem; font-weight: 600; color: var(--choc);
  max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.auth-veil {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(63,45,32,.45); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.auth-veil[hidden] { display: none; }
.auth-box {
  position: relative; background: var(--bg); border: 1px solid var(--line);
  border-radius: 16px; padding: 2rem 2rem 1.6rem; width: 100%; max-width: 24rem;
  box-shadow: 0 20px 60px rgba(63,45,32,.3);
}
.auth-box h2 { font-family: var(--serif); color: var(--choc); font-size: 1.5rem; margin-bottom: 1rem; }
.auth-close {
  position: absolute; top: .8rem; right: .9rem; border: 0; background: none;
  font-size: 1.5rem; color: var(--muted); cursor: pointer; line-height: 1;
}
.auth-close:hover { color: var(--cranberry); }
.auth-tabs { display: flex; gap: .4rem; margin-bottom: 1.2rem; border-bottom: 2px solid var(--line); }
.auth-tabs button {
  background: none; border: 0; padding: .45rem .9rem; font: inherit; cursor: pointer;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.auth-tabs button.on { color: var(--choc); border-bottom-color: var(--cranberry); font-weight: 600; }
.auth-form label {
  display: block; font-size: .82rem; font-weight: 600; color: var(--muted);
  text-transform: lowercase; margin-bottom: .8rem;
}
.auth-form input {
  display: block; width: 100%; box-sizing: border-box; margin-top: .25rem;
  padding: .55rem .7rem; font: inherit; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.auth-form input:focus { outline: none; border-color: var(--rust); }
.auth-go { width: 100%; margin-top: .3rem; }
.auth-note { font-size: .8rem; color: var(--muted); margin-top: .7rem; min-height: 1.1em; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .grid, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .masonry { columns: 3; }
  .foot-inner { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 2.3rem; }
}
@media (max-width: 620px) {
  .grid, .grid-3 { grid-template-columns: 1fr; }
  .masonry { columns: 2; }
  .nav nav { display: none; }
  .hero { padding: 3rem 1.2rem; }
}

/* homepage latest feed strip */
#feedLatest { display: grid; gap: .5rem; }
.feed-item {
  display: flex; gap: .8rem; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: .7rem 1rem; text-decoration: none; color: var(--ink);
}
.feed-item:hover { border-color: var(--rust); }
.feed-ic { font-size: 1.3rem; }
.feed-tx { min-width: 0; }
.feed-tx b { display: block; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-tx i { font-size: .8rem; color: var(--muted); font-style: normal; }
