/* memories.cool v2 - Instagram-shaped, but its own thing.
   One stylesheet, custom properties at the top, no framework. */

:root {
  --bg:        #fafafa;
  --surface:   #ffffff;
  --ink:       #16161a;
  --ink-soft:  #6b6b76;
  --line:      #e6e6ea;
  /* Brand colours are SAMPLED from the logo artwork, not chosen separately.
     The accent used to be an arbitrary purple (#6a5acd) that had nothing to do
     with the mark sitting next to it. */
  --brand:     #0060A8;   /* azure  - the M's left half */
  --brand-ink: #ffffff;
  --jade:      #24A86C;   /* the M's right half */
  --coral:     #FC6C60;   /* the heart */
  --danger:    #c0392b;
  --ok:        #1e7a4d;
  --radius:    14px;
  --shadow:    0 1px 2px rgba(20,20,30,.06), 0 8px 24px rgba(20,20,30,.05);
  --wrap:      935px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e11; --surface: #17171c; --ink: #f2f2f5; --ink-soft: #9a9aa6;
    --line: #26262e; --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  /* The full-bleed hero is 100vw. Where the platform draws a classic scrollbar,
     100vw counts the scrollbar's width too, which would otherwise give every
     page a few pixels of horizontal scroll. */
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
img, video { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
small { font-size: 12.5px; }
.muted { color: var(--ink-soft); }

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--wrap); margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; flex: none; }
/* Signed in: the mark alone. You know whose site you are on, and the name would
   only take width from the nav. */
.brand img { height: 38px; width: 38px; display: block; }
/* Signed out: the full lockup, and deliberately large - a first-time visitor
   has never seen the mark, so it has to say the name, and the landing page has
   the room. Width is the constraint here, not height. */
.brand-full img { height: 46px; width: auto; }
@media (max-width: 640px) { .brand-full img { height: 36px; } }
@media (max-width: 480px) {
  .brand img { height: 32px; width: 32px; }
  .brand-full img { height: 30px; }
}
.topsearch { flex: 1; max-width: 280px; }
.topsearch input {
  width: 100%; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: inherit;
}
.topnav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.topnav > a {
  padding: 8px 9px; border-radius: 10px; line-height: 0;
  position: relative; color: var(--ink);
}
.topnav > a:hover { background: var(--bg); }
/* Line icons on a 24px grid, inheriting the text colour. The CURRENT page is
   marked by filling its icon rather than colouring it, so it still reads
   without relying on colour. */
.ico { display: block; }
.topnav .ico { stroke-width: 1.7; }
.signed-out .topnav > a { font-size: 14px; font-weight: 500; white-space: nowrap; }
/* "Log in" and "Sign up" were wrapping onto two lines on a 375px screen. */
@media (max-width: 480px) {
  .topbar-inner { gap: 8px; }
  .signed-out .topnav { gap: 2px; }
  .signed-out .topnav > a { font-size: 13px; padding: 7px 8px; }
}
.badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--danger); color: #fff;
  font-size: 10px; line-height: 1; padding: 3px 5px; border-radius: 9px;
}

/* ---------------------------------------------------------------- layout */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 24px 16px 64px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.feed-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; }
.feed-col { min-width: 0; max-width: 500px; }
.side-col { position: sticky; top: 78px; align-self: start; }
@media (max-width: 860px) {
  .feed-layout { grid-template-columns: 1fr; }
  .side-col { display: none; }
  .feed-col { max-width: none; margin: 0 auto; }
}

