/* بِنیها — "Ben between the mountains and the river".
   Zagros blue + Zayandeh-Rud turquoise, apricot/terracotta earth, walnut ink, snow paper.
   Font: Vazirmatn throughout. */
/* Vazirmatn v33 (SIL Open Font License, see fonts/Vazirmatn-OFL.txt), one variable file for all weights. */
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn.f6d31671339d.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: #f3f8fc;
  --surface: #ffffff;
  --surface-2: #e8f1f7;
  --sand: #d9e6ef;
  --ink: #1d2427;
  --ink-2: #3c4549;
  --muted: #6c706b;
  --line: #d8e4ed;
  --zagros: #0e3b43;
  --zagros-2: #164f59;
  --river: #1f8a8a;
  --river-soft: #d8eeec;
  --apricot: #e2a35d;
  --clay: #b9532e;
  --walnut: #4a3427;
  --primary: var(--river);
  --primary-ink: #ffffff;
  --accent: var(--clay);
  --ok: #2e7d4f;
  --warn: #a86a00;
  --danger: #b3261e;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgb(30 25 15 / .06);
  --shadow: 0 1px 2px rgb(30 25 15 / .05), 0 10px 30px -10px rgb(30 25 15 / .18);
  --font: "Vazirmatn", system-ui, sans-serif;
  --display: var(--font);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111719;
    --surface: #182023;
    --surface-2: #1f292c;
    --sand: #2a3437;
    --ink: #ece7dc;
    --ink-2: #cfc9bd;
    --muted: #9a9a90;
    --line: #2b3538;
    --river: #4fc0bb;
    --river-soft: #173b3b;
    --primary-ink: #0b1517;
    --clay: #e2784f;
    --apricot: #ebb071;
    --shadow: 0 1px 2px rgb(0 0 0 / .4);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  /* Nothing may make the page wider than the screen (no sideways wobble on phones).
     "clip" keeps the sticky header working; "hidden" is the fallback for old browsers. */
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* Phones: scale all rem-based text down a notch so pages feel less zoomed in. */
@media (max-width: 600px) {
  html {
    font-size: 87.5%;
  }

  body {
    line-height: 1.75;
  }

  /* iOS Safari zooms into fields under 16px on focus. */
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.9 var(--font);
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--river);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}

:focus-visible {
  outline: 3px solid var(--apricot);
  outline-offset: 2px;
  border-radius: 4px;
}

h1,
h2,
h3,
h4 {
  line-height: 1.35;
  margin: 0 0 .5em;
  color: var(--ink);
}

h1 {
  font-size: clamp(1.8rem, 2.5vw + 1.1rem, 2.6rem);
  font-weight: 800;
}

h2 {
  font-size: 1.45rem;
  font-weight: 800;
}

h3 {
  font-size: 1.06rem;
  font-weight: 700;
}

.display {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0;
}

code,
pre {
  font-family: ui-monospace, monospace;
  font-size: .9em;
}

.wrap {
  width: min(1440px, 100% - clamp(32px, 5vw, 80px));
  margin-inline: auto;
}

.main {
  padding-block: 32px 72px;
  min-height: 60vh;
}

.muted {
  color: var(--muted);
}

.lead {
  font-size: 1.12rem;
  color: var(--ink-2);
  max-width: 62ch;
}

.eyebrow {
  color: var(--clay);
  font-weight: 700;
  font-size: .9rem;
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  inset-inline-start: 8px;
  top: -60px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 100;
}

.skip:focus {
  top: 8px;
}

/* ---------- Top bar & header ---------- */
.topbar {
  background: var(--zagros);
  color: #d9e6e4;
  font-size: .82rem;
}

.topbar-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  height: 34px;
  align-items: center;
}

.topbar a {
  color: #d9e6e4;
}

.topbar-links {
  display: flex;
  gap: 16px;
}

.topbar-hello {
  font-weight: 500;
  letter-spacing: .01em;
}

@media (max-width: 560px) {
  .topbar-links a:not(:first-child) {
    display: none;
  }
}

.site-header {
  --header-gap: 12px;
  position: sticky;
  top: 0;
  padding-top: var(--header-gap);
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  flex: none;
}

.brand:hover {
  text-decoration: none;
}

/* Logo image (mountain + «بِنیها»): dark lettering on light backgrounds, cream lettering on dark ones. */
.logo {
  display: block;
  height: 52px;
  width: auto;
}

.logo-on-dark {
  display: none;
}

.site-footer .logo {
  height: 64px;
}

.site-footer .logo-on-dark {
  display: block;
}

@media (max-width: 700px) {
  .site-header .logo {
    height: 44px;
  }
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 1;
}

.nav-main,
.nav-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-main a {
  color: var(--ink-2);
  font-weight: 500;
  font-size: .95rem;
  padding: 8px 12px;
  border-radius: 999px;
}

.nav-main a:hover {
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
}

.nav-tools {
  gap: 12px;
}

.nav-tools>a:not(.btn) {
  color: var(--ink-2);
  font-weight: 500;
}

.nav form {
  margin: 0;
}

.nav-search input {
  width: 190px;
  padding: 7px 14px 7px 36px;
  border-radius: 999px;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='16' height='16' fill='none' stroke='%236c706b' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat left 12px center;
  border-color: transparent;
}

.icon-link {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--ink-2);
}

.icon-link:hover {
  background: var(--surface-2);
}

.badge {
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--clay);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
}

.account {
  position: relative;
}

.account summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.account summary::-webkit-details-marker {
  display: none;
}

.account-menu {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  display: flex;
  flex-direction: column;
  z-index: 30;
}

.account-menu a,
.account-menu button {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--ink);
  text-align: start;
}

.account-menu a:hover,
.account-menu button:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.account-menu form {
  margin: 0;
}

.account-menu button {
  width: 100%;
}

.nav-toggle,
.nav-burger {
  display: none;
}

@media (max-width: 1080px) {
  .header-row {
    flex-wrap: wrap;
    gap: 12px;
    min-height: 64px;
  }

  .nav-burger {
    display: block;
    margin-inline-start: auto;
    width: 44px;
    height: 44px;
    cursor: pointer;
    position: relative;
  }

  .nav-burger span,
  .nav-burger span::before,
  .nav-burger span::after {
    position: absolute;
    inset-inline: 11px;
    height: 2px;
    background: var(--ink);
    content: "";
    border-radius: 2px;
    transition: transform .2s;
  }

  .nav-burger span {
    top: 21px;
  }

  .nav-burger span::before {
    top: -7px;
    inset-inline: 0;
  }

  .nav-burger span::after {
    top: 7px;
    inset-inline: 0;
  }

  .nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 16px;
  }

  .nav-toggle:checked~.nav {
    display: flex;
  }

  .nav-main {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-tools {
    flex-wrap: wrap;
  }

  .nav-search {
    flex-basis: 100%;
  }

  .nav-search input {
    width: 100%;
  }
}

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border: 1.5px solid var(--river);
  border-radius: 999px;
  background: var(--river);
  color: var(--primary-ink);
  font: 700 .95rem var(--font);
  cursor: pointer;
  transition: transform .15s, filter .15s;
}

.btn:hover {
  text-decoration: none;
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--river);
}

.btn-accent {
  background: var(--apricot);
  border-color: var(--apricot);
  color: #2b1a0c;
}

.btn-ghost-light {
  background: transparent;
  border-color: rgb(255 255 255 / .6);
  color: #fff;
}

.btn-sm {
  padding: 6px 16px;
  font-size: .86rem;
}

.btn-block {
  width: 100%;
}

.linklike {
  background: none;
  border: 0;
  padding: 0;
  color: var(--river);
  font: inherit;
  cursor: pointer;
}

