/*
 * Shared styles for shelfpin.app.
 *
 * Extracted from index.html when the guides were added — three pages copying
 * the same forty lines of CSS is three places to forget when the dark-mode
 * colours change, which is exactly how privacy.html ended up unreadable once
 * already.
 */

:root {
  color-scheme: light dark;
  --fg: #1a1a1a;
  --bg: #fff;
  --muted: #5c6670;
  --line: #e1e4e8;
  --panel: #f6f8fa;
  --link: #0f766e;
  --green: #1a7f37;
  --amber: #b45309;
  --grey: #8c9196;
  /* The teal from the app icon. One accent, used sparingly. */
  --brand: #0f766e;
  --brand-soft: #e6f2f0;
  --card: #fff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e8e8e8;
    --bg: #141414;
    --muted: #9aa4ae;
    --line: #333;
    --panel: #1e1e1e;
    --link: #5eead4;
    --green: #3fb950;
    --amber: #d29922;
    --brand: #2dd4bf;
    --brand-soft: #12312e;
    --card: #1a1a1a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }

body {
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 46rem;
  margin: 0 auto;
  padding: 3.5rem 1.25rem 5rem;
  color: var(--fg);
  background: var(--bg);
}

h1 { font-size: 2.4rem; line-height: 1.15; margin: 0 0 .6rem; letter-spacing: -0.02em; }
.tagline { font-size: 1.2rem; color: var(--muted); margin: 0 0 2.5rem; }
h2 { font-size: 1.2rem; margin: 2.75rem 0 .75rem; }
h3 { font-size: 1.02rem; margin: 2rem 0 .5rem; }
a { color: var(--link); }

/* Article pages: smaller title, and a way back to the front page. */
.guide h1 { font-size: 1.9rem; margin-bottom: 1rem; }
.back { display: inline-block; margin: 0 0 2rem; font-size: .9rem; }

.demo {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 1.25rem 1.5rem; margin: 0 0 2rem; max-width: 24rem;
}
.demo-heading { font-weight: 600; margin: 0 0 .75rem; }
.row { display: flex; align-items: baseline; gap: .6rem; margin: .45rem 0; flex-wrap: wrap; }
.dot { flex: 0 0 auto; width: .5em; height: .5em; border-radius: 50%; transform: translateY(-.1em); }
.name { flex: 1 1 auto; min-width: 0; }
.qty { flex: 0 0 auto; opacity: .75; font-variant-numeric: tabular-nums; }
.in .dot { background: var(--green); }
.low .dot { background: var(--amber); }
.low .qty { color: var(--amber); opacity: 1; }
.out .dot { background: var(--grey); }
.out .name, .out .qty { opacity: .55; }

ul { padding-left: 1.2rem; }
li { margin: .45rem 0; }

/* Code has to scroll rather than push the page sideways on a phone. */
pre {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: .9rem 1rem; overflow-x: auto; font-size: .875rem; line-height: 1.5;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
pre code { font-size: 1em; }

blockquote {
  margin: 1.5rem 0; padding: .25rem 0 .25rem 1.1rem;
  border-left: 3px solid var(--line); color: var(--muted);
}

/* ---- Masthead ------------------------------------------------------- */

/*
 * The landing page wants room; the guides want a narrow measure you can
 * actually read a thousand words in. Two widths, not one.
 */
body.home { max-width: 64rem; padding-top: 2rem; }

.masthead {
  display: flex; align-items: center; justify-content: space-between;
  gap: .6rem; margin: 0 0 3rem;
}
.masthead svg { width: 30px; height: 30px; border-radius: 7px; flex: 0 0 auto; }
.masthead .wordmark { font-weight: 650; font-size: 1.05rem; letter-spacing: -0.01em; }
.masthead .brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: .6rem; }
.masthead nav { display: flex; align-items: center; gap: 1.4rem; font-size: .93rem; }
.masthead nav a { text-decoration: none; color: var(--muted); }
.masthead nav a:hover { color: var(--fg); }
@media (max-width: 34rem) { .masthead nav .hide-sm { display: none; } }

/* ---- Hero ----------------------------------------------------------- */

.hero {
  display: grid; grid-template-columns: 1fr; gap: 2.5rem;
  background: var(--brand-soft); border-radius: 16px;
  padding: 2.5rem 2rem; margin: 0 0 1rem;
}
@media (min-width: 48rem) {
  .hero { grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; padding: 3rem 2.75rem; }
}
.hero h1 { font-size: 2.7rem; }
@media (min-width: 48rem) { .hero h1 { font-size: 3rem; } }
.hero .tagline { margin-bottom: 1.25rem; font-size: 1.15rem; }
.hero p { max-width: 34rem; }

/* Three short claims, each of which the app can actually back up. */
.trust {
  list-style: none; padding: 0; margin: 1.25rem 0 0;
  display: flex; flex-wrap: wrap; gap: .4rem 1.25rem;
  font-size: .88rem; color: var(--muted);
}
.trust li { margin: 0; }
.trust li::before { content: "✓ "; color: var(--brand); font-weight: 700; }

.cta {
  display: inline-block; background: var(--brand); color: #fff;
  padding: .7rem 1.25rem; border-radius: 8px; text-decoration: none;
  font-weight: 600; font-size: .95rem;
}
.cta:hover { filter: brightness(1.08); }
.cta-note { display: block; margin-top: .7rem; color: var(--muted); font-size: .9rem; }

/* ---- The product-page mock ------------------------------------------ */

/*
 * A stylised product page rather than a screenshot. Stays sharp at any size,
 * follows the dark-mode palette, weighs nothing, and doesn't put a test store
 * full of fake snowboards on the marketing site.
 */
.mock {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 1.1rem; font-size: .95rem;
}
.mock-media {
  aspect-ratio: 4 / 3; border-radius: 9px; margin-bottom: 1rem;
  background:
    radial-gradient(circle at 30% 28%, rgba(45, 212, 191, .22), transparent 55%),
    radial-gradient(circle at 72% 68%, rgba(15, 118, 110, .18), transparent 55%),
    var(--panel);
  display: grid; place-items: center;
}
.mock-media span { color: var(--muted); font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; }
.mock-title { font-weight: 650; font-size: 1.05rem; margin: 0 0 .15rem; }
.mock-price { color: var(--muted); margin: 0 0 .9rem; font-variant-numeric: tabular-nums; }
.mock-swatches { display: flex; gap: .4rem; margin: 0 0 1rem; flex-wrap: wrap; }
.mock-swatches span {
  border: 1px solid var(--line); border-radius: 6px;
  padding: .22rem .55rem; font-size: .8rem; color: var(--muted);
}
.mock-swatches span.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.mock-btn {
  display: block; text-align: center; border-radius: 8px; padding: .6rem;
  font-size: .9rem; font-weight: 600; margin-bottom: .5rem;
}
.mock-btn.outline { border: 1px solid var(--fg); }
.mock-btn.solid { background: var(--fg); color: var(--bg); }
.mock .demo {
  margin: 1rem 0 0; max-width: none; padding: .9rem 1rem;
  border-style: dashed; border-color: var(--brand);
}
.mock-caption {
  margin: .75rem 0 0; font-size: .82rem; color: var(--brand); font-weight: 600;
  display: flex; align-items: center; gap: .4rem;
}

/* ---- Guide cards ----------------------------------------------------- */

.guides { list-style: none; padding: 0; display: grid; gap: 1rem; }
@media (min-width: 40rem) { .guides { grid-template-columns: 1fr 1fr; } }
.guides li {
  margin: 0; background: var(--card); border: 1px solid var(--line);
  border-radius: 11px; padding: 1.1rem 1.2rem;
}
.guides li:hover { border-color: var(--brand); }
.guides a { font-weight: 600; text-decoration: none; }
.guides a:hover { text-decoration: underline; }
.guides .why { display: block; margin-top: .45rem; color: var(--muted); font-size: .93rem; }

/* ---- Assorted -------------------------------------------------------- */

.callout {
  background: var(--brand-soft); border-radius: 11px;
  padding: 1.1rem 1.3rem; margin: 2rem 0;
}
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

/* ---- Guide pages ----------------------------------------------------- */

/* The tinted band that ties an article to the landing page. */
.pagehead {
  background: var(--brand-soft); border-radius: 16px;
  padding: 2rem 1.75rem; margin: 0 0 2.5rem;
}
.pagehead h1 { margin-top: 0; }
.pagehead p:last-child { margin-bottom: 0; }
.pagehead .lede { font-size: 1.1rem; color: var(--muted); }

/* Numbered option cards, for "here are your three choices". */
.options { display: grid; gap: 1rem; margin: 1.5rem 0; }
.option {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 11px; padding: 1.1rem 1.25rem;
}
.option h3 { margin: 0 0 .4rem; display: flex; align-items: baseline; gap: .55rem; }
.option h3 .n {
  flex: 0 0 auto; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: .8rem; font-weight: 700;
  display: inline-grid; place-items: center; transform: translateY(.1em);
}
.option p:last-child { margin-bottom: 0; }
.option.pick { border-color: var(--brand); border-width: 2px; }

/* A miniature of the app's Locations screen. */
.locmock {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 1.1rem 1.2rem; margin: 1.75rem 0;
  font-size: .93rem;
}
.locmock h4 {
  margin: 0 0 .2rem; font-size: .82rem; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted);
}
.locmock h4 + p { margin: 0 0 .8rem; color: var(--muted); font-size: .88rem; }
.locmock .lrow {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  padding: .55rem 0; border-top: 1px solid var(--line);
}
.locmock .lrow:first-of-type { border-top: 0; }
.locmock .lname { flex: 1 1 auto; min-width: 8rem; }
.locmock .lname small { display: block; color: var(--muted); font-size: .82rem; }
.locmock .tag {
  flex: 0 0 auto; font-size: .76rem; padding: .12rem .5rem; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
}
.locmock .split { margin-top: 1.4rem; }
.locmock .hidden-row .lname { opacity: .6; }

/* Closing card at the foot of an article. */
.endcta {
  background: var(--brand-soft); border-radius: 14px;
  padding: 1.5rem 1.6rem; margin: 3rem 0 0;
}
.endcta h2 { margin-top: 0; }
.endcta p:last-of-type { margin-bottom: 1rem; }

footer {
  margin-top: 3.5rem; padding-top: 1.5rem;
  border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem;
}