/* ---------------------------------------------------------------- avatars */
.avatar {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
  background: var(--line); flex: none;
}
.avatar.sm { width: 26px; height: 26px; }
.avatar.lg { width: 52px; height: 52px; }
.avatar.xl { width: 140px; height: 140px; }
@media (max-width: 640px) { .avatar.xl { width: 84px; height: 84px; } }
.avatar.placeholder { display: grid; place-items: center; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-block; padding: 8px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: inherit;
  font: inherit; font-weight: 600; cursor: pointer; text-align: center;
}
.btn:hover { border-color: var(--ink-soft); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-lg { padding: 12px 22px; font-size: 16px; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-wide { width: 100%; }
.link-btn {
  background: none; border: 0; color: var(--brand);
  font: inherit; font-weight: 600; cursor: pointer; padding: 4px;
}

/* ---------------------------------------------------------------- cards */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 24px; overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 12px;
}
.card-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.card-user-text { display: flex; flex-direction: column; min-width: 0; }
.card-user-text small { color: var(--ink-soft); }
.card-meta { display: flex; align-items: center; gap: 8px; flex: none; }

.pill {
  font-size: 11px; font-weight: 600; text-transform: lowercase;
  padding: 3px 8px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line); color: var(--ink-soft);
}
.pill-group  { border-color: #d9b8ff; color: #7a3fbf; background: #f7efff; }
.pill-public { border-color: #b8e0c6; color: var(--ok); background: #eefaf2; }
@media (prefers-color-scheme: dark) {
  .pill-group  { background: #2a1f3d; }
  .pill-public { background: #14291d; }
}

.card-media { position: relative; background: #000; }
.carousel-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.carousel-track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: center; width: 100%; height: auto; object-fit: contain; max-height: 70vh; }
.car-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.9); border: 0; cursor: pointer;
  width: 30px; height: 30px; border-radius: 50%; color: #222;
  display: grid; place-items: center; line-height: 0;
}
.car-nav.prev { left: 8px; } .car-nav.next { right: 8px; }
.car-dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.car-dots .dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.5); }
.car-dots .dot.on { background: #fff; }

.card-actions { display: flex; align-items: center; gap: 2px; padding: 10px 8px 0; }
.act {
  background: none; border: 0; cursor: pointer; padding: 6px;
  line-height: 0; color: var(--ink); border-radius: 8px;
}
.act:hover { color: var(--ink-soft); }
.act .ico { transition: transform .15s ease; }
.act:active .ico { transform: scale(.85); }
/* Liked and saved are the two states worth a colour - a filled grey heart would
   read as "disabled" rather than "yours". */
.act.js-like.on   { color: var(--coral); }
.act.js-save.on   { color: var(--brand); }
.icon-btn {
  background: none; border: 0; cursor: pointer; padding: 4px;
  line-height: 0; color: var(--ink-soft); border-radius: 8px;
}
.icon-btn:hover { color: var(--ink); }
.card-body { padding: 4px 12px 14px; }
.likes { margin: 4px 0; font-weight: 600; }
.caption { margin: 4px 0; overflow-wrap: anywhere; }
.time { color: var(--ink-soft); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; margin: 8px 0 0; }

/* ---------------------------------------------------------------- sidebar */
.side-me { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.side-me span { display: flex; flex-direction: column; }
.side-me small { color: var(--ink-soft); }
.side-block h3 { font-size: 13px; color: var(--ink-soft); margin-bottom: 10px; }
.sug { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.sug a { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sug span { display: flex; flex-direction: column; min-width: 0; }
.sug small { color: var(--ink-soft); }
.side-note { margin-top: 24px; font-size: 12.5px; color: var(--ink-soft); }

/* ---------------------------------------------------------------- grids */
.grid-posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
@media (min-width: 700px) { .grid-posts { gap: 6px; } }
.tile {
  position: relative; aspect-ratio: 1; overflow: hidden;
  background: var(--line); border-radius: 4px;
}
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; }
.tile-text { display: grid; place-items: center; height: 100%; padding: 10px; font-size: 13px; text-align: center; }
.tile-multi { position: absolute; top: 6px; right: 7px; color: #fff; line-height: 0;
              filter: drop-shadow(0 1px 3px rgba(0,0,0,.65)); }
.tile-hover {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; gap: 6px;
  background: rgba(0,0,0,.45); color: #fff; font-weight: 600;
  opacity: 0; transition: opacity .15s ease;
}
.tile-hover .ico { display: inline-block; margin-right: 2px; }
.tile:hover .tile-hover { opacity: 1; }

/* ---------------------------------------------------------------- profile */
.profile-head { display: flex; gap: 32px; align-items: flex-start; margin-bottom: 32px; }
@media (max-width: 640px) { .profile-head { gap: 16px; } }
.profile-meta { min-width: 0; }
.profile-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.profile-top h1 { font-size: 22px; font-weight: 500; margin: 0; }
.stats { list-style: none; display: flex; gap: 28px; padding: 0; margin: 16px 0; }
@media (max-width: 640px) { .stats { gap: 16px; font-size: 13px; } }
.realname { font-weight: 600; margin: 4px 0; }
.bio { margin: 4px 0; }

/* ---------------------------------------------------------------- post detail */
.post-detail {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
  gap: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
@media (max-width: 800px) { .post-detail { grid-template-columns: 1fr; } }
.post-detail-media { background: #000; }
.post-detail-side { display: flex; flex-direction: column; }
.thread { flex: 1; padding: 12px; border-top: 1px solid var(--line); overflow-y: auto; max-height: 46vh; }
.comment { margin: 0 0 10px; overflow-wrap: anywhere; }
.comment-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.comment-form input[type=text] { flex: 1; border: 0; background: none; color: inherit; font: inherit; outline: none; }

/* ---------------------------------------------------------------- forms */
.auth { max-width: 420px; margin: 0 auto; background: var(--surface);
        border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.settings { max-width: 520px; }
label { display: block; margin-bottom: 16px; font-weight: 600; }
label small { display: block; font-weight: 400; color: var(--ink-soft); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=url],
input[type=date], input[type=search], input[type=file], textarea, select {
  width: 100%; padding: 10px 12px; margin-top: 6px; font: inherit;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: inherit;
}
textarea { resize: vertical; }
.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checkbox, .radio { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.checkbox input, .radio input { width: auto; margin-top: 3px; }
.checkbox span, .radio span { display: flex; flex-direction: column; }
.audience { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 16px; }
.audience legend { font-weight: 600; padding: 0 6px; }
.errors { background: #fdecea; border: 1px solid #f5c6c2; color: #8a1c12;
          padding: 10px 14px 10px 30px; border-radius: 10px; }
@media (prefers-color-scheme: dark) { .errors { background: #2b1512; border-color: #5a2420; color: #f4b4ad; } }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 16px 0; }
.inline-form input { width: auto; flex: 1; min-width: 180px; margin-top: 0; }

.flash { max-width: var(--wrap); margin: 12px auto 0; padding: 10px 16px; border-radius: 10px; }
.flash-success { background: #eefaf2; color: var(--ok); border: 1px solid #b8e0c6; }
.flash-error   { background: #fdecea; color: #8a1c12; border: 1px solid #f5c6c2; }

/* ---------------------------------------------------------------- misc */
.empty { text-align: center; padding: 56px 20px; color: var(--ink-soft);
         background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty h2 { color: var(--ink); }
.empty-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.locked { border-style: solid; }
.error-page h1 { font-size: 56px; margin-bottom: 0; }

.group-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.group-card { background: var(--surface); border: 1px solid var(--line);
              border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.group-banner { width: 100%; height: 110px; object-fit: cover; }
.group-banner.placeholder { display: grid; place-items: center; font-size: 32px; background: var(--bg); }
.group-meta { display: block; padding: 12px; }
.group-meta small { display: block; color: var(--ink-soft); }

.album-row, .member-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; }
.album-card { flex: 0 0 150px; text-align: center; }
.album-card img, .album-placeholder {
  width: 150px; height: 150px; object-fit: cover; border-radius: 12px;
  background: var(--line); display: grid; place-items: center; font-size: 28px;
}
.album-card strong { display: block; margin-top: 6px; font-size: 13px; }
.album-card small { color: var(--ink-soft); }
.member { text-align: center; flex: 0 0 64px; }
.member small { display: block; font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.member em { font-size: 10px; color: var(--brand); font-style: normal; }

.notif { display: flex; align-items: center; gap: 12px; padding: 12px;
         border-bottom: 1px solid var(--line); }
.notif.unread { background: var(--surface); }
.notif > a { display: flex; align-items: center; gap: 10px; }
.notif-text { flex: 1; }
.notif-actions { display: flex; gap: 6px; }
.notif-thumb img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.person span { display: flex; flex-direction: column; }
.person small { color: var(--ink-soft); }

.preview { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.preview img { width: 88px; height: 88px; object-fit: cover; border-radius: 8px; }

.invite code { display: inline-block; background: var(--bg); padding: 8px 10px;
               border-radius: 8px; border: 1px solid var(--line); word-break: break-all; }

/* landing */
.hero { text-align: center; padding: 56px 16px 32px; }
.hero h1 { font-size: clamp(30px, 6vw, 48px); letter-spacing: -.02em; }
.lede { font-size: 18px; color: var(--ink-soft); max-width: 560px; margin: 0 auto 24px; }

/* v1's photo hero. The dark gradient is not decoration - it is what keeps the
   white headline legible over an arbitrary photograph. */
.hero-photo {
  position: relative;
  /* Full-bleed, as v1's was. The page content sits in a 935px column; these
     margins break the hero out of it to the full viewport width without any
     wrapper markup. max-width:100vw keeps a scrollbar from causing horizontal
     overflow on Windows. */
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: -24px;
  padding: clamp(72px, 18vh, 160px) 24px;
  background-image: linear-gradient(rgba(0,0,0,.55), rgba(0,0,0,.55)),
                    url('/assets/images/homepage2.jpg');
  background-size: cover;
  background-position: center;
  color: #fff;
}
.hero-photo h1 { color: #fff; text-shadow: 0 2px 18px rgba(0,0,0,.35); }
.hero-photo .lede { color: rgba(255,255,255,.92); }
.hero-note { color: rgba(255,255,255,.8); font-size: 13px; margin: 14px 0 0; }
.hero-inner { max-width: 640px; margin: 0 auto; }
.band { text-align: center; padding: 24px 16px; }
.band h2 { font-size: 20px; font-weight: 500; color: var(--ink-soft); }
.who, .features, .cta { padding: 40px 0; text-align: center; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; text-align: left; }
.who-card { background: var(--surface); border: 1px solid var(--line);
            border-radius: var(--radius); padding: 20px; }
/* A line icon in the brand azure, on the same grid as every other icon - the
   emoji that used to sit here rendered as tofu boxes wherever the emoji font
   was missing, and never matched the weight of the type beneath them. */
.who-icon { display: inline-block; color: var(--brand); line-height: 0; margin-bottom: 10px; }
.who-card p, .grid-3 p { color: var(--ink-soft); }
.feature-image {
  width: 100%; height: 220px; object-fit: cover;
  border-radius: 12px; margin-bottom: 14px; background: var(--line);
}
.feature h3 { margin-bottom: .35em; }

.foot { max-width: var(--wrap); margin: 0 auto; padding: 24px 16px 48px;
        color: var(--ink-soft); font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; }
.foot span { margin-left: auto; }

/* ---------------------------------------------------------------- legal + pricing */
.legal { max-width: 760px; margin: 0 auto; background: var(--surface);
         border: 1px solid var(--line); border-radius: var(--radius); padding: 36px; }
.legal h1 { text-align: center; }
.legal h2 { font-size: 1.25em; margin-top: 32px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.legal p, .legal li { color: var(--ink-soft); }
.legal li { margin-bottom: 8px; }

.pricing { text-align: center; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
             gap: 20px; margin: 32px 0; text-align: left; }
.plan { background: var(--surface); border: 1px solid var(--line);
        border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; }
.plan-featured { border-color: var(--brand); box-shadow: var(--shadow); }
.plan-price { margin: 8px 0 16px; }
.plan-price .amount { font-size: 30px; font-weight: 700; }
.plan-price small { display: block; color: var(--ink-soft); }
.plan-features { list-style: none; padding: 0; margin: 0 0 20px; flex: 1; }
.plan-features li { padding: 6px 0; border-bottom: 1px solid var(--line); color: var(--ink-soft); }

/* ------------------------------------------------- composer audience controls */
.req {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--coral); margin-left: 6px;
}
.audience-sub {
  margin: 14px 0 8px; font-weight: 600; font-size: 13px; color: var(--ink-soft);
  border-top: 1px solid var(--line); padding-top: 12px;
}
/* States the COMBINED reach in one sentence. The two controls above are easy to
   misread and the cost of misreading is a family photo shown to strangers. */
.audience-summary {
  margin: 14px 0 0; padding: 10px 12px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--line);
  font-size: 13px; color: var(--ink-soft);
}
.audience-summary.warn {
  border-color: var(--coral); color: var(--ink);
  background: color-mix(in srgb, var(--coral) 10%, transparent);
}
.audience select:disabled { opacity: .5; }
.audience .radio input:disabled + span { opacity: .45; }

/* ------------------------------------------------- inline icon alignment */
.lock-line { display: flex; align-items: center; gap: 6px; }
.lock-line .ico, .person small .ico { display: inline-block; vertical-align: -2px; }
.empty h2 .ico { display: inline-block; vertical-align: -3px; margin-right: 4px; }
.group-banner.placeholder .ico, .album-placeholder .ico { color: var(--ink-soft); }