.linklike.danger {
  color: var(--danger);
}

input,
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid color-mix(in srgb, var(--river) 30%, transparent);
  border-color: var(--river);
}

input[type=checkbox],
input[type=radio] {
  width: auto;
  accent-color: var(--river);
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  font-size: .92rem;
}

.field ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.field ul label {
  font-weight: 500;
  display: flex;
  gap: 6px;
  align-items: center;
}

.help {
  color: var(--muted);
  font-size: .82rem;
}

.errorlist {
  color: var(--danger);
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  font-size: .88rem;
}

.md-editor {
  font-family: ui-monospace, monospace;
  line-height: 1.7;
}

.form-card,
.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.auth-card {
  max-width: 460px;
  margin: 24px auto;
}

.auth-card.wide {
  max-width: 660px;
}

.form-actions,
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ---------- Messages ---------- */
.messages {
  margin: 0 auto 20px;
}

.main-home .messages {
  width: min(1440px, 100% - clamp(32px, 5vw, 80px));
  margin-top: 16px;
}

.msg {
  padding: 12px 18px;
  border-radius: 12px;
  margin: 0 0 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--river);
}

.msg-success {
  border-inline-start-color: var(--ok);
}

.msg-error {
  border-inline-start-color: var(--danger);
}

.msg-warning {
  border-inline-start-color: var(--warn);
}

/* ---------- Mountain ridge motif ---------- */
.ridge {
  display: block;
  width: 100%;
  height: 70px;
}

.ridge-back {
  fill: var(--sand);
}

.ridge-front {
  fill: var(--paper);
}

.ridge-hero {
  position: absolute;
  bottom: -1px;
  inset-inline: 0;
  z-index: 3;
  pointer-events: none;
}

.ridge-hero .ridge-back {
  fill: color-mix(in srgb, var(--paper) 45%, transparent);
}

.ridge-footer {
  height: 80px;
  margin-bottom: -1px;
}

.ridge-footer .ridge-back {
  fill: var(--zagros-2);
}

.ridge-footer .ridge-front {
  fill: var(--zagros);
}

/* ---------- Home: photo hero (Ben's mountain reflected in the lake) ---------- */
.main-home {
  padding-bottom: 32px;
}

.home-hero {
  /* Prints fly into the pile from outside the photo: clip them to it. */
  overflow: clip;
  position: relative;
  isolation: isolate;
  color: #fff;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  background: var(--zagros) url("../img/ben-lake-2400.faabd6f5d99f.webp") 30% 45% / cover no-repeat;
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  /* Only enough shade to keep the white header readable; the photo itself stays bright. */
  background: linear-gradient(to bottom, rgb(9 38 44 / .45) 0%, rgb(9 38 44 / 0) 18%),
    linear-gradient(to top, rgb(9 38 44 / .3), transparent 25%);
}

.home-hero .ridge-hero {
  z-index: 0;
}

@media (max-width: 1400px) {
  .home-hero {
    background-image: url("../img/ben-lake-1400.10f33cfac189.webp");
  }
}

@media (max-width: 700px) {
  .home-hero {
    background-image: url("../img/ben-lake-portrait.62266ed00df1.webp");
    background-position: center 30%;
  }

  .home-hero::before {
    background: linear-gradient(to bottom, rgb(9 38 44 / .45) 0%, rgb(9 38 44 / 0) 16%),
      linear-gradient(to top, rgb(9 38 44 / .3), transparent 30%);
  }
}

/* The navbar is sticky on every page, home included. On the home page the photo is
   pulled up underneath the navbar so it shows through it. */
.has-hero {
  --masthead-h: calc(12px + 72px + 1px);
}

@media (max-width: 1080px) {
  .has-hero {
    --masthead-h: calc(12px + 64px + 1px);
  }
}

@media (max-width: 700px) {
  .site-header {
    --header-gap: 8px;
  }

  .has-hero {
    --masthead-h: calc(8px + 64px + 1px);
  }
}

.has-hero .main-home {
  position: relative;
  margin-top: calc(-1 * var(--masthead-h));
}

.has-hero .main-home .messages {
  position: absolute;
  top: calc(var(--masthead-h) + 12px);
  inset-inline: 0;
  z-index: 5;
}

.has-hero .site-header {
  background: transparent;
  backdrop-filter: none;
  border-bottom-color: rgb(255 255 255 / .16);
  transition: background-color .25s, border-color .25s;
}

.has-hero .nav-main a,
.has-hero .nav-tools>a:not(.btn),
.has-hero .icon-link,
.has-hero .account summary {
  color: #fff;
}

.has-hero .nav-main a:hover,
.has-hero .icon-link:hover {
  background: rgb(255 255 255 / .16);
  color: #fff;
}

.has-hero .account summary {
  border-color: rgb(255 255 255 / .35);
}

.has-hero .nav-search input {
  background-color: rgb(255 255 255 / .14);
  color: #fff;
}

.has-hero .nav-search input::placeholder {
  color: rgb(255 255 255 / .75);
}

.has-hero .nav-burger span,
.has-hero .nav-burger span::before,
.has-hero .nav-burger span::after {
  background: #fff;
}

.has-hero .site-header .btn {
  background: #fff;
  border-color: #fff;
  color: var(--zagros);
}

/* Open phone menu needs a solid backdrop to stay readable. */
.has-hero .site-header:has(.nav-toggle:checked) {
  background: rgb(9 38 44 / .94);
  backdrop-filter: blur(12px);
}

/* Docked state: back to the normal solid header. */
.has-hero.is-stuck .site-header {
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom-color: var(--line);
}

.has-hero.is-stuck .nav-main a,
.has-hero.is-stuck .nav-tools>a:not(.btn),
.has-hero.is-stuck .icon-link,
.has-hero.is-stuck .account summary {
  color: var(--ink);
}

.has-hero.is-stuck .nav-main a:hover,
.has-hero.is-stuck .icon-link:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.has-hero.is-stuck .account summary {
  border-color: var(--line);
}

.has-hero.is-stuck .nav-search input {
  background-color: var(--surface-2);
  color: var(--ink);
}

.has-hero.is-stuck .nav-search input::placeholder {
  color: var(--muted);
}

.has-hero.is-stuck .nav-burger span,
.has-hero.is-stuck .nav-burger span::before,
.has-hero.is-stuck .nav-burger span::after {
  background: var(--ink);
}

.has-hero.is-stuck .site-header .btn {
  background: var(--river);
  border-color: var(--river);
  color: var(--primary-ink);
}

.has-hero.is-stuck .site-header:has(.nav-toggle:checked) {
  background: var(--paper);
}

/* Slideshow card floating over the right (RTL start) of the photo */
.hero-card-wrap {
  position: relative;
  z-index: 2;
  padding-bottom: 96px;
}

@media (min-width: 821px) {
  .hero-card-wrap {
    align-self: center;
    padding-block: 110px 40px;
    width: 100%;
    padding-inline: clamp(32px, 6vw, 120px);
  }
}

/* Slides as prints thrown onto a pile (hero-pile.js). Without JS or with reduced
   motion the prints simply sit in a still, tidy pile. */
.hero-pile {
  --print-w: 460px;
  width: calc(var(--print-w) + 90px);
  max-width: 100%;
}

.pile-stage {
  position: relative;
  height: calc(var(--print-w) * .75 + 175px);
}

.print {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: var(--z, 1);
  display: block;
  width: var(--print-w);
  max-width: calc(100% - 24px);
  padding: 12px 12px 0;
  background: #fff;
  border-radius: 3px;
  color: var(--ink);
  box-shadow: 0 2px 4px rgb(0 0 0 / .15), 0 26px 50px -16px rgb(0 0 0 / .55);
  transform: translate(calc(-50% + var(--tx, 0px)), calc(-50% + var(--ty, 0px))) rotate(var(--r, 0deg));
}

.print:hover {
  text-decoration: none;
}

.print-img {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #e9eef2;
}

.print-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.print-caption {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 4px 14px;
}

.print-label {
  background: var(--apricot);
  color: #2b1a0c;
  font-weight: 800;
  font-size: .7rem;
  padding: 0 9px;
  border-radius: 999px;
}

.print-title {
  font-size: 1.02rem;
  line-height: 1.6;
  color: #1d2427;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.print-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 12px;
  font-size: .76rem;
  color: #5f6a6e;
}

.print-meta:empty {
  display: none;
}

/* Live mode: prints wait off-screen until thrown, then fly in and land. */
.hero-pile.is-live .print {
  opacity: 0;
  pointer-events: none; /* not yet thrown: invisible, so it mustn't catch clicks meant for the pile */
  transform: translate(calc(-50% + var(--fx, 0px)), calc(-50% + var(--fy, 0px))) rotate(var(--fr, 0deg)) scale(1.15);
  transition: transform 1s cubic-bezier(.2, .85, .25, 1.04), opacity .35s ease-out;
}

.hero-pile.is-live .print.landed {
  opacity: 1;
  pointer-events: auto;
  transform: translate(calc(-50% + var(--tx, 0px)), calc(-50% + var(--ty, 0px))) rotate(var(--r, 0deg));
}

.hero-pile.is-live .print.no-anim {
  transition: none;
}

.pile-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.pile-btn {
  height: 36px;
  min-width: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / .45);
  background: rgb(9 38 44 / .35);
  color: #fff;
  font: 700 .85rem var(--font);
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.pile-btn:hover {
  background: rgb(255 255 255 / .22);
}

.pile-btn[data-pile-pause] {
  font-size: .62rem;
  letter-spacing: -2px;
}

@media (max-width: 600px) {
  .hero-pile {
    --print-w: min(72vw, 310px);
    width: 100%;
  }

  .pile-stage {
    height: calc(var(--print-w) * .75 + 150px);
  }
}

@media (max-width: 600px) {
  .hero-card-wrap {
    padding-bottom: 72px;
  }
}

/* ---------- Home: pillars ---------- */
.intro {
  padding-block: 40px 0;
}

.pillars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.pillars li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}

.pillars b {
  font-size: 1.02rem;
}

.pillars span:last-child {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.8;
}

.pillar-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--river-soft);
  color: var(--river);
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.pillars li:nth-child(2) .pillar-icon {
  background: color-mix(in srgb, var(--apricot) 22%, transparent);
  color: var(--walnut);
}

.pillars li:nth-child(3) .pillar-icon {
  background: color-mix(in srgb, var(--clay) 16%, transparent);
  color: var(--clay);
}

.pillars li:nth-child(4) .pillar-icon {
  background: var(--sand);
  color: var(--ink-2);
}

@media (max-width: 1000px) {
  .pillars {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .pillars {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .pillars li {
    display: grid;
    grid-template-columns: 38px 1fr;
    column-gap: 12px;
    padding: 14px;
  }

  .pillar-icon {
    grid-row: span 2;
    margin: 0;
  }
}

/* ---------- Section blocks ---------- */
.block {
  margin-top: 64px;
}

.block-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.block-head::after {
  content: "";
  position: absolute;
  bottom: -1px;
  inset-inline-start: 0;
  width: 64px;
  height: 3px;
  background: var(--clay);
  border-radius: 3px;
}

.block-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 700;
}

.block-head>a {
  font-weight: 700;
  font-size: .9rem;
  white-space: nowrap;
}

/* News + events */
.news-events {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 40px;
}

.news-events.no-events {
  grid-template-columns: 1fr;
}

.news-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.news-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  align-items: start;
}

.news-item h3 {
  margin: 0;
}

.news-item h3 a {
  color: var(--ink);
}

.news-img {
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--surface-2);
}

.news-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-lead {
  grid-column: 1 / -1;
  grid-template-columns: 1.2fr 1fr;
  gap: 22px;
}

.news-lead .news-img {
  aspect-ratio: 16 / 10;
}

.news-lead h3 {
  font-family: var(--display);
  font-size: 1.8rem;
  line-height: 1.5;
}

.events {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  align-self: start;
}

.events .block-head h2 {
  font-size: 1.6rem;
}

.event {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
  color: var(--ink);
}

.event:last-child {
  border-bottom: 0;
}

.event:hover {
  text-decoration: none;
}

.event:hover b {
  color: var(--river);
}

.event-date {
  flex: none;
  width: 60px;
  height: 64px;
  border-radius: 12px;
  background: var(--zagros);
  color: #fff;
  display: grid;
  place-content: center;
  text-align: center;
  line-height: 1.1;
}

.event-date b {
  font-size: 1.5rem;
}

.event-date small {
  font-size: .72rem;
  color: var(--apricot);
}

.event-body {
  display: flex;
  flex-direction: column;
}

.event-body small {
  color: var(--muted);
}

@media (max-width: 900px) {
  .news-events {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {

  .news-list,
  .news-lead {
    grid-template-columns: 1fr;
  }

  .news-item:not(.news-lead) {
    grid-template-columns: 84px 1fr;
  }
}

/* Culture */
.culture-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 28px;
}

.feature {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 420px;
  display: flex;
  align-items: flex-end;
  background: var(--zagros);
  box-shadow: var(--shadow);
}

.feature-img {
  position: absolute;
  inset: 0;
}

.feature-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s;
}

.feature:hover .feature-img img {
  transform: scale(1.04);
}

.feature::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgb(9 38 44 / .92), rgb(9 38 44 / .1) 60%);
  pointer-events: none;
}

.feature-body {
  position: relative;
  z-index: 1;
  padding: 28px;
}

.feature-body h3 {
  font-size: 2.2rem;
  line-height: 1.5;
  margin: 8px 0 6px;
}

.feature-body h3 a {
  color: #fff;
}

.feature-body .meta {
  color: #c9dad8;
}

.feature-body .chip {
  background: var(--apricot);
  color: #2b1a0c;
}

.culture-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mini {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  color: var(--ink);
  transition: background .15s;
}

.mini:hover {
  background: var(--surface);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.mini img,
.mini-ph {
  width: 96px;
  height: 76px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--surface-2);
}

.mini>span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}

.mini b {
  line-height: 1.6;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.tile {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--zagros-2);
  color: #fff;
  display: flex;
  align-items: flex-end;
}

.tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .8;
  transition: transform .5s, opacity .3s;
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgb(9 38 44 / .9), transparent 65%);
}

.tile:hover {
  text-decoration: none;
}

.tile:hover img {
  transform: scale(1.06);
  opacity: 1;
}

.tile-text {
  position: relative;
  z-index: 1;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}

.tile-text b {
  font-family: var(--display);
  font-size: 1.45rem;
}

.tile-text small {
  color: var(--apricot);
  font-size: .8rem;
}

@media (max-width: 900px) {
  .culture-grid {
    grid-template-columns: 1fr;
  }

  .feature {
    min-height: 340px;
  }
}

.band-lead {
  color: #b9d1cf;
  max-width: 60ch;
  margin-top: -6px;
}

/* Photos scattered like prints on a table (photo-pile.js places them). Without JS
   they simply sit in a wrapped row. */
.photo-pile {
  --photo-w: 230px;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.photo {
  display: block;
  width: var(--photo-w);
  padding: 10px 10px 0;
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgb(0 0 0 / .12), 0 12px 28px -10px rgb(20 40 50 / .45);
  color: #3a3a3a;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s;
}

.photo:hover {
  text-decoration: none;
}

.photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e9eef2;
}

.photo span {
  display: block;
  padding: 6px 2px 10px;
  font-size: .8rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-pile.is-scattered {
  display: block;
}

.photo-pile.is-scattered .photo {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: var(--z, 1);
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
}

.photo-pile.is-scattered .photo:hover,
.photo-pile.is-scattered .photo:focus-visible {
  z-index: 100;
  transform: translate(-50%, -54%) rotate(0deg) scale(1.08);
  box-shadow: 0 2px 4px rgb(0 0 0 / .15), 0 24px 44px -12px rgb(20 40 50 / .55);
}

@media (max-width: 600px) {
  .photo-pile {
    --photo-w: 150px;
  }

  .photo span {
    font-size: .72rem;
    padding-bottom: 8px;
  }
}

/* Contribute CTA */
.cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 40px;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(120deg, var(--walnut), var(--clay));
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: "";
  position: absolute;
  inset-inline-start: -40px;
  bottom: -60px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 36px solid rgb(255 255 255 / .06);
}

.cta h2 {
  color: #fff;
  font-size: 2.3rem;
  margin-bottom: 6px;
}

.cta p {
  margin: 0;
  max-width: 58ch;
  color: #f6e6d8;
}

/* ---------- Cards & lists (inner pages) ---------- */
.meta {
  color: var(--muted);
  font-size: .85rem;
  margin: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.chip {
  display: inline-block;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--river-soft);
  color: var(--river);
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.9;
}

.chip:hover {
  text-decoration: none;
}

.chip-lg {
  padding: 6px 18px;
  font-size: .9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
}

.chip-lg.active,
.chip-lg:hover {
  background: var(--zagros);
  border-color: var(--zagros);
  color: #fff;
}

.page-head {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.page-head h1 {
  font-family: var(--display);
  font-size: clamp(2.2rem, 3vw + 1rem, 3rem);
  font-weight: 700;
}

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.members {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.member {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  padding: 4px 14px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.member img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}

.empty {
  text-align: center;
  padding: 64px 0;
  color: var(--muted);
}

.empty h1 {
  font-family: var(--display);
  font-size: 5rem;
  color: var(--river);
  margin: 0;
}

.inline-search {
  display: flex;
  gap: 8px;
  max-width: 440px;
  margin: 16px auto;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
}

/* ---------- Post ---------- */
.post {
  max-width: 880px;
  margin-inline: auto;
}

.post-head {
  margin-bottom: 24px;
}

.post-head h1 {
  font-family: var(--display);
  font-size: clamp(2.2rem, 3vw + 1.2rem, 3.2rem);
  font-weight: 700;
  line-height: 1.5;
}

.crumbs {
  font-size: .88rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.event-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--river-soft);
  color: var(--ink);
  margin-bottom: 24px;
  font-weight: 500;
}

.post-cover {
  margin: 0 0 32px;
}

.post-cover img {
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  background: var(--surface-2);
  border-radius: var(--radius);
}

.prose {
  font-size: 1.1rem;
  line-height: 2.15;
  overflow-wrap: anywhere;
}

.prose h2,
.prose h3 {
  font-family: var(--display);
  margin-top: 1.6em;
}

.prose h2 {
  font-size: 1.9rem;
}

.prose h3 {
  font-size: 1.5rem;
}

.prose img,
.prose iframe,
.prose video,
.prose object {
  max-width: 100%;
  border-radius: 12px;
}

.prose audio {
  width: 100%;
}

.prose blockquote {
  margin: 1.6em 0;
  padding: 8px 22px;
  border-inline-start: 4px solid var(--apricot);
  background: var(--surface-2);
  border-radius: 10px;
  font-family: var(--display);
  font-size: 1.3rem;
}

.prose hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 2em 0;
}

.prose table {
  border-collapse: collapse;
  width: 100%;
}

.prose td,
.prose th {
  border: 1px solid var(--line);
  padding: 6px 10px;
}

.post-foot {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status {
  display: inline-block;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: .82rem;
  font-weight: 700;
}

.status-pending {
  color: var(--warn);
}

.status-published {
  color: var(--ok);
}

.status-draft {
  color: var(--muted);
}

/* Comments */
.comments {
  max-width: 880px;
  margin: 56px auto 0;
}

.comments h2 {
  font-family: var(--display);
  font-size: 1.9rem;
}

.comment {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 12px;
}

.comment-body p {
  margin: .3em 0;
}

.comment-actions {
  display: flex;
  gap: 14px;
  font-size: .85rem;
}

.comment-actions form {
  margin: 0;
}

.reply {
  margin-inline-start: 36px;
  position: relative;
}

.reply::before {
  content: "";
  position: absolute;
  inset-inline-start: -20px;
  top: 0;
  bottom: 12px;
  width: 2px;
  background: var(--line);
}

.comment-form {
  margin-top: 20px;
}

.login-prompt {
  padding: 18px;
  background: var(--surface-2);
  border-radius: 14px;
  text-align: center;
}

/* Profile */
.profile {
  display: flex;
  gap: 22px;
  align-items: center;
  margin-bottom: 36px;
}

.profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 4px 0;
  color: var(--muted);
  font-size: .88rem;
}

.profile-subhead {
  margin: 32px 0 14px;
  font-size: 1.15rem;
}

.profile-comments {
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 760px;
}

.profile-comments li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.profile-comment-post {
  font-weight: 700;
  margin-inline-end: 8px;
}

.profile-comments p {
  margin: 4px 0 0;
  font-size: .92rem;
  overflow-wrap: anywhere;
}

.avatar-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 10px;
  max-width: 560px;
}

.avatar-choice {
  position: relative;
  display: block;
  cursor: pointer;
}

.avatar-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.avatar-choice img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--surface-2);
  outline: 3px solid transparent;
  outline-offset: 2px;
  transition: outline-color .15s, transform .15s;
}

.avatar-choice:hover img {
  transform: scale(1.05);
}

.avatar-choice input:checked + img {
  outline-color: var(--river);
}

.avatar-choice input:focus-visible + img {
  outline-color: var(--apricot);
}

.avatar {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: var(--surface-2);
  box-shadow: 0 0 0 4px var(--paper), 0 0 0 6px var(--apricot);
}

.field .optional {
  color: var(--muted);
  font-weight: 400;
  font-size: .85em;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
  padding: 0;
  list-style: none;
}

.social-links a {
  --brand: var(--zagros);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  transition: background .15s, color .15s, border-color .15s;
}

.social-links a:hover,
.social-links a:focus-visible {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.social-links svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.social-links .social-instagram { --brand: #e4405f; }
.social-links .social-telegram { --brand: #26a5e4; }
.social-links .social-eitaa { --brand: #ff7634; }
.social-links .social-bale { --brand: #00b894; }
.social-links .social-rubika { --brand: #36aee2; }
.social-links .social-youtube { --brand: #ff0000; }
.social-links .social-spotify { --brand: #1db954; }
.social-links .social-soundcloud { --brand: #ff5500; }

/* Save button */
.react {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: .88rem;
  cursor: pointer;
}

.react:hover {
  border-color: var(--river);
  text-decoration: none;
}

.react.is-on {
  border-color: var(--clay);
  background: var(--clay);
  color: #fff;
}

/* Feed */
.feed {
  display: grid;
  gap: 28px;
  max-width: 680px;
  margin-inline: auto;
}

/* Each post is a print like the lists (.polaroid): white frame, a slight tilt that
   straightens on hover. The frame stays white in dark mode, so its colours stay light-theme. */
.feed-item {
  --ink: #1d2427;
  --ink-2: #3c4549;
  --muted: #6c706b;
  --line: #d8e4ed;
  --river: #1f8a8a;
  --river-soft: #d8eeec;
  --surface: #fff;
  --surface-2: #e9eef2;
  --r: -.6deg;
  padding: 0 12px;
  background: #fff;
  border-radius: 3px;
  color: var(--ink);
  box-shadow: 0 1px 2px rgb(0 0 0 / .1), 0 12px 26px -12px rgb(20 40 50 / .4);
  transform: rotate(var(--r));
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s;
}

.feed-item:nth-child(5n+2) { --r: .7deg; }
.feed-item:nth-child(5n+3) { --r: -.3deg; }
.feed-item:nth-child(5n+4) { --r: .9deg; }
.feed-item:nth-child(5n+5) { --r: -.9deg; }

.feed-item:hover,
.feed-item:focus-within {
  transform: rotate(0deg);
  box-shadow: 0 2px 4px rgb(0 0 0 / .12), 0 22px 40px -14px rgb(20 40 50 / .5);
}

.feed-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 10px 2px;
}

.feed-author {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
}

.feed-author img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
}

.feed-body {
  display: block;
  color: var(--ink);
}

.feed-body:hover {
  text-decoration: none;
}

.feed-img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 460px;
  object-fit: cover;
  background: var(--surface-2);
}

.feed-body h2 {
  margin: 14px 2px 4px;
  font-size: 1.15rem;
}

.feed-body p {
  margin: 0 2px 8px;
  color: var(--ink-2);
}

.feed-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 2px 16px;
}

/* Seller tools on the order page */
.seller-panel {
  margin-top: 32px;
}

/* Editor: the member's earlier uploads */
.image-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .88rem;
}

.image-strip button {
  flex: none;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
  overflow: hidden;
}

.image-strip button:hover,
.image-strip button:focus-visible {
  border-color: var(--river);
}

.image-strip img {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
}

/* Not found */
.not-found {
  max-width: 620px;
  margin: 0 auto;
  padding: 48px 0 64px;
  text-align: center;
}

.not-found-code {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(4.5rem, 12vw, 7rem);
  font-weight: 800;
  line-height: 1;
  color: var(--river);
}

.not-found h1 {
  margin: 8px 0 6px;
  font-size: 1.6rem;
}

.not-found-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 24px;
}

/* Post statistics */
.post-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feed-stats {
  margin-inline-start: auto;
  align-self: center;
}

/* Members */
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}

.member-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-align: center;
}

.member-card:hover {
  border-color: var(--river);
  text-decoration: none;
}

.member-card img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--surface-2);
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}

.table th,
.table td {
  padding: 12px 16px;
  text-align: start;
  border-bottom: 1px solid var(--line);
}

.table thead th {
  background: var(--surface-2);
  font-size: .88rem;
}

.qty {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
}

.qty input {
  width: 76px;
}

@media (max-width: 640px) {
  .table {
    display: block;
    overflow-x: auto;
  }
}

/* Shop */
.price {
  color: var(--clay);
  font-weight: 800;
  margin: 4px 0 0;
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  max-width: 1040px;
  margin: 24px auto 0;
}

.product-media {
  position: sticky;
  top: 96px;
}

.product-img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.product-info h1 {
  font-size: clamp(1.3rem, 1vw + 1rem, 1.7rem);
  font-weight: 800;
  margin: 0 0 4px;
}

.product-info .eyebrow {
  font-size: .8rem;
}

.product-creator {
  margin: 0;
  color: var(--ink-2);
  font-size: .95rem;
}

.buy-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.buy-box .price {
  margin: 0;
  font-size: 1.2rem;
}

.buy {
  display: flex;
  align-items: center;
  gap: 8px;
}

.buy input {
  width: 64px;
  padding: 7px 10px;
}

.buy .btn {
  padding: 8px 18px;
  font-size: .9rem;
}

.product-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .85rem;
}

.product-info .prose {
  margin-top: 24px;
  font-size: .95rem;
}

.product-info .music-widget {
  margin: 24px 0;
}

.product-subhead {
  margin: 28px 0 8px;
  font-size: 1rem;
}

.track-list {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.track-list li {
  display: flex;
  gap: 12px;
  padding: 9px 14px;
  font-size: .9rem;
}

.track-list li + li {
  border-top: 1px solid var(--line);
}

.track-list span {
  width: 18px;
  color: var(--muted);
  text-align: center;
}

.checkout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 28px;
  align-items: start;
}

.summary {
  background: var(--surface-2);
  padding: 22px;
  border-radius: var(--radius);
}

.summary p {
  display: flex;
  justify-content: space-between;
  margin: 6px 0;
}

.summary .total {
  font-weight: 800;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.notice {
  background: color-mix(in srgb, var(--apricot) 16%, transparent);
  border: 1px solid var(--apricot);
  border-radius: 14px;
  padding: 4px 20px;
  margin: 20px 0;
}

.notice.transfer {
  margin-top: 0;
  font-size: .92rem;
}

.downloads {
  margin: 28px 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.downloads h2 {
  margin: 0 0 4px;
  font-size: 1.15rem;
}

.downloads h3 {
  margin: 18px 0 6px;
  font-size: 1rem;
}

.download-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.download-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  font-size: .92rem;
}

.download-list li + li {
  border-top: 1px solid var(--line);
}

.download-list .btn {
  flex: none;
}

.card-number {
  margin: 4px 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-align: center;
  user-select: all;
}

@media (max-width: 760px) {

  .product-detail,
  .checkout {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-detail {
    gap: 20px;
    margin-top: 8px;
  }

  .product-media {
    position: static;
    max-width: 300px;
    margin-inline: auto;
  }
}

.sample {
  background: var(--surface-2);
  padding: 16px;
  border-radius: 12px;
  margin-top: 24px;
  overflow-x: auto;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 72px;
}

.footer-inner {
  background: var(--zagros);
  color: #c9dad8;
  padding: 24px 0 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 32px;
}

.footer-grid h4 {
  color: #fff;
  font-size: .95rem;
  margin-bottom: 10px;
}

.footer-grid>div:not(.footer-about) {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-grid a {
  color: #c9dad8;
  font-size: .92rem;
}

.footer-grid a:hover {
  color: #fff;
}

.footer-about p {
  font-size: .92rem;
  line-height: 2;
  max-width: 44ch;
}

.footer-bottom {
  border-top: 1px solid rgb(255 255 255 / .1);
  margin-top: 28px;
  padding-top: 16px;
  font-size: .82rem;
  color: #8fb0ad;
}

@media (max-width: 820px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-about {
    grid-column: 1 / -1;
  }
}

/* ---------- بچه‌های شهر بن: link card on home + the group's own page ---------- */
.group-promo {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 28px;
  align-items: center;
  padding: 22px;
  border-radius: 22px;
  background: var(--zagros);
  color: #e3ecea;
  box-shadow: var(--shadow);
  background-image: radial-gradient(circle at 10% 20%, rgb(79 192 187 / .2), transparent 45%), radial-gradient(circle at 90% 90%, rgb(226 163 93 / .16), transparent 45%);
}

.group-promo:hover {
  text-decoration: none;
}

.group-promo:hover .btn {
  filter: brightness(1.07);
}

.group-promo img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 16px 30px -14px rgb(0 0 0 / .6);
}

.group-promo-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.group-promo-text small {
  color: var(--apricot);
  font-weight: 700;
}

.group-promo-text b {
  color: #fff;
  font-size: 2rem;
  line-height: 1.4;
}

.group-promo-text span {
  color: #b9d1cf;
}

@media (max-width: 720px) {
  .group-promo {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }
}

.group-hero {
  position: relative;
  background: var(--zagros);
  color: #e3ecea;
  padding: 56px 0 110px;
  overflow: hidden;
  background-image: radial-gradient(circle at 15% 20%, rgb(79 192 187 / .22), transparent 40%), radial-gradient(circle at 85% 80%, rgb(226 163 93 / .18), transparent 40%);
}

.group-hero h1 {
  color: #fff;
  font-size: clamp(2.4rem, 4vw + 1rem, 4rem);
  margin-bottom: 8px;
}

.group-hero .eyebrow {
  color: var(--apricot);
}

.members-light {
  margin-top: 20px;
}

.members-light .member {
  background: rgb(255 255 255 / .08);
  border-color: rgb(255 255 255 / .18);
  color: #fff;
}

/* ---------- Phone: Instagram-style bottom tab bar ---------- */
.tabbar {
  display: none;
}

@media (max-width: 700px) {
  :root {
    --tabbar-h: 60px;
  }

  body {
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  }

  .tabbar {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--paper) 94%, transparent);
    backdrop-filter: saturate(1.4) blur(14px);
    border-top: 1px solid var(--line);
  }

  .tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--muted);
    font-size: .66rem;
    font-weight: 500;
    -webkit-tap-highlight-color: transparent;
  }

  .tab:hover {
    text-decoration: none;
  }

  .tab svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .tab.is-active {
    color: var(--ink);
    font-weight: 700;
  }

  .tab.is-active svg {
    stroke-width: 2.4;
  }

  .tab:active svg,
  .tab:active .tab-avatar {
    transform: scale(.9);
  }

  .tab-create svg {
    width: 30px;
    height: 30px;
    color: var(--clay);
  }

  .tab-icon {
    position: relative;
    display: grid;
  }

  .tab-icon .badge {
    top: -6px;
    inset-inline-start: -10px;
  }

  .tab-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface-2);
  }

  .tab.is-active .tab-avatar {
    box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--ink);
  }

  /* Hero card sits above the tab bar. */
  .hero-card-wrap {
    padding-bottom: calc(72px + var(--tabbar-h));
  }
}

.search-page {
  margin: 12px 0 0;
}
/* ---------- Share row on post pages ---------- */
.share {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.share-label {
  font-weight: 700;
  font-size: .9rem;
  color: var(--ink-2);
  margin-inline-end: 4px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font: 500 .85rem var(--font);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}

.share-btn:hover {
  text-decoration: none;
  background: var(--zagros);
  border-color: var(--zagros);
  color: #fff;
}

.share-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.share-copy {
  padding-inline: 14px;
}

.share-toast {
  position: absolute;
  inset-inline-start: 0;
  top: calc(100% + 8px);
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: .82rem;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}

.share-toast.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Comment form for visitors ---------- */
.hp {
  position: absolute !important;
  inset-inline-start: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.field:has(.hp) {
  display: none;
}

.small {
  font-size: .85rem;
}

/* ---------- Which logo shows where ---------- */
/* Over the home photo the header is transparent: cream lettering. */
.has-hero .site-header .logo-on-light {
  display: none;
}

.has-hero .site-header .logo-on-dark {
  display: block;
}

/* Docked header on the home page is light again. */
.has-hero.is-stuck .site-header .logo-on-light {
  display: block;
}

.has-hero.is-stuck .site-header .logo-on-dark {
  display: none;
}

/* Dark mode: every header background is dark. */
@media (prefers-color-scheme: dark) {
  .site-header .logo-on-light,
  .has-hero.is-stuck .site-header .logo-on-light {
    display: none;
  }

  .site-header .logo-on-dark,
  .has-hero.is-stuck .site-header .logo-on-dark {
    display: block;
  }
}

/* ---------- Post editor: image upload ---------- */
.editor-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: -6px 0 18px;
}

.editor-status {
  font-size: .85rem;
  color: var(--river);
}

/* ---------- Loose prints: post lists, the group's works, the shop ---------- */
/* White-framed prints, each slightly tilted and nudged off the grid (the pattern
   repeats every 5 and 7 items, so it never looks regular), never overlapping. */
.polaroids {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 30px 24px;
  padding: 8px 6px 16px;
}

.polaroid {
  --r: -1deg;
  --dx: 0px;
  --dy: 0px;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 10px 10px 0;
  background: #fff;
  border-radius: 3px;
  color: #1d2427;
  box-shadow: 0 1px 2px rgb(0 0 0 / .1), 0 12px 26px -12px rgb(20 40 50 / .4);
  transform: translate(var(--dx), var(--dy)) rotate(var(--r));
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s;
}

.polaroid:nth-child(5n+1) { --r: -1.2deg; --dy: 2px; }
.polaroid:nth-child(5n+2) { --r: .9deg; --dy: -2px; }
.polaroid:nth-child(5n+3) { --r: -.5deg; --dy: 3px; }
.polaroid:nth-child(5n+4) { --r: 1.4deg; --dy: -1px; }
.polaroid:nth-child(5n+5) { --r: -1.4deg; --dy: 1px; }
.polaroid:nth-child(7n+2) { --dx: 2px; }
.polaroid:nth-child(7n+4) { --dx: -3px; }
.polaroid:nth-child(7n+6) { --dx: 2px; }

.polaroid:hover,
.polaroid:focus-visible {
  z-index: 2;
  text-decoration: none;
  transform: translate(var(--dx), calc(var(--dy) - 6px)) rotate(0deg) scale(1.03);
  box-shadow: 0 2px 4px rgb(0 0 0 / .12), 0 22px 40px -14px rgb(20 40 50 / .5);
}

.polaroid-img {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #e9eef2;
}

.polaroid-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.polaroid-empty {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 12px;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
  background: linear-gradient(160deg, #eef4f8, #dde8ef);
}

.polaroid-caption {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 4px 14px;
}

.polaroid-caption b {
  font-size: .98rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.polaroid-caption small {
  font-size: .78rem;
  color: #5f6a6e;
}

.polaroid-chip {
  font-size: .7rem;
  font-weight: 700;
  color: var(--river);
  background: #e3f1f0;
  padding: 0 9px;
  border-radius: 999px;
  margin-bottom: 2px;
}

/* Scattered mode (photo-pile.js): prints are placed across the whole width and overlap. */
.polaroids.is-scattered {
  --photo-w: 240px;
  position: relative;
  /* Keep the prints' stacking inside the pile, under the sticky header and tab bar. */
  isolation: isolate;
  display: block;
  padding: 0;
}

.polaroids.is-scattered .polaroid {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: var(--z, 1);
  width: var(--photo-w);
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
}

.polaroids.is-scattered .polaroid:hover,
.polaroids.is-scattered .polaroid:focus-visible {
  z-index: 100;
  transform: translate(-50%, -53%) rotate(0deg) scale(1.06);
}

.polaroid .price {
  margin: 0;
}

@media (max-width: 600px) {
  .polaroids.is-scattered {
    --photo-w: 158px;
  }

  .polaroids {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 14px;
  }

  .polaroid {
    padding: 7px 7px 0;
  }

  .polaroid-caption {
    padding: 7px 2px 10px;
  }

  .polaroid-caption b {
    font-size: .86rem;
  }
}

@supports (overflow: clip) {
  html,
  body {
    overflow-x: clip;
  }
}

/* ---------- Post media: players above the text ---------- */
.post-media {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin: 0 0 32px;
}

.media-item {
  margin: 0;
}

.media-frame {
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-2);
}

.media-youtube .media-frame,
.media-aparat .media-frame {
  aspect-ratio: 16 / 9;
}

.media-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.audio-player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.audio-player audio {
  flex: 1;
  width: 100%;
  min-width: 0;
}

.media-item figcaption {
  margin-top: 6px;
  font-size: .88rem;
  color: var(--muted);
}

/* Post editor: media rows */
.media-fieldset {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 14px 18px 18px;
  margin: 8px 0 20px;
}

.media-fieldset legend {
  font-weight: 700;
  padding: 0 6px;
}

.media-row {
  display: grid;
  grid-template-columns: 2fr 1.4fr 1.2fr auto;
  gap: 0 12px;
  align-items: start;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.media-row:first-child {
  border-top: 0;
}

.media-delete {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 34px;
  font-size: .85rem;
  color: var(--danger);
}

@media (max-width: 760px) {
  .media-row {
    grid-template-columns: 1fr;
  }

  .media-delete {
    margin-top: 0;
  }
}

/* ---------- Music: the group's track list (home) and the floating mini player ---------- */
.mini-player {
  position: fixed;
  z-index: 60;
  bottom: 20px;
  inset-inline-end: 20px;
  width: min(400px, calc(100% - 24px));
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 4px 8px;
  padding: 10px 12px 8px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--zagros) 94%, transparent);
  backdrop-filter: blur(12px);
  color: #fff;
  box-shadow: 0 18px 40px -14px rgb(0 0 0 / .55);
}

.mini-player[hidden] {
  display: none;
}

.mp-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #fff;
}

.mp-info:hover {
  text-decoration: none;
}

.mp-info img {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
}

.mp-info span {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.5;
}

.mp-info b {
  font-size: .86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-info small {
  font-size: .72rem;
  color: #b9d1cf;
}

.mp-controls {
  display: flex;
  align-items: center;
  gap: 2px;
}

.mp-controls button,
.mp-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: .9rem;
  cursor: pointer;
}

.mp-controls button:hover:not(:disabled),
.mp-close:hover {
  background: rgb(255 255 255 / .14);
}

.mp-controls button:disabled {
  opacity: .35;
  cursor: default;
}

#mp-play {
  width: 40px;
  height: 40px;
  background: var(--apricot);
  color: #2b1a0c;
}

/* Skip icons point the reading direction: "next" points left in RTL. */
[dir="rtl"] .mp-skip {
  transform: scaleX(-1);
}

.mp-close {
  font-size: .8rem;
  opacity: .75;
}

.mp-seek {
  grid-column: 1 / -1;
  width: 100%;
  height: 4px;
  padding: 0;
  border: 0;
  accent-color: var(--apricot);
  direction: ltr;
}

/* Leave room so the player never hides the end of a page. */
html.has-player body {
  padding-bottom: 96px;
}

.turbo-progress-bar {
  height: 3px;
  background: var(--apricot);
}

@media (max-width: 700px) {
  .mini-player {
    inset-inline: 8px;
    width: auto;
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px);
  }

  html.has-player body {
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 96px);
  }
}

/* ---------- Home: SoundCloud-style music block (one block, scrollable track list) ---------- */
.music-widget {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: 20px;
  background: var(--zagros);
  color: #fff;
  box-shadow: var(--shadow);
}

.mw-backdrop {
  position: absolute;
  inset: -40px;
  z-index: -1;
  background: center / cover no-repeat;
  filter: blur(36px) saturate(1.3);
  opacity: .45;
  transition: background-image .4s;
}

.mw-head {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px;
  background: linear-gradient(to bottom, rgb(9 38 44 / .2), rgb(9 38 44 / .55));
}

.mw-cover {
  flex: none;
  width: 132px;
  height: 132px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 14px 30px -12px rgb(0 0 0 / .6);
}

.mw-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mw-artist {
  color: var(--apricot);
  font-weight: 700;
  font-size: .8rem;
}

.mw-title {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mw-bar {
  position: relative;
  height: 6px;
  margin-top: 10px;
  border-radius: 6px;
  background: rgb(255 255 255 / .22);
  cursor: pointer;
}

.mw-bar span {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 0;
  border-radius: inherit;
  background: var(--apricot);
}

.mw-time {
  color: #b9d1cf;
  font-size: .76rem;
}

.mw-play {
  flex: none;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  background: var(--apricot);
  color: #2b1a0c;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 10px 24px -10px rgb(0 0 0 / .6);
  transition: transform .15s;
}

.mw-play:hover {
  transform: scale(1.06);
}

.mw-list {
  list-style: none;
  margin: 0;
  padding: 6px 8px 10px;
  max-height: 290px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgb(9 38 44 / .55);
  scrollbar-width: thin;
  scrollbar-color: rgb(255 255 255 / .3) transparent;
}

.mw-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #e3ecea;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.mw-row:hover {
  background: rgb(255 255 255 / .08);
}

.mw-row.is-disabled,
.mw-row.is-disabled:hover {
  background: transparent;
  opacity: .5;
  cursor: default;
}

.mw-row.is-playing {
  background: rgb(255 255 255 / .12);
  color: #fff;
}

.mw-num {
  flex: none;
  width: 22px;
  color: #9fbcb9;
  font-size: .8rem;
  text-align: center;
}

.mw-row img,
.mw-thumb {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
  background: rgb(255 255 255 / .1);
}

.mw-name {
  flex: 1;
  min-width: 0;
  font-size: .9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Little equalizer on the playing row (moves only while audio plays). */
.mw-eq {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.mw-row.is-playing .mw-eq {
  display: flex;
}

.mw-eq i {
  width: 3px;
  height: 40%;
  border-radius: 2px;
  background: var(--apricot);
}

.music-widget.is-playing .mw-row.is-playing .mw-eq i {
  animation: eq .9s ease-in-out infinite alternate;
}

.music-widget.is-playing .mw-row.is-playing .mw-eq i:nth-child(2) {
  animation-delay: -.3s;
}

.music-widget.is-playing .mw-row.is-playing .mw-eq i:nth-child(3) {
  animation-delay: -.6s;
}

@keyframes eq {
  from { height: 25%; }
  to { height: 100%; }
}

@media (max-width: 600px) {
  .mw-head {
    gap: 14px;
    padding: 16px;
  }

  .mw-cover {
    width: 84px;
    height: 84px;
  }

  .mw-title {
    font-size: 1rem;
  }

  .mw-play {
    width: 52px;
    height: 52px;
    font-size: 1.1rem;
  }

  .mw-list {
    max-height: 260px;
  }
}

/* Cloudflare Turnstile widget on signup / login */
.cf-turnstile {
  margin: 4px 0 16px;
  min-height: 65px;
}

/* ---------- Phone sizes ----------
   Kept together at the end so they win over the desktop rules above. Root is 14px here
   (see Base), so 1rem = 14px. */
@media (max-width: 600px) {
  h1,
  .page-head h1,
  .post-head h1 {
    font-size: 1.75rem;
  }

  .block-head h2 {
    font-size: 1.5rem;
  }

  .prose h2 {
    font-size: 1.4rem;
  }

  .prose h3 {
    font-size: 1.2rem;
  }

  .feature-body h3,
  .cta h2 {
    font-size: 1.55rem;
  }

  .group-promo-text b {
    font-size: 1.5rem;
  }

  .group-promo img {
    width: 120px;
    height: 120px;
  }

  .cta {
    padding: 24px;
  }

  /* Small labels: not under ~11–12px. */
  .tab {
    font-size: .8rem;
  }

  .chip {
    font-size: .86rem;
  }

  .polaroid-chip {
    font-size: .8rem;
  }

  .pile-btn[data-pile-pause] {
    font-size: .8rem;
  }

  /* Home album without the scatter (photo-pile.js): two even columns. */
  .photo-pile {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .photo {
    width: auto;
  }

  /* Less air between blocks. */
  .block {
    margin-top: 40px;
  }

  .site-footer {
    margin-top: 48px;
  }

  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px 12px;
  }

  .form-card,
  .auth-card {
    padding: 18px;
    margin-block: 16px;
  }

  .group-hero h1 {
    font-size: 1.9rem;
  }

  .comments h2 {
    font-size: 1.5rem;
  }

  .tile-text b {
    font-size: 1.2rem;
  }

  /* Reading text: a notch smaller, with less space between lines. */
  .prose {
    font-size: 1.05rem;
    line-height: 1.95;
  }

  .lead {
    font-size: 1rem;
  }

  /* Avatars */
  .avatar {
    width: 68px;
    height: 68px;
  }

  .profile {
    gap: 14px;
    margin-bottom: 24px;
  }

  .member-card img {
    width: 52px;
    height: 52px;
  }

  .avatar-picker {
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 8px;
  }

  .feed-author img {
    width: 34px;
    height: 34px;
  }
}

/* ---------- Post composer (/contribute/new/) ---------- */
.composer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.composer-main {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.composer-main #id_title {
  font-size: 1.3rem;
  font-weight: 700;
}

.editor-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.editor-box:focus-within {
  border-color: var(--river);
}

.editor-box .editor-tools {
  margin: 0;
  padding: 8px 10px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.editor-box textarea {
  border: 0;
  border-radius: 0;
  min-height: 360px;
  outline: 0;
}

.editor-md {
  margin-inline-start: auto;
}

.composer .media-fieldset summary {
  cursor: pointer;
  font-weight: 700;
}

.composer .media-fieldset[open] summary {
  margin-bottom: 8px;
}

.composer-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.side-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.side-card .field:last-child {
  margin-bottom: 0;
}

.side-label {
  display: block;
  font-weight: 700;
  font-size: .92rem;
  margin-bottom: 8px;
}

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  border: 2px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  cursor: pointer;
  overflow: hidden;
  margin-bottom: 6px;
}

.dropzone:hover {
  border-color: var(--river);
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone img {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dropzone.has-image img {
  display: block;
}

.dropzone.has-image {
  border-style: solid;
}

.dropzone-text {
  color: var(--muted);
  font-size: .88rem;
  padding: 12px;
  text-align: center;
}

.dropzone-text::before {
  content: "🖼";
  display: block;
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.side-card .check {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: .85rem;
  margin-bottom: 4px;
}

.event-card summary {
  display: list-item;
  cursor: pointer;
  margin-bottom: 0;
}

.event-card[open] summary {
  margin-bottom: 12px;
}

.submit-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.submit-card .field {
  margin-bottom: 6px;
}

.composer .has-error input,
.composer .has-error textarea {
  border-color: var(--danger);
}

@media (max-width: 900px) {
  .composer-grid {
    grid-template-columns: 1fr;
  }

  .composer-main {
    padding: 16px;
  }
}

/* ---------- Login, signup, password pages ---------- */
.auth-shell {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  max-width: 880px;
  margin: 32px auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.auth-art {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 40px 32px;
  text-align: center;
  background:
    radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--river) 14%, transparent), transparent 70%),
    linear-gradient(180deg, var(--river-soft), color-mix(in srgb, var(--apricot) 12%, var(--paper)));
}

.auth-art img {
  width: min(100%, 300px);
  height: auto;
  margin-bottom: 18px;
}

.auth-art-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--zagros);
}

.auth-art-text {
  margin: 0;
  max-width: 260px;
  font-size: .84rem;
  line-height: 1.8;
  color: var(--muted);
}

.auth-panel {
  padding: 40px 40px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-title {
  margin: 0 0 6px;
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.5;
}

.auth-lead {
  margin: 0 0 22px;
  font-size: .86rem;
  line-height: 1.9;
  color: var(--muted);
}

.auth-panel .field,
.settings .field {
  margin-bottom: 14px;
}

.auth-panel .field label,
.settings .field label {
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.auth-panel input:not([type=checkbox]),
.settings input:not([type=checkbox]) {
  height: 44px;
  padding: 0 12px;
  font-size: .92rem;
}

.auth-panel .help,
.settings .help {
  display: block;
  margin-top: 4px;
  font-size: .76rem;
  line-height: 1.7;
}

.auth-panel .help ul,
.settings .help ul {
  margin: 4px 0 0;
  padding-inline-start: 18px;
}

.auth-panel .errorlist,
.settings .errorlist {
  font-size: .8rem;
}

.auth-form > .errorlist.nonfield,
.settings-form .errorlist.nonfield {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--danger) 9%, var(--surface));
}

.auth-form .cf-turnstile {
  margin: 4px 0 14px;
}

.auth-btn {
  width: 100%;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  font-size: .92rem;
}

.auth-aside {
  margin: -6px 0 14px;
  font-size: .8rem;
  text-align: end;
}

.auth-note {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--river-soft);
  font-size: .8rem;
  line-height: 1.9;
}

.auth-foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: .8rem;
  color: var(--muted);
  text-align: center;
}

.auth-foot:empty {
  display: none;
}

/* Two-way switch between texted code and password */
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--paper);
  border: 1px solid var(--line);
}

.seg a {
  padding: 7px 10px;
  border-radius: 7px;
  font-size: .82rem;
  font-weight: 600;
  text-align: center;
  color: var(--muted);
}

.seg a:hover {
  text-decoration: none;
  color: var(--ink);
}

.seg a.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--line);
}

@media (max-width: 760px) {
  .auth-shell {
    grid-template-columns: 1fr;
    margin: 12px auto;
  }

  .auth-art {
    flex-direction: row;
    justify-content: flex-start;
    gap: 14px;
    padding: 16px 20px;
    text-align: start;
  }

  .auth-art img {
    width: 84px;
    margin: 0;
  }

  .auth-art-title {
    font-size: 1rem;
  }

  .auth-art-text {
    font-size: .78rem;
    line-height: 1.7;
  }

  .auth-art > p {
    flex: 1;
  }

  .auth-art-title + .auth-art-text {
    display: none;
  }

  .auth-panel {
    padding: 24px 20px 20px;
  }
}

/* ---------- Account settings ---------- */
.settings {
  max-width: 880px;
  margin: 24px auto;
}

.settings-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.settings-head h1 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
}

.settings-head p {
  margin: 0;
  font-size: .84rem;
  color: var(--muted);
}

.settings-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
}

.settings-head-links {
  display: flex;
  gap: 8px;
  margin-inline-start: auto;
}

.settings-card {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  margin-bottom: 14px;
  padding: 24px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.settings-info h2 {
  margin: 0 0 6px;
  font-size: .98rem;
  font-weight: 700;
}

.settings-info p {
  margin: 0;
  font-size: .8rem;
  line-height: 1.9;
  color: var(--muted);
}

.settings-form {
  max-width: 420px;
}

.settings-form .btn {
  border-radius: var(--radius-sm);
}

.settings-value {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: .92rem;
}

.settings-card.is-danger {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
}

.settings-card.is-danger h2 {
  color: var(--danger);
}

.settings details > summary {
  list-style: none;
  width: fit-content;
}

.settings details > summary::-webkit-details-marker {
  display: none;
}

.settings details[open] > summary {
  margin-bottom: 16px;
}

.settings .field:has(input[type=checkbox]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.settings .field:has(input[type=checkbox]) label {
  margin: 0;
  font-weight: 500;
}

.settings .field input[type=checkbox] {
  order: -1;
}

.settings .field:has(input[type=checkbox]) .errorlist {
  flex-basis: 100%;
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn-danger-ghost {
  background: transparent;
  border-color: color-mix(in srgb, var(--danger) 50%, transparent);
  color: var(--danger);
}

@media (max-width: 760px) {
  .settings-head {
    flex-wrap: wrap;
  }

  .settings-head-links {
    margin-inline-start: 0;
    width: 100%;
  }

  .settings-card {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px;
  }
}
